/* ══════════════════════════════════════════════════════════════════════════
   OPENAZURE Ticketing — DARK PREMIUM DESIGN
   Style: Linear / Vercel / Stripe Dark
   Palette: Deep Navy #0A0E27 · Azure Blue · Mint Green · Premium accents
   ══════════════════════════════════════════════════════════════════════════ */

:root, [data-theme="dark"] {
  /* ─── COULEURS DE FOND (Dark Premium) ──────────────────── */
  --bg:         #0A0E27;          /* Fond principal - bleu nuit profond */
  --bg-2:       #0F1535;          /* Variation légère */
  --bg-3:       #131A3F;          /* Sections élevées */

  --surface:    #131A3F;          /* Cards / panels */
  --surface-2:  #1A2350;          /* Hover / surfaces actives */
  --surface-3:  #20296B;          /* Surfaces les plus hautes */

  /* Glassmorphism backdrop */
  --glass:      rgba(19, 26, 63, 0.6);
  --glass-hi:   rgba(26, 35, 80, 0.75);
  --glass-border: rgba(107, 127, 236, 0.18);
  --glass-border-hi: rgba(107, 127, 236, 0.35);

  /* ─── BORDURES LUMINEUSES ──────────────────────────────── */
  --border:     rgba(107, 127, 236, 0.15);
  --border-2:   rgba(107, 127, 236, 0.08);
  --border-glow: rgba(107, 127, 236, 0.4);

  /* ─── COULEURS MARQUE OPENAZURE (lumineuses sur dark) ──── */
  --navy:       #0A0E27;
  --azure:      #4F6BFF;          /* Bleu plus lumineux pour dark */
  --azure-hi:   #6B7FFF;
  --azure-glow: rgba(79, 107, 255, 0.4);
  --sky:        #93AAFF;
  --mint:       #10E29C;          /* Vert plus vibrant */
  --mint-hi:    #3DEFB0;
  --mint-glow:  rgba(16, 226, 156, 0.4);

  /* Accents */
  --amber:      #FFB72B;
  --rose:       #FF5C7C;
  --red:        #FF4757;
  --violet:     #A78BFA;

  /* ─── TEXTE ─────────────────────────────────────────────── */
  --text:       #F0F2FB;          /* Quasi blanc, pas trop dur */
  --text-2:     #B6BFE0;          /* Secondaire lumineux */
  --text-3:     #6B7BA8;          /* Tertiaire */
  --text-4:     #4A5680;
  --text-inv:   #0A0E27;          /* Pour fonds clairs */

  /* ─── OMBRES & GLOW ────────────────────────────────────── */
  --shadow-sm:  0 1px 2px rgba(0,0,0,.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.3);
  --shadow-xl:  0 24px 60px rgba(0,0,0,.5);
  --glow:       0 0 0 3px rgba(79,107,255,.25);
  --glow-mint:  0 0 0 3px rgba(16,226,156,.25);
  --glow-soft:  0 0 30px rgba(79,107,255,.15);

  /* Radii */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px;

  --sidebar-w:  260px;
  --topbar-h:   72px;

  --ff-display: 'Space Grotesk', -apple-system, 'Segoe UI', sans-serif;
  --ff-body:    'Inter', -apple-system, 'Segoe UI', sans-serif;
}

/* ══════════════════════════════════════════════════════════════════════════
   LIGHT THEME — Variation claire élégante
   ══════════════════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg:         #F5F7FB;
  --bg-2:       #FFFFFF;
  --bg-3:       #FAFBFD;

  --surface:    #FFFFFF;
  --surface-2:  #F8FAFC;
  --surface-3:  #EEF2F7;

  --glass:      rgba(255, 255, 255, 0.75);
  --glass-hi:   rgba(255, 255, 255, 0.92);
  --glass-border: rgba(29, 42, 152, 0.12);
  --glass-border-hi: rgba(29, 42, 152, 0.2);

  --border:     #E5E9F0;
  --border-2:   #EEF2F7;
  --border-glow: rgba(29, 42, 152, 0.25);

  --navy:       #FFFFFF;
  --azure:      #1D2A98;
  --azure-hi:   #2538B8;
  --azure-glow: rgba(29, 42, 152, 0.25);
  --sky:        #6B7FEC;
  --mint:       #00A651;
  --mint-hi:    #3FCC7C;
  --mint-glow:  rgba(0, 166, 81, 0.25);

  --amber:      #F59E0B;
  --rose:       #F43F5E;
  --red:        #DC2626;
  --violet:     #6366F1;

  --text:       #0F172A;
  --text-2:     #475569;
  --text-3:     #94A3B8;
  --text-4:     #CBD5E1;
  --text-inv:   #F8FAFC;

  --shadow-sm:  0 1px 2px rgba(13,22,99,.04), 0 1px 3px rgba(13,22,99,.06);
  --shadow-md:  0 4px 12px rgba(13,22,99,.06), 0 2px 4px rgba(13,22,99,.04);
  --shadow-lg:  0 12px 40px rgba(13,22,99,.08), 0 4px 12px rgba(13,22,99,.04);
  --shadow-xl:  0 24px 60px rgba(13,22,99,.12);
  --glow:       0 0 0 3px rgba(29,42,152,.15);
}

/* En light, page-content devient clair */
[data-theme="light"] body { background: #F5F7FB; }
[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(29, 42, 152, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(0, 166, 81, 0.03) 0%, transparent 50%);
}
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.88);
}

