/* =====================================================================
   Smart AO — interface (couleurs de l'entreprise : --sao-primary / --sao-dark / --sao-accent)
   ===================================================================== */
:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --border: #e6ebf1;
  --text: #0f1b2d;
  --muted: #6b7a8c;
  --soft: color-mix(in srgb, var(--sao-primary) 9%, transparent);
  --bright: #1f8fd6;                       /* bleu clair du logo, pour les dégradés */
  --gold: #e3a52b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 6px 24px rgba(15, 27, 45, .05);
  --shadow-lg: 0 12px 40px rgba(14, 40, 65, .16);
  --topbar-h: 66px;
  --bs-primary: var(--sao-primary);
  --bs-link-color: var(--sao-primary);
  --bs-link-hover-color: var(--sao-dark);
  --bs-border-color: var(--border);
  --bs-border-radius: 10px;
}
[data-bs-theme="dark"] {
  --bg: #0b1119;
  --surface: #141c27;
  --surface-2: #1a2431;
  --border: #253244;
  --text: #e6edf5;
  --muted: #8d9bad;
  --soft: rgba(31, 143, 214, .14);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --bs-body-bg: #0b1119;
  --bs-link-color: #6cb8ea;
}
html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
body { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; }
a { color: var(--bs-link-color); text-decoration: none; }
a:hover { text-decoration: none; }
.min-w-0 { min-width: 0; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-muted, .form-text { color: var(--muted) !important; }
.text-accent { color: var(--sao-accent) !important; }
.text-primary { color: var(--sao-primary) !important; }
[data-bs-theme="dark"] .text-primary { color: #6cb8ea !important; }

/* ---------- Boutons, champs, badges ---------- */
.btn { border-radius: 11px; font-weight: 600; }
.btn-pill { border-radius: 999px; }
.btn-primary { --bs-btn-bg: var(--sao-primary); --bs-btn-border-color: var(--sao-primary); --bs-btn-hover-bg: var(--sao-dark); --bs-btn-hover-border-color: var(--sao-dark);
  --bs-btn-active-bg: var(--sao-dark); --bs-btn-active-border-color: var(--sao-dark); --bs-btn-disabled-bg: var(--sao-primary); --bs-btn-disabled-border-color: var(--sao-primary);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--sao-primary) 30%, transparent); }
.btn-outline-primary { --bs-btn-color: var(--sao-primary); --bs-btn-border-color: color-mix(in srgb, var(--sao-primary) 40%, transparent); --bs-btn-hover-bg: var(--sao-primary);
  --bs-btn-hover-border-color: var(--sao-primary); --bs-btn-active-bg: var(--sao-dark); --bs-btn-active-border-color: var(--sao-dark); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #8cc8ef; --bs-btn-border-color: #2f6f99; }
.btn-navy { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--sao-dark), color-mix(in srgb, var(--sao-dark) 70%, var(--sao-primary))); color: #fff; border: 0;
  padding: 9px 18px; box-shadow: 0 6px 18px color-mix(in srgb, var(--sao-dark) 35%, transparent); }
.btn-navy:hover { color: #fff; filter: brightness(1.12); }
/* Couleurs complètes (sinon Bootstrap applique un fond vide au survol et le bouton disparaît) */
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--sao-accent); --bs-btn-border-color: var(--sao-accent);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: color-mix(in srgb, var(--sao-accent) 85%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--sao-accent) 85%, #000);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: color-mix(in srgb, var(--sao-accent) 75%, #000); --bs-btn-active-border-color: color-mix(in srgb, var(--sao-accent) 75%, #000);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--sao-accent); --bs-btn-disabled-border-color: var(--sao-accent);
  --bs-btn-focus-shadow-rgb: 233, 113, 50; box-shadow: 0 4px 14px color-mix(in srgb, var(--sao-accent) 35%, transparent); }
