:root {
  --navy: #0d1424;
  --navy-soft: #131c30;
  --bg: #f4f5f8;
  --card: #ffffff;
  --border: #e8eaef;
  --text: #1f2433;
  --muted: #8a90a2;
  --muted-2: #6b7280;
  --indigo: #4f46e5;
  --indigo-dark: #4338ca;
  --indigo-soft: #eef0fe;
  --purple: #7c3aed;
  --green: #16a34a;
  --green-soft: #e7f6ec;
  --amber: #d97706;
  --amber-soft: #fdf6e3;
  --red: #dc2626;
  --red-soft: #fdecec;
  --blue-soft: #e7eefe;
  --blue-text: #3258d6;
  /* Topbar (light by default; overridden in dark theme below) */
  --top-bg: #ffffff;
  --top-text: var(--text);
  --top-border: var(--border);
  --top-btn-bg: #f2f3f7;
  --top-btn-border: var(--border);
  /* Sidebar (light by default; overridden in dark theme below) */
  --side-bg: #ffffff;
  --side-text: #2b3145;
  --side-muted: #7b8296;
  --side-hover: #f2f3f7;
  --side-border: var(--border);
  --side-active-bg: var(--indigo-soft);
  --side-active-text: var(--indigo);
  --radius: 16px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

/* Dark theme: override the neutrals (brand accents stay the same). Applied by
   setting data-theme="dark" on <html> (persisted in localStorage). */
:root[data-theme="dark"] {
  --navy: #060a14;
  --navy-soft: #0d1424;
  --bg: #0f1626;
  --card: #182032;
  --border: #2a3346;
  --text: #e7eaf2;
  --muted: #8a93a8;
  --muted-2: #aab2c5;
  --indigo-soft: #20284a;
  --green-soft: #133024;
  --amber-soft: #332611;
  --red-soft: #3a1d1d;
  --blue-soft: #16233f;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  /* Topbar & sidebar keep a dark panel look in dark mode */
  --top-bg: var(--navy);
  --top-text: #ffffff;
  --top-border: transparent;
  --top-btn-bg: rgba(255, 255, 255, 0.06);
  --top-btn-border: rgba(255, 255, 255, 0.12);
  --side-bg: #0d1424;
  --side-text: #e7ebf3;
  --side-muted: #8a93a8;
  --side-hover: rgba(255, 255, 255, 0.08);
  --side-border: #2a3346;
  --side-active-bg: var(--indigo);
  --side-active-text: #ffffff;
}

/* Dark-mode overrides for surfaces that hardcode a light colour. */
:root[data-theme="dark"] .btn-secondary { background: var(--card); color: var(--text); }
:root[data-theme="dark"] .btn-secondary:hover { background: var(--navy-soft); }
:root[data-theme="dark"] tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: var(--card); color: var(--text); }
:root[data-theme="dark"] .pw-modal,
:root[data-theme="dark"] .brand-preview .bp-card { background: var(--card); }
:root[data-theme="dark"] .mode-toggle.light button { background: var(--card); color: var(--text); }

* { box-sizing: border-box; }

/* Constrain inline SVGs so icons without explicit dimensions never blow up. */
.panel-head svg { width: 24px; height: 24px; flex-shrink: 0; }
.stat .icon svg { width: 24px; height: 24px; }
.cmd-label svg, .mode-label svg { width: 16px; height: 16px; flex-shrink: 0; }
.target-row svg, .step-btn svg, .back-link svg, .detail-row svg { width: 18px; height: 18px; flex-shrink: 0; }
.drawer-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.topbar {
  background: var(--top-bg);
  color: var(--top-text);
  border-bottom: 1px solid var(--top-border);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; }