/* En light, modal devient clair */
[data-theme="light"] .modal {
  background: #FFFFFF;
  border-color: var(--border);
}
[data-theme="light"] .modal-header {
  background: linear-gradient(90deg, rgba(29, 42, 152, 0.04) 0%, transparent 100%);
}
[data-theme="light"] .modal-footer {
  background: var(--surface-2);
}

/* Tables en light */
[data-theme="light"] .table th { background: var(--surface-2); }
[data-theme="light"] .table tbody tr:hover { background: rgba(29, 42, 152, 0.04); }

/* Inputs en light */
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: #FFFFFF;
  border-color: var(--border);
}
[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
  background: #FFFFFF;
}

/* Toasts en light */
[data-theme="light"] .toast {
  background: #FFFFFF;
}

/* Transitions douces lors du switch */
body, .card, .kpi, .topbar, .modal, .toast,
.form-input, .form-select, .form-textarea,
.btn-secondary, .icon-btn, .table, .badge {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

*,*::before,*::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* Aurore subtile en arrière-plan */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(79, 107, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(16, 226, 156, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(167, 139, 250, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--azure); text-decoration: none; transition: color .15s; }
a:hover { color: var(--azure-hi); }

h1,h2,h3,h4 { font-family: var(--ff-display); letter-spacing: -0.01em; margin: 0; color: var(--text); }
h1 { font-size: 1.625rem; font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR — Adaptive (suit la couleur du dashboard selon le thème)
   ══════════════════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  z-index: 40;
  border-right: 1px solid var(--border);
}

/* Mode light : sidebar blanc cassé (comme dashboard) */
[data-theme="light"] .sidebar {
  background:
    radial-gradient(ellipse at top right, rgba(0, 166, 81, .04) 0%, transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(29, 42, 152, .04) 0%, transparent 50%),
    #F5F7FB;
  color: #0F172A;
  border-right-color: rgba(29, 42, 152, .08);
}

/* Mode dark : sidebar bleu nuit profond (comme dashboard) */
[data-theme="dark"] .sidebar,
:root:not([data-theme="light"]) .sidebar {
  background:
    radial-gradient(ellipse at top right, rgba(16, 226, 156, .05) 0%, transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(79, 107, 255, .06) 0%, transparent 50%),
    #0A0E27;
  color: var(--text);
  border-right-color: rgba(107, 127, 236, .12);
}

/* Liseré lumineux à droite (séparation visuelle subtile) */
.sidebar::before {
  content: '';
  position: absolute;
  top: 10%; right: 0; bottom: 10%;
  width: 1px;
  pointer-events: none;
  z-index: 1;
}
[data-theme="light"] .sidebar::before {
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(29, 42, 152, .25) 30%,
    rgba(0, 166, 81, .25) 70%,
    transparent 100%);
}
[data-theme="dark"] .sidebar::before,
:root:not([data-theme="light"]) .sidebar::before {
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(79, 107, 255, .35) 30%,
    rgba(16, 226, 156, .35) 70%,
    transparent 100%);
}

/* Halo subtil en haut */
.sidebar::after {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 220px;
  pointer-events: none;
  animation: sidebarGlow 8s ease-in-out infinite;
  filter: blur(20px);
}
[data-theme="light"] .sidebar::after {
  background: radial-gradient(ellipse at center,
    rgba(29, 42, 152, .06) 0%,
    rgba(0, 166, 81, .03) 40%,
    transparent 70%);
}
[data-theme="dark"] .sidebar::after,
:root:not([data-theme="light"]) .sidebar::after {
  background: radial-gradient(ellipse at center,
    rgba(79, 107, 255, .12) 0%,
    rgba(16, 226, 156, .04) 40%,
    transparent 70%);
}

@keyframes sidebarGlow {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

/* ─── Zone brand : logo plus compact ─── */
.sidebar-header {
  padding: 1.25rem 1rem .75rem;
  position: relative;
  z-index: 2;
}

.brand-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ─── Logo compact, transparent PNG ─── */
.brand-logo-img {
  width: 75%;
  max-width: 170px;
  height: auto;
  display: block;
  background: transparent;
  padding: 0;
  border-radius: 0;
  object-fit: contain;
  transition: all 0.3s ease;
}

/* Mode dark : afficher le logo blanc, cacher le logo couleur */
[data-theme="dark"] .brand-logo-light,
:root:not([data-theme="light"]) .brand-logo-light {
  display: none;
}
[data-theme="dark"] .brand-logo-dark,
:root:not([data-theme="light"]) .brand-logo-dark {
  display: block;
}

/* Mode light : afficher le logo couleur, cacher le logo blanc */
[data-theme="light"] .brand-logo-light {
  display: block;
}
[data-theme="light"] .brand-logo-dark {
  display: none;
}

.brand-logo-img:hover {
  transform: scale(1.02);
}

.brand-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(29, 42, 152, .25) 30%,
    rgba(0, 166, 81, .25) 70%,
    transparent 100%);
}

