/* ================================================================
   LOPANGO ADMIN — Design System
   Police: Sora (display) + DM Sans (body)
   Thème: Dark navy professionnel avec accents bleu-violet
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=DM+Sans:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  /* ══════════════════════════════════════════
     LOPANGO — DESIGN TOKENS (source de vérité)
     Charte officielle v2.0 — 2026-04-30
     Pour changer le thème : modifier ces valeurs.
     Tout le reste suit automatiquement.
     ══════════════════════════════════════════ */

  /* ── Couleurs primaires (Branding) ── */
  --color-primary:        #3B82F6;   /* Bleu profond — authority */
  --color-secondary:      #60A5FA;   /* Bleu clair — hover, accents */
  --color-accent:         #38BDF8;   /* Cyan digital — highlights */

  /* ── États sémantiques ── */
  --color-success:        #34D399;
  --color-warning:        #FBBF24;
  --color-danger:         #F87171;
  --color-info:           #3B82F6;

  /* ── Backgrounds états ── */
  --success-bg:           rgba(52,211,153,.15);
  --success-border:       rgba(52,211,153,.40);
  --warning-bg:           rgba(251,191,36,.15);
  --warning-border:       rgba(251,191,36,.40);
  --danger-bg:            rgba(248,113,113,.15);
  --danger-border:        rgba(248,113,113,.40);
  --info-bg:              rgba(59,130,246,.12);
  --info-border:          rgba(59,130,246,.30);
  --neutral:              #94A3B8;
  --neutral-bg:           rgba(100,116,139,.10);
  --neutral-border:       rgba(100,116,139,.22);

  /* ── Surfaces (Dark mode dashboard) ── */
  --bg:                   #0D1117;   /* Fond principal */
  --bg2:                  #161B22;   /* Surface secondaire */
  --panel:                #1C2333;   /* Cards, panels */
  --panel2:               #243044;   /* Panels surélevés */
  --border:               rgba(148,163,184,.25);
  --border2:              rgba(148,163,184,.38);

  /* ── Textes ── */
  --text:                 #F0F6FC;   /* Texte principal */
  --text2:                #C9D1D9;   /* Texte secondaire */
  --text3:                #8B949E;   /* Texte tertiaire / muted */
  --muted:                #8B949E;   /* Alias pour compatibilité */

  /* ── Shadows ── */
  --shadow-sm:            0 1px 3px rgba(0,0,0,.20);
  --shadow-md:            0 4px 16px rgba(0,0,0,.30);
  --shadow-lg:            0 12px 40px rgba(0,0,0,.40);
  --shadow-glow:          0 0 32px rgba(0,194,255,.10);
  --shadow-focus:         0 0 0 3px rgba(0,194,255,.20);

  /* ── Spacing system (base 8px — JAMAIS de valeurs arbitraires) ── */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Typographie ── */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* ── Radius ── */
  --radius-sm:    6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;

  /* ── Layout ── */
  --sidebar-w:   260px;
  --topbar-h:     64px;
  --topbar-height: 64px;
  --sidebar-width: 260px;

  /* ── Transitions ── */
  --transition:  .18s cubic-bezier(.4,0,.2,1);

  /* ── Aliases branding (raccourcis pratiques) ── */
  --p:           var(--color-accent);      /* accent cyan */
  --p2:          var(--color-secondary);   /* bleu clair */
  --p-glow:      rgba(0,194,255,.15);
  --p-hover:     rgba(0,194,255,.08);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(79,140,255,.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(124,92,255,.06) 0%, transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }
input, select, textarea { font-family: var(--font-body); }
select { background: var(--panel2); color: var(--text); border: 1px solid var(--border); }
select option { background: var(--panel2); color: var(--text); }

/* ── App Shell ────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  padding: 24px 28px 40px;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,140,255,.4), transparent);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--p), var(--p2));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,140,255,.3);
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .04em;
  color: var(--text);
}

/* Nav */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.sidebar-content::-webkit-scrollbar { width: 4px; }
.sidebar-content::-webkit-scrollbar-track { background: transparent; }
.sidebar-content::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-section-title {
  padding: 10px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text3);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text2);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  background: var(--p-hover);
  color: var(--text);
}

