/* ============================================================================
   NEXOO APP — BRIQUE 11D : MINI-ADMIN NEXOO (role = 'admin' uniquement)
   Dark Mode exclusif · Mobile-first (100dvh, inputs 16px anti-zoom iOS)
   ============================================================================ */

/* Bouton d'accès Admin sur le Dashboard Accueil (affiché uniquement si estAdmin) */
.dash-admin-btn {
  width: 100%;
  margin-top: 10px;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: linear-gradient(
    135deg,
    rgba(250, 204, 21, 0.14) 0%,
    rgba(34, 197, 94, 0.1) 100%
  );
  color: #fef08a;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.18s ease, background 0.18s ease;
}

.dash-admin-btn:hover {
  border-color: rgba(250, 204, 21, 0.65);
  background: linear-gradient(
    135deg,
    rgba(250, 204, 21, 0.22) 0%,
    rgba(34, 197, 94, 0.14) 100%
  );
}

.dash-admin-btn:active {
  transform: scale(0.985);
}

.dash-admin-btn.hidden {
  display: none !important;
}

/* Overlay plein écran du cockpit Admin */
.nexoo-admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background:
    radial-gradient(ellipse 80% 35% at 50% -5%, rgba(250, 204, 21, 0.12), transparent 65%),
    radial-gradient(circle at 90% 95%, rgba(34, 197, 94, 0.1), transparent 45%),
    #080e1c;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.nexoo-admin-overlay[hidden] {
  display: none !important;
}

/* En-tête fixe */
.nexoo-admin-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(11, 19, 37, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nexoo-admin-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nexoo-admin-back-btn,
.nexoo-admin-icon-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(24, 36, 63, 0.75);
  color: #f8fafc;
  border-radius: 10px;
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.nexoo-admin-back-btn:hover,
.nexoo-admin-icon-btn:hover {
  background: #18243f;
  border-color: rgba(255, 255, 255, 0.24);
}

.nexoo-admin-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nexoo-admin-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexoo-admin-subtitle {
  font-size: 11.5px;
  color: #94a3b8;
}

/* Zone scrollable centrale */
.nexoo-admin-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px max(32px, env(safe-area-inset-bottom));
}

.nexoo-admin-container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Bandeau KPI global */
.nexoo-admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.nexoo-admin-stat-card {
  background: rgba(17, 26, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nexoo-admin-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.nexoo-admin-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.1;
}

.nexoo-admin-stat-sub {
  font-size: 11.5px;
  color: #64748b;
}

/* Barre d'onglets segmentée */
.nexoo-admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: #0d1629;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nexoo-admin-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.16s ease, color 0.16s ease;
}

.nexoo-admin-tab.active {
  background: #18243f;
  color: #f8fafc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nexoo-admin-tab-count {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #cbd5e1;
}

.nexoo-admin-tab.active .nexoo-admin-tab-count {
  background: rgba(34, 197, 94, 0.2);
  color: #39ff14;
}

/* Barre d'outils (recherche + filtres + bouton créer) */
.nexoo-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nexoo-admin-search-wrap {
  flex: 1;
  min-width: 210px;
}

.nexoo-admin-input,
.nexoo-admin-select,
.nexoo-admin-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0c1426;
  color: #f8fafc;
  font-size: 16px; /* Anti-zoom iOS */
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.nexoo-admin-textarea {
  padding: 10px 13px;
  min-height: 76px;
  resize: vertical;
  font-family: inherit;
}

.nexoo-admin-input:focus,
.nexoo-admin-select:focus,
.nexoo-admin-textarea:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.nexoo-admin-select option {
  background: #0c1426;
  color: #f8fafc;
}

.nexoo-admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nexoo-admin-filter-pill {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d1629;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.nexoo-admin-filter-pill.active {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.16);
  color: #39ff14;
}

.nexoo-admin-btn-primary {
  appearance: none;
  border: none;
  border-radius: 11px;
  min-height: 42px;
  padding: 0 16px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #04130a;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: filter 0.16s ease, opacity 0.16s ease;
}

.nexoo-admin-btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.nexoo-admin-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nexoo-admin-btn-secondary {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(24, 36, 63, 0.72);
  color: #e2e8f0;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.nexoo-admin-btn-secondary:hover:not(:disabled) {
  background: #18243f;
  border-color: rgba(255, 255, 255, 0.28);
}

.nexoo-admin-btn-danger {
  appearance: none;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.nexoo-admin-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
}

/* Liste & cartes */
.nexoo-admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nexoo-admin-card {
  background: rgba(17, 26, 46, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nexoo-admin-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nexoo-admin-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.nexoo-admin-card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: #f8fafc;
}

.nexoo-admin-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 7px;
  background: #0c1426;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #39ff14;
}

.nexoo-admin-meta {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* Badges de statut */
.nexoo-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.nexoo-admin-badge.green {
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.36);
  color: #4ade80;
}

.nexoo-admin-badge.amber {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.36);
  color: #fcd34d;
}

.nexoo-admin-badge.red {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.36);
  color: #fca5a5;
}

.nexoo-admin-badge.blue {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.nexoo-admin-badge.gold {
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fde047;
}

.nexoo-admin-badge.gray {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}

/* Jauge de licences Club */
.nexoo-admin-quota {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nexoo-admin-quota-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #cbd5e1;
}

.nexoo-admin-quota-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.nexoo-admin-quota-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #39ff14);
  transition: width 0.25s ease;
}

.nexoo-admin-quota-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.nexoo-admin-quota-fill.full {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Actions bas de carte */
.nexoo-admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Modale d'édition / création */
.nexoo-admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9400;
  background: rgba(4, 8, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.nexoo-admin-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nexoo-admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nexoo-admin-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #f8fafc;
}

.nexoo-admin-modal-close {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

.nexoo-admin-form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nexoo-admin-form-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nexoo-admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nexoo-admin-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.nexoo-admin-help {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
}

.nexoo-admin-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.nexoo-admin-checkbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: #0c1426;
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
}

.nexoo-admin-checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #22c55e;
}

.nexoo-admin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nexoo-admin-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
  font-size: 13px;
}

.nexoo-admin-empty {
  padding: 28px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13.5px;
  background: rgba(17, 26, 46, 0.65);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
}

/* Toast discret en bas d'écran */
.nexoo-admin-toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 9500;
  padding: 11px 18px;
  border-radius: 999px;
  background: #18243f;
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #f8fafc;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

@media (max-width: 720px) {
  .nexoo-admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .nexoo-admin-form-row2 {
    grid-template-columns: 1fr;
  }
  .nexoo-admin-tab {
    font-size: 12px;
    padding: 9px 4px;
  }
}
.nav-admin-btn.hidden {
  display: none !important;
}

@media (min-width: 860px) {
  .dash-admin-btn {
    display: none;
  }
}
.nexoo-admin-field[hidden] {
  display: none !important;
}