/* Système de design — « File d'attente » (service public, Bénin).
 *
 * Direction : accessible et institutionnelle (design-system/file-d-attente-anip/
 * MASTER.md). Police Atkinson Hyperlegible, bleu institutionnel à fort
 * contraste, aplats plutôt que dégradés, focus toujours visible, cibles
 * tactiles d'au moins 44 px. Les couleurs du drapeau béninois ne servent que
 * de signature (bandeau, logo) — jamais pour porter une information seule.
 *
 * Surcouche sur Bootstrap 5.3 : on redéfinit ses variables CSS (--bs-*), et
 * celles de ses composants dont la couleur est compilée en dur (.btn-primary,
 * .nav-pills, .form-check-input...). Les noms de classes historiques des
 * templates (.feature-card, .row-item, .doc-item, .suivi-*, .kpi...) sont
 * conservés et simplement restylés.
 */

/* ===================================================================
   1. Jetons
   =================================================================== */

:root {
  /* Signature Bénin */
  --bj-green: #008751;
  --bj-yellow: #fcd116;
  --bj-red: #e8112d;

  /* Marque */
  --brand-navy: #0b1f3a;
  --primary: #0369a1;          /* 5.9:1 sur blanc */
  --primary-hover: #075985;
  --primary-active: #0c4a6e;
  --primary-soft: #e0f2fe;
  --primary-soft-border: #bae6fd;
  --primary-ink: #0c4a6e;
  --on-primary: #ffffff;

  /* Surfaces & texte */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #0f172a;
  --ink-muted: #475569;        /* 7.5:1 sur blanc */
  --ink-subtle: #64748b;       /* 4.7:1 sur blanc */
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  /* Sémantique */
  --success: #15803d;
  --success-soft: #dcfce7;
  --success-ink: #166534;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --warning-ink: #92400e;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --danger-ink: #991b1b;

  /* Forme & profondeur */
  --radius-sm: .5rem;
  --radius: .75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .05);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .10);
  --focus-ring: 0 0 0 3px var(--surface), 0 0 0 6px rgba(3, 105, 161, .55);

  --ease: cubic-bezier(.2, 0, 0, 1);
  --dur-fast: 150ms;
  --dur: 220ms;

  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Bootstrap */
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.55;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--ink-muted);
  --bs-tertiary-color: var(--ink-subtle);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--line);

  --bs-primary: var(--primary);
  --bs-primary-rgb: 3, 105, 161;
  --bs-primary-bg-subtle: var(--primary-soft);
  --bs-primary-border-subtle: var(--primary-soft-border);
  --bs-primary-text-emphasis: var(--primary-ink);
  --bs-success: var(--success);
  --bs-success-rgb: 21, 128, 61;
  --bs-success-bg-subtle: var(--success-soft);
  --bs-success-text-emphasis: var(--success-ink);
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;
  --bs-warning-bg-subtle: var(--warning-soft);
  --bs-warning-text-emphasis: var(--warning-ink);
  --bs-danger: var(--danger);
  --bs-danger-rgb: 185, 28, 28;
  --bs-danger-bg-subtle: var(--danger-soft);
  --bs-danger-text-emphasis: var(--danger-ink);
  --bs-info: var(--primary);
  --bs-info-rgb: 3, 105, 161;
  --bs-info-bg-subtle: var(--primary-soft);
  --bs-info-text-emphasis: var(--primary-ink);
  --bs-secondary-rgb: 71, 85, 105;

  --bs-link-color: var(--primary);
  --bs-link-color-rgb: 3, 105, 161;
  --bs-link-hover-color: var(--primary-hover);
  --bs-link-hover-color-rgb: 7, 89, 133;

  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius: var(--radius);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-border-radius-xl: var(--radius-xl);
  --bs-box-shadow-sm: var(--shadow-sm);
  --bs-box-shadow: var(--shadow);
  --bs-box-shadow-lg: var(--shadow-lg);
  --bs-focus-ring-color: rgba(3, 105, 161, .45);
}

/* Mode sombre — posé sur <html data-bs-theme="dark"> avant le premier rendu. */
[data-bs-theme="dark"] {
  --brand-navy: #050d1a;
  --primary: #38bdf8;          /* texte/liens sur fond sombre */
  --primary-hover: #7dd3fc;
  --primary-active: #bae6fd;
  --primary-soft: #0c2a40;
  --primary-soft-border: #164e72;
  --primary-ink: #bae6fd;

  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #172338;
  --ink: #e6ebf2;
  --ink-muted: #a7b4c8;
  --ink-subtle: #8a99b0;
  --line: #24324a;
  --line-strong: #33445f;

  --success: #4ade80;
  --success-soft: #0f2e1d;
  --success-ink: #bbf7d0;
  --warning: #fbbf24;
  --warning-soft: #33250a;
  --warning-ink: #fde68a;
  --danger: #f87171;
  --danger-soft: #3a1416;
  --danger-ink: #fecaca;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  --focus-ring: 0 0 0 3px var(--bg), 0 0 0 6px rgba(56, 189, 248, .7);

  --bs-primary-rgb: 56, 189, 248;
  --bs-success-rgb: 74, 222, 128;
  --bs-danger-rgb: 248, 113, 113;
  --bs-info-rgb: 56, 189, 248;
  --bs-secondary-rgb: 148, 163, 184;
  --bs-link-color-rgb: 56, 189, 248;
  --bs-link-hover-color-rgb: 125, 211, 252;
  --bs-focus-ring-color: rgba(56, 189, 248, .5);

  color-scheme: dark;
}

/* ===================================================================
   2. Base
   =================================================================== */

html { scroll-padding-top: 5rem; }

@media (max-width: 575.98px) {
  .container, .container-fluid { padding-left: 1rem; padding-right: 1rem; }
}

body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
  color: var(--ink);
  text-wrap: balance;
}
p { text-wrap: pretty; }
.text-muted { color: var(--ink-muted) !important; }
.small, small { font-size: .875rem; }
strong, b { font-weight: 700; }
.fw-semibold { font-weight: 700 !important; }

a { text-underline-offset: .18em; }
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.feature-card):not(.row-item):not(.card):not(.list-group-item):hover {
  text-decoration-thickness: 2px;
}

::selection { background: var(--primary-soft); color: var(--primary-ink); }

/* Focus clavier toujours visible (jamais supprimé). */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring) !important;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2000;
  padding: .75rem 1rem;
  background: var(--brand-navy);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 1rem; color: #fff; }

/* Transitions sobres — couleur et ombre seulement. */
a, .btn, .card, .list-group-item, .nav-link, .form-control, .form-select,
.feature-card, .row-item, .doc-item, .jour-btn {
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

/* ===================================================================
   3. En-tête du site
   =================================================================== */

.flag-band {
  display: flex;
  height: 4px;
}
.flag-band span { flex: 1; }
.flag-band span:nth-child(1) { background: var(--bj-green); }
.flag-band span:nth-child(2) { background: var(--bj-yellow); }
.flag-band span:nth-child(3) { background: var(--bj-red); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow); }
.site-header .navbar { padding: .6rem 0; }

/* Logo (templates/_logo.html) : trois silhouettes en file + nom et slogan,
   conformes à la maquette images/landing page.png. */