.nav-link.is-active {
  background: linear-gradient(135deg, rgba(79,140,255,.15), rgba(124,92,255,.10));
  color: #fff;
  font-weight: 600;
}

.nav-link.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: linear-gradient(180deg, var(--p), var(--p2));
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
  transition: var(--transition);
}

.nav-link:hover .nav-icon,
.nav-link.is-active .nav-icon {
  opacity: 1;
}

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar, .user-avatar-fallback {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--p), var(--p2));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-meta { min-width: 0; }

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.logout-button {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text3);
  display: grid;
  place-items: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.logout-button:hover {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.logout-button svg { width: 16px; height: 16px; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(6,13,26,.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-title-group {}

.topbar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.topbar-date {
  font-size: 12px;
  color: var(--text3);
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-header-left { display: flex; flex-direction: column; gap: 4px; }
.page-header-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-header-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.page-header-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 20px;
  background: var(--p-hover); color: var(--p);
  border: 1px solid rgba(0,194,255,.2);
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-desc {
  font-size: 13px;
  color: var(--text3);
  margin-top: 3px;
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
  flex: 1;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--p), var(--p2));
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.stat-card:hover::after { opacity: 1; }

.stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--p-hover);
  border: 1px solid rgba(0,194,255,.15);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  font-size: 16px;
  flex-shrink: 0;
}
.stat-card.color-success .stat-icon { background: var(--success-bg); border-color: var(--success-border); }
.stat-card.color-warning .stat-icon { background: var(--warning-bg); border-color: var(--warning-border); }
.stat-card.color-danger  .stat-icon { background: var(--danger-bg);  border-color: var(--danger-border); }
.stat-card.color-info    .stat-icon { background: var(--info-bg);    border-color: var(--info-border); }
.stat-card.color-success::after { background: var(--color-success); opacity: 1; }
.stat-card.color-warning::after { background: var(--color-warning); opacity: 1; }
.stat-card.color-danger::after  { background: var(--color-danger);  opacity: 1; }
.stat-card.color-info::after    { background: var(--color-info);    opacity: 1; }
.stat-card.color-success .stat-value { color: var(--color-success); }
.stat-card.color-info    .stat-value { color: var(--p); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.stat-change {
  font-size: 12px;
  color: var(--text3);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Section Title ────────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin: 32px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead tr {
  background: var(--panel2);
  border-bottom: 1px solid var(--border2);
}

.data-table th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td {
  background: var(--p-hover);
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-success  { background: var(--success-bg);  color: var(--success);  border-color: var(--success-border); }
.badge-warning  { background: var(--warning-bg);  color: var(--warning);  border-color: var(--warning-border); }
.badge-danger   { background: var(--danger-bg);   color: var(--danger);   border-color: var(--danger-border);  }
.badge-info     { background: var(--info-bg);     color: var(--info);     border-color: var(--info-border);    }
.badge-neutral  { background: var(--neutral-bg);  color: var(--neutral);  border-color: var(--neutral-border); }

/* Status dot */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-bg);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-bg); }
  50% { box-shadow: 0 0 0 5px rgba(16,217,138,.05); }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--p), var(--p2));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79,140,255,.25);
}

.btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79,140,255,.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-ghost:hover {
  background: var(--p-hover);
  border-color: rgba(79,140,255,.3);
  color: var(--text);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}

.btn-danger:hover { background: rgba(244,63,94,.18); }

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sm:hover { background: var(--p-hover); color: var(--text); border-color: rgba(79,140,255,.3); }

.btn-sm.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--p), var(--p2));
  color: #fff;
  box-shadow: 0 2px 6px rgba(79,140,255,.2);
}

.btn-sm.btn-primary:hover { opacity: .88; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text2);
}