.btn-navy { --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; }
.form-control, .form-select { border-radius: 11px; border-color: var(--border); background-color: var(--surface); padding-top: .5rem; padding-bottom: .5rem; }
.form-control-sm, .form-select-sm { border-radius: 9px; padding-top: .3rem; padding-bottom: .3rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--sao-primary); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--sao-primary) 18%, transparent); }
.form-check-input:checked { background-color: var(--sao-primary); border-color: var(--sao-primary); }
.form-label { font-weight: 600; font-size: 13px; color: color-mix(in srgb, var(--text) 85%, transparent); }
.badge { font-weight: 700; border-radius: 8px; padding: .38em .6em; }
.text-bg-primary { background-color: var(--sao-primary) !important; }
.alert { border-radius: var(--radius-sm); border: 0; box-shadow: var(--shadow); }
.dropdown-menu { border: 1px solid var(--border); border-radius: 14px; padding: 6px; }
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; font-weight: 500; }
.nav-tabs { border-bottom: 1px solid var(--border); gap: 4px; }
.nav-tabs .nav-link { border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; border-radius: 0; padding: .7rem .9rem; }
.nav-tabs .nav-link.active { color: var(--sao-primary); background: transparent; border-bottom-color: var(--sao-primary); }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { color: #6cb8ea; }
/* Pastilles de filtres (comme les onglets Tout / Cabinet / …) */
.nav-pills { gap: 8px; flex-wrap: wrap; }
.nav-pills .nav-link { border-radius: 999px; background: var(--surface-2); color: color-mix(in srgb, var(--text) 75%, transparent); font-weight: 600; font-size: 13px; padding: .5rem 1rem; border: 1px solid var(--border); }
.nav-pills .nav-link:hover { background: var(--soft); }
.nav-pills .nav-link.active { background: var(--sao-dark); color: #fff; border-color: var(--sao-dark); box-shadow: 0 4px 12px color-mix(in srgb, var(--sao-dark) 30%, transparent); }
.dot-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 10.5px; font-weight: 800;
  line-height: 18px; text-align: center; border: 2px solid var(--surface); box-sizing: content-box; }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--topbar-h); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