.brand-subtitle {
  color: #1D2A98;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
  opacity: 0.75;
}

/* ─── Navigation ────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem .75rem;
  position: relative;
  z-index: 2;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(29, 42, 152, .15); border-radius: 10px; }

.nav-section { margin-bottom: 1.5rem; }
.nav-label {
  font-size: .65rem;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: .15em;
  padding: .5rem .875rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(29, 42, 152, .15) 0%, transparent 100%);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .875rem;
  color: #475569;
  border-radius: 10px;
  font-weight: 500;
  font-size: .875rem;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  position: relative;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item i {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
  flex-shrink: 0;
  color: #64748B;
  transition: color .2s;
}
.nav-item:hover {
  background: rgba(29, 42, 152, .06);
  color: #1D2A98;
  transform: translateX(2px);
}
.nav-item:hover i { color: #1D2A98; }

.nav-item.active {
  background: linear-gradient(90deg,
    rgba(29, 42, 152, .12) 0%,
    rgba(0, 166, 81, .08) 100%);
  color: #1D2A98;
  box-shadow:
    inset 0 0 0 1px rgba(29, 42, 152, .2),
    0 4px 16px rgba(29, 42, 152, .1);
  font-weight: 600;
}
.nav-item.active i { color: #1D2A98; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: linear-gradient(180deg, #1D2A98 0%, #00A651 100%);
  border-radius: 0 3px 3px 0;
  box-shadow:
    0 0 12px rgba(29, 42, 152, .5),
    0 0 24px rgba(0, 166, 81, .3);
}

.nav-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #1D2A98 0%, #00A651 100%);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(29, 42, 152, .3);
}

/* ─── Mode DARK : adaptation textes/couleurs nav ─── */
[data-theme="dark"] .nav-label,
:root:not([data-theme="light"]) .nav-label {
  color: rgba(255,255,255,.4);
}
[data-theme="dark"] .nav-label::after,
:root:not([data-theme="light"]) .nav-label::after {
  background: linear-gradient(90deg, rgba(107,127,236,.2) 0%, transparent 100%);
}
[data-theme="dark"] .nav-item,
:root:not([data-theme="light"]) .nav-item {
  color: rgba(255,255,255,.72);
}
[data-theme="dark"] .nav-item i,
:root:not([data-theme="light"]) .nav-item i {
  color: rgba(255,255,255,.55);
}
[data-theme="dark"] .nav-item:hover,
:root:not([data-theme="light"]) .nav-item:hover {
  background: rgba(79, 107, 255, .12);
  color: #fff;
}
[data-theme="dark"] .nav-item:hover i,
:root:not([data-theme="light"]) .nav-item:hover i {
  color: #6B7FFF;
}
[data-theme="dark"] .nav-item.active,
:root:not([data-theme="light"]) .nav-item.active {
  background: linear-gradient(90deg, rgba(79, 107, 255, .18) 0%, rgba(16, 226, 156, .08) 100%);
  color: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(79, 107, 255, .25),
    0 4px 16px rgba(79, 107, 255, .15);
}
[data-theme="dark"] .nav-item.active i,
:root:not([data-theme="light"]) .nav-item.active i {
  color: #6B7FFF;
}
[data-theme="dark"] .nav-item.active::before,
:root:not([data-theme="light"]) .nav-item.active::before {
  background: linear-gradient(180deg, #4F6BFF 0%, #10E29C 100%);
  box-shadow:
    0 0 12px rgba(79, 107, 255, .6),
    0 0 24px rgba(16, 226, 156, .3);
}

/* Scrollbar nav adaptée mode dark */
[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb,
:root:not([data-theme="light"]) .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(107, 127, 236, .2);
}

/* User chip adapté dark */
[data-theme="dark"] .user-chip,
:root:not([data-theme="light"]) .user-chip {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(107, 127, 236, .15);
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
[data-theme="dark"] .user-chip:hover,
:root:not([data-theme="light"]) .user-chip:hover {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(107, 127, 236, .3);
  box-shadow: 0 4px 20px rgba(79, 107, 255, .15);
}
[data-theme="dark"] .user-name,
:root:not([data-theme="light"]) .user-name {
  color: #F0F2FB;
}
[data-theme="dark"] .user-role,
:root:not([data-theme="light"]) .user-role {
  color: rgba(255,255,255,.5);
}
[data-theme="dark"] .sidebar-footer,
:root:not([data-theme="light"]) .sidebar-footer {
  border-top-color: rgba(107, 127, 236, .12);
}
[data-theme="dark"] .brand-divider,
:root:not([data-theme="light"]) .brand-divider {
  background: linear-gradient(90deg, transparent 0%, rgba(79,107,255,.3) 30%, rgba(16,226,156,.3) 70%, transparent 100%);
}
[data-theme="dark"] .brand-subtitle,
:root:not([data-theme="light"]) .brand-subtitle {
  color: #6B7FFF;
}

/* ─── Footer (profil utilisateur) ───────────────────────── */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(29, 42, 152, .1);
  position: relative;
  z-index: 2;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem;
  background: #fff;
  border: 1px solid rgba(29, 42, 152, .12);
  border-radius: 12px;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(13, 22, 99, .05);
}
.user-chip:hover {
  background: #fff;
  border-color: rgba(29, 42, 152, .25);
  box-shadow:
    0 4px 16px rgba(29, 42, 152, .12),
    0 0 30px rgba(0, 166, 81, .08);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1D2A98 0%, #00A651 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .85rem;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(29, 42, 152, .25);
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: .825rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0F172A;
}
.user-role {
  font-size: .7rem;
  color: #64748B;
}
.logout-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #94A3B8;
  border-radius: 8px;
  transition: all .15s;
  text-decoration: none;
}
.logout-btn:hover {
  background: rgba(220, 38, 38, .1);
  color: #DC2626;
}
.logout-btn i { width: 16px; height: 16px; }