.form-input, .field-input, .login-input {
  padding: 10px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-input:focus,
.field-input:focus,
.login-input:focus {
  border-color: var(--p);
  background: rgba(79,140,255,.05);
  box-shadow: 0 0 0 3px var(--p-glow);
}

.form-input::placeholder,
.field-input::placeholder { color: var(--text3); }

select.form-input,
select.field-input,
select.login-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%235a7499' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

textarea.form-input,
textarea.field-input,
textarea.login-input {
  resize: vertical;
  min-height: 80px;
}

/* Field grid for editor layouts */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 16px;
  opacity: .6;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text3);
}

/* ── Login ────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(79,140,255,.12) 0%, transparent 70%),
    var(--bg);
}

.login-card {
  width: min(400px, 100%);
  padding: 36px;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 28px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-logo {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--p), var(--p2));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(79,140,255,.35);
}

.login-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .04em;
}

.login-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text3);
  margin-bottom: 24px;
}

.login-error {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 16px;
}

.login-error:empty { display: none; }

.login-button {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--p), var(--p2));
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(79,140,255,.3);
}

.login-button:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(79,140,255,.4);
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4,9,20,.75);
  backdrop-filter: blur(6px);
  padding: 20px;
  animation: fadeIn .15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-box {
  width: min(540px, 100%);
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s cubic-bezier(.4,0,.2,1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text3);
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

.modal-body { padding: 20px 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--border);
}

.modal-error {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 14px;
}

/* ── Portal Editor ────────────────────────────────────────── */
.portal-editor-wrap { display: flex; flex-direction: column; gap: 20px; }

.editor-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.editor-topbar h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  flex: 1;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.editor-left { display: flex; flex-direction: column; gap: 16px; }
.editor-right { position: sticky; top: 80px; }

.editor-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.editor-card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Toggles */
.rules-grid { display: flex; flex-direction: column; gap: 10px; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.toggle-row:hover { background: var(--p-hover); border-color: var(--border2); }

.toggle-info { display: flex; flex-direction: column; gap: 2px; }
.toggle-label { font-size: 13px; font-weight: 600; }
.toggle-desc { font-size: 11px; color: var(--text3); }

.toggle-wrap { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-wrap input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: var(--border2);
  transition: .2s;
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.toggle-wrap input:checked + .toggle-slider { background: var(--p); }
.toggle-wrap input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Offers */
.offers-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }

.offer-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.offer-check:hover { background: var(--p-hover); }
.offer-check.assigned { border-color: rgba(79,140,255,.3); background: rgba(79,140,255,.05); }

.offer-check input { width: 16px; height: 16px; accent-color: var(--p); cursor: pointer; flex-shrink: 0; }
.offer-check-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.offer-name { font-size: 13px; font-weight: 600; }
.offer-meta { font-size: 11px; color: var(--text3); }

.default-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

/* Preview */
.preview-frame-wrap { margin-top: 12px; border-radius: var(--radius-lg); overflow: hidden; }

/* ── Loading ───────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px;
  color: var(--text3);
  font-size: 14px;
}

.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--p);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utilities ────────────────────────────────────────────── */
code, .mono {
  font-family: var(--font-mono);
  font-size: .88em;
  background: rgba(255,255,255,.06);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--info);
}

.muted { color: var(--text3); }
.strong { font-weight: 700; }

/* ── Responsive ───────────────────────────────────────────── */
.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* RESPONSIVE BREAKPOINTS — Corrected 2026-04-30 */
@media (max-width: 1199px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1023px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px; }
}
@media (max-width: 767px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px; }
}
@media (max-width: 599px) {
  .stats-grid { grid-template-columns: 1fr; gap: 8px; }
  .stat-card { padding: 12px; font-size: 14px; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 20px; }
  .app-content { padding: 12px; }
}

/* ── Fix layout définitif ── */
.app-main {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
}
#page { width: 100%; padding: 0; }

/* ── Tables ne débordent pas ── */
.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
}

/* ── Cards responsive ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

/* ── Modales bien centrées ── */
#offer-modal,
#portal-modal,
#site-modal,
#voucher-modal {
  z-index: 1000;
}

/* ── Loading spinner ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--text3);
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================================================
   NOUVEAUX COMPOSANTS — v2.0 (2026-04-30)
   Alignés sur les tokens :root officiels
   ================================================================ */