.brand {
  --logo-gap: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: #0f3a68;
  text-decoration: none;
  min-height: 44px;
}
.brand:hover { color: #0f3a68; }
.brand .logo-mark { width: 2.75rem; height: 3.9rem; flex-shrink: 0; }
.brand .logo-text { display: flex; flex-direction: column; }
.brand .logo-name {
  font-family: "Plus Jakarta Sans", var(--font);
  font-weight: 800;
  font-size: 1.28rem;
  line-height: 1.1;
  letter-spacing: -.015em;
  color: #0b2a4f;
}
.brand .logo-tag { font-size: .72rem; line-height: 1.35; color: #3d5a80; margin-top: .2rem; white-space: nowrap; }
[data-bs-theme="dark"] .site-header .brand { color: #e6ebf2; }
[data-bs-theme="dark"] .site-header .brand .logo-name { color: #fff; }
[data-bs-theme="dark"] .site-header .brand .logo-tag { color: var(--ink-muted); }
@media (max-width: 575.98px) { .site-header .brand .logo-tag { display: none; } }

.site-nav { gap: .25rem; }
.site-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .5rem .85rem !important;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-weight: 700;
  font-size: .95rem;
}
.site-nav .nav-link:hover { color: var(--ink); background: var(--surface-2); }
.site-nav .nav-link.active,
.site-nav .nav-link[aria-current="page"] {
  color: var(--primary-ink);
  background: var(--primary-soft);
}
[data-bs-theme="dark"] .site-nav .nav-link.active,
[data-bs-theme="dark"] .site-nav .nav-link[aria-current="page"] { color: var(--primary-ink); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .75rem .3rem .3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .875rem;
  color: var(--ink);
  white-space: nowrap;
}
.user-chip .avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: .8rem;
}
.user-chip .role { color: var(--ink-muted); font-size: .78rem; display: block; line-height: 1.1; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-muted);
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn.dropdown-toggle::after { display: none; }

.navbar-toggler {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.navbar-toggler:focus { box-shadow: var(--focus-ring); }
.navbar-toggler .bi { font-size: 1.5rem; }

@media (max-width: 1199.98px) {
  .site-header .navbar-collapse {
    padding: .75rem 0 .5rem;
    border-top: 1px solid var(--line);
    margin-top: .6rem;
  }
  .site-nav .nav-link { width: 100%; }
}

/* ===================================================================
   4. Pied de page (même composition que la page d'accueil)
   =================================================================== */

.site-footer { margin-top: 4rem; background: #082040; color: #c9d6e6; font-size: .88rem; }
.site-footer a { color: #dbe5f1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand, .site-footer .brand:hover { color: #fff; --logo-gap: #082040; text-decoration: none; }
.site-footer .brand .logo-name { color: #fff; }
.site-footer .brand .logo-tag { color: #9fb2c8; }
.site-footer .footer-top {
  display: grid; grid-template-columns: 1.1fr 2.2fr 1.1fr; gap: 2rem; align-items: center;
  padding: 2.2rem 0 1.6rem; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.site-footer .footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; justify-content: center; }
.site-footer .footer-nav a { font-weight: 500; white-space: nowrap; }
.site-footer .footer-made { text-align: right; font-size: .8rem; }
.site-footer .footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem;
  padding: 1.1rem 0 1.4rem; font-size: .78rem; color: #9fb2c8;
}
.tricolor { display: flex; width: 64px; height: 3px; border-radius: 2px; overflow: hidden; margin: .5rem 0 0 auto; }
.tricolor i { flex: 1; }
.tricolor i:nth-child(1) { background: var(--bj-green); }
.tricolor i:nth-child(2) { background: var(--bj-yellow); }
.tricolor i:nth-child(3) { background: var(--bj-red); }
@media (max-width: 991.98px) {
  .site-footer .footer-top { grid-template-columns: 1fr; }
  .site-footer .footer-nav { justify-content: flex-start; }
  .site-footer .footer-made { text-align: left; }
  .tricolor { margin-left: 0; }
}

/* ===================================================================
   5. Composants Bootstrap restylés
   =================================================================== */

/* Boutons — 44 px de haut par défaut, aplats, focus net. */
.btn {
  --bs-btn-font-weight: 700;
  --bs-btn-padding-y: .625rem;
  --bs-btn-padding-x: 1.125rem;
  --bs-btn-border-radius: var(--radius-sm);
  --bs-btn-focus-box-shadow: var(--focus-ring);
  letter-spacing: .005em;
}
.btn-sm {
  --bs-btn-padding-y: .4375rem;
  --bs-btn-padding-x: .8rem;
  --bs-btn-font-size: .875rem;
}
.btn-lg {
  --bs-btn-padding-y: .8rem;
  --bs-btn-padding-x: 1.5rem;
  --bs-btn-font-size: 1.05rem;
  --bs-btn-border-radius: var(--radius);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  --bs-btn-bg: #0369a1;
  --bs-btn-border-color: #0369a1;
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: #075985;
  --bs-btn-hover-border-color: #075985;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #0c4a6e;
  --bs-btn-active-border-color: #0c4a6e;
  --bs-btn-disabled-bg: #0369a1;
  --bs-btn-disabled-border-color: #0369a1;
  box-shadow: 0 1px 2px rgba(3, 105, 161, .25);
}
.btn-outline-primary {
  --bs-btn-color: var(--primary);
  --bs-btn-border-color: var(--primary-soft-border);
  --bs-btn-bg: var(--surface);
  --bs-btn-hover-bg: var(--primary-soft);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-hover-color: var(--primary-ink);
  --bs-btn-active-bg: var(--primary-soft);
  --bs-btn-active-border-color: var(--primary);
  --bs-btn-active-color: var(--primary-ink);
  --bs-btn-disabled-color: var(--primary);
  --bs-btn-disabled-border-color: var(--primary-soft-border);
}
.btn-secondary {
  --bs-btn-bg: #334155;
  --bs-btn-border-color: #334155;
  --bs-btn-hover-bg: #1e293b;
  --bs-btn-hover-border-color: #1e293b;
}
.btn-outline-secondary {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-bg: var(--surface);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-border-color: var(--ink-subtle);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--surface-2);
  --bs-btn-active-border-color: var(--ink-subtle);
  --bs-btn-active-color: var(--ink);
}
.btn-success {
  --bs-btn-bg: #15803d;
  --bs-btn-border-color: #15803d;
  --bs-btn-hover-bg: #166534;
  --bs-btn-hover-border-color: #166534;
  --bs-btn-active-bg: #14532d;
  --bs-btn-active-border-color: #14532d;
  --bs-btn-disabled-bg: #15803d;
  --bs-btn-disabled-border-color: #15803d;
}
.btn-outline-success {
  --bs-btn-color: var(--success);
  --bs-btn-border-color: var(--success);
  --bs-btn-hover-bg: var(--success);
  --bs-btn-hover-border-color: var(--success);
  --bs-btn-hover-color: #fff;
}
.btn-danger {
  --bs-btn-bg: #b91c1c;
  --bs-btn-border-color: #b91c1c;
  --bs-btn-hover-bg: #991b1b;
  --bs-btn-hover-border-color: #991b1b;
}
.btn-outline-danger {
  --bs-btn-color: var(--danger);
  --bs-btn-border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  --bs-btn-hover-bg: var(--danger-soft);
  --bs-btn-hover-border-color: var(--danger);
  --bs-btn-hover-color: var(--danger-ink);
  --bs-btn-active-bg: var(--danger-soft);
  --bs-btn-active-color: var(--danger-ink);
}
.btn-warning {
  --bs-btn-bg: #f59e0b;
  --bs-btn-border-color: #f59e0b;
  --bs-btn-color: #1f1300;
  --bs-btn-hover-bg: #d97706;
  --bs-btn-hover-border-color: #d97706;
  --bs-btn-hover-color: #1f1300;
}
.btn-light {
  --bs-btn-bg: #fff;
  --bs-btn-border-color: #fff;
  --bs-btn-color: var(--brand-navy);
  --bs-btn-hover-bg: #e0f2fe;
  --bs-btn-hover-border-color: #e0f2fe;
  --bs-btn-hover-color: var(--brand-navy);
}
.btn-outline-light {
  --bs-btn-border-color: rgba(255, 255, 255, .45);
  --bs-btn-hover-bg: rgba(255, 255, 255, .12);
  --bs-btn-hover-border-color: #fff;
  --bs-btn-hover-color: #fff;
}
.btn-link { --bs-btn-font-weight: 700; }

/* Cartes */
.card {
  --bs-card-bg: var(--surface);
  --bs-card-border-color: var(--line);
  --bs-card-border-radius: var(--radius-lg);
  --bs-card-inner-border-radius: calc(var(--radius-lg) - 1px);
  --bs-card-cap-bg: var(--surface-2);
  --bs-card-spacer-y: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card.shadow-sm { box-shadow: var(--shadow) !important; }
.card-header {
  font-weight: 700;
  border-bottom-color: var(--line);
}
.card.border-primary { border-color: var(--primary) !important; box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
a.card:hover, label.card:hover { border-color: var(--primary-soft-border); box-shadow: var(--shadow-lg); }

/* Listes */
.list-group {
  --bs-list-group-bg: var(--surface);
  --bs-list-group-border-color: var(--line);
  --bs-list-group-active-bg: var(--primary-soft);
  --bs-list-group-active-border-color: var(--primary-soft-border);
  --bs-list-group-active-color: var(--primary-ink);
  --bs-list-group-action-hover-bg: var(--surface-2);
}
.list-group-item { padding: .85rem 1.15rem; }
.list-group-item-action {
  border-radius: var(--radius) !important;
  margin-bottom: .45rem;
  border: 1px solid var(--line) !important;
}
.list-group-item-action:last-child { margin-bottom: 0; }
.list-group-item-action:hover { border-color: var(--primary-soft-border) !important; }

/* Formulaires — champs hauts, libellés lisibles, focus marqué. */
.form-label { font-weight: 700; font-size: .95rem; margin-bottom: .4rem; color: var(--ink); }
.form-text { color: var(--ink-muted); font-size: .85rem; }
.form-control, .form-select {
  min-height: 2.875rem;
  padding: .625rem .875rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}
.form-select { padding-right: 2.5rem; }
.form-control-sm, .form-select-sm { min-height: 2.375rem; padding-top: .4rem; padding-bottom: .4rem; font-size: .9rem; }
.form-control-lg { min-height: 3.25rem; font-size: 1.15rem; }
.form-control::placeholder { color: var(--ink-subtle); opacity: 1; }
.form-control:hover, .form-select:hover { border-color: var(--ink-subtle); }
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .18);
  background-color: var(--surface);
  color: var(--ink);
}
.form-control.is-invalid, .was-validated .form-control:invalid { border-color: var(--danger); }
.invalid-feedback { color: var(--danger); font-weight: 700; }
textarea.form-control { min-height: 6rem; }
.form-control[type="file"] { padding: .45rem .5rem; }
.form-control::file-selector-button {
  border-radius: .35rem;
  margin-right: .75rem;
  padding: .35rem .8rem;
  background: var(--surface-2);
  color: var(--ink);
  border: 0;
  font-weight: 700;
}

.form-check { min-height: 1.75rem; padding-left: 2rem; }
.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: .15rem;
  margin-left: -2rem !important;
  border: 1.5px solid var(--line-strong);
  background-color: var(--surface);
}
.form-check-input:checked { background-color: #0369a1; border-color: #0369a1; }
.form-check-input:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
.form-switch { padding-left: 3rem; }
.form-switch .form-check-input { width: 2.4rem; margin-left: -3rem !important; }
.form-check-label { cursor: pointer; }

.input-group-text { background: var(--surface-2); border: 1.5px solid var(--line-strong); color: var(--ink-muted); }

/* Badges — pilules lisibles, jamais en dessous de 12 px. */
.badge {
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .01em;
  padding: .38em .7em;
  border-radius: 999px;
}
.badge.bg-primary, .badge.text-bg-primary { background: var(--primary-soft) !important; color: var(--primary-ink) !important; }
.badge.bg-secondary, .badge.text-bg-secondary { background: var(--surface-2) !important; color: var(--ink-muted) !important; box-shadow: inset 0 0 0 1px var(--line); }
.badge.bg-success, .badge.text-bg-success { background: var(--success-soft) !important; color: var(--success-ink) !important; }
.badge.bg-warning, .badge.text-bg-warning { background: var(--warning-soft) !important; color: var(--warning-ink) !important; }
.badge.bg-danger, .badge.text-bg-danger { background: var(--danger-soft) !important; color: var(--danger-ink) !important; }
.badge.bg-info, .badge.text-bg-info { background: var(--primary-soft) !important; color: var(--primary-ink) !important; }
.badge.text-bg-light, .badge.bg-light { background: var(--surface) !important; color: var(--ink) !important; }
.badge.bg-dark, .badge.text-bg-dark { background: var(--ink) !important; color: var(--bg) !important; }

/* Alertes — bordure gauche d'accent, icône implicite par la couleur + texte. */
.alert {
  --bs-alert-border-radius: var(--radius);
  --bs-alert-padding-y: .9rem;
  --bs-alert-padding-x: 1.1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-subtle);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.alert-primary, .alert-info { border-left-color: var(--primary); background: var(--primary-soft); border-color: var(--primary-soft-border); color: var(--primary-ink); }
.alert-success { border-left-color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success-ink); }
.alert-warning { border-left-color: #d97706; background: var(--warning-soft); border-color: color-mix(in srgb, #d97706 30%, transparent); color: var(--warning-ink); }
.alert-danger { border-left-color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); color: var(--danger-ink); }
.alert-secondary, .alert-light { border-left-color: var(--ink-subtle); background: var(--surface); color: var(--ink); }
.alert .alert-link { color: inherit; }
.alert-dismissible .btn-close { padding: 1.1rem; }

.flash-stack { display: grid; gap: .6rem; margin-bottom: 1.5rem; }
.flash-stack .alert { display: flex; align-items: flex-start; gap: .65rem; margin: 0; }
.flash-stack .alert > .bi { font-size: 1.15rem; line-height: 1.4; flex-shrink: 0; }

/* Tableaux */
.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line);
  --bs-table-striped-bg: var(--surface-2);
  --bs-table-hover-bg: var(--surface-2);
  --bs-table-color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.table > thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-muted);
  font-weight: 700;
  border-bottom-width: 1px;
  white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .75rem .85rem; }

/* Navigation à onglets / pilules (sous-nav admin) */
.nav-pills {
  --bs-nav-pills-link-active-bg: var(--primary-soft);
  --bs-nav-pills-link-active-color: var(--primary-ink);
  --bs-nav-pills-border-radius: var(--radius-sm);
}
.nav-pills .nav-link {
  color: var(--ink-muted);
  font-weight: 700;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.nav-pills .nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-pills .nav-link.active { box-shadow: inset 0 0 0 1px var(--primary-soft-border); }
.nav-tabs { --bs-nav-tabs-link-active-color: var(--primary-ink); --bs-nav-tabs-border-color: var(--line); }
.nav-tabs .nav-link { font-weight: 700; color: var(--ink-muted); }

.sub-nav {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: .4rem;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: thin;
}
.sub-nav .nav { flex-wrap: nowrap; }
.sub-nav .nav-link { white-space: nowrap; }

/* Menus déroulants */
.dropdown-menu {
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-border-radius: var(--radius);
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-bg: var(--surface-2);
  --bs-dropdown-link-hover-color: var(--ink);
  --bs-dropdown-link-active-bg: var(--primary-soft);
  --bs-dropdown-link-active-color: var(--primary-ink);
  --bs-dropdown-item-padding-y: .55rem;
  box-shadow: var(--shadow-lg);
  padding: .4rem;
}
.dropdown-item { border-radius: .4rem; font-weight: 700; display: flex; align-items: center; gap: .55rem; min-height: 40px; }

/* Accordéon (FAQ) */
.accordion {
  --bs-accordion-bg: var(--surface);
  --bs-accordion-border-color: var(--line);
  --bs-accordion-border-radius: var(--radius-lg);
  --bs-accordion-inner-border-radius: calc(var(--radius-lg) - 1px);
  --bs-accordion-btn-focus-box-shadow: var(--focus-ring);
  --bs-accordion-active-bg: var(--surface);
  --bs-accordion-active-color: var(--primary-ink);
  --bs-accordion-btn-padding-y: 1.1rem;
}
.accordion-button { font-weight: 700; color: var(--ink); }
.accordion-button:not(.collapsed) { box-shadow: inset 0 -1px 0 var(--line); }

/* Barres de progression, pagination, modales */
.progress { --bs-progress-bar-bg: #0369a1; --bs-progress-bg: var(--surface-2); --bs-progress-border-radius: 999px; }
.pagination { --bs-pagination-active-bg: #0369a1; --bs-pagination-active-border-color: #0369a1; --bs-pagination-color: var(--primary); }
.modal { --bs-modal-bg: var(--surface); --bs-modal-border-radius: var(--radius-xl); --bs-modal-border-color: var(--line); }

.btn-close:focus { box-shadow: var(--focus-ring); }
[data-bs-theme="dark"] .text-bg-light { background-color: var(--surface-2) !important; color: var(--ink) !important; }
.border { border-color: var(--line) !important; }
.bg-light { background-color: var(--surface-2) !important; }
.bg-body-tertiary { background-color: var(--surface-2) !important; }

/* ===================================================================
   6. Mise en page commune (pages internes)
   =================================================================== */

.page-content { padding-top: 2rem; padding-bottom: 1rem; }

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.page-header h1 { margin-bottom: .25rem; }
.page-header .page-sub { color: var(--ink-muted); margin: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
}

.section-title {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted) !important;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--ink-muted);
  background: var(--surface);
}
.empty-state .bi { font-size: 1.75rem; display: block; margin-bottom: .4rem; color: var(--ink-subtle); }

/* En-tête des pages publiques (espace usager) */
.hero {
  position: relative;
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--bj-green) 0 33.3%, var(--bj-yellow) 33.3% 66.6%, var(--bj-red) 66.6%);
}
.hero h1 { max-width: 44rem; margin-left: auto; margin-right: auto; }
.hero .lead { margin-left: auto; margin-right: auto; color: var(--ink-muted) !important; }
.lead { font-size: 1.15rem; line-height: 1.6; }