/* ══════════════════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════════════════════════════════════════ */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }

.topbar {
  height: var(--topbar-h);
  background: rgba(15, 21, 53, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky; top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }

.menu-toggle {
  display: none;
  border: none; background: transparent;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: var(--text-2);
}
.menu-toggle:hover { background: var(--glass-hi); color: var(--text); }

.page-title h1 { font-size: 1.375rem; font-weight: 600; color: var(--text); }
.page-title p { margin: 2px 0 0; font-size: .825rem; color: var(--text-3); }

.search-box {
  display: flex; align-items: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: .5rem .875rem;
  width: 320px;
  transition: all .18s;
  backdrop-filter: blur(10px);
}
.search-box:focus-within {
  border-color: var(--azure);
  box-shadow: var(--glow);
  background: var(--glass-hi);
}
.search-box i { width: 16px; height: 16px; color: var(--text-3); margin-right: .5rem; }
.search-box input {
  border: none; outline: none; background: transparent;
  flex: 1; font-size: .875rem; color: var(--text);
}
.search-box input::placeholder { color: var(--text-3); }

.icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-2);
  position: relative;
  transition: all .15s;
}
.icon-btn:hover {
  background: var(--glass-hi);
  color: var(--azure);
  border-color: var(--glass-border-hi);
  box-shadow: 0 0 20px rgba(79, 107, 255, .15);
}
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 2px var(--bg-2), 0 0 12px var(--rose);
}
.icon-btn i { width: 18px; height: 18px; }

/* ══════════════════════════════════════════════════════════════════════════
   NOTIFICATIONS PANEL
   ══════════════════════════════════════════════════════════════════════════ */
.notif-wrapper { position: relative; }

.notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 10px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--surface);
  line-height: 1;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 400px;
  max-height: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(13,22,99,.18), 0 4px 12px rgba(13,22,99,.08);
  z-index: 50;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: notifIn .18s cubic-bezier(.4,0,.2,1);
}

/* ─── PANNEAU SÉLECTEUR DE LANGUE ─── */
.lang-wrapper { position: relative; }
.lang-btn { font-size: 1.2rem; }

.lang-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(13,22,99,.18), 0 4px 12px rgba(13,22,99,.08);
  z-index: 50;
  overflow: hidden;
  animation: notifIn .18s cubic-bezier(.4,0,.2,1);
}
[data-theme="dark"] .lang-panel,
:root:not([data-theme="light"]) .lang-panel {
  background: rgba(15, 21, 53, 0.95);
  backdrop-filter: blur(20px);
  border-color: rgba(107, 127, 236, .25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 30px rgba(79, 107, 255, .12);
}

.lang-panel-title {
  padding: .625rem 1rem .375rem;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  background: var(--surface-2);
}
[data-theme="dark"] .lang-panel-title,
:root:not([data-theme="light"]) .lang-panel-title {
  background: rgba(15, 21, 53, .5);
}

.lang-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-size: .875rem;
  transition: background .12s;
  border-left: 3px solid transparent;
}
.lang-item:hover {
  background: rgba(29, 42, 152, .06);
  color: var(--azure);
}
[data-theme="dark"] .lang-item:hover,
:root:not([data-theme="light"]) .lang-item:hover {
  background: rgba(79, 107, 255, .08);
}
.lang-item.active {
  background: rgba(29, 42, 152, .04);
  border-left-color: var(--azure);
  font-weight: 600;
}
[data-theme="dark"] .lang-item.active,
:root:not([data-theme="light"]) .lang-item.active {
  background: rgba(79, 107, 255, .08);
}
.search-wrapper { position: relative; }