/* ── Form Components ─────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: .3px;
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

.form-input:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.form-input::placeholder {
  color: var(--text3);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

select.form-input {
  cursor: pointer;
}

.form-hint {
  font-size: 12px;
  color: var(--text3);
}

.form-error {
  font-size: 12px;
  color: var(--color-danger);
  font-weight: 500;
}

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  margin-bottom: var(--space-4);
}

.alert-icon { flex-shrink: 0; font-size: 16px; }

.alert-message { flex: 1; line-height: 1.5; }

.alert-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  opacity: .6;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--color-success);
}
.alert-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--color-warning);
}
.alert-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--color-danger);
}
.alert-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--color-info);
}

/* ── Toast ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toast-in .25s cubic-bezier(.4,0,.2,1);
  max-width: 360px;
  border: 1px solid transparent;
}

.toast-out {
  animation: toast-out .25s cubic-bezier(.4,0,.2,1) forwards;
}

.toast-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--color-success);
}
.toast-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--color-warning);
}
.toast-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--color-danger);
}
.toast-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--color-info);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(.96); }
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fade-in .2s ease;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modal-in .22s cubic-bezier(.4,0,.2,1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover {
  background: var(--danger-bg);
  color: var(--color-danger);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-shrink: 0;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Section ─────────────────────────────────────────────────── */
.section {
  margin-bottom: var(--space-8);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.section-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider-line {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  color: var(--text3);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ── Settings Page ───────────────────────────────────────────── */
.settings-wrap {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-h) + var(--space-4));
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.settings-tab:hover {
  background: var(--panel2);
  color: var(--text);
}

.settings-tab.active {
  background: var(--color-primary);
  color: white;
  border-color: transparent;
  font-weight: 600;
}

.settings-content {
  flex: 1;
  min-width: 0;
}

.settings-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.settings-panel.hidden {
  display: none;
}

.settings-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  gap: var(--space-4);
}

.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4) var(--space-6);
}

@media (max-width: 1023px) {
  .settings-wrap { flex-direction: column; }
  .settings-tabs { flex-direction: row; flex-wrap: wrap; min-width: unset; position: static; }
  .settings-fields { grid-template-columns: 1fr; }
}

@media (max-width: 599px) {
  .settings-tabs { gap: var(--space-1); }
  .settings-tab { font-size: 12px; padding: var(--space-2) var(--space-3); }
}

/* ── DataTable ───────────────────────────────────────────────── */
.dt-wrap {
  width: 100%;
}

.dt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.dt-search { flex: 1; min-width: 200px; max-width: 320px; }

.dt-info {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
}

.dt-th {
  user-select: none;
  white-space: nowrap;
}

.dt-sortable {
  cursor: pointer;
  transition: color var(--transition);
}
.dt-sortable:hover { color: var(--color-accent); }
.dt-sorted { color: var(--color-accent); }

.dt-sort-icon {
  font-size: 11px;
  opacity: .6;
  margin-left: 4px;
}

.dt-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.dt-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.dt-page-btn:hover:not(:disabled) {
  background: var(--panel2);
  color: var(--text);
  border-color: var(--color-accent);
}
.dt-page-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  font-weight: 600;
}
.dt-page-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.dt-page-ellipsis {
  color: var(--text3);
  font-size: 13px;
  padding: 0 var(--space-1);
}

/* ── ActionMenu ──────────────────────────────────────────────── */
.action-menu-wrap {
  position: relative;
  display: inline-block;
}

.action-menu-trigger {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  border-radius: var(--radius-sm);
}

.action-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 500;
  overflow: hidden;
  animation: fade-in .15s ease;
}

.action-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.action-menu-item:hover {
  background: var(--p-hover);
  color: var(--text);
}
.action-menu-item.danger { color: var(--color-danger); }
.action-menu-item.danger:hover { background: var(--danger-bg); }

/* ── Filters bar ─────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}


/* ========== DASHBOARD RESPONSIVE ========== */
.page.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.dashboard-page .headline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
  width: 100%;
  flex: 1;
  min-width: 0;
}

.dashboard-page .dashboard-section {
  margin-bottom: var(--space-lg);
}