/* Fixed box so a custom logo image (width:100%) can't overflow the header. */
.brand .logo { color: #6366f1; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; }
.brand .logo svg { width: 28px; height: 28px; }
.brand .logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.hamburger {
  background: var(--top-btn-bg);
  border: 1px solid var(--top-btn-border);
  color: var(--top-text);
  width: 50px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.hamburger:hover { filter: brightness(0.96); }

/* ---------- Mail simulation banner ---------- */
.mail-banner { background: var(--amber-soft); color: #92580a; border-bottom: 1px solid #f3e1b3; padding: 11px 28px; font-size: 14px; text-align: center; }
.mail-banner code { background: rgba(146,88,10,.12); padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: 13px; }

/* ---------- Layout ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 28px 28px 80px; }

/* ---------- Stat cards ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.stat .label { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; line-height: 1.4; }
.stat .value { font-size: 34px; font-weight: 800; margin-top: 14px; }
.stat .value.green { color: var(--green); }
.stat .value.amber { color: var(--amber); }
.stat .value.purple { color: var(--purple); }
.stat .value.muted { color: var(--muted); }
.stat .icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon.indigo { background: var(--indigo-soft); color: var(--indigo); }
.icon.green { background: var(--green-soft); color: var(--green); }
.icon.amber { background: var(--amber-soft); color: var(--amber); }
.icon.purple { background: #f3e9ff; color: var(--purple); }

/* ---------- Section header ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.section-head h1 { font-size: 30px; font-weight: 800; margin: 0 0 6px; }
.section-head p { margin: 0; color: var(--muted-2); font-size: 15px; }
.head-actions { display: flex; gap: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  border-radius: 12px; padding: 13px 20px;
  font-size: 15px; font-weight: 600; border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-dark); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f7f8fa; }
.btn-danger-ghost { background: var(--red-soft); color: var(--red); width: 100%; justify-content: center; padding: 16px; font-weight: 700; font-size: 16px; border: 1px solid #f7d4d4; }
.btn-danger-ghost:hover { background: #fbdcdc; }
.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid #f7d4d4; }
.btn-danger:hover { background: #fbdcdc; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 10px; }

/* ---------- Table card ---------- */
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.backup-row:last-child { border-bottom: none; }
.backup-row .backup-key { font-weight: 600; font-size: 14px; word-break: break-all; }

.targets-pick { display: flex; gap: 18px; flex-wrap: wrap; padding: 4px 0; }
.targets-pick label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.targets-pick input { width: auto; }

.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar #dashSearch { flex: 1; min-width: 220px; }
.filter-bar #dashStatus { max-width: 220px; }

.table-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 14px; font-weight: 700; color: var(--muted-2); padding: 22px 24px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 20px 24px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 15px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }

/* Compact, overflow-safe table for secondary lists (e.g. known users). */
.users-table th, .users-table td { padding: 12px 16px; }
.users-table td { word-break: break-all; }
.users-table td[data-label="Dernière"], .users-table td[data-label="Rôle"], .users-table td[data-label="Connexions"] { white-space: nowrap; word-break: normal; }
.users-table th:last-child, .users-table td:last-child { text-align: right; white-space: nowrap; width: 1%; }
.users-table .btn { white-space: nowrap; }

.client-cell { display: flex; align-items: center; gap: 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--indigo-soft); color: var(--indigo); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.client-name { font-weight: 700; }
.client-email { color: var(--muted); font-size: 14px; margin-top: 2px; word-break: break-all; }

.targets { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.target-row { display: flex; align-items: center; gap: 8px; }
.target-row .ico-pve { color: var(--amber); }
.target-row .ico-tp { color: var(--purple); }
.target-row .k { color: var(--muted-2); }
.target-row .v { font-weight: 600; }

.manage-link { color: var(--indigo); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.manage-link:hover { text-decoration: underline; }

.date-cell .k { color: var(--muted-2); }
.date-cell .access-yes { color: var(--green); font-weight: 700; }
.date-cell .access-no { color: var(--muted); font-style: italic; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.badge-en_creation { background: #eef0f3; color: #5b6472; }
.badge-proxmox_cree { background: var(--blue-soft); color: var(--blue-text); }
.badge-teleport_cree { background: #ede9fe; color: #6d28d9; }
.badge-mails_envoyes { background: #e0f2fe; color: #0369a1; }
.badge-onboarde { background: #e7f6ec; color: #15803d; }
.badge-revoque { background: var(--red-soft); color: var(--red); }
.badge-followup { background: var(--amber-soft); color: var(--amber); margin-left: 8px; }

/* ---------- Detail page ---------- */
.detail-grid { display: flex; flex-direction: column; gap: 24px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.panel-head { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; margin: 0 0 22px; }
.detail-top { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.detail-top h1 { margin: 0; font-size: 30px; }
.detail-rows { margin-top: 26px; }
.detail-row { display: flex; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border); font-size: 16px; }
.detail-row .k { color: var(--muted-2); }
.detail-row .v { font-weight: 700; }

.subtle-label { text-transform: uppercase; letter-spacing: .06em; font-size: 13px; font-weight: 800; color: var(--muted); margin: 30px 0 14px; }
.step-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: #f6f7f9; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; font-size: 16px; font-weight: 600; color: var(--text); text-align: left;
}
.step-btn:hover { background: #eef0f3; }
.step-btn.done { color: var(--green); }
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ---------- Code blocks ---------- */
.cmd-group { margin-top: 18px; }
.cmd-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted-2); margin-bottom: 10px; }
.code {
  position: relative;
  background: var(--navy); color: #7ee787;
  font-family: var(--mono); font-size: 14px; line-height: 1.6;
  padding: 18px 56px 18px 20px; border-radius: 12px;
  white-space: pre-wrap; word-break: break-all;
}
.code .copy { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.08); border: none; color: #cbd5e1; border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.code .copy:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12px; color: var(--muted); }
input, select, textarea {
  font-family: inherit; font-size: 15px; color: var(--text);
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 12px; margin-top: 26px; }

/* ---------- Drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(13, 20, 36, .55); backdrop-filter: blur(2px); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 320px; background: var(--side-bg); color: var(--side-text); border-right: 1px solid var(--side-border); z-index: 70; transform: translateX(-100%); transition: transform .25s ease; display: flex; flex-direction: column; padding: 26px; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; }
.drawer-head .brand { font-size: 22px; }
.drawer-head .sub { color: var(--side-muted); font-size: 13px; margin-top: 4px; }
.drawer-close { background: none; border: none; color: var(--side-muted); font-size: 26px; line-height: 1; }
.drawer-nav { margin-top: 32px; display: flex; flex-direction: column; gap: 4px; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); padding: 0 12px; margin-bottom: 6px; }
.drawer-nav a { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--side-text); }
.drawer-nav a:hover { background: var(--side-hover); }
.drawer-nav a.active { background: var(--side-active-bg); color: var(--side-active-text); }
.drawer-nav a.active svg { color: var(--side-active-text); }
.drawer-foot { margin-top: auto; }
.drawer-foot .mode-label { display: flex; align-items: center; gap: 8px; color: var(--side-muted); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 12px; }
.mode-toggle { display: flex; gap: 8px; }
.mode-toggle button { flex: 1; padding: 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: #cbd5e1; font-weight: 700; font-size: 14px; }
.mode-toggle button.active { background: var(--indigo); border-color: var(--indigo); color: #fff; }
/* Light variant for use on a card (e.g. the Configuration page). */
.mode-toggle.light button { background: #fff; border-color: var(--border); color: var(--text); cursor: pointer; }
.mode-toggle.light button.active { background: var(--indigo); border-color: var(--indigo); color: #fff; }

/* ---------- Persistent collapsible sidebar (desktop ≥ 1024px) ----------
   On wide screens the drawer becomes a fixed left rail, always visible, and the
   content is shifted to sit beside it. The hamburger toggles `nav-collapsed`
   (hide/show), persisted in localStorage. Below 1024px it stays an off-canvas
   drawer opened by the hamburger over an overlay (mobile behaviour untouched). */
@media (min-width: 1024px) {
  .drawer { transform: translateX(0); width: 264px; padding: 22px; transition: transform .25s ease; }
  /* The topbar already carries the brand → hide the drawer's duplicate header. */
  .drawer-head { display: none; }
  .drawer-nav { margin-top: 8px; }
  .drawer-overlay { display: none !important; }
  .topbar, .mail-banner, main#app { margin-left: 264px; transition: margin-left .25s ease; }
  body.nav-collapsed .drawer { transform: translateX(-100%); }
  body.nav-collapsed .topbar,
  body.nav-collapsed .mail-banner,
  body.nav-collapsed main#app { margin-left: 0; }
}

/* ---------- Misc ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--indigo); font-weight: 600; margin-bottom: 18px; }
.user-chip { display: flex; align-items: center; gap: 12px; padding: 12px 0 18px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.user-chip .user-meta { flex: 1; min-width: 0; }
.drawer-version { margin-top: auto; padding: 14px 0 4px; font-size: 12px; color: var(--side-muted); }
.user-chip .user-name { font-weight: 700; font-size: 14px; color: var(--side-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .user-email { font-size: 12px; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 48px; height: 48px; opacity: .4; margin-bottom: 12px; }
.empty .error-endpoint { margin-top: 4px; margin-bottom: 18px; font-size: 13px; color: var(--muted-2); }
.empty .error-endpoint code, .dash-warning-row code { background: #f6f7f9; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.dash-warning { background: var(--amber-soft); border: 1px solid #f3e1b3; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 22px; }
.dash-warning-row { color: #92580a; font-size: 14px; }
.dash-warning-row::before { content: "\26A0"; margin-right: 8px; }
.dash-warning-row + .dash-warning-row { margin-top: 6px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--indigo); border-radius: 50%; animation: spin .7s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast { background: var(--navy); color: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; max-width: 340px; animation: slideIn .2s ease; }
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--indigo); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }

/* ---------- Stars ---------- */
.stars { display: flex; gap: 6px; }
.stars button, .stars span { background: none; border: none; font-size: 34px; color: #d8dbe2; line-height: 1; padding: 0; }
.stars .on { color: #f5b301; }
.stars button:hover { color: #f5b301; }
.feedback-display { display: flex; align-items: center; gap: 10px; }
.feedback-display .rating { color: #f5b301; font-size: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tbody td { border-bottom: none; padding: 8px 20px; }
  tbody tr { border-bottom: 1px solid var(--border); padding: 14px 0; }
  td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .container { padding: 18px 16px 60px; }
}

/* ---------- Guide / Aide ---------- */
.guide-hero { margin: 8px 0 24px; }
.guide-hero h1 { font-size: 30px; margin: 0 0 10px; }
.guide-hero p { color: var(--muted-2); max-width: 760px; font-size: 16px; line-height: 1.6; }
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.guide-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 24px 20px; }
.guide-card h2 { font-size: 18px; margin: 6px 0 10px; }
.guide-card p { color: var(--muted-2); line-height: 1.6; margin: 0 0 10px; }
.guide-card ul, .guide-card ol { margin: 0 0 10px; padding-left: 20px; color: var(--muted-2); line-height: 1.7; }
.guide-card li { margin: 2px 0; }
.guide-card code { background: #f6f7f9; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 13px; }
.guide-step { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--indigo-soft); color: var(--indigo); font-weight: 800; font-size: 16px; }
.guide-note { background: #fdf6e3; border-left: 4px solid #d97706; border-radius: 6px; padding: 8px 12px; font-size: 13px; color: #92670c; margin: 4px 0 0 !important; }
@media (max-width: 760px) { .guide-grid { grid-template-columns: 1fr; } }

/* ---------- Branding live preview ---------- */
.brand-preview { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg); }
.brand-preview .bp-topbar { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 12px 16px; font-weight: 800; font-size: 16px; }
.brand-preview .bp-logo { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: #6366f1; }
.brand-preview .bp-logo.lg { width: 46px; height: 46px; border-radius: 14px; background: var(--indigo-soft); color: var(--indigo); margin-bottom: 10px; }
.brand-preview .bp-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand-preview .bp-card { background: #fff; margin: 22px auto; max-width: 340px; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 26px 24px; text-align: center; }
.brand-preview .bp-title { font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.brand-preview .bp-tagline { color: var(--muted-2); font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.brand-preview .bp-btn { width: 100%; padding: 11px; border: none; border-radius: 10px; color: #fff; font-weight: 700; font-size: 14px; background: var(--indigo); }
.brand-preview .bp-foot { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* Dashboard pager (server-side pagination controls). */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 4px; }
.pager:empty { display: none; }

/* Self-service password change modal. */
.pw-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.pw-modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 28px; width: 100%; max-width: 420px; }
.pw-modal h2 { margin: 0 0 6px; font-size: 19px; }
.pw-modal label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 5px; color: var(--muted-2); }
.pw-modal input { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; box-sizing: border-box; }
.pw-meter { height: 5px; border-radius: 3px; background: var(--border); margin: 7px 0 0; overflow: hidden; }
.pw-meter > div { height: 100%; width: 0; background: transparent; transition: width .2s, background .2s; }
.pw-err { display: none; background: #fdecec; border-left: 4px solid #dc2626; color: #a31515; padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 6px; }
.pw-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Drawer theme toggle. */
.drawer-theme { margin: 16px 20px 0; }

/* Analytics conversion funnel. */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: flex; align-items: center; gap: 12px; }
.funnel-label { width: 130px; font-size: 13px; color: var(--muted-2); flex: none; }
.funnel-track { flex: 1; background: var(--bg); border-radius: 8px; overflow: hidden; height: 26px; }
.funnel-bar { height: 100%; background: linear-gradient(90deg, var(--indigo), var(--purple)); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: flex-end; padding: 0 8px; min-width: 24px; border-radius: 8px; }
.funnel-pct { width: 46px; text-align: right; font-size: 13px; font-weight: 600; color: var(--muted-2); flex: none; }

/* Language switcher on public client-facing pages (FR/EN). */
.lang-switch { position: fixed; top: 14px; right: 16px; z-index: 60; display: flex; gap: 2px; background: rgba(255,255,255,.12); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-switch button { background: transparent; border: none; color: var(--text); font-size: 12px; font-weight: 700; padding: 6px 10px; cursor: pointer; }
.lang-switch button.on { background: var(--indigo); color: #fff; }