.search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 480px;
  max-height: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(13,22,99,.18), 0 4px 12px rgba(13,22,99,.08);
  z-index: 50;
  overflow-y: auto;
  animation: notifIn .18s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] .search-panel,
:root:not([data-theme="light"]) .search-panel {
  background: rgba(15, 21, 53, 0.95);
  backdrop-filter: blur(20px);
  border-color: rgba(107, 127, 236, .25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 30px rgba(79, 107, 255, .12);
}

.search-section {
  border-bottom: 1px solid var(--border-2);
}
.search-section:last-child { border-bottom: none; }

.search-section-title {
  padding: .625rem 1rem .375rem;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
}
[data-theme="dark"] .search-section-title,
:root:not([data-theme="light"]) .search-section-title {
  background: rgba(15, 21, 53, .5);
}

.search-result {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 1rem;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: all .12s;
  cursor: pointer;
}
.search-result:hover {
  background: rgba(29, 42, 152, .05);
  border-left-color: var(--azure);
}
[data-theme="dark"] .search-result:hover,
:root:not([data-theme="light"]) .search-result:hover {
  background: rgba(79, 107, 255, .08);
}

.search-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}
.search-result-title {
  font-weight: 600;
  font-size: .875rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-subtitle {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: .68rem;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-3);
}
.search-empty i { width: 36px; height: 36px; color: var(--border); margin-bottom: .5rem; }
.search-empty p { font-size: .85rem; margin: 0; }

.search-hint-block {
  padding: 1rem;
  text-align: center;
  font-size: .85rem;
  color: var(--text-3);
}

/* Highlight des termes recherchés */
mark.search-hl {
  background: rgba(255, 183, 43, .25);
  color: inherit;
  padding: 1px 2px;
  border-radius: 3px;
  font-weight: 600;
}

@keyframes notifIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-header {
  padding: 1rem 1.125rem;
  border-bottom: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(29,42,152,.03), rgba(0,166,81,.02));
}
.notif-header h3 {
  font-size: .95rem;
  font-weight: 600;
  margin: 0;
}
.notif-header .count-pill {
  font-size: .7rem;
  padding: 3px 8px;
  background: var(--azure);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
}

.notif-body { flex: 1; overflow-y: auto; }
.notif-body::-webkit-scrollbar { width: 6px; }
.notif-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.notif-section {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border-2);
}
.notif-section:last-child { border-bottom: none; }
.notif-section-title {
  padding: .5rem 1.125rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-section-title i { width: 13px; height: 13px; }

.notif-item {
  display: block;
  padding: .625rem 1.125rem;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.notif-item:hover {
  background: var(--surface-2);
  border-left-color: var(--azure);
  color: inherit;
}
.notif-item .notif-title {
  font-size: .825rem;
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-item .notif-meta {
  font-size: .72rem;
  color: var(--text-3);
  display: flex;
  gap: 8px;
  margin-top: 2px;
  align-items: center;
}
.notif-item .notif-meta .num {
  font-size: .72rem;
}

.notif-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-3);
}
.notif-empty i { width: 36px; height: 36px; color: var(--border); margin-bottom: .5rem; }
.notif-empty p { font-size: .85rem; margin: 0; }

.notif-footer {
  padding: .625rem 1.125rem;
  border-top: 1px solid var(--border-2);
  text-align: center;
  background: var(--surface-2);
}
.notif-footer a {
  font-size: .8rem;
  color: var(--azure);
  font-weight: 600;
  text-decoration: none;
}

.notif-loader {
  padding: 2rem;
  text-align: center;
  color: var(--text-3);
  font-size: .85rem;
}

@media (max-width: 520px) {
  .notif-panel {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    left: 0;
    width: auto;
    border-radius: 0 0 14px 14px;
    max-height: calc(100vh - var(--topbar-h));
  }
}

.page-content { padding: 2rem; }

/* ══════════════════════════════════════════════════════════════════════════
   CARDS & KPIs — Dark Premium Glassmorphism
   ══════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  position: relative;
  overflow: hidden;
}

/* Liseré lumineux subtil au-dessus des cards */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, .08) 50%,
    transparent 100%);
  pointer-events: none;
}

.card-header {
  padding: 1.125rem 1.375rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.card-header h2, .card-header h3 { font-size: 1rem; color: var(--text); }
.card-body { padding: 1.375rem; }

.grid { display: grid; gap: 1.25rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-12 > * { grid-column: span 12; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* KPI cards */
.kpi {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all .22s cubic-bezier(.4,0,.2,1);
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 140px; height: 140px;
  background: radial-gradient(circle, var(--kpi-accent, var(--azure)) 0%, transparent 70%);
  opacity: .15;
  border-radius: 50%;
  transform: translate(30%, -30%);
  transition: transform .4s;
  filter: blur(20px);
}

/* Liseré supérieur lumineux */
.kpi::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, .12) 50%,
    transparent 100%);
  pointer-events: none;
}