.dashboard-page .section-title {
  font-weight: 800;
  margin-bottom: 14px;
}

@media (max-width: 1199px) {
  .dashboard-page .headline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .dashboard-page .headline-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   DASHBOARD RESPONSIVE — ajout 2026-05-03
   ============================================= */
.page.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-page .headline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  flex: 1;
  min-width: 0;
}

.dashboard-page .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  flex: 1;
  min-width: 0;
}

/* Tablet large */
@media (max-width: 1199px) {
  .dashboard-page .headline-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-page .stats-grid    { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet / Mobile large */
@media (max-width: 767px) {
  .dashboard-page .headline-grid { grid-template-columns: 1fr; }
  .dashboard-page .stats-grid    { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile small */
@media (max-width: 599px) {
  .dashboard-page .stats-grid { grid-template-columns: 1fr; }
}

/* ── Audit table column widths ─────────────────── */
#dt-audit { table-layout: fixed; width: 100%; }
#dt-audit .dt-th:nth-child(1), #dt-audit td:nth-child(1) { width: 160px; }
#dt-audit .dt-th:nth-child(2), #dt-audit td:nth-child(2) { width: 110px; }
#dt-audit .dt-th:nth-child(3), #dt-audit td:nth-child(3) { width: 100px; }
#dt-audit .dt-th:nth-child(4), #dt-audit td:nth-child(4) { width: 120px; }
#dt-audit .dt-th:nth-child(5), #dt-audit td:nth-child(5) { width: 130px; }
#dt-audit .dt-th:nth-child(6), #dt-audit td:nth-child(6) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }

/* ── Dashboard layout ─────────────────────────────────── */
.dashboard-page > div[style*="grid-template-columns"] {
  grid-template-columns: 1fr 320px !important;
}
@media (max-width: 1200px) {
  .dashboard-page > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

.page-permissions {
  display: grid;
  gap: 20px;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(14,165,233,.14));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #dbeafe;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

.hero-subtitle {
  margin: 10px 0 16px;
  color: rgba(255,255,255,.78);
  max-width: 60ch;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-pill,
.role-pill,
.perm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 600;
}

.meta-pill {
  padding: 8px 12px;
  background: rgba(255,255,255,.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
}

.hero-stats {
  display: grid;
  gap: 12px;
}

.stat-box {
  padding: 16px;
  border-radius: 18px;
  background: rgba(15,23,42,.42);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}

.stat-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.55);
  margin-bottom: 6px;
}

.stat-box strong {
  display: block;
  line-height: 1.5;
}

.matrix-card {
  overflow: hidden;
}

.matrix-header {
  padding-bottom: 8px;
}

.permissions-table {
  border-collapse: separate;
  border-spacing: 0 10px;
}

.permissions-table thead th {
  position: sticky;
  top: 0;
  background: rgba(15,23,42,.96);
  backdrop-filter: blur(8px);
  z-index: 1;
}

.permissions-table tbody tr {
  background: rgba(255,255,255,.03);
  transition: transform .18s ease, background .18s ease;
}

.permissions-table tbody tr:hover {
  background: rgba(255,255,255,.06);
  transform: translateY(-1px);
}

.permissions-table td,
.permissions-table th {
  padding: 16px 14px;
}

.resource-cell {
  display: grid;
  gap: 4px;
}

.resource-cell span {
  color: rgba(255,255,255,.55);
  font-size: 13px;
}

.role-pill {
  padding: 8px 12px;
  color: #fff;
}

.role-gold { background: linear-gradient(135deg, #f59e0b, #d97706); }
.role-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.role-green { background: linear-gradient(135deg, #10b981, #059669); }

.perm {
  min-width: 54px;
  padding: 7px 12px;
  font-size: 13px;
}

.perm-yes { background: rgba(16,185,129,.16); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.perm-no { background: rgba(148,163,184,.12); color: #cbd5e1; border: 1px solid rgba(148,163,184,.2); }
.perm-maybe { background: rgba(59,130,246,.12); color: #bfdbfe; border: 1px solid rgba(59,130,246,.2); }

@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
  }
}