.step-note {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  height: 100%;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.step-note > i {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.15rem;
}

/* ===================================================================
   7. Cartes à accent (services, étapes, établissements)
   Accents en aplats doux : la couleur aide à distinguer, le texte informe.
   =================================================================== */

.accent-indigo { --accent: #0369a1; --accent-soft: #e0f2fe; --accent-ink: #0c4a6e; }
.accent-sky    { --accent: #0e7490; --accent-soft: #cffafe; --accent-ink: #155e75; }
.accent-teal   { --accent: #15803d; --accent-soft: #dcfce7; --accent-ink: #166534; }
.accent-amber  { --accent: #b45309; --accent-soft: #fef3c7; --accent-ink: #92400e; }
.accent-rose   { --accent: #be123c; --accent-soft: #ffe4e6; --accent-ink: #9f1239; }
[data-bs-theme="dark"] .accent-indigo { --accent: #38bdf8; --accent-soft: #0c2a40; --accent-ink: #bae6fd; }
[data-bs-theme="dark"] .accent-sky    { --accent: #22d3ee; --accent-soft: #082f38; --accent-ink: #a5f3fc; }
[data-bs-theme="dark"] .accent-teal   { --accent: #4ade80; --accent-soft: #0f2e1d; --accent-ink: #bbf7d0; }
[data-bs-theme="dark"] .accent-amber  { --accent: #fbbf24; --accent-soft: #33250a; --accent-ink: #fde68a; }
[data-bs-theme="dark"] .accent-rose   { --accent: #fb7185; --accent-soft: #3b1019; --accent-ink: #fecdd3; }

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent-soft, var(--primary-soft));
  color: var(--accent, var(--primary));
  font-size: 1.35rem;
}
.feature-icon-sm { width: 2.6rem; height: 2.6rem; border-radius: var(--radius-sm); font-size: 1.15rem; }

.feature-card {
  position: relative;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.feature-card.text-center { padding-top: 1.75rem; }
a.feature-card, label.feature-card { cursor: pointer; }
a.feature-card:hover, label.feature-card:hover {
  border-color: var(--accent, var(--primary));
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
a.feature-card .text-primary { color: var(--accent, var(--primary)) !important; }
a.feature-card:hover .bi-arrow-right { transform: translateX(3px); }
.bi-arrow-right { display: inline-block; transition: transform var(--dur) var(--ease); }

label.feature-card:has(input:checked) {
  border-color: var(--accent, var(--primary));
  box-shadow: 0 0 0 2px var(--accent, var(--primary)), var(--shadow);
  background: color-mix(in srgb, var(--accent-soft, var(--primary-soft)) 35%, var(--surface));
}
label.feature-card:has(input:focus-visible) { box-shadow: var(--focus-ring); }
label.feature-card .feature-check {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .8rem;
}
label.feature-card:has(input:checked) .feature-check { background: var(--accent, var(--primary)); border-color: var(--accent, var(--primary)); }
[data-bs-theme="dark"] label.feature-card:has(input:checked) .feature-check { color: var(--bg); }
label.feature-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

/* Checklist documentaire */
.doc-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: .6rem;
  cursor: pointer;
}
.doc-item:last-child { margin-bottom: 0; }
.doc-item:hover { border-color: var(--accent, var(--primary)); }
.doc-item input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.doc-item:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.doc-item .doc-check {
  flex-shrink: 0;
  margin-top: .1rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: .4rem;
  border: 2px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .85rem;
  background: var(--surface);
}
.doc-item .doc-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft, var(--primary-soft));
  color: var(--accent, var(--primary));
  font-size: 1.05rem;
}
.doc-item .doc-body { flex: 1 1 auto; min-width: 0; }
.doc-item:has(input:checked) {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success-soft) 45%, var(--surface));
}
.doc-item:has(input:checked) .doc-check { background: var(--success); border-color: var(--success); }
[data-bs-theme="dark"] .doc-item:has(input:checked) .doc-check { color: var(--bg); }

.badge-obligatoire { background: var(--danger-soft) !important; color: var(--danger-ink) !important; }

/* Lignes de file (guichet, accueil, listes admin) */
.row-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-height: 3.5rem;
  padding: .7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, var(--primary));
  border-radius: var(--radius);
  margin-bottom: .5rem;
  text-decoration: none;
  color: inherit;
  flex-wrap: wrap;
}
.row-item:last-child { margin-bottom: 0; }
a.row-item:hover {
  border-color: var(--accent, var(--primary));
  box-shadow: var(--shadow);
  color: inherit;
}
.row-avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft, var(--primary-soft));
  color: var(--accent-ink, var(--primary-ink));
  font-weight: 700;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
.row-item .row-body { flex: 1 1 12rem; min-width: 0; }

/* Puces de date (choix du rendez-vous) */
.jour-btn {
  flex-shrink: 0;
  min-width: 4.75rem;
  min-height: 44px;
  padding: .65rem .5rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
  text-align: center;
}
.jour-btn:hover { border-color: var(--primary); color: var(--primary); }
.jour-btn.active { background: #0369a1; border-color: #0369a1; color: #fff; box-shadow: var(--shadow); }

/* ===================================================================
   8. Connexion (usager, code, agent)
   =================================================================== */

.auth-shell {
  display: flex;
  max-width: 980px;
  margin: 1rem auto 0;
  min-height: 480px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}
.auth-visual {
  flex: 0 0 40%;
  position: relative;
  overflow: hidden;
  padding: 2.75rem;
  color: #fff;
  background: var(--brand-navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-visual::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--bj-green) 0 33.3%, var(--bj-yellow) 33.3% 66.6%, var(--bj-red) 66.6%);
}
.auth-visual::after {
  content: "";
  position: absolute;
  right: -5rem;
  bottom: -5rem;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  border: 2.5rem solid rgba(56, 189, 248, .10);
}
.auth-visual > * { position: relative; z-index: 1; }
.auth-eyebrow {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .75rem;
  font-weight: 700;
  color: #7dd3fc;
}
.auth-visual h2 { color: #fff; font-size: 1.9rem; line-height: 1.2; margin: .6rem 0 .8rem; }
.auth-visual p { color: #cbd5e1; font-size: .95rem; max-width: 21rem; margin-bottom: 0; }
.auth-form-side { flex: 1 1 auto; padding: 2.75rem; }

.input-icon { position: relative; }
.input-icon > i {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-subtle);
  pointer-events: none;
}
.input-icon .form-control { padding-left: 2.6rem; }
.input-icon.input-icon-toggle .form-control { padding-right: 5.25rem; }
.input-icon-toggle-btn {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  min-height: 36px;
  padding: 0 .65rem;
  background: none;
  border: none;
  border-radius: .4rem;
  color: var(--primary);
  font-size: .85rem;
  font-weight: 700;
}
.input-icon-toggle-btn:hover { background: var(--primary-soft); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--ink-subtle);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }

@media (max-width: 767.98px) {
  .auth-shell { flex-direction: column; min-height: 0; }
  .auth-visual { flex: none; padding: 2rem 1.5rem 1.75rem; }
  .auth-visual h2 { font-size: 1.5rem; }
  .auth-form-side { padding: 1.75rem 1.25rem; }
}

/* ===================================================================
   9. Suivi public d'un ticket
   =================================================================== */

.suivi-carte {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 2.25rem 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.suivi-carte::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--primary);
}
.suivi-carte.suivi-appele::before,
.suivi-carte.suivi-en_cours::before,
.suivi-carte.suivi-termine::before { background: var(--success); }
.suivi-carte.suivi-absent::before { background: #d97706; }
.suivi-carte.suivi-annule::before { background: var(--ink-subtle); }
.suivi-carte.suivi-appele {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 45%, transparent), var(--shadow-lg);
  animation: suivi-appel 1.6s ease-in-out 3;
}
.suivi-label {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.suivi-position {
  font-size: clamp(4.5rem, 18vw, 6rem);
  font-weight: 700;
  line-height: 1;
  margin: .4rem 0 .6rem;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.suivi-detail { color: var(--ink-muted); }
.suivi-guichet {
  display: inline-block;
  margin: .75rem 0 1rem;
  padding: .5rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--success);
  color: #fff;
  font-size: 2.25rem;
  font-weight: 700;
}
[data-bs-theme="dark"] .suivi-guichet { color: var(--bg); }
.suivi-icone { font-size: 2.75rem; line-height: 1; margin-bottom: .75rem; color: var(--primary); }
.suivi-live {
  display: inline-block;
  width: .55rem;
  height: .55rem;
  margin-right: .2rem;
  border-radius: 50%;
  background: var(--success);
  vertical-align: middle;
  animation: suivi-pouls 2s ease-in-out infinite;
}
.note-echelle { display: flex; gap: .35rem; max-width: 24rem; margin: 0 auto; }
.note-btn { flex: 1 1 0; min-width: 0; line-height: 1.15; padding: .55rem .15rem; }
.note-btn .small { font-size: .72rem; white-space: nowrap; }
@keyframes suivi-pouls {
  0%, 100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, .45); }
  50% { box-shadow: 0 0 0 .4rem rgba(21, 128, 61, 0); }
}
@keyframes suivi-appel {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

/* ===================================================================
   10. Indicateurs (tableau de bord, statistiques)
   =================================================================== */

.kpi {
  height: 100%;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.kpi-icone {
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: .65rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, var(--primary));
  background: var(--accent-soft, var(--primary-soft));
  font-size: 1rem;
}
.kpi-valeur { font-size: 1.85rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-unite { font-size: .95rem; font-weight: 700; color: var(--ink-muted); }
.kpi-libelle { font-size: .9rem; font-weight: 700; margin-top: .25rem; }
.kpi-aide { font-size: .8rem; color: var(--ink-muted); margin-top: .2rem; }
.gain-positif { color: #047857; }
.gain-negatif { color: #b45309; }
[data-bs-theme="dark"] .gain-positif { color: #34d399; }
[data-bs-theme="dark"] .gain-negatif { color: #fbbf24; }

.stat-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.stat-tile .feature-icon { width: 2.75rem; height: 2.75rem; }
.stat-tile .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-tile .stat-label { font-size: .875rem; color: var(--ink-muted); margin-top: .25rem; }

.statut-ligne {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.15rem;
  border-bottom: 1px solid var(--line);
}
.statut-ligne:last-child { border-bottom: 0; }
.statut-ligne .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink-subtle); flex-shrink: 0; }
.statut-ligne .bar { flex: 1; height: .4rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; max-width: 12rem; }
.statut-ligne .bar > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.statut-ligne .count { min-width: 2rem; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.graphique { position: relative; height: 260px; }
.graphique-tableau summary { cursor: pointer; font-size: .85rem; color: var(--ink-muted); min-height: 32px; }
.graphique-tableau table { font-variant-numeric: tabular-nums; }

/* ===================================================================
   11. Guichet — carte « dossier actuel »
   =================================================================== */

.current-ticket {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .10), var(--shadow);
}
.current-ticket .ticket-number {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  line-height: 1;
}
.current-ticket.is-en-cours { border-color: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent), var(--shadow); }
.current-ticket.is-en-cours .ticket-number { color: var(--success); }

.ready-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1.5px dashed var(--line-strong);
}
.btn-xl { --bs-btn-padding-y: 1rem; --bs-btn-padding-x: 1.75rem; --bs-btn-font-size: 1.1rem; --bs-btn-border-radius: var(--radius); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--ink-muted);
}
.status-pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-pill.is-primary { background: var(--primary-soft); color: var(--primary-ink); }
.status-pill.is-success { background: var(--success-soft); color: var(--success-ink); }
.status-pill.is-warning { background: var(--warning-soft); color: var(--warning-ink); }

/* ===================================================================
   12. Page d'accueil (landing)
   =================================================================== */

.landing section { padding: 4.5rem 0; }
.landing section.section-tight { padding: 3rem 0; }
.landing .section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 44rem; margin-bottom: 2.5rem; }
.section-head.text-center { margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); margin: .5rem 0 .75rem; }
.section-head p { color: var(--ink-muted); font-size: 1.08rem; margin: 0; }