.topbar::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--sao-dark), var(--sao-primary), var(--bright), var(--sao-accent)); }
.topbar-inner { height: 100%; max-width: 1560px; margin: 0 auto; padding: 0 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-right { justify-content: flex-end; }
.tb-brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.tb-brand b { display: block; font-size: 16px; font-weight: 800; line-height: 1.1; color: var(--sao-dark); }
[data-bs-theme="dark"] .tb-brand b { color: #fff; }
.tb-brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tb-search { align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; height: 40px; width: min(340px, 26vw); margin-left: 8px; }
.tb-search i { color: var(--muted); }
.tb-search input { border: 0; background: transparent; outline: 0; width: 100%; font-size: 13.5px; color: var(--text); }
.tb-search:focus-within { border-color: var(--sao-primary); box-shadow: 0 0 0 .2rem var(--soft); background: var(--surface); }
.tb-nav { align-items: stretch; gap: 4px; height: var(--topbar-h); }
.tb-nav-item { position: relative; display: flex; align-items: center; justify-content: center; width: 62px; color: #8796a8; font-size: 21px; border-bottom: 3px solid transparent; transition: color .15s, background .15s; }
.tb-nav-item:hover { color: var(--sao-primary); background: var(--soft); }
.tb-nav-item.active { color: var(--sao-primary); border-bottom-color: var(--sao-primary); }
[data-bs-theme="dark"] .tb-nav-item.active { color: #6cb8ea; border-bottom-color: #6cb8ea; }
.tb-nav-item .dot-count { top: 12px; right: 10px; }
.tb-icon { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface-2); color: color-mix(in srgb, var(--text) 80%, transparent); display: inline-flex;
  align-items: center; justify-content: center; font-size: 18px; transition: background .15s, color .15s; flex-shrink: 0; }
.tb-icon:hover { background: var(--soft); color: var(--sao-primary); }
.tb-clock { flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; padding: 5px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.tb-clock b { font-size: 15px; font-weight: 800; color: var(--sao-dark); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
[data-bs-theme="dark"] .tb-clock b { color: #fff; }
.tb-clock small { font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tb-avatar { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sao-primary) 30%, transparent); color: #fff; font-weight: 800; font-size: 14px; }
.ai-running { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: #6d28d9; background: #ede9fe; border: 1px solid #ddd6fe; white-space: nowrap; }
.ai-running .spinner-grow { width: .7rem; height: .7rem; color: #7c3aed; }
.ai-running:hover { background: #ddd6fe; color: #5b21b6; }
[data-bs-theme="dark"] .ai-running { background: rgba(124,58,237,.18); border-color: rgba(124,58,237,.35); color: #c4b5fd; }
#saoAiPill { display: contents; }
/* Fiche d'analyse du dossier (rapport de consultation) */
.fa-form > summary { list-style: none; display: inline-flex; align-items: center; }
.fa-form > summary::-webkit-details-marker { display: none; }
.fa-section { border: 1px solid var(--bs-border-color); border-radius: 14px; padding: 12px 14px 14px; margin-bottom: 12px; }
.fa-section legend { float: none; width: auto; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--sao-primary, #156082); padding: 0 6px; margin: 0 0 4px; }
.fa-view { border: 1px solid var(--bs-border-color); border-radius: 14px; padding: 14px 16px; background: var(--bs-body-bg); }
.fa-view.fa-old { opacity: .75; }
.fa-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 13.5px; }
.fa-table caption { caption-side: top; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--sao-dark, #0E2841); padding: 6px 10px; border-radius: 8px 8px 0 0; }
.fa-table th { width: 32%; font-weight: 600; color: var(--bs-secondary-color); background: var(--surface-2, #f8fafc); vertical-align: top; }
.fa-table th, .fa-table td { border: 1px solid var(--bs-border-color); padding: 6px 10px; overflow-wrap: anywhere; }
.fa-table td.fa-favorable { color: #15803d; font-weight: 700; } .fa-table td.fa-defavorable { color: #dc2626; font-weight: 700; }
@media (max-width: 575px) { .fa-table th { width: 40%; } }

/* Aide à la saisie du mot de passe (page d'inscription) */
.pwd-criteria { display: none; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2, #f8fafc); border: 1px solid var(--bs-border-color); }
.pwd-criteria.show { display: block; }
.pwd-criteria .pc-title { font-size: 12.5px; font-weight: 700; }
.pwd-criteria .pc-level { font-size: 12px; font-weight: 700; }
.pc-strength { height: 6px; border-radius: 999px; background: var(--bs-border-color); overflow: hidden; margin-bottom: 8px; }
.pc-bar { height: 100%; width: 0; border-radius: 999px; transition: width .25s ease, background .25s ease; background: #dc2626; }
.pc-bar.weak, .pc-level.weak { --c: #dc2626; } .pc-bar.medium, .pc-level.medium { --c: #d97706; }
.pc-bar.good, .pc-level.good { --c: #16a34a; } .pc-bar.strong, .pc-level.strong { --c: #15803d; }
.pc-bar[class*=" "] { background: var(--c); } .pc-level { color: var(--c, inherit); }
.pc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 12.5px; }
.pc-list li { display: flex; align-items: center; gap: 6px; color: var(--bs-secondary-color); }
.pc-list li.valid { color: #15803d; } .pc-list li.invalid { color: #dc2626; }
.pc-match { margin-top: 8px; font-size: 13px; font-weight: 600; } .pc-match.ok { color: #15803d; } .pc-match.ko { color: #dc2626; }
@media (max-width: 420px) { .pc-list { grid-template-columns: 1fr; } }
/* IA en pause (crédit épuisé, plafond atteint) : information, pas une panne */
.ai-running.ai-paused { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.ai-running.ai-paused:hover { background: #fde68a; color: #78350f; }
[data-bs-theme="dark"] .ai-running.ai-paused { background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.4); color: #fcd34d; }
.notif-menu { width: min(360px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.notif-item button { display: flex; gap: 10px; width: 100%; border: 0; background: transparent; padding: 10px 14px; align-items: flex-start; color: var(--text); }
.notif-item button:hover { background: var(--surface-2); }
.notif-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: transparent; flex-shrink: 0; }
.notif-item.unread .notif-dot { background: var(--sao-primary); }
.notif-item.unread .notif-title { font-weight: 700; }
.notif-title { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.profile-menu { min-width: 250px; }

/* ---------- Mise en page : 2 ou 3 colonnes ---------- */
.shell { max-width: 1560px; margin: 0 auto; padding: 22px 18px 40px; display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 22px; align-items: start; }
.shell.with-right { grid-template-columns: 272px minmax(0, 1fr) 320px; }
.guest-shell { display: block; padding: 0; max-width: none; }
.sticky-col { position: sticky; top: calc(var(--topbar-h) + 18px); display: grid; gap: 16px; max-height: calc(100vh - var(--topbar-h) - 36px); overflow-y: auto; scrollbar-width: none; padding-bottom: 4px; }
.sticky-col::-webkit-scrollbar { display: none; }
/* Une colonne ou une carte ne doit jamais s'élargir au-delà de sa place à cause d'un long texte */
.col-main, .col-left, .col-right, .sticky-col > *, .side-card, .card { min-width: 0; }

/* Colonne de gauche */
.side-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.profile-card { display: flex; align-items: center; gap: 12px; }
.pc-avatar { width: 46px; height: 46px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--sao-primary) 25%, transparent); }
.profile-card strong { font-size: 14.5px; font-weight: 800; }
.pc-sub { font-size: 11px; color: var(--muted); letter-spacing: .03em; font-weight: 600; }
.quick-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.quick-stats a { display: block; text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); color: var(--text); }
.quick-stats a:hover { background: var(--soft); }
.quick-stats b { display: block; font-size: 22px; font-weight: 800; color: var(--sao-primary); line-height: 1.1; }
.quick-stats span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.side-nav { padding: 8px; }
.nav-section { font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 4px; }
.nav-section:first-child { padding-top: 4px; }
.nav-section { display: flex; align-items: center; gap: 7px; }
.step-num { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; letter-spacing: 0;
  color: #fff; background: linear-gradient(140deg, var(--sao-primary), var(--sao-dark)); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 12px; color: color-mix(in srgb, var(--text) 88%, transparent); font-weight: 600; font-size: 13.5px; transition: background .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-ico { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px;
  color: var(--tint); background: color-mix(in srgb, var(--tint) 13%, transparent); transition: transform .15s; }
.nav-item:hover .nav-ico { transform: scale(1.06); }
.nav-item.active { background: color-mix(in srgb, var(--tint) 11%, transparent); color: var(--tint); }
.nav-item.active .nav-ico { background: var(--tint); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--tint) 40%, transparent); }
[data-bs-theme="dark"] .nav-item.active { color: #fff; }
.nav-label { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.nav-section { line-height: 1.3; }
.nav-count { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.nav-count.hot { background: #e5484d; color: #fff; border-color: #e5484d; }
.side-title { font-weight: 800; font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.chip-0 { background: #ede9fe; color: #6d28d9; } .chip-1 { background: #e0f2fe; color: #0369a1; } .chip-2 { background: #fee2e2; color: #b91c1c; }
.chip-3 { background: #dcfce7; color: #15803d; } .chip-4 { background: #ffedd5; color: #c2410c; }
[data-bs-theme="dark"] .chip { filter: brightness(.85) saturate(1.2); }
.side-foot { font-size: 11.5px; color: var(--muted); text-align: center; padding: 4px 8px 8px; line-height: 1.7; }
.net.online i { color: #22c55e; } .net.offline { color: var(--sao-accent); }

/* Menu sur tablette et téléphone */
.sao-offcanvas { width: min(330px, 88vw) !important; background: var(--bg); }
.sao-offcanvas .side-nav { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.sao-offcanvas .profile-card { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }

/* ---------- Cartes et contenus ---------- */
.card { border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); font-weight: 700; padding: 14px 18px; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-footer { border-radius: 0 0 var(--radius) var(--radius) !important; background: transparent; border-top: 1px solid var(--border); }
.card-body { padding: 18px; }
.list-group-item { background: transparent; border-color: var(--border); }
.card > .list-group:last-child .list-group-item:last-child, .card > .list-group-flush:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.page-head h1 { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.02em; color: var(--sao-dark); }
[data-bs-theme="dark"] .page-head h1 { color: #fff; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.section-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 6px 13px; border-radius: 999px;
  background: linear-gradient(135deg, #f6c453, var(--gold)); color: #3b2a05; box-shadow: 0 4px 12px rgba(227, 165, 43, .3); }
.table { --bs-table-bg: transparent; margin-bottom: 0; color: var(--text); }
.table > :not(caption) > * > * { padding: .7rem .8rem; border-color: var(--border); }
.table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; white-space: nowrap; background: var(--surface-2); border-bottom: 0; }
.table thead th:first-child { border-top-left-radius: 10px; } .table thead th:last-child { border-top-right-radius: 10px; }
.table-hover tbody tr { transition: background .12s; }
.table-hover tbody tr:hover > * { background: color-mix(in srgb, var(--sao-primary) 5%, transparent); }
.card > .table-responsive { padding: 8px; }
.progress { background: color-mix(in srgb, var(--sao-primary) 12%, transparent); border-radius: 99px; }
.progress-bar { background: linear-gradient(90deg, var(--sao-primary), var(--bright)); border-radius: 99px; }
.sao-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sao-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }

/* Grande carte bleu nuit (en-tête de tableau de bord, fiche) */
.hero { position: relative; overflow: hidden; border-radius: 22px; color: #fff; padding: 22px; box-shadow: var(--shadow-lg);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--sao-primary) 85%, transparent) 0%, transparent 55%),
              linear-gradient(140deg, var(--sao-dark) 0%, color-mix(in srgb, var(--sao-dark) 80%, #000) 100%); }
.hero::after { content: ''; position: absolute; width: 320px; height: 320px; right: -110px; bottom: -150px; border-radius: 50%; border: 46px solid rgba(255,255,255,.04); pointer-events: none; }
.hero-kicker { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #f6c453; display: flex; align-items: center; gap: 8px; }
.hero-title { overflow-wrap: anywhere; font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.hero-sub { color: rgba(255,255,255,.72); font-size: 13.5px; }
.hero-badge { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: #fff; box-shadow: 0 0 0 4px var(--gold), 0 8px 22px rgba(0,0,0,.3); }
.hero-badge img { width: 44px; height: 44px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; font-weight: 700; font-size: 13px; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }
.hero-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.hero-btn.gold { color: #f6c453; border-color: rgba(246,196,83,.45); background: rgba(246,196,83,.1); }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.hero-stat { display: block; text-align: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 12px 8px; color: #fff; transition: background .15s, transform .15s; }
a.hero-stat:hover { background: rgba(255,255,255,.13); color: #fff; transform: translateY(-2px); }
.hero-stat b { display: block; font-size: 24px; font-weight: 800; color: #f6c453; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.72); }

/* Carte bleue vive (colonne de droite) */
.stat-blue { border-radius: 20px; padding: 22px 18px; color: #fff; text-align: center; box-shadow: 0 12px 30px color-mix(in srgb, var(--bright) 35%, transparent);
  background: linear-gradient(140deg, var(--sao-primary) 0%, var(--bright) 100%); position: relative; overflow: hidden; }
.stat-blue::before { content: ''; position: absolute; width: 180px; height: 180px; left: -60px; top: -90px; border-radius: 50%; background: rgba(255,255,255,.08); }
.stat-blue small { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.stat-blue b { display: block; font-size: 38px; font-weight: 800; line-height: 1.1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.stat-blue span { font-size: 13px; opacity: .9; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-stat { display: block; text-align: center; background: var(--surface); border-radius: 16px; padding: 14px 8px; box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); color: var(--text); }
a.mini-stat:hover { transform: translateY(-2px); transition: transform .15s; color: var(--text); }
.mini-stat b { display: block; font-size: 22px; font-weight: 800; color: var(--sao-primary); }
.mini-stat span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.person-row:last-child { border-bottom: 0; }
.person-row .avatar { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.person-row .who { flex: 1; min-width: 0; }
/* Titre sur 2 lignes au plus, puis « … » ; jamais de débordement */
.person-row .who a, .person-row .who strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-weight: 700; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.person-row .who small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-row > .badge, .person-row > .mono, .person-row > .soft-btn { flex-shrink: 0; }
.col-right .person-row .avatar { width: 38px; height: 38px; font-size: 12px; }
.soft-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 9px; background: var(--soft); color: var(--sao-primary); white-space: nowrap; }
.soft-btn:hover { background: var(--sao-primary); color: #fff; }

.task-tile { background: var(--surface); transition: transform .15s, box-shadow .15s; border-color: var(--border) !important; }
.task-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
a.person-row:hover .who strong { color: var(--sao-primary); }

/* Frise du parcours d'un dossier */
.parcours-steps { display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.parcours-steps::before { content: ''; position: absolute; top: 17px; left: 8%; right: 8%; height: 4px; border-radius: 4px; background: var(--border); }
.pstep { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; z-index: 1; }
.pdot { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  background: var(--surface); color: var(--muted); border: 3px solid var(--border); transition: all .2s; }
.pstep.done .pdot { background: var(--sao-primary); border-color: var(--sao-primary); color: #fff; }
.pstep.current .pdot { background: var(--sao-accent); border-color: color-mix(in srgb, var(--sao-accent) 35%, transparent); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--sao-accent) 18%, transparent); }
.plabel { font-size: 12px; font-weight: 700; color: var(--muted); }
.pstep.done .plabel { color: var(--sao-primary); } .pstep.current .plabel { color: var(--text); }
.pnow { font-size: 10.5px; font-weight: 700; color: var(--sao-accent); }
.parcours-ferme .pstep { opacity: .45; }
@media (max-width: 575.98px) { .plabel { font-size: 10px; } .pdot { width: 30px; height: 30px; font-size: 12px; } .parcours-steps::before { top: 13px; } .pnow { display: none; } }

/* Tuiles de chiffres clés */
.kpi { padding: 16px; height: 100%; transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi .kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .kpi-value { font-size: 27px; font-weight: 800; line-height: 1.15; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi .kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); color: var(--sao-primary); font-size: 16px; }
[data-bs-theme="dark"] .kpi .kpi-icon { color: #6cb8ea; }

/* Barres horizontales (une seule teinte, libellé direct) */
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 10px; padding: 6px 0; color: var(--text); }
.hbar-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; position: relative; }
.hbar-fill { height: 100%; background: var(--sao-primary); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar:hover .hbar-fill { filter: brightness(1.15); }
.hbar-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
[data-bs-theme="dark"] .hbar-fill { background: #4e9cc9; }

/* Projets : éléments par catégorie */
.cat-block { border-left: 0; overflow: hidden; }
.cat-block > .card-header { border-left: 5px solid var(--cat, var(--sao-primary)); }
.cat-title { color: var(--cat, var(--sao-primary)); font-weight: 800; letter-spacing: .03em; }
.el-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); transition: background .12s; }
.el-row:hover { background: var(--surface-2); }
.el-name { flex: 1 1 220px; font-weight: 600; min-width: 0; }
.el-row .form-select, .el-row .form-control { width: auto; }
.pick-cat { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.pick-cat-head { padding: 12px 16px; color: #fff; background: linear-gradient(135deg, var(--cat, var(--sao-primary)), color-mix(in srgb, var(--cat, var(--sao-primary)) 70%, #000)); display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .04em; }
.pick-cat-body { padding: 10px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; }
.type-card { cursor: pointer; border: 2px solid var(--border); border-radius: 16px; padding: 14px 10px; text-align: center; height: 100%; transition: all .15s; background: var(--surface); }
.type-card:hover { border-color: var(--sao-primary); transform: translateY(-2px); }
.btn-check:checked + .type-card { border-color: var(--sao-primary); background: var(--soft); box-shadow: 0 6px 18px color-mix(in srgb, var(--sao-primary) 20%, transparent); }
.type-card .code { font-weight: 800; font-size: 20px; color: var(--sao-primary); }

/* Dépouillement */
.dep-sit { font-size: 12px; }
tr.row-nous > * { background: color-mix(in srgb, var(--sao-accent) 12%, transparent) !important; }
tr.row-out > * { color: var(--muted); }
.bornes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.bornes .b { border-radius: 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); }
.bornes .b small { color: var(--muted); display: block; font-size: 11.5px; font-weight: 600; }
.bornes .b strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.scale { position: relative; height: 46px; margin: 24px 6px 8px; }
.scale-line { position: absolute; top: 20px; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--border); }
.scale-zone { position: absolute; top: 20px; height: 6px; background: color-mix(in srgb, var(--sao-primary) 45%, transparent); }
.scale-tick { position: absolute; top: 8px; width: 2px; height: 30px; background: var(--muted); }
.scale-tick span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; white-space: nowrap; color: var(--muted); }
.scale-dot { position: absolute; top: 16px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface); border: 2px solid var(--sao-primary); box-shadow: 0 0 0 2px var(--surface); }
.scale-dot.nous { background: var(--sao-accent); border-color: var(--sao-accent); }
.scale-dot.out { border-color: var(--muted); }

/* ---------- Barre d'onglets du téléphone ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; height: calc(68px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); box-shadow: 0 -6px 24px rgba(15, 27, 45, .06); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 68px; color: #8a98a9; font-size: 11px; font-weight: 700;
  background: none; border: 0; padding: 0; }
.tab-ico { position: relative; font-size: 21px; line-height: 1; }
.tab-ico .dot-count { top: -6px; right: -12px; }
.tab.active { color: var(--sao-primary); }
.tab.active::before { content: ''; position: absolute; top: 0; width: 34px; height: 4px; border-radius: 0 0 4px 4px; background: var(--sao-primary); }
.tab-main { color: var(--sao-dark); }
.tab-fab { width: 58px; height: 58px; margin-top: -30px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 25px; color: #fff;
  background: linear-gradient(140deg, var(--sao-primary), var(--sao-dark)); box-shadow: 0 10px 22px color-mix(in srgb, var(--sao-dark) 40%, transparent), 0 0 0 5px var(--surface); }

/* Bandeau d'installation */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1050; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--sao-dark), color-mix(in srgb, var(--sao-dark) 75%, var(--sao-primary))); box-shadow: var(--shadow-lg); animation: saoUp .3s ease-out; }
.install-banner img { border-radius: 12px; background: #fff; }
.install-banner b { display: block; font-size: 14px; } .install-banner small { display: block; font-size: 12px; opacity: .8; }
@keyframes saoUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Connexion ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; overflow: hidden;
  background: radial-gradient(900px 500px at 15% 0%, color-mix(in srgb, var(--sao-primary) 55%, transparent), transparent 60%),
              radial-gradient(700px 500px at 100% 100%, color-mix(in srgb, var(--sao-accent) 25%, transparent), transparent 60%), var(--sao-dark); }
.auth-wrap::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
/* Le motif de fond ne doit jamais passer au-dessus du contenu (sinon les boutons ne réagissent plus) */
.auth-wrap > * { position: relative; z-index: 1; }
.auth-grid { position: relative; width: 100%; max-width: 1040px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.auth-pitch { color: #fff; }
.auth-pitch h1 { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.auth-pitch h1 span { background: linear-gradient(90deg, #f6c453, var(--sao-accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-pitch p { color: rgba(255,255,255,.75); font-size: 16px; max-width: 460px; }
.auth-feat { display: flex; gap: 12px; align-items: center; margin-top: 14px; color: rgba(255,255,255,.88); font-weight: 600; }
.auth-feat i { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.1); color: #f6c453; font-size: 17px; }
.auth-card { width: 100%; max-width: 440px; justify-self: end; border-radius: 24px; overflow: hidden; background: var(--surface); box-shadow: 0 30px 80px rgba(0,0,0,.35); border: 0; }
.auth-head { padding: 28px 24px 22px; text-align: center; color: #fff; background: linear-gradient(140deg, var(--sao-primary), var(--bright)); position: relative; }
.auth-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 22px; background: var(--surface); border-radius: 24px 24px 0 0; }
.auth-logo { width: 76px; height: 76px; padding: 10px; border-radius: 22px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.auth-head h2 { font-size: 22px; font-weight: 800; margin: 12px 0 2px; }
.auth-head p { margin: 0; font-size: 13px; opacity: .88; }
.auth-body { padding: 8px 28px 28px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon > .form-control { padding-left: 42px; height: 50px; border-radius: 14px; background: var(--surface-2); }
.input-icon > .pwd-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px 8px; }
.btn-auth { height: 52px; border-radius: 14px; font-size: 16px; background: linear-gradient(135deg, var(--sao-primary), var(--bright)); border: 0; color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--bright) 40%, transparent); }
.btn-auth:hover { color: #fff; filter: brightness(1.06); }

/* ---------- Téléphone et tablette ---------- */
@media (max-width: 1399.98px) { .shell.with-right { grid-template-columns: 260px minmax(0, 1fr) 290px; } .shell { grid-template-columns: 260px minmax(0, 1fr); } }
@media (max-width: 1199.98px) {
  .shell, .shell.with-right { grid-template-columns: minmax(0, 1fr); padding: 16px 14px 32px; }
  .col-right .sticky-col { position: static; max-height: none; overflow: visible; }
  .topbar-inner { grid-template-columns: 1fr auto; }
  .tb-nav { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1199.98px) { .topbar-inner { grid-template-columns: auto 1fr auto; } .tb-nav { display: flex !important; justify-content: center; } }
@media (max-width: 767.98px) {
  :root { --topbar-h: 60px; }
  body.has-shell { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .shell, .shell.with-right { padding: 12px 10px 24px; gap: 14px; }
  .topbar-inner { padding: 0 10px; gap: 6px; }
  .tb-icon, .tb-avatar { width: 40px; height: 40px; }
  .page-head { padding: 14px 16px; }
  .page-head h1 { font-size: 18px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .hero { padding: 18px; border-radius: 20px; }
  .hero-title { font-size: 20px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .card-body { padding: 14px; }
  .kpi .kpi-value { font-size: 22px; }
  .install-banner { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast-zone { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
  .table-responsive-stack thead { display: none; }
  .table-responsive-stack tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table-responsive-stack td { display: flex; justify-content: space-between; gap: 12px; border: 0 !important; padding: 4px 12px !important; text-align: right; }
  .table-responsive-stack td::before { content: attr(data-label); font-weight: 700; color: var(--muted); text-align: left; font-size: 12px; }
  .table-responsive-stack td.td-main { display: block; text-align: left; }
  .table-responsive-stack td.td-main::before { content: none; }
  .el-row .form-select, .el-row .form-control { width: 100%; max-width: none !important; }
  .auth-grid { grid-template-columns: 1fr; }
  .auth-pitch { display: none; }
  .auth-card { justify-self: center; }
}
@media print {
  .topbar, .col-left, .col-right, .tabbar, .install-banner, .page-head .actions, .no-print { display: none !important; }
  .shell { display: block; padding: 0; }
  .card, .page-head { box-shadow: none; border: 0; }
  body { background: #fff; }
}