.kpi:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-hi);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 0 30px var(--kpi-glow, rgba(79, 107, 255, .15));
}
.kpi:hover::before { transform: translate(20%, -40%) scale(1.3); }

/* KPI cliquable (lien) */
a.kpi-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: block;
}
a.kpi-link:hover {
  border-color: var(--kpi-accent, var(--azure));
  transform: translateY(-4px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.35),
    0 0 40px var(--kpi-glow, rgba(79, 107, 255, .2));
}
.kpi-cta {
  margin-top: 10px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--kpi-accent, var(--azure));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all .25s ease;
}
.kpi-cta i { width: 12px; height: 12px; }
a.kpi-link:hover .kpi-cta {
  opacity: 1;
  transform: translateX(0);
}

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--kpi-accent, var(--azure)) 18%, transparent);
  color: var(--kpi-accent, var(--azure));
  margin-bottom: .875rem;
  border: 1px solid color-mix(in srgb, var(--kpi-accent, var(--azure)) 25%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--kpi-accent, var(--azure)) 20%, transparent);
}
.kpi-icon i { width: 20px; height: 20px; stroke-width: 2.25; }

.kpi-label { font-size: .8rem; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.kpi-value {
  font-family: var(--ff-display);
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.kpi-delta {
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: .5rem;
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.kpi-delta.up   { background: rgba(0,179,65,.1);  color: var(--mint); }
.kpi-delta.down { background: rgba(220,38,38,.1); color: var(--red); }
.kpi-delta i { width: 12px; height: 12px; }

.kpi[data-accent="azure"]  { --kpi-accent: var(--azure); --kpi-glow: rgba(79, 107, 255, .25); }
.kpi[data-accent="mint"]   { --kpi-accent: var(--mint);  --kpi-glow: rgba(16, 226, 156, .25); }
.kpi[data-accent="amber"]  { --kpi-accent: var(--amber); --kpi-glow: rgba(255, 183, 43, .25); }
.kpi[data-accent="rose"]   { --kpi-accent: var(--rose);  --kpi-glow: rgba(255, 92, 124, .25); }
.kpi[data-accent="violet"] { --kpi-accent: var(--violet);--kpi-glow: rgba(167, 139, 250, .25); }
.kpi[data-accent="red"]    { --kpi-accent: var(--red);   --kpi-glow: rgba(255, 71, 87, .25); }

/* ══════════════════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table th {
  text-align: left;
  padding: .875rem 1rem;
  font-weight: 600;
  color: var(--text-3);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(15, 21, 53, 0.4);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(79, 107, 255, 0.05); }
.table tbody tr:last-child td { border-bottom: none; }

.table .num {
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-weight: 600;
  color: var(--azure);
  font-size: .82rem;
  text-shadow: 0 0 12px rgba(79, 107, 255, .3);
}

.cell-user { display: flex; align-items: center; gap: .625rem; }
.cell-user .avatar { width: 28px; height: 28px; font-size: .72rem; }
.cell-user .avatar.muted { background: var(--surface-2); color: var(--text-3); }

/* ══════════════════════════════════════════════════════════════════════════
   BADGES / STATUTS / PRIORITÉS
   ══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.prio { text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; }
.prio-low      { background: rgba(107, 127, 236, .15); color: var(--sky); border: 1px solid rgba(107,127,236,.2); }
.prio-medium   { background: rgba(79, 107, 255, .15);  color: var(--azure); border: 1px solid rgba(79,107,255,.25); }
.prio-high     { background: rgba(255, 183, 43, .15);  color: var(--amber); border: 1px solid rgba(255,183,43,.25); }
.prio-critical { background: rgba(255, 71, 87, .18);   color: #FF8A9C; border: 1px solid rgba(255,71,87,.35); animation: pulse 2s infinite; }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,71,87,.4); }
  50%     { box-shadow: 0 0 0 6px rgba(255,71,87,0); }
}

.status-new             { background: rgba(167, 139, 250, .15);  color: var(--violet); border: 1px solid rgba(167,139,250,.25); }
.status-in_progress     { background: rgba(79, 107, 255, .15);   color: var(--azure); border: 1px solid rgba(79,107,255,.25); }
.status-pending_client  { background: rgba(255, 183, 43, .15);   color: var(--amber); border: 1px solid rgba(255,183,43,.25); }
.status-pending_supplier{ background: rgba(255, 183, 43, .15);   color: var(--amber); border: 1px solid rgba(255,183,43,.25); }
.status-scheduled       { background: rgba(167, 139, 250, .15);  color: var(--violet); border: 1px solid rgba(167,139,250,.25); }
.status-resolved        { background: rgba(16, 226, 156, .15);   color: var(--mint); border: 1px solid rgba(16,226,156,.3); }
.status-closed          { background: rgba(107, 123, 168, .15);  color: var(--text-2); border: 1px solid rgba(107,123,168,.25); }
.status-cancelled       { background: rgba(107, 123, 168, .15);  color: var(--text-2); border: 1px solid rgba(107,123,168,.25); }
.status-rejected        { background: rgba(255, 71, 87, .18);    color: #FF8A9C; border: 1px solid rgba(255,71,87,.35); }

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .625rem 1.125rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  transition: all .16s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn i { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--azure) 0%, var(--mint) 100%);
  color: #fff;
  box-shadow:
    0 4px 16px rgba(79, 107, 255, .35),
    0 2px 4px rgba(79, 107, 255, .25),
    inset 0 1px 0 rgba(255,255,255,.15);
  position: relative;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--azure-hi) 0%, var(--mint-hi) 100%);
  color: #fff;
  box-shadow:
    0 8px 28px rgba(79, 107, 255, .5),
    0 4px 8px rgba(79, 107, 255, .3),
    inset 0 1px 0 rgba(255,255,255,.2);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--text);
  border-color: var(--glass-border);
}
.btn-secondary:hover {
  background: var(--glass-hi);
  border-color: var(--glass-border-hi);
  color: var(--text);
  box-shadow: 0 0 20px rgba(79, 107, 255, .15);
}

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--glass); color: var(--text); }

.btn-danger {
  background: linear-gradient(135deg, var(--red) 0%, #FF6B7A 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 71, 87, .35);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #FF6B7A 0%, var(--red) 100%);
  color: #fff;
  box-shadow: 0 8px 28px rgba(255, 71, 87, .5);
  transform: translateY(-1px);
}

.btn-sm { padding: .4rem .75rem; font-size: .8rem; }

/* ══════════════════════════════════════════════════════════════════════════
   FORMS — Dark Premium
   ══════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.125rem; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .375rem;
}
.form-label .req { color: var(--rose); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: .625rem .875rem;
  background: rgba(15, 21, 53, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: .875rem;
  color: var(--text);
  transition: all .15s;
  outline: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--azure);
  background: rgba(15, 21, 53, 0.8);
  box-shadow: var(--glow);
}
.form-textarea { min-height: 120px; resize: vertical; font-family: inherit; }

.form-select option { background: var(--bg-2); color: var(--text); }

.form-hint { font-size: .75rem; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: .75rem; color: var(--red); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #0A1628 0%, #020B18 100%);
  display: grid; place-items: center;
  padding: 2rem; position: relative;
  overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,120,212,.22) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(125,211,252,.14) 0%, transparent 45%);
  pointer-events: none;
}
.login-page::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(125,211,252,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,211,252,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: rgba(10,22,40,.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(125,211,252,.15);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  box-shadow: 0 40px 80px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
}
.login-logo {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 2rem;
  color: #fff;
}
.login-logo .brand-mark { background: rgba(125,211,252,.12); border-color: rgba(125,211,252,.25); }
.login-logo .brand-name { color: #fff; font-size: 1.1rem; }
.login-logo .brand-tag { color: var(--sky); }

.login-card h1 {
  color: #fff; font-size: 1.625rem; margin-bottom: .25rem;
}
.login-card .subtitle {
  color: rgba(255,255,255,.55);
  font-size: .875rem;
  margin-bottom: 2rem;
}
.login-card .form-label { color: rgba(255,255,255,.85); }
.login-card .form-input {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.1);
  color: #fff;
}
.login-card .form-input::placeholder { color: rgba(255,255,255,.35); }
.login-card .form-input:focus {
  background: rgba(255,255,255,.08);
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(125,211,252,.15);
}
.login-card .btn-primary { width: 100%; justify-content: center; padding: .75rem; font-size: .925rem; }
.login-demo {
  margin-top: 1.75rem;
  padding: 1rem;
  background: rgba(125,211,252,.05);
  border: 1px dashed rgba(125,211,252,.2);
  border-radius: 10px;
  color: rgba(255,255,255,.7);
  font-size: .8rem;
}
.login-demo strong { color: var(--sky); }
.login-demo code {
  background: rgba(0,0,0,.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .78rem;
  color: var(--sky);
}
.login-error {
  background: rgba(220,38,38,.12);
  border: 1px solid rgba(220,38,38,.25);
  color: #fecaca;
  padding: .75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: .85rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   FILTERS BAR
   ══════════════════════════════════════════════════════════════════════════ */
.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: 1rem 1.375rem;
  border-bottom: 1px solid var(--glass-border);
}
.filters .form-select, .filters .form-input {
  padding: .5rem .75rem;
  font-size: .825rem;
  min-width: 0;
  width: 100%;
}
.filters button { white-space: nowrap; }

@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters button { grid-column: span 2; justify-self: start; }
}
@media (max-width: 520px) {
  .filters { grid-template-columns: 1fr; }
  .filters button { grid-column: auto; }
}

/* ══════════════════════════════════════════════════════════════════════════
   TICKET DETAIL — Dark Premium
   ══════════════════════════════════════════════════════════════════════════ */
.ticket-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.ticket-header h1 { margin-bottom: .5rem; }
.ticket-meta { display: flex; gap: 1.25rem; flex-wrap: wrap; color: var(--text-3); font-size: .82rem; }
.ticket-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.ticket-meta i { width: 14px; height: 14px; }

.ticket-description {
  background: rgba(15, 21, 53, 0.5);
  border: 1px solid var(--glass-border);
  padding: 1.25rem;
  border-radius: 10px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

/* Timeline */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ''; position: absolute;
  top: 6px; bottom: 6px; left: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--glass-border) 0%, var(--glass-border-hi) 50%, var(--glass-border) 100%);
}
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item::before {
  content: ''; position: absolute;
  left: -1.5rem; top: 6px;
  width: 14px; height: 14px;
  background: var(--bg-2);
  border: 2px solid var(--azure);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--bg), 0 0 12px var(--azure-glow);
}
.timeline-item.internal::before { border-color: var(--amber); box-shadow: 0 0 0 3px var(--bg), 0 0 12px rgba(255, 183, 43, .4); }
.timeline-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  margin-bottom: .375rem;
}
.timeline-user { font-weight: 600; font-size: .875rem; color: var(--text); }
.timeline-date { font-size: .72rem; color: var(--text-3); }
.timeline-body {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: .75rem 1rem;
  font-size: .875rem;
  line-height: 1.55;
  color: var(--text-2);
}
.timeline-item.internal .timeline-body {
  background: rgba(255, 183, 43, .08);
  border-color: rgba(255, 183, 43, .25);
}

