/* ═══════════════════════════════════════════════════════════
   Rebootly Provider Portal — Design System v2
   3 thèmes : dark (défaut) · light · minimal
   ═══════════════════════════════════════════════════════════ */

/* ─── Thème Dark (défaut) ───────────────────────────────── */
[data-theme="dark"] {
  --bg:           #080e1c;
  --bg-surface:   #0f1929;
  --bg-card:      #131f33;
  --bg-hover:     #1a2842;
  --bg-input:     #0d1626;
  --border:       #1e3050;
  --border-light: rgba(30,48,80,.5);

  --accent:       #3b82f6;
  --accent-2:     #60a5fa;
  --accent-glow:  rgba(59,130,246,.15);
  --accent-grad:  linear-gradient(135deg, #1d4ed8, #3b82f6);

  --green:        #22c55e;
  --orange:       #f59e0b;
  --red:          #ef4444;
  --purple:       #a855f7;

  --text:         #e2e8f0;
  --text-muted:   #64748b;
  --text-faint:   #334155;

  --sidebar-w:    260px;
  --radius:       14px;
  --radius-sm:    6px;
  --shadow:       0 4px 24px rgba(0,0,0,.4);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.25);
}

/* ─── Thème Light ───────────────────────────────────────── */
:root, [data-theme="light"] {
  --bg:           #F8FAFC;
  --bg-surface:   #F0F4F8;
  --bg-card:      #ffffff;
  --bg-hover:     #f8fafc;
  --bg-input:     #f8fafc;
  --border:       #e2e8f0;
  --border-light: rgba(226,232,240,.8);

  --accent:       #0044CC;
  --accent-2:     #40D4FF;
  --accent-glow:  rgba(0,68,204,.1);
  --accent-grad:  linear-gradient(135deg, #0044CC, #40D4FF);

  --green:        #16a34a;
  --orange:       #d97706;
  --red:          #dc2626;
  --purple:       #9333ea;

  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-faint:   #cbd5e1;

  --shadow:       0 8px 32px rgba(0,0,0,.06);
  --shadow-sm:    0 1px 4px rgba(0,0,0,.06);
}

/* ─── Thème Minimal ─────────────────────────────────────── */
[data-theme="minimal"] {
  --bg:           #fafafa;
  --bg-surface:   #f4f4f5;
  --bg-card:      #ffffff;
  --bg-hover:     #f9f9f9;
  --bg-input:     #ffffff;
  --border:       #e4e4e7;
  --border-light: rgba(228,228,231,.6);

  --accent:       #18181b;
  --accent-2:     #3f3f46;
  --accent-glow:  rgba(24,24,27,.06);
  --accent-grad:  linear-gradient(135deg, #18181b, #3f3f46);

  --green:        #16a34a;
  --orange:       #b45309;
  --red:          #dc2626;
  --purple:       #7c3aed;

  --text:         #18181b;
  --text-muted:   #71717a;
  --text-faint:   #d4d4d8;

  --shadow:       0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
  --shadow-sm:    0 1px 2px rgba(0,0,0,.04);
}

/* ═══════════════════════════════════════════════════════════
   Base
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  transition: background .2s, color .2s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: 'Courier New', 'SF Mono', monospace; }

/* ═══════════════════════════════════════════════════════════
   Pages Auth
   ═══════════════════════════════════════════════════════════ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
[data-theme="dark"] .auth-page,
:root .auth-page {
  background: radial-gradient(ellipse at 50% -20%, rgba(59,130,246,.18) 0%, transparent 65%), var(--bg);
}

.auth-container { width: 100%; max-width: 400px; padding: 1.5rem; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: .875rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.logo-gradient-lg {
  width: 48px; height: 48px;
  background: var(--accent-grad);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.auth-title  { font-size: 1.4rem; font-weight: 700; }
.auth-sub    { font-size: .8rem; color: var(--text-muted); margin-top: 1px; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow);
}
.auth-card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 1.5rem; }
.auth-footer-text {
  margin-top: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
}

/* ═══════════════════════════════════════════════════════════
   Layout Sidebar
   ═══════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
}
[data-theme="dark"] .sidebar,
:root .sidebar {
  background: var(--bg-surface);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.logo-gradient {
  width: 32px; height: 32px;
  background: var(--accent-grad);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.logo-title { font-size: .9rem; font-weight: 700; line-height: 1.2; }
.logo-sub   { font-size: .68rem; color: var(--text-muted); }

/* Section nav */
.nav-section {
  padding: 1rem .75rem .25rem;
}
.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 0 .5rem;
  margin-bottom: .25rem;
}
.nav-links { list-style: none; }
.nav-links li { margin-bottom: 2px; }
.nav-links a {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: all .12s;
  white-space: nowrap;
  overflow: hidden;
}
.nav-links a:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}
.nav-links a.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}
[data-theme="minimal"] .nav-links a.active {
  background: var(--bg-surface);
  color: var(--text);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-left: -1px;
  padding-left: calc(.75rem - 1px);
}
.nav-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }

/* Provider info + bottom */
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: .75rem;
}
.sidebar-provider-chip {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .6rem .75rem;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
  overflow: hidden;
}
.provider-avatar {
  width: 28px; height: 28px;
  background: var(--accent-grad);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.provider-name  { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.provider-role  { font-size: .68rem; color: var(--text-muted); }

.sidebar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
}
.logout-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .82rem;
  flex: 1;
}
.logout-link:hover { color: var(--red); text-decoration: none; background: rgba(239,68,68,.06); }

/* Theme switcher */
.theme-switcher {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.theme-btn {
  width: 24px; height: 24px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: .7rem;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s;
  color: var(--text-muted);
}
.theme-btn:hover, .theme-btn.active { background: var(--bg-card); color: var(--text); }

/* Lang switcher */
.lang-switcher {
  display: flex;
  gap: .25rem;
  padding: .5rem .75rem;
  flex-wrap: wrap;
}
.lang-btn {
  padding: .2rem .45rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all .1s;
}
.lang-btn:hover { color: var(--text); text-decoration: none; }
.lang-btn.active { background: var(--accent-glow); color: var(--accent); border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   Main Content
   ═══════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 2rem 2.25rem;
  min-height: 100vh;
}

/* ─── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.page-sub   { color: var(--text-muted); font-size: .82rem; margin-top: .2rem; }

/* ═══════════════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 1.25rem; }
.card-header {
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

/* ═══════════════════════════════════════════════════════════
   KPI Grid
   ═══════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.375rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-card.kpi-blue::before   { background: var(--accent); }
.kpi-card.kpi-orange::before { background: var(--orange); }
.kpi-card.kpi-red::before    { background: var(--red); }
.kpi-card.kpi-green::before  { background: var(--green); }
.kpi-card.kpi-grey::before   { background: var(--text-faint); }
.kpi-value { font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.kpi-label { font-size: .78rem; color: var(--text-muted); margin-top: .4rem; font-weight: 500; }

/* Quota bar */
.quota-bar-bg {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin-top: .75rem;
}
.quota-bar-fill {
  background: var(--accent-grad);
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}

/* ═══════════════════════════════════════════════════════════
   Tables
   ═══════════════════════════════════════════════════════════ */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  padding: .625rem .875rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: .75rem .875rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: .875rem;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--bg-hover); }

/* ═══════════════════════════════════════════════════════════
   Badges
   ═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .625rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active    { background: rgba(34,197,94,.12);  color: var(--green); }
.badge-revoked   { background: rgba(239,68,68,.12);  color: var(--red); }
.badge-expired   { background: rgba(100,116,139,.12); color: var(--text-muted); }
.badge-pending   { background: rgba(245,158,11,.12); color: var(--orange); }
.badge-trial     { background: rgba(168,85,247,.12); color: var(--purple); }
.badge-suspended { background: rgba(239,68,68,.12);  color: var(--red); }
.badge-cancelled { background: rgba(100,116,139,.12); color: var(--text-muted); }
.badge-plan      { background: var(--accent-glow);   color: var(--accent); }
.badge-lg        { font-size: .875rem; padding: .3rem .9rem; }

[data-theme="minimal"] .badge {
  border-radius: 4px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   Filter bar
   ═══════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: .375rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-btn {
  padding: .35rem .875rem;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.filter-btn.active { background: var(--accent-glow); color: var(--accent); border-color: var(--accent); font-weight: 600; }
[data-theme="minimal"] .filter-btn { border-radius: var(--radius-sm); }

/* ═══════════════════════════════════════════════════════════
   Forms
   ═══════════════════════════════════════════════════════════ */
.form-group   { margin-bottom: 1rem; }
.form-label   {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .375rem;
  color: var(--text-muted);
  letter-spacing: .01em;
}
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .875rem;
  color: var(--text);
  font-family: inherit;
  font-size: .875rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); opacity: .6; }
.form-input-center { text-align: center; font-size: 1.5rem; letter-spacing: .5rem; }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; align-items: center; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.checkbox-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .12s;
  background: var(--bg-input);
  font-size: .875rem;
}
.checkbox-item:hover { border-color: var(--accent); }
.checkbox-item input { accent-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .55rem 1.125rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.btn-primary:hover { opacity: 1; box-shadow: 0 4px 12px rgba(59,130,246,.35); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: .5rem .875rem;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-danger {
  background: rgba(239,68,68,.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.25);
}
.btn-danger:hover { background: rgba(239,68,68,.18); }

.btn-sm   { padding: .35rem .75rem; font-size: .78rem; }
.btn-full { width: 100%; justify-content: center; }

[data-theme="minimal"] .btn-primary {
  background: var(--text);
  color: #fff;
  box-shadow: none;
}
[data-theme="minimal"] .btn-primary:hover { box-shadow: none; }

/* ═══════════════════════════════════════════════════════════
   Alerts
   ═══════════════════════════════════════════════════════════ */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert-success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.25); color: var(--green); }
.alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.25); color: var(--red); }
.alert-warn    { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.25); color: var(--orange); }
.alert-info    { background: var(--accent-glow);   border: 1px solid rgba(59,130,246,.2); color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   Empty state
   ═══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: .5; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.empty-sub   { font-size: .85rem; }

/* ═══════════════════════════════════════════════════════════
   Detail list
   ═══════════════════════════════════════════════════════════ */
.detail-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: .625rem 1rem;
  margin-top: 1rem;
  font-size: .875rem;
}
.detail-list dt { color: var(--text-muted); font-weight: 500; padding-top: 1px; }
.detail-list dd { word-break: break-word; }

/* ═══════════════════════════════════════════════════════════
   Status dot
   ═══════════════════════════════════════════════════════════ */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.status-dot.active   { background: var(--green); box-shadow: 0 0 5px var(--green); }
.status-dot.inactive { background: var(--text-muted); }
.status-dot.error    { background: var(--red); box-shadow: 0 0 5px var(--red); }

/* ═══════════════════════════════════════════════════════════
   Inline form (details/summary dropdown)
   ═══════════════════════════════════════════════════════════ */
.inline-form { position: relative; display: inline-block; }
.inline-form summary { list-style: none; cursor: pointer; }
.inline-form summary::-webkit-details-marker { display: none; }
.inline-form-body {
  position: absolute;
  top: calc(100% + .5rem);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-width: 340px;
  z-index: 200;
  box-shadow: var(--shadow);
}

/* ═══════════════════════════════════════════════════════════
   Timeline
   ═══════════════════════════════════════════════════════════ */
.timeline { padding: .5rem 0; }
.timeline-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.25rem;
  position: relative;
}
.timeline-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: .4rem;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 4px; top: 16px; bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-meta { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }

/* ═══════════════════════════════════════════════════════════
   Plans grid
   ═══════════════════════════════════════════════════════════ */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.375rem;
  position: relative;
  transition: border-color .2s, box-shadow .2s;
}
.plan-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.plan-card.plan-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.plan-badge-current {
  position: absolute;
  top: -1px; right: 1rem;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 0 0 6px 6px;
  letter-spacing: .03em;
}
.plan-name          { font-size: .95rem; font-weight: 700; margin-bottom: .2rem; }
.plan-quota         { font-size: .8rem; color: var(--text-muted); margin-bottom: 1rem; }
.plan-price         { display: flex; align-items: baseline; gap: .25rem; }
.plan-price-amount  { font-size: 1.875rem; font-weight: 700; letter-spacing: -.02em; }
.plan-price-period  { font-size: .8rem; color: var(--text-muted); }
.plan-annual        { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ═══════════════════════════════════════════════════════════
   Impersonation banner
   ═══════════════════════════════════════════════════════════ */
.impersonation-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  color: #fff;
  text-align: center;
  padding: .45rem 1rem;
  font-size: .82rem;
  font-weight: 500;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
body:has(.impersonation-banner) .sidebar { top: 36px; }
body:has(.impersonation-banner) .main-content { padding-top: calc(2rem + 36px); }

/* ═══════════════════════════════════════════════════════════
   Provider badge (old compat)
   ═══════════════════════════════════════════════════════════ */
.provider-badge {
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,.2);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.flex   { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.flex-gap { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.gap-sm { gap: .5rem; }

.text-muted  { color: var(--text-muted); }
.text-small  { font-size: .78rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-mono   { font-family: 'Courier New', monospace; font-size: .85em; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Code block */
.code-block {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--accent-2);
  position: relative;
}

/* Scrollbar (dark themes) */
[data-theme="dark"] ::-webkit-scrollbar,
:root ::-webkit-scrollbar {
  width: 6px; height: 6px;
}
[data-theme="dark"] ::-webkit-scrollbar-track,
:root ::-webkit-scrollbar-track { background: var(--bg); }
[data-theme="dark"] ::-webkit-scrollbar-thumb,
:root ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .main-content { padding: 1.25rem; }
  .form-row, .form-row-3, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Compat (anciens noms de var) ─────────────────── */
:root, [data-theme] {
  --bg-darkest:  var(--bg);
  --bg-dark:     var(--bg-surface);
  --bg-card-alt: var(--bg-hover);
  --accent-blue:  var(--accent);
  --accent-blue2: var(--accent);
  --accent-green: var(--green);
  --accent-orange:var(--orange);
  --accent-red:   var(--red);
  --text-primary: var(--text);
  --sidebar-w:    260px;
}

/* Premium Design Overrides */
body { -webkit-font-smoothing: antialiased; }
.card { transition: box-shadow .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,68,204,.2); }
.badge { font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
code, .mono { font-family: "JetBrains Mono", Consolas, monospace; }
.page-title { font-weight: 800; letter-spacing: -.02em; }
.card-header { font-weight: 700; font-size: .95rem; }
.sidebar .nav-links a { border-radius: 10px; transition: all .15s; }
.sidebar .nav-links a:hover { background: var(--accent-glow); }
.sidebar .nav-links a.active { background: var(--accent-glow); color: var(--accent); font-weight: 700; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.logo-gradient { background: linear-gradient(135deg, #0044CC, #40D4FF); border-radius: 10px; }