.landing-hero {
  position: relative;
  padding: 4rem 0 4.5rem !important;
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 70%),
    var(--bg);
  overflow: hidden;
}
.landing-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  line-height: 1.1;
  letter-spacing: -.025em;
  margin: 1rem 0 1.1rem;
}
.landing-hero h1 .accent-word { color: var(--primary); }
.landing-hero .lead { max-width: 36rem; color: var(--ink-muted); font-size: 1.2rem; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .85rem .35rem .4rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.hero-badge .flag-dot {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: conic-gradient(var(--bj-green) 0 33%, var(--bj-yellow) 33% 66%, var(--bj-red) 66%);
  flex-shrink: 0;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; margin-top: 2.25rem; padding: 0; list-style: none; }
.hero-proof li { display: flex; align-items: center; gap: .5rem; color: var(--ink-muted); font-size: .95rem; font-weight: 700; }
.hero-proof .bi { color: var(--success); font-size: 1.15rem; }

/* Maquette de ticket « en direct » (illustration du concept) */
.ticket-demo {
  position: relative;
  max-width: 24rem;
  margin: 0 auto;
}
.ticket-demo .phone {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
}
.ticket-demo .phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}
.ticket-demo .ticket {
  border-radius: var(--radius-lg);
  background: var(--brand-navy);
  color: #fff;
  padding: 1.35rem 1.25rem 1.25rem;
  position: relative;
  overflow: hidden;
}
.ticket-demo .ticket::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--bj-green) 0 33.3%, var(--bj-yellow) 33.3% 66.6%, var(--bj-red) 66.6%);
}
.ticket-demo .ticket-label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; font-weight: 700; }
.ticket-demo .ticket-place { font-size: 4.25rem; font-weight: 700; line-height: 1; margin: .3rem 0 .4rem; font-variant-numeric: tabular-nums; }
.ticket-demo .ticket-meta { color: #cbd5e1; font-size: .9rem; }
.ticket-demo .ticket-cut {
  border-top: 2px dashed rgba(255, 255, 255, .18);
  margin: 1rem -1.25rem;
  position: relative;
}
.ticket-demo .ticket-row { display: flex; justify-content: space-between; font-size: .85rem; color: #cbd5e1; }
.ticket-demo .ticket-row strong { color: #fff; }
.ticket-demo .progress-line { height: .45rem; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: .9rem; }
.ticket-demo .progress-line > span { display: block; height: 100%; width: 72%; background: #38bdf8; border-radius: inherit; }
.ticket-demo .notif {
  position: absolute;
  left: -2.5rem;
  bottom: -1.75rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  max-width: 16rem;
  padding: .75rem .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .85rem;
}
.ticket-demo .notif .feature-icon { width: 2.25rem; height: 2.25rem; font-size: 1rem; }
.ticket-demo .notif-top { left: auto; right: -2rem; top: -1.75rem; bottom: auto; }
.ticket-demo { padding: 1.5rem 0; }
@media (max-width: 575.98px) {
  .ticket-demo .notif { position: static; margin-top: .75rem; max-width: none; }
}

/* Bande de chiffres réels (issus de la base) */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
}
.stat-strip .stat {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.stat-strip .stat-value { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-strip .stat-label { margin-top: .4rem; color: var(--ink-muted); font-size: .92rem; }

/* Problème → solution */
.compare-card {
  height: 100%;
  padding: 1.75rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
}
.compare-card h3 { font-size: 1.15rem; display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; }
.compare-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.compare-card li { display: flex; gap: .7rem; align-items: flex-start; }
.compare-card li .bi { flex-shrink: 0; margin-top: .15rem; font-size: 1.1rem; }
.compare-card.is-before li .bi { color: var(--danger); }
.compare-card.is-after { border-color: var(--success); box-shadow: 0 0 0 1px var(--success), var(--shadow); }
.compare-card.is-after li .bi { color: var(--success); }

/* Étapes numérotées */
.flow-steps { counter-reset: step; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); padding: 0; margin: 0; list-style: none; }
.flow-step {
  position: relative;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.flow-step .step-num {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--brand-navy);
  color: #fff;
  font-weight: 700;
  margin-bottom: 1rem;
}
[data-bs-theme="dark"] .flow-step .step-num { background: var(--primary); color: var(--bg); }
.flow-step h3 { font-size: 1.08rem; margin-bottom: .5rem; }
.flow-step p { color: var(--ink-muted); font-size: .95rem; margin: 0; }
.flow-step .step-where { display: inline-flex; align-items: center; gap: .35rem; margin-top: .9rem; font-size: .8rem; font-weight: 700; color: var(--primary); }

/* Cycle de vie du ticket */
.status-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
  padding: 0;
  margin: 0;
  list-style: none;
  position: relative;
}
.status-track::before {
  content: "";
  position: absolute;
  top: 1.35rem;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--line-strong);
}
.status-track li { position: relative; text-align: center; padding: 0 .25rem; }
.status-track .status-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto .75rem;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 1.15rem;
}
.status-track li:last-child .status-dot { background: var(--success); border-color: var(--success); color: #fff; }
.status-track strong { display: block; font-size: .98rem; }
.status-track span { display: block; font-size: .85rem; color: var(--ink-muted); margin-top: .25rem; }
@media (max-width: 767.98px) {
  .status-track { grid-template-columns: 1fr; gap: 0; }
  .status-track::before { top: 1rem; bottom: 1rem; left: 1.35rem; right: auto; width: 2px; height: auto; }
  .status-track li { display: grid; grid-template-columns: 2.75rem 1fr; column-gap: 1rem; text-align: left; padding: 0 0 1.25rem; }
  .status-track .status-dot { margin: 0; grid-row: span 2; }
}

/* Canaux d'accès */
.channel-card { height: 100%; padding: 1.75rem; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); }
.channel-card h3 { font-size: 1.15rem; margin: 1rem 0 .5rem; }
.channel-card p { color: var(--ink-muted); margin-bottom: 1rem; }
.channel-card ul { padding-left: 1.1rem; margin: 0; color: var(--ink-muted); font-size: .95rem; }
.channel-card ul li { margin-bottom: .3rem; }

/* Rôles du personnel */
.role-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border-radius: var(--radius-lg); border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); height: 100%; }
.role-card h3 { color: #fff; font-size: 1.05rem; margin-bottom: .35rem; }
.role-card p { color: #cbd5e1; font-size: .92rem; margin: 0; }
.role-card .feature-icon { background: rgba(56, 189, 248, .14); color: #7dd3fc; }
.section-dark { background: var(--brand-navy); color: #e2e8f0; }
.section-dark h2 { color: #fff; }
.section-dark .section-head p { color: #cbd5e1; }
.section-dark .eyebrow { color: #7dd3fc; }

/* Bande d'appel à l'action finale */
.cta-band {
  position: relative;
  padding: 2.75rem;
  border-radius: var(--radius-xl);
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-border);
  overflow: hidden;
}
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.cta-band p { color: var(--ink-muted); }
@media (max-width: 575.98px) { .cta-band { padding: 1.75rem 1.25rem; } }

/* ===================================================================
   13. Mouvement
   =================================================================== */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content { animation: fadeInUp .3s var(--ease) both; }

/* .reveal n'est posée qu'en JS : sans JS, le contenu reste visible. */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid #fff;
  border-right-color: transparent;
  animation: btn-spin .6s linear infinite;
}
.btn-outline-primary.is-loading::after, .btn-outline-secondary.is-loading::after,
.btn-outline-danger.is-loading::after, .btn-light.is-loading::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===================================================================
   14. Impression
   =================================================================== */

@media print {
  .site-header, .site-footer, .flag-band, .btn-close, .skip-link { display: none !important; }
  body { background: #fff; }
  .page-content { animation: none; padding-top: 0 !important; }
  .card, .feature-card, .kpi, .panel { box-shadow: none !important; }
}

/* ===================================================================
   15. Pages publiques (espace usager, suivi) — même langage visuel que
       la page d'accueil : Plus Jakarta Sans, bleu marine, boutons arrondis.
   =================================================================== */

body.pub { font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.pub h1, body.pub h2, body.pub h3, body.pub .h1, body.pub .h2, body.pub .h3 { letter-spacing: -.02em; }
.site-header .site-nav .nav-link { font-family: "Plus Jakarta Sans", var(--font); font-weight: 600; font-size: .9rem; color: var(--ink); }
.site-header .site-nav .nav-link:hover { color: var(--primary); }

.btn-navy {
  --bs-btn-bg: #0b2a4f; --bs-btn-border-color: #0b2a4f; --bs-btn-color: #fff;
  --bs-btn-hover-bg: #0f3460; --bs-btn-hover-border-color: #0f3460; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #082040; --bs-btn-active-border-color: #082040; --bs-btn-active-color: #fff;
  --bs-btn-border-radius: 999px; --bs-btn-padding-x: 1.35rem;
  box-shadow: 0 6px 16px rgba(11, 42, 79, .22);
}
[data-bs-theme="dark"] .btn-navy { --bs-btn-bg: #0369a1; --bs-btn-border-color: #0369a1; --bs-btn-hover-bg: #075985; --bs-btn-hover-border-color: #075985; }
.btn-pill { --bs-btn-border-radius: 999px; }
.btn .bi-arrow-right { transition: transform var(--dur) var(--ease); }
.btn:hover .bi-arrow-right { transform: translateX(3px); }

/* Bandeau d'introduction des pages du parcours : photo floutée + voile bleu */
.cl-band { position: relative; overflow: hidden; color: #fff; background: #0b2a4f; isolation: isolate; }
.cl-band-bg { position: absolute; inset: 0; z-index: -1; }
.cl-band-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 35%; filter: blur(22px) saturate(1.2); transform: scale(1.2); }
.cl-band-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(8, 30, 58, .9) 0%, rgba(8, 30, 58, .76) 50%, rgba(8, 30, 58, .6) 100%); }
.cl-band-in { padding-top: 2.25rem; padding-bottom: 2.6rem; }
.cl-band h1 { color: #fff; font-size: clamp(1.75rem, 3.2vw, 2.45rem); font-weight: 700; margin: .9rem 0 .6rem; }
.cl-band .lead, .cl-band p { color: rgba(255, 255, 255, .86); }
.cl-band .lead { font-size: 1.05rem; max-width: 46rem; margin: 0; }
.cl-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .84rem; color: rgba(255, 255, 255, .78); }
.cl-crumb a { color: #fff; text-decoration: none; font-weight: 600; }
.cl-crumb a:hover { text-decoration: underline; }
.cl-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .45); font-size: .8rem; font-weight: 600; color: #fff; }

/* Indicateur d'étapes du parcours */
.cl-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 1.6rem 0 0; counter-reset: etape; }
.cl-steps li { flex: 1 1 0; min-width: 0; }
.cl-step { display: flex; align-items: center; gap: .6rem; padding-top: .7rem; border-top: 3px solid rgba(255, 255, 255, .22); font-size: .84rem; font-weight: 600; color: rgba(255, 255, 255, .72); }
.cl-step .n { flex-shrink: 0; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: rgba(255, 255, 255, .14); color: #fff; }
.cl-step.is-done { border-top-color: #6cb8f5; color: #fff; }
.cl-step.is-done .n { background: #6cb8f5; color: #0b2a4f; }
.cl-step.is-current { border-top-color: #fff; color: #fff; }
.cl-step.is-current .n { background: #fff; color: #0b2a4f; }
.cl-step .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575.98px) {
  .cl-steps li { flex: 0 0 auto; }
  .cl-steps li.is-current { flex: 1 1 auto; }
  .cl-step .lbl { display: none; }
  .cl-step.is-current .lbl { display: inline; white-space: normal; }
}

.cl-section { padding: 2.5rem 0 0; }
.cl-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.cl-section-head h2 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.cl-section-head p { color: var(--ink-muted); margin: .3rem 0 0; }

/* Cartes d'administration (photo du bâtiment) */
.cl-admin {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.cl-admin:hover { color: inherit; transform: translateY(-4px); box-shadow: 0 18px 38px rgba(16, 38, 66, .14); border-color: var(--primary-soft-border); }
.cl-admin-img { position: relative; aspect-ratio: 1000 / 525; overflow: hidden; background: var(--surface-2); }
.cl-admin-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.cl-admin:hover .cl-admin-img img { transform: scale(1.05); }
.cl-admin-img .cl-noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: var(--primary); background: var(--primary-soft); }
.cl-badge { position: absolute; top: .9rem; left: .9rem; padding: .3rem .8rem; border-radius: 999px; font-size: .74rem; font-weight: 700; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.cl-badge.is-pilot { background: #1f8a4c; color: #fff; }
.cl-badge.is-demo { background: #fff; color: #1f5f9e; }
.cl-admin-body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem 1.35rem 1.35rem; }
.cl-admin-type { display: flex; align-items: center; gap: .5rem; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.cl-admin h3 { font-size: 1.2rem; font-weight: 700; margin: .45rem 0 .9rem; }
.cl-facts { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.cl-facts li { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: 8px; background: var(--surface-2); font-size: .8rem; font-weight: 600; color: var(--ink-muted); }
.cl-facts .bi { color: var(--primary); }
.cl-admin-cta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1rem; border-radius: 999px; background: #0b2a4f; color: #fff; font-weight: 700; font-size: .92rem; transition: background var(--dur) var(--ease); }
.cl-admin:hover .cl-admin-cta { background: #0f3460; }
[data-bs-theme="dark"] .cl-admin-cta { background: #0369a1; }
.cl-admin-cta .bi { transition: transform var(--dur) var(--ease); }
.cl-admin:hover .cl-admin-cta .bi { transform: translateX(4px); }

/* Atouts + aide */
.cl-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cl-perk { display: flex; gap: .9rem; align-items: flex-start; padding: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.cl-perk .ic { flex-shrink: 0; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; background: var(--primary-soft); color: var(--primary); }
.cl-perk .ic.is-green { background: var(--success-soft); color: var(--success); }
.cl-perk h3 { font-size: .98rem; font-weight: 700; margin: .15rem 0 .3rem; }
.cl-perk p { font-size: .86rem; color: var(--ink-muted); margin: 0; }
.cl-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.5rem 1.75rem; border-radius: 18px; background: var(--primary-soft); border: 1px solid var(--primary-soft-border); }
.cl-help h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .3rem; }
.cl-help p { margin: 0; color: var(--ink-muted); font-size: .92rem; }
@media (max-width: 991.98px) { .cl-perks { grid-template-columns: 1fr; } }

/* Étape « zone de résidence » */
.cl-zone { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.cl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 1.6rem; }
.cl-card h2 { font-size: 1.12rem; font-weight: 700; margin: 0 0 1rem; }
.cl-input-wrap { position: relative; }
.cl-input-wrap > .bi { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.15rem; color: var(--ink-subtle); pointer-events: none; }
.cl-input-wrap .form-control { padding-left: 2.8rem; min-height: 3.4rem; font-size: 1.05rem; border-radius: 12px; }
.cl-or { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; color: var(--ink-subtle); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.cl-or::before, .cl-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cl-why { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.cl-why li { display: flex; gap: .8rem; align-items: flex-start; font-size: .92rem; color: var(--ink-muted); }
.cl-why .bi { flex-shrink: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.cl-why strong { display: block; color: var(--ink); font-size: .95rem; }
@media (max-width: 991.98px) { .cl-zone { grid-template-columns: 1fr; } }

.cl-poste { position: relative; display: flex; flex-direction: column; height: 100%; padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.cl-poste:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cl-poste.is-best { border: 2px solid var(--primary); box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .1), var(--shadow); }
.cl-poste-flag { align-self: flex-start; display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .8rem; padding: .25rem .7rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700; }
[data-bs-theme="dark"] .cl-poste-flag { color: #04121f; }
.cl-poste h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .5rem; }
.cl-poste .meta { display: flex; gap: .5rem; align-items: flex-start; font-size: .88rem; color: var(--ink-muted); margin: 0 0 .4rem; }
.cl-poste .meta .bi { color: var(--primary); margin-top: .1rem; }
.cl-poste .dist { display: inline-flex; align-items: center; gap: .35rem; margin: .4rem 0 1rem; padding: .3rem .7rem; border-radius: 8px; background: var(--success-soft); color: var(--success-ink); font-size: .82rem; font-weight: 700; align-self: flex-start; }
.cl-poste .btn { margin-top: auto; }

/* En-tête : jamais de retour à la ligne dans les liens et boutons ; resserré
   entre 1200 et 1400 px (conteneur Bootstrap de 1140 px). */
.site-header .site-nav .nav-link, .site-header .btn { white-space: nowrap; }
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .site-header .site-nav .nav-link { padding: .5rem .55rem !important; font-size: .86rem; }
  .site-header .brand .logo-tag { display: none; }
}
.brand .logo-name { white-space: nowrap; }

/* ===================================================================
   16. Bouton mode clair / sombre (un clic)
   =================================================================== */
.theme-toggle {
  position: relative; display: inline-grid; place-items: center; flex-shrink: 0;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: #0b2a4f; overflow: hidden;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--line-strong); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle .bi { position: absolute; font-size: 1.1rem; transition: transform .35s var(--ease), opacity .25s var(--ease); }
.theme-toggle__sun { color: #f5b301; opacity: 0; transform: rotate(-90deg) scale(.5); }
.theme-toggle__moon { opacity: 1; transform: none; }
[data-bs-theme="dark"] .theme-toggle { color: #e6ebf2; }
[data-bs-theme="dark"] .theme-toggle__moon { opacity: 0; transform: rotate(90deg) scale(.5); }
[data-bs-theme="dark"] .theme-toggle__sun { opacity: 1; transform: none; }
html.theme-transition, html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after {
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease) !important;
}

/* En-tête public : liens plus aérés, lien actif souligné */
.site-header .site-nav .nav-link { position: relative; border-radius: 10px; }
.site-header .site-nav .nav-link.active { background: transparent; color: #0b2a4f; }
.site-header .site-nav .nav-link.active::after {
  content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .3rem; height: 2px; border-radius: 2px; background: var(--primary);
}
[data-bs-theme="dark"] .site-header .site-nav .nav-link.active { color: #fff; }
@media (max-width: 1199.98px) { .site-header .site-nav .nav-link.active::after { left: .85rem; right: auto; width: 1.5rem; } }

/* ===================================================================
   17. Pages de connexion (auth_base.html)
   =================================================================== */
.auth-page [hidden] { display: none !important; }
.auth-page { padding: clamp(1.25rem, 4vw, 3rem) 1rem; }
.auth-container {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  max-width: 1080px; margin: 0 auto; min-height: 600px;
  border-radius: 24px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(11, 42, 79, .14);
}
[data-bs-theme="dark"] .auth-container { box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }

.auth-branding {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background: radial-gradient(120% 90% at 0% 0%, #12437a 0%, #0b2a4f 55%, #071a33 100%);
  padding: clamp(2rem, 4vw, 3.25rem); display: flex; flex-direction: column; justify-content: center;
}
.auth-branding__content { position: relative; z-index: 1; max-width: 26rem; }
.auth-branding__logo { display: inline-flex; align-items: center; gap: .7rem; margin-bottom: 2.25rem; color: #fff; --logo-gap: #0b2a4f; font-family: "Plus Jakarta Sans", var(--font); font-weight: 800; font-size: 1.2rem; }
.auth-branding__logo .logo-mark { width: 34px; height: 48px; }
.auth-branding__title { color: #fff; font-family: "Plus Jakarta Sans", var(--font); font-size: clamp(1.9rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 .9rem; }
.auth-branding__subtitle { color: rgba(255, 255, 255, .82); font-size: 1.02rem; line-height: 1.65; margin: 0 0 2rem; }
.auth-branding__features { display: grid; gap: .9rem; }
.auth-branding .feature { display: flex; align-items: center; gap: .75rem; font-weight: 600; font-size: .95rem; color: rgba(255, 255, 255, .95); }
.auth-branding .feature .bi { flex-shrink: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgba(108, 184, 245, .16); color: #6cb8f5; font-size: 1rem; }
.auth-branding__flag { position: absolute; left: 0; right: 0; bottom: 0; display: flex; height: 5px; z-index: 1; }
.auth-branding__flag i { flex: 1; }
.auth-branding__flag i:nth-child(1) { background: var(--bj-green); }
.auth-branding__flag i:nth-child(2) { background: var(--bj-yellow); }
.auth-branding__flag i:nth-child(3) { background: var(--bj-red); }
.auth-branding__decoration { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.auth-branding .circle { position: absolute; border-radius: 50%; }
.auth-branding .circle--1 { width: 22rem; height: 22rem; right: -9rem; bottom: -9rem; border: 3rem solid rgba(108, 184, 245, .08); }
.auth-branding .circle--2 { width: 9rem; height: 9rem; right: 3rem; top: 2.5rem; background: rgba(255, 255, 255, .05); }
.auth-branding .circle--3 { width: 4rem; height: 4rem; left: 55%; bottom: 4rem; background: rgba(108, 184, 245, .12); }
@media (prefers-reduced-motion: no-preference) {
  .auth-branding .circle--2 { animation: auth-flotte 9s ease-in-out infinite; }
  .auth-branding .circle--3 { animation: auth-flotte 7s ease-in-out infinite reverse; }
}
@keyframes auth-flotte { 50% { transform: translateY(-14px); } }

.auth-form-wrapper { display: flex; align-items: center; justify-content: center; padding: clamp(1.75rem, 4vw, 3.25rem); background: var(--surface); }
.auth-form { width: 100%; max-width: 25rem; }
.auth-form__header { margin-bottom: 1.6rem; }
.auth-form__title { font-family: "Plus Jakarta Sans", var(--font); font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .35rem; color: var(--ink); }
.auth-form__subtitle { color: var(--ink-muted); margin: 0; }

.auth-form .alert { display: flex; align-items: flex-start; gap: .65rem; padding: .8rem .9rem; border-radius: 12px; margin-bottom: 1.1rem; font-size: .92rem; border: 1px solid transparent; border-left-width: 1px; box-shadow: none; }
.auth-form .alert > .bi { font-size: 1.1rem; line-height: 1.3; flex-shrink: 0; }
.auth-form .alert > span { flex: 1; }
.alert--error { background: var(--danger-soft); color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 30%, transparent) !important; }
.alert--success { background: var(--success-soft); color: var(--success-ink); border-color: color-mix(in srgb, var(--success) 30%, transparent) !important; }
.alert--warning { background: var(--warning-soft); color: var(--warning-ink); border-color: color-mix(in srgb, #d97706 30%, transparent) !important; }
.alert--info { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-soft-border) !important; }
.alert__close { flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; margin: -.2rem -.3rem 0 0; border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: .7; }
.alert__close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }

.auth-form .form { display: grid; gap: 1.1rem; }
.auth-form .form-group { margin: 0; }
.auth-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 479.98px) { .auth-form .form-row { grid-template-columns: 1fr; } }
.auth-form .form-label { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; font-size: .9rem; font-weight: 700; margin-bottom: .45rem; }
.form-label__link { font-size: .82rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.form-label__link:hover { text-decoration: underline; }
.form-label__optional { color: var(--ink-subtle); font-weight: 500; }
.input-wrapper { position: relative; }
.input-wrapper .input-icon { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--ink-subtle); font-size: 1.05rem; pointer-events: none; transition: color var(--dur-fast) var(--ease); }
.form-input {
  display: block; width: 100%; min-height: 3.1rem; padding: .7rem 1rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.form-input::placeholder { color: var(--ink-subtle); }
.form-input:hover { border-color: var(--ink-subtle); }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .16); }
.input-wrapper:focus-within .input-icon { color: var(--primary); }
.form-input--icon { padding-left: 2.75rem; }
.form-input--password { padding-right: 3.25rem; }
.form-input--code { font-size: 1.4rem; font-weight: 800; letter-spacing: .5em; text-align: center; padding-left: 2.75rem; }
.password-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-muted); }
.password-toggle:hover { background: var(--surface-2); color: var(--ink); }
.form-hint { display: flex; gap: .5rem; margin: .55rem 0 0; padding: .6rem .75rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary-ink); font-size: .84rem; }
.form-hint--plain { display: block; margin: .35rem 0 0; padding: 0; background: none; color: var(--ink-muted); }
.auth-form .form > .form-hint--plain { margin-top: -.6rem; }

.checkbox { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .92rem; user-select: none; min-height: 32px; }
.checkbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkbox__mark { flex-shrink: 0; width: 1.25rem; height: 1.25rem; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.checkbox__mark::after { content: ""; width: .55rem; height: .32rem; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translateY(-1px) scale(0); transition: transform var(--dur-fast) var(--ease); }
.checkbox input:checked + .checkbox__mark { background: #0369a1; border-color: #0369a1; }
.checkbox input:checked + .checkbox__mark::after { transform: rotate(-45deg) translateY(-1px) scale(1); }
.checkbox input:focus-visible + .checkbox__mark { box-shadow: var(--focus-ring); }
.checkbox__hint { color: var(--ink-subtle); font-size: .82rem; }

.auth-page .btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 3.1rem; border-radius: 12px; font-weight: 700; font-size: 1rem; text-decoration: none; }
.btn--full { width: 100%; }
.btn--primary { background: #0b2a4f; border: 1.5px solid #0b2a4f; color: #fff; box-shadow: 0 8px 20px rgba(11, 42, 79, .25); }
.btn--primary:hover { background: #0f3460; border-color: #0f3460; color: #fff; }
.btn--primary:disabled { opacity: .85; color: #fff; }
.btn--primary .bi-arrow-right { transition: transform var(--dur) var(--ease); }
.btn--primary:hover .bi-arrow-right { transform: translateX(3px); }
[data-bs-theme="dark"] .btn--primary { background: #0369a1; border-color: #0369a1; box-shadow: none; }
[data-bs-theme="dark"] .btn--primary:hover { background: #075985; border-color: #075985; }
.btn--link { display: block; width: 100%; margin-top: .75rem; background: none; border: 0; min-height: 0 !important; padding: .4rem; color: var(--primary); font-size: .88rem !important; font-weight: 600 !important; }
.btn--link:hover { text-decoration: underline; }
.spinner { width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: btn-spin .7s linear infinite; }

.divider { display: flex; align-items: center; gap: .9rem; margin: 1.6rem 0 1.1rem; color: var(--ink-subtle); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.btn--social { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); font-size: .92rem !important; }
.btn--social:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-subtle); }
.btn--social .bi { color: var(--primary); font-size: 1.05rem; }
.auth-form__footer { margin: 1.6rem 0 0; text-align: center; color: var(--ink-muted); font-size: .9rem; }
.auth-form__footer a { font-weight: 700; color: var(--primary); }

.known-number { display: flex; align-items: center; gap: .85rem; padding: 1rem; margin-bottom: 1.1rem; border-radius: 14px; background: var(--primary-soft); border: 1px solid var(--primary-soft-border); }
.known-number__icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #0369a1; color: #fff; font-size: 1.15rem; flex-shrink: 0; }
.known-number__label { display: block; font-size: .85rem; color: var(--primary-ink); }
.known-number strong { font-size: 1.1rem; letter-spacing: .02em; }

@media (max-width: 859.98px) {
  .auth-container { grid-template-columns: 1fr; min-height: 0; }
  .auth-branding { padding: 1.75rem 1.5rem 2rem; }
  .auth-branding__logo { margin-bottom: 1.1rem; }
  .auth-branding__subtitle { margin-bottom: 1.2rem; }
  .auth-branding__features { display: none; }
}

/* ===================================================================
   18. Espace agents : barre latérale + barre du haut
   =================================================================== */
body.agent-shell { background: var(--bg); }
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-main > main { flex: 1 0 auto; }
.app-content { width: 100%; max-width: 1440px; margin: 0 auto; padding-left: clamp(1rem, 2.5vw, 2rem); padding-right: clamp(1rem, 2.5vw, 2rem); }

.sidebar {
  --sb-w: 268px;
  position: sticky; top: 0; height: 100vh; width: var(--sb-w); flex-shrink: 0; z-index: 1040;
  display: flex; flex-direction: column; color: #cfdced;
  background: linear-gradient(180deg, #0b2a4f 0%, #082040 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  transition: width .28s var(--ease), transform .28s var(--ease);
}
[data-bs-theme="dark"] .sidebar { background: linear-gradient(180deg, #071a33 0%, #050f20 100%); }
.sidebar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--bj-green) 0 33.3%, var(--bj-yellow) 33.3% 66.6%, var(--bj-red) 66.6%); }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1.35rem 1.1rem .9rem 1.25rem; }
.sb-brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; --logo-gap: #0b2a4f; min-width: 0; }
.sb-brand:hover { color: #fff; }
.sb-brand .logo-mark { width: 30px; height: 42px; flex-shrink: 0; }
.sb-brand__name { display: block; font-family: "Plus Jakarta Sans", var(--font); font-weight: 800; font-size: 1.08rem; line-height: 1.1; white-space: nowrap; }
.sb-brand__tag { display: block; font-size: .72rem; color: #8fb3d9; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; margin-top: .15rem; }
.sb-close { display: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; }

.sb-place { display: flex; align-items: center; gap: .65rem; margin: .25rem .9rem .75rem; padding: .7rem .8rem; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .07); font-size: .82rem; }
.sb-place > .bi { color: #6cb8f5; font-size: 1rem; flex-shrink: 0; }
.sb-place strong { display: block; color: #fff; font-size: .86rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-place .sb-label { min-width: 0; }
.sb-place .sb-label > span { display: block; color: #8fb3d9; }

.sb-nav { flex: 1 1 auto; overflow-y: auto; padding: .25rem .75rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.sb-nav ul { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: 2px; }
.sb-section { margin: .85rem .6rem .35rem; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6f93bb; }
.sb-link {
  position: relative; display: flex; align-items: center; gap: .8rem; min-height: 42px; padding: .5rem .8rem;
  border-radius: 10px; color: #cfdced; text-decoration: none; font-weight: 600; font-size: .93rem; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.sb-link > .bi:first-child { font-size: 1.12rem; width: 1.3rem; text-align: center; flex-shrink: 0; color: #8fb3d9; transition: color var(--dur-fast) var(--ease); }
.sb-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sb-link:hover > .bi:first-child { color: #fff; }
.sb-link.is-active { background: rgba(56, 189, 248, .16); color: #fff; }
.sb-link.is-active > .bi:first-child { color: #6cb8f5; }
.sb-link.is-active::before { content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: #6cb8f5; }
.sb-link:focus-visible { box-shadow: 0 0 0 3px rgba(108, 184, 245, .6) !important; }
.sb-ext { margin-left: auto; font-size: .75rem; opacity: .55; }
.sb-label { overflow: hidden; text-overflow: ellipsis; }

.sb-foot { padding: .75rem; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; gap: .35rem; }
.sb-user { display: flex; align-items: center; gap: .7rem; padding: .45rem .5rem; min-width: 0; }
.sb-avatar { flex-shrink: 0; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: linear-gradient(135deg, #0369a1, #38bdf8); color: #fff; font-weight: 800; font-size: .85rem; }
.sb-user strong { display: block; color: #fff; font-size: .88rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .sb-label > span { display: block; font-size: .76rem; color: #8fb3d9; }
.sb-user .sb-label { min-width: 0; }
.sb-logout:hover { background: rgba(232, 17, 45, .14); color: #fff; }
.sb-backdrop { position: fixed; inset: 0; z-index: 1035; background: rgba(4, 14, 30, .55); backdrop-filter: blur(2px); }

/* Barre réduite (ordinateur) : icônes seules */
html.sb-rail .sidebar { --sb-w: 80px; }
html.sb-rail .sb-label, html.sb-rail .sb-ext, html.sb-rail .sb-brand__tag { display: none; }
html.sb-rail .sb-head { justify-content: center; padding-left: .5rem; padding-right: .5rem; }
html.sb-rail .sb-place { justify-content: center; margin-left: .7rem; margin-right: .7rem; padding: .65rem; }
html.sb-rail .sb-section { height: 1px; margin: .9rem .6rem .6rem; overflow: hidden; color: transparent; background: rgba(255, 255, 255, .1); }
html.sb-rail .sb-link { justify-content: center; padding: .55rem; }
html.sb-rail .sb-link.is-active::before { left: -.75rem; }
html.sb-rail .sb-user { justify-content: center; }

/* Barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .9rem;
  min-height: 68px; padding: .6rem clamp(1rem, 2.5vw, 2rem);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 1.15rem; transition: background-color var(--dur-fast) var(--ease); }
.topbar-btn:hover { background: var(--surface-2); color: var(--ink); }
.topbar-title { display: flex; align-items: center; gap: .7rem; min-width: 0; font-family: "Plus Jakarta Sans", var(--font); font-weight: 800; font-size: 1.12rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title__icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 1rem; flex-shrink: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .55rem; }
.topbar-chip { align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); font-size: .86rem; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); box-shadow: none; --sb-w: 288px; }
  html.sb-rail .sidebar { --sb-w: 288px; }
  html.sb-rail .sb-label, html.sb-rail .sb-brand__tag { display: revert; }
  body.sb-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  body.sb-open { overflow: hidden; }
  .sb-close { display: grid; place-items: center; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* Bandeau du poste sélectionné (administration) */
.poste-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.1rem; padding: .85rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.poste-bar__icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.poste-bar__text { flex: 1 1 14rem; min-width: 0; }
.poste-bar__label { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-subtle); }
.poste-bar__form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; min-width: 0; }
.poste-bar__form .form-select { max-width: 22rem; }

/* Tuiles d'indicateurs des tableaux de bord accueil / guichet */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.kpi-tile { position: relative; display: flex; align-items: center; gap: .9rem; padding: 1.05rem 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.kpi-tile::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--primary)); }
.kpi-tile .kpi-ic { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 12px; background: var(--accent-soft, var(--primary-soft)); color: var(--accent, var(--primary)); font-size: 1.2rem; flex-shrink: 0; }
.kpi-tile .kpi-n { font-family: "Plus Jakarta Sans", var(--font); font-size: 1.75rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-tile .kpi-l { font-size: .84rem; color: var(--ink-muted); margin-top: .25rem; }
.agent-shell .page-header h1 { font-family: "Plus Jakarta Sans", var(--font); font-weight: 800; letter-spacing: -.02em; }
.agent-shell .row-item { border-radius: 14px; }