/* ══════════════════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; top: 1rem; right: 1rem;
  z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: linear-gradient(180deg, rgba(26, 35, 80, 0.95) 0%, rgba(15, 21, 53, 0.95) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-hi);
  border-left: 4px solid var(--azure);
  padding: .875rem 1.125rem;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(79, 107, 255, 0.15);
  display: flex; align-items: center; gap: .625rem;
  font-size: .875rem;
  min-width: 260px;
  color: var(--text);
  animation: toast-in .22s cubic-bezier(.4,0,.2,1);
}
.toast.success { border-left-color: var(--mint); box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 30px var(--mint-glow); }
.toast.error   { border-left-color: var(--red); box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 30px rgba(255,71,87,.3); }
.toast.warning { border-left-color: var(--amber); }
.toast i { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success i { color: var(--mint); }
.toast.error i { color: var(--red); }
.toast.warning i { color: var(--amber); }
@keyframes toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MODAL — Dark Premium
   ══════════════════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 8, 25, 0.7);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 1rem;
}
.modal {
  background: linear-gradient(180deg, rgba(26, 35, 80, 0.95) 0%, rgba(15, 21, 53, 0.95) 100%);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border-hi);
  border-radius: var(--r-xl);
  width: 100%; max-width: 520px;
  max-height: 90vh;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(79, 107, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: modal-in .22s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, rgba(79, 107, 255, 0.06) 0%, transparent 100%);
  flex-shrink: 0;
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--glass-border-hi); border-radius: 10px; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  background: rgba(10, 14, 39, 0.4);
  flex-shrink: 0;
}
@keyframes modal-in {
  from { transform: translateY(20px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CHART CONTAINERS
   ══════════════════════════════════════════════════════════════════════════ */
.chart-wrap { position: relative; height: 280px; }
.chart-wrap.sm { height: 220px; }

/* ══════════════════════════════════════════════════════════════════════════
   EMPTY / LOADING
   ══════════════════════════════════════════════════════════════════════════ */
.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-3);
}
.empty i { width: 48px; height: 48px; stroke-width: 1.5; margin-bottom: 1rem; color: var(--border); }
.empty h3 { color: var(--text-2); margin-bottom: .375rem; }
.empty p { font-size: .875rem; }

.skeleton { background: linear-gradient(90deg, var(--border-2) 0%, var(--surface-2) 50%, var(--border-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════════════════ */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: .5rem; }
.gap { gap: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: .82rem; }
.text-xs { font-size: .72rem; }
.font-mono { font-family: 'SF Mono', 'Cascadia Code', monospace; }
.text-right { text-align: right; }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; place-items: center; }
  .search-box { width: 200px; }
  .page-content { padding: 1.25rem; }
  .topbar { padding: 0 1rem; }
}
@media (max-width: 520px) {
  .search-box { display: none; }
  .topbar { height: 64px; }
  .page-title h1 { font-size: 1.125rem; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ANIMATIONS STAGGERED
   ══════════════════════════════════════════════════════════════════════════ */
.fade-in { animation: fadeIn .4s ease both; }
.fade-in-stagger > * { animation: fadeIn .4s ease both; }
.fade-in-stagger > *:nth-child(1) { animation-delay: .05s; }
.fade-in-stagger > *:nth-child(2) { animation-delay: .1s; }
.fade-in-stagger > *:nth-child(3) { animation-delay: .15s; }
.fade-in-stagger > *:nth-child(4) { animation-delay: .2s; }
.fade-in-stagger > *:nth-child(5) { animation-delay: .25s; }
.fade-in-stagger > *:nth-child(6) { animation-delay: .3s; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
