/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   charte.css : CHARTE GRAPHIQUE UNIQUE de B2B ENGIN (Sarl RGZ)
   Reprend le design system de POWERGZ (même maison RGZ) : thème clair lumineux, menu bleu nuit,
   cartes blanches aux ombres fines, bleu d'action, états doux (vert, ambre RGZ, rouge), typographie
   Plus Jakarta Sans (titres) + Inter (texte). Thème sombre disponible par le bouton du menu.
   Partagée par l'administration (admin.html), l'espace commercial (index.html), les pages d'accès,
   les pages d'erreur. Les e-mails reprennent la palette via charte.py.
   Contrastes texte ≥ 4.5:1 : les teintes vives servent aux fonds, les variantes « -text » au texte.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
  /* Marque */
  --brand-900: #0B1B3A; --brand-800: #10264F; --brand-700: #183466;
  --primary: #1D3FA8; --primary-600: #2450D3; --primary-soft: #EEF2FF; --primary-ring: rgba(36, 80, 211, .18);
  /* États (toujours accompagnés d'une icône ou d'un libellé) */
  --pos: #12A672;  --pos-text: #047857;  --pos-soft: #E7F8F0;
  --warn: #F2A007; --warn-text: #A16207; --warn-soft: #FEF5E1;
  --neg: #E5484D;  --neg-text: #B42318;  --neg-soft: #FDECEC;
  --info: #2F7DE1; --info-text: #1D4ED8; --info-soft: #EAF2FD;
  --accent-rgz: #F2A007;
  /* Neutres */
  --bg: #F5F7FB; --surface: #FFFFFF; --surface-2: #F3F5F9; --surface-3: #E9EDF4;
  --border: #E3E8EF; --border-strong: #CDD5E1;
  --text: #0E1726; --text-2: #3D4A5C; --text-3: #5F6B7D; --focus: #2450D3;
  /* Menu (identique dans les deux thèmes) */
  --side-bg: #0B1B3A; --side-text: #C5CFE2; --side-muted: #8592AD; --side-active-bar: #7FA2FF;
  --side-hover: rgba(255, 255, 255, .06); --side-active: rgba(255, 255, 255, .10); --side-border: rgba(255, 255, 255, .08);
  /* Ombres fines et superposées */
  --shadow-xs: 0 1px 2px rgba(14, 23, 38, .05);
  --shadow-sm: 0 1px 2px rgba(14, 23, 38, .04), 0 1px 3px rgba(14, 23, 38, .06);
  --shadow-md: 0 2px 4px rgba(14, 23, 38, .04), 0 8px 24px rgba(14, 23, 38, .08);
  --shadow-lg: 0 12px 40px rgba(14, 23, 38, .16);
  --overlay: rgba(7, 13, 25, .55);
  /* Typographie, rayons, mouvement */
  --font-title: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px; --r-pill: 999px;
  --t-fast: 140ms cubic-bezier(.2, .8, .2, 1); --t-base: 220ms cubic-bezier(.2, .8, .2, 1);

  /* Correspondance avec les noms de la mise en page (app.css) */
  --brand: var(--primary-600); --brand-hover: var(--primary); --brand-soft: var(--primary-soft); --brand-ink: var(--primary-600);
  --bar: var(--primary-600); --bar-track: var(--surface-3);
  --ok: var(--pos-text); --ok-soft: var(--pos-soft);
  --bad: var(--neg-text); --bad-soft: var(--neg-soft);
  --mute: var(--text-3); --mute-soft: var(--surface-3);
  --radius: var(--r-lg); --radius-sm: var(--r-sm);
  --font: var(--font-body); --mono: var(--font-body);
  --shadow-float: var(--shadow-lg);
  --blanc: #FFFFFF; --voile-fond: var(--overlay); --rouge-texte: var(--neg-text); --vert: var(--pos); --noir-carte: var(--surface);
  color-scheme: light;
}
/* Thème sombre : uniquement sur choix de l'utilisateur (bouton du menu) */
:root[data-theme="dark"] {
  --bg: #0A1120; --surface: #111A2C; --surface-2: #162136; --surface-3: #1D2A42;
  --border: #233149; --border-strong: #31415E;
  --text: #EEF2F8; --text-2: #C3CDDC; --text-3: #94A1B6;
  --primary: #5B82F0; --primary-600: #4C74EC; --primary-soft: #18264A; --primary-ring: rgba(91, 130, 240, .28); --focus: #8FB0FF;
  --pos-text: #5EDBA9; --pos-soft: #0D3326; --warn-text: #F8C661; --warn-soft: #3A2A08;
  --neg-text: #FF9C9C; --neg-soft: #3D1418; --info-text: #8DBBFF; --info-soft: #102A4C;
  --side-bg: #070D19;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .25);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ─── Base ─────────────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); }
body { font-family: var(--font-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, h4 { font-family: var(--font-title); letter-spacing: -.015em; color: var(--text); }
.num, .kpi-value, td.right, .nav-count { font-variant-numeric: tabular-nums; }
a { color: var(--primary-600); text-underline-offset: 2px; }
.muted, .cell-sub { color: var(--text-3); }
.cell-main { color: var(--text); font-weight: 600; }
::selection { background: var(--primary-ring); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-600); }

/* ─── Menu latéral bleu nuit ────────────────────────────────────────────────────────────────── */
.sidebar { background: var(--side-bg); color: var(--side-text); border-right: 1px solid var(--side-border);
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(36, 80, 211, .22), transparent 60%);
  --surface: var(--side-bg); --surface-2: var(--side-hover); --border: var(--side-border); --text: #FFFFFF; --text-2: var(--side-text); --text-3: var(--side-muted); }
.sidebar .brand { border-bottom: 1px solid var(--side-border); background: transparent; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 10px; background: #FFFFFF; padding: 3px; display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-family: var(--font-title); font-weight: 800; font-size: 16px; letter-spacing: -.01em; color: #FFFFFF; }
.brand-name b, .brand-name i { font-style: normal; font-weight: 800; color: #FFFFFF; }
.brand-name i { color: var(--side-active-bar); }
.brand-sub { color: var(--side-muted); font-size: 12px; }
.sidebar .nav-label { color: var(--side-muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; }
.sidebar .nav-item { position: relative; min-height: 38px; border-radius: var(--r-md); color: var(--side-text); font-weight: 500; transition: background var(--t-fast), color var(--t-fast); }
.sidebar .nav-item .icon { color: var(--side-muted); transition: color var(--t-fast); }
.sidebar .nav-item:hover { background: var(--side-hover); color: #FFFFFF; }
.sidebar .nav-item:hover .icon { color: #FFFFFF; }
.sidebar .nav-item[aria-current="page"] { background: var(--side-active); color: #FFFFFF; font-weight: 600; }
.sidebar .nav-item[aria-current="page"] .icon { color: var(--side-active-bar); }
.sidebar .nav-item[aria-current="page"]::after { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-active-bar); }
.sidebar .nav-sub::before { border-left-color: var(--side-border); }
.sidebar .nav-sub[aria-current="page"]::before { border-left: 2px solid var(--side-active-bar); }
.sidebar .nav-count:not(:empty) { background: rgba(229, 72, 77, .9); color: #FFFFFF; border-radius: var(--r-pill); padding: 1px 7px; font-weight: 700; font-size: 11px; }
.sidebar :is(#ncTotal, #ncJoign, #ncElig, #ncHaute, #ncFat, #ncPleins, #ncVides, #ncVidesAnciens, #ncRecents):not(:empty) { background: rgba(255, 255, 255, .08); color: var(--side-text); font-weight: 500; }
.sidebar-foot { color: var(--side-muted); border-top: 1px solid var(--side-border); }
.sidebar-foot a { color: var(--side-text); }
.deconnexion, #btnDeconnexion { background: var(--side-hover); color: var(--side-text); border: 1px solid var(--side-border); border-radius: var(--r-md); transition: background var(--t-fast), color var(--t-fast); }
.deconnexion .icon, #btnDeconnexion .icon { color: var(--side-muted); }
.deconnexion:hover, #btnDeconnexion:hover { background: rgba(229, 72, 77, .18); color: #FF9A9D; }
.deconnexion:hover .icon, #btnDeconnexion:hover .icon { color: #FF9A9D; }
.bouton-theme { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 36px; margin-bottom: 8px; border-radius: var(--r-md);
  background: transparent; color: var(--side-text); border: 1px solid var(--side-border); font: inherit; font-size: 12.5px; cursor: pointer; }
.bouton-theme:hover { background: var(--side-hover); color: #FFFFFF; }
.bouton-theme .icon { width: 15px; height: 15px; }

/* ─── Barre supérieure translucide ──────────────────────────────────────────────────────────── */
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border); color: var(--text); }
.page-title, #titre { font-family: var(--font-title); font-size: 22px; font-weight: 800; letter-spacing: -.025em; color: var(--text); }
.page-sub, #sousTitre { color: var(--text-3); font-size: 13px; }
.topbar .utilisateur, .topbar .stamp { color: var(--text-3); }
.topbar .utilisateur strong { color: var(--text); }
.icon-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: var(--r-md); box-shadow: var(--shadow-xs); }

/* ─── Boutons ───────────────────────────────────────────────────────────────────────────────── */
.btn { border-radius: var(--r-md); font-weight: 600; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary-600); border-color: var(--primary-600); color: #FFFFFF; box-shadow: 0 1px 2px rgba(14, 23, 38, .12), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); box-shadow: 0 4px 14px var(--primary-ring); }
.btn-danger { background: var(--surface); color: var(--neg-text); border-color: color-mix(in srgb, var(--neg) 35%, var(--border)); }
.btn-danger:hover:not(:disabled) { background: var(--neg-soft); border-color: var(--neg); }
.btn-danger-plein { background: var(--neg); border-color: var(--neg); color: #FFFFFF; }
.btn-link { color: var(--primary-600); }
.btn-sm { border-radius: var(--r-sm); }
/* Boutons de période : contrôle segmenté */
.filtres-actions { background: var(--surface-3); border-radius: var(--r-md); padding: 3px; gap: 2px !important; height: auto !important; align-self: end; }
.btn-periode { border: 0; background: none; box-shadow: none; color: var(--text-3); min-height: 32px; }
.btn-periode:hover:not(:disabled) { background: none; color: var(--text); }
.btn-periode[aria-pressed="true"] { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }

/* ─── Cartes et KPI ─────────────────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-head { padding: 20px 20px 0; }
.card-body { padding: 16px 20px 20px; }
.card-title { font-family: var(--font-title); font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -.01em; }
.card-sub { color: var(--text-3); font-size: 13px; }
.kpi { padding: 20px; transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base); overflow: hidden; }
button.kpi:hover, .kpi:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.kpi-label { color: var(--text-3); font-size: 13px; font-weight: 500; gap: 10px; }
.kpi-label .icon { width: 38px; height: 38px; padding: 10px; border-radius: 11px; background: var(--primary-soft); color: var(--primary-600); flex: none; }
.kpi.kpi-perf .kpi-label .icon { background: var(--pos-soft); color: var(--pos-text); }
.kpi.kpi-alerte .kpi-label .icon { background: var(--neg-soft); color: var(--neg-text); }
.kpi-value { font-family: var(--font-title); font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.kpi-value.positif { color: var(--pos-text); }
.kpi-value.negatif { color: var(--neg-text); }
.kpi-foot { color: var(--text-3); font-size: 12px; }
.kpi-go { color: var(--primary-600); font-weight: 600; }
.kpi-strip { background: var(--surface); }
.kpi-strip > button { color: var(--text); border-left-color: var(--border); }
.kpi-strip > button:hover { background: var(--surface-2); }
.kpi-strip > button[aria-pressed="true"] { background: var(--primary-soft); }

/* Bandeau d'accueil « Vue d'ensemble » (bleu nuit dégradé) */
.overview-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 24px 24px 20px; margin-bottom: 20px; color: #FFFFFF;
  background: linear-gradient(135deg, #0B1B3A 0%, #15336E 55%, #1D3FA8 100%); box-shadow: var(--shadow-md); }
.overview-hero::after { content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 162, 255, .35), transparent 65%); pointer-events: none; }
.overview-hero .eyebrow { color: #9DB7FF; }
.overview-hero h2 { color: #FFFFFF; font-size: 24px; margin: 4px 0; letter-spacing: -.02em; font-weight: 800; }
.overview-hero p { color: #C5CFE2; font-size: 14px; margin: 0; }
.hero-row { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-top: 24px; }
.hero-stat { min-width: 0; padding: 16px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); color: #FFFFFF;
  text-align: left; font: inherit; cursor: pointer; transition: background var(--t-fast), transform var(--t-fast); }
.hero-stat:hover { background: rgba(255, 255, 255, .12); transform: translateY(-1px); }
.hero-stat .lbl { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #C5CFE2; }
.hero-stat .lbl .icon { color: #9DB7FF; width: 15px; height: 15px; }
.hero-stat .val { font-family: var(--font-title); font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero-stat .val.alerte { color: #FFB4B6; } .hero-stat .val.bon { color: #5EE0B0; }
.hero-stat .sub { font-size: 12px; color: #9AA8C2; }
.pill-live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14); font-size: 12px; color: #E3E9F5; white-space: nowrap; }
.pill-live .dot { width: 7px; height: 7px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); animation: pulse 2s ease-in-out infinite; }

/* ─── Tableaux ──────────────────────────────────────────────────────────────────────────────── */
th { background: var(--surface-2); color: var(--text-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border-strong); }
td { border-bottom: 1px solid var(--border); color: var(--text); }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: color-mix(in srgb, var(--primary-soft) 70%, transparent); }
tr.ligne-retard td:first-child { box-shadow: inset 3px 0 0 var(--neg); }
tr.ligne-retard td { background: color-mix(in srgb, var(--neg-soft) 55%, var(--surface)); }

/* ─── Badges ────────────────────────────────────────────────────────────────────────────────── */
.pill { border-radius: var(--r-pill); font-weight: 600; font-size: 12px; }
.pill-ok { background: var(--pos-soft); color: var(--pos-text); }
.pill-warn { background: var(--warn-soft); color: var(--warn-text); }
.pill-bad { background: var(--neg-soft); color: var(--neg-text); }
.pill-brand { background: var(--primary-soft); color: var(--primary-600); }
.pill-mute { background: var(--surface-3); color: var(--text-2); }
.pastille.aujourdhui { background: var(--primary-600); color: #FFFFFF; }
.pastille.demain { background: var(--info-soft); color: var(--info-text); }
.pastille.futur, .pastille.passe { background: var(--surface-3); color: var(--text-2); }

/* ─── Formulaires ───────────────────────────────────────────────────────────────────────────── */
input[type=text], input[type=search], input[type=date], input[type=time], input[type=email], input[type=tel], input[type=number], input[type=password], select, textarea,
.f-champ input, .f-champ select, .f-champ textarea {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), box-shadow var(--t-fast); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-600); box-shadow: 0 0 0 4px var(--primary-ring); }
.f-champ input[readonly], .f-champ input:disabled, .f-champ select:disabled { background: var(--surface-2); color: var(--text-2); box-shadow: none; }
label, .f-champ label, .filtres-grille label { color: var(--text-2); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary-600); }
::placeholder { color: var(--text-3); opacity: .8; }

/* ─── Progression ───────────────────────────────────────────────────────────────────────────── */
.bar-track, .progress { background: var(--surface-3); border-radius: var(--r-pill); }
.bar-fill, .progress span { background: var(--primary-600); border-radius: inherit; transition: width var(--t-base); }
.bar-fill.critique, .progress span.critique { background: var(--neg); }

/* ─── Onglets (contrôle segmenté), pagination, menus ────────────────────────────────────────── */
.onglets { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--surface-3); border-radius: var(--r-md); max-width: 100%; }
.onglet { border: 0; background: none; color: var(--text-3); font-weight: 600; border-radius: var(--r-sm); min-height: 34px; transition: background var(--t-fast), color var(--t-fast); }
.onglet:hover { color: var(--text); border: 0; }
.onglet[aria-current="page"] { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }
.onglet .compte { color: inherit; opacity: .75; }
.onglet.alerte:not([aria-current]) { color: var(--neg-text); }
.pager-btns .btn[aria-current="page"] { background: var(--primary-600); border-color: var(--primary-600); color: #FFFFFF; }
.menu, .dropdown .menu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.menu button { color: var(--text); } .menu button:hover { background: var(--surface-2); }

/* ─── Encadrés, états vides, notifications, fenêtres ────────────────────────────────────────── */
.notice { --ton: var(--info); --ton-text: var(--info-text); background: color-mix(in srgb, var(--ton) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ton) 28%, var(--border));
  border-radius: var(--r-lg); color: var(--text-2); }
.notice .icon { color: var(--ton-text); }
.notice strong { color: var(--ton-text); }
.notice.warn { --ton: var(--warn); --ton-text: var(--warn-text); }
.regle { background: var(--warn-soft); color: var(--text); border-left: 3px solid var(--accent-rgz); border-radius: var(--r-md); }
.empty { color: var(--text-3); padding: 48px 16px; }
.empty .icon { width: 56px; height: 56px; padding: 16px; border-radius: 16px; background: var(--primary-soft); color: var(--primary-600); margin-bottom: 14px; }
.empty strong { color: var(--text); font-family: var(--font-title); font-size: 17px; }
.toast { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); animation: toast-in var(--t-base); }
.toast .icon { color: var(--info-text); }
.toast.success .icon { color: var(--pos-text); }
.toast.error { border-color: color-mix(in srgb, var(--neg) 40%, var(--border)); }
.toast.error .icon { color: var(--neg-text); }
.overlay, dialog::backdrop, #navOverlay.ouvert { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.formulaire, dialog.confirm { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
dialog[open] { animation: toast-in var(--t-base); }
.drawer { background: var(--surface); color: var(--text); border-left: 1px solid var(--border); }
.section-label { color: var(--primary-600); }
.f-erreur { color: var(--neg-text); }
.skeleton { color: var(--text-3); }
.dl dt { color: var(--text-3); } .dl dd { color: var(--text); }

/* Lignes de rendez-vous */
.rdv-ligne { transition: background var(--t-fast); }
.rdv-ligne:hover { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.rdv-ligne.retard { box-shadow: inset 3px 0 0 var(--neg); }
.rdv-ligne.attribuer { box-shadow: inset 3px 0 0 var(--accent-rgz); }
.rdv-heure { font-family: var(--font-title); font-weight: 800; color: var(--text); }
.rdv-groupe { background: var(--surface-2); color: var(--text-3); }
.rdv-groupe.rouge { color: var(--neg-text); }

/* Bloc « Centre d'appel » */
.cc-bloc { background: var(--surface); border-color: var(--border); border-radius: var(--r-lg); }
.cc-tete { background: var(--surface-2); }
.cc-etiquette { color: var(--text-3); }
.cc-valeur { color: var(--text); }

/* ═══ Composants de l'ADMINISTRATION ═══════════════════════════════════════════════════════════ */
.depot { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; padding: 40px 24px; color: var(--text-3);
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-xl);
  background: radial-gradient(80% 120% at 50% 0%, var(--primary-soft), transparent 70%), var(--surface);
  transition: border-color var(--t-base), background var(--t-base), transform var(--t-base); }
.depot .icon { width: 56px; height: 56px; padding: 15px; border-radius: 16px; background: var(--primary-600); color: #FFFFFF; box-shadow: 0 8px 24px var(--primary-ring); margin-bottom: 6px; }
.depot > div { color: var(--text); font-weight: 600; }
.depot.survol, .depot:hover { border-color: var(--primary-600); background: var(--primary-soft); transform: scale(1.005); }
.cadre-zone { flex: 1; display: flex; }
.cadre-zone[hidden] { display: none; }
.cadre-base { flex: 1; width: 100%; min-height: calc(100vh - 66px); border: 0; display: block; background: var(--bg); }
.filtres-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px 16px; align-items: end; padding: 20px; border-bottom: 1px solid var(--border); }
.filtres-grille label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; }
.filtres-grille input, .filtres-grille select { width: 100%; height: 40px; max-width: none; }
.filtres-actions { display: flex; align-items: center; }
.visu-barre { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.visu-onglets { display: inline-flex; gap: 2px; flex-wrap: wrap; padding: 3px; background: var(--surface-3); border-radius: var(--r-md); }
.visu-onglets button { border: 0; background: none; color: var(--text-3); border-radius: var(--r-sm); padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.visu-onglets button[aria-current] { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }
.visu-onglets .n { color: var(--text-3); font-size: 11px; margin-left: 4px; font-weight: 500; }
.visu-barre input[type=search] { flex: 0 1 240px; min-width: 160px; margin-left: auto; }
.visu-grille { max-height: 62vh; overflow: auto; }
.visu-grille table { border-collapse: separate; border-spacing: 0; font-size: 12px; width: max-content; min-width: 100%; }
.visu-grille th, .visu-grille td { border-right: 1px solid var(--border); padding: 5px 8px; white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis; text-align: left; vertical-align: top; }
.visu-grille thead th { position: sticky; top: 0; z-index: 2; text-align: center; }
.visu-grille .rn { position: sticky; left: 0; z-index: 1; background: var(--surface-2) !important; color: var(--text-3); text-align: right; min-width: 44px; }
.visu-grille thead .rn { z-index: 3; }
.visu-grille tr.entete td:not(.rn) { font-weight: 700; background: var(--primary-soft); color: var(--text); }
.visu-pied { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); }
.compteurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.compteurs > div { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface-2); }
.compteurs span { display: block; font-size: 12px; color: var(--text-3); }
.compteurs strong { font-family: var(--font-title); font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.actions-rdv { display: flex; flex-wrap: wrap; gap: 6px; }
.tableau-compact td, .tableau-compact th { padding: 8px 10px; }
.mdp-temp { font-size: 18px; padding: 12px; background: var(--primary-soft); color: var(--primary-600); border-radius: var(--r-md); user-select: all; font-weight: 700; font-variant-numeric: tabular-nums; }
.param { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.param:last-child { border-bottom: 0; }
.param textarea { width: 100%; min-height: 110px; }
@media (max-width: 640px) { .param { grid-template-columns: 1fr; } }

/* ═══ Espace COMMERCIAL : mobile d'abord ═══════════════════════════════════════════════════════ */
.nav-mobile { display: none; }
@media (max-width: 760px) {
  .espace-commercial .nav-mobile { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 30;
    background: var(--side-bg); border: 1px solid var(--side-border); border-radius: 18px; padding: 4px; box-shadow: var(--shadow-lg);
    background-image: radial-gradient(120% 140% at 0% 0%, rgba(36, 80, 211, .30), transparent 60%); }
  .espace-commercial .nav-mobile button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; white-space: nowrap;
    background: none; border: 0; border-radius: 14px; color: var(--side-text); font: inherit; font-size: 10.5px; font-weight: 600; position: relative; cursor: pointer; }
  .espace-commercial .nav-mobile .icon { width: 20px; height: 20px; color: var(--side-muted); }
  .espace-commercial .nav-mobile button[aria-current="page"] { background: var(--side-active); color: #FFFFFF; }
  .espace-commercial .nav-mobile button[aria-current="page"] .icon { color: var(--side-active-bar); }
  .espace-commercial .nav-mobile .pastille-compte:not(:empty) { position: absolute; top: 5px; right: calc(50% - 22px); background: var(--neg); color: #FFFFFF;
    font-size: 10px; border-radius: 9px; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
  .espace-commercial .content { padding-bottom: 104px; }
  .espace-commercial .btn, .espace-commercial input, .espace-commercial select { min-height: 48px; }
  .espace-commercial .onglet { min-height: 40px; flex: none; white-space: nowrap; }
  .espace-commercial .onglets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .espace-commercial .onglets::-webkit-scrollbar { display: none; }
  .espace-commercial .rdv-actions .btn { width: 100%; justify-content: center; }
  .espace-commercial .rdv-ligne { border-radius: var(--r-lg); margin: 0 0 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
  /* Tableaux transformés en cartes (libellés posés par l'interface) */
  .espace-commercial .table-scroll table, .espace-commercial .table-scroll tbody, .espace-commercial .table-scroll tr,
  .espace-commercial .table-scroll td { display: block; width: 100%; }
  .espace-commercial .table-scroll thead { display: none; }
  .espace-commercial .table-scroll tr { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); margin: 0 0 12px; padding: 8px 0; box-shadow: var(--shadow-sm); }
  .espace-commercial .table-scroll tr > td:first-child { grid-column: 1 / -1; font-size: 15px; }
  .espace-commercial .table-scroll tbody tr td { background: transparent !important; border: 0; padding: 6px 16px; text-align: left !important; }
  .espace-commercial .table-scroll td[data-libelle]::before { content: attr(data-libelle); display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-3); margin-bottom: 2px; font-weight: 700; }
}

/* ═══ Pages d'accès (connexion, inscription, mot de passe) et pages d'erreur ════════════════════
   Écran partagé : vitrine bleu nuit animée à gauche, formulaire clair à droite. */
body.acces { margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); color: var(--text); }
.vitrine { position: relative; overflow: hidden; color: #FFFFFF; min-height: 100vh; min-height: 100dvh; padding: clamp(24px, 5vh, 44px) clamp(24px, 4vw, 52px);
  display: flex; flex-direction: column; gap: clamp(12px, 3vh, 28px);
  background: radial-gradient(120% 90% at 0% 0%, #1D3FA8 0%, transparent 55%), linear-gradient(160deg, #10264F 0%, #0B1B3A 60%, #081430 100%); }
.vitrine::before { content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); }
.vitrine .bulle { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; animation: flotter 18s ease-in-out infinite; }
.vitrine .bulle.b1 { width: 38vh; height: 38vh; background: #2450D3; top: -12vh; right: -8vh; }
.vitrine .bulle.b2 { width: 30vh; height: 30vh; background: #12A672; bottom: -10vh; left: -6vh; animation-delay: -6s; opacity: .35; }
.vitrine .bulle.b3 { width: 22vh; height: 22vh; background: #F2A007; top: 45%; right: 20%; animation-delay: -12s; opacity: .22; }
.vitrine > :not(.bulle) { position: relative; z-index: 1; }
.vitrine .marque-v { display: flex; align-items: center; gap: 12px; }
.vitrine .marque-v img { width: 44px; height: 44px; border-radius: 10px; background: #FFFFFF; padding: 3px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.vitrine .marque-v b { display: block; color: #FFFFFF; font-family: var(--font-title); font-size: 1.15rem; letter-spacing: -.01em; }
.vitrine .marque-v small { color: #A9B6D3; font-size: .75rem; }
.accroche { margin-top: clamp(16px, 6vh, 60px); }
.accroche h1 { color: #FFFFFF; font-family: var(--font-title); font-weight: 800; font-size: clamp(1.6rem, min(2.8vw, 5vh), 2.7rem); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 12px; max-width: 18ch; }
.accroche h1 span { background: linear-gradient(90deg, #7FA6FF, #5EE0B0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accroche p { color: #C5CFE2; font-size: clamp(.9rem, 2vh, 1.06rem); line-height: 1.55; margin: 0; max-width: 46ch; }
.atouts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.atouts li { display: flex; align-items: flex-start; gap: 12px; opacity: 0; transform: translateY(12px); animation: apparaitre .6s cubic-bezier(.2, .8, .2, 1) forwards; }
.atouts li:nth-child(1) { animation-delay: .35s; } .atouts li:nth-child(2) { animation-delay: .5s; } .atouts li:nth-child(3) { animation-delay: .65s; }
.atouts .ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #9DB8FF; }
.atouts .ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.atouts b { display: block; font-size: .875rem; font-weight: 600; }
.atouts small { color: #A9B6D3; font-size: .75rem; line-height: 1.4; }
.apercu { align-self: flex-start; width: min(100%, 360px); padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); animation: apparaitre .7s .8s cubic-bezier(.2, .8, .2, 1) both, planer 6s 1.5s ease-in-out infinite; }
.apercu-tete { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.apercu-tete small { color: #A9B6D3; font-size: .6875rem; }
.apercu-tete b { font-family: var(--font-title); font-size: 1.15rem; }
.apercu-tete em { font-style: normal; color: #5EE0B0; font-size: .75rem; font-weight: 600; margin-left: 6px; }
.barres { display: flex; align-items: flex-end; gap: 7px; height: clamp(44px, 8vh, 68px); }
.barres span { flex: 1; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #5B8CFF, #2450D3); transform-origin: bottom; transform: scaleY(0); animation: pousser .9s cubic-bezier(.2, .8, .2, 1) forwards; }
.barres span:nth-child(odd) { background: linear-gradient(180deg, #5EE0B0, #12A672); }
.barres span:last-child { background: linear-gradient(180deg, #FFD27A, #F2A007); }
.barres span:nth-child(1) { height: 40%; animation-delay: 1s; } .barres span:nth-child(2) { height: 55%; animation-delay: 1.06s; } .barres span:nth-child(3) { height: 48%; animation-delay: 1.12s; }
.barres span:nth-child(4) { height: 66%; animation-delay: 1.18s; } .barres span:nth-child(5) { height: 60%; animation-delay: 1.24s; } .barres span:nth-child(6) { height: 78%; animation-delay: 1.3s; }
.barres span:nth-child(7) { height: 72%; animation-delay: 1.36s; } .barres span:nth-child(8) { height: 88%; animation-delay: 1.42s; } .barres span:nth-child(9) { height: 100%; animation-delay: 1.48s; }
.vitrine footer { margin-top: auto; color: #8592AD; font-size: .6875rem; }

.acces-zone { display: grid; place-items: center; padding: clamp(16px, 4vh, 40px) clamp(16px, 4vw, 40px); min-width: 0; }
.acces main { width: min(var(--largeur, 380px), 100%); animation: apparaitre .6s .1s cubic-bezier(.2, .8, .2, 1) both; }
.acces form, .acces .carte { background: none; border: 0; padding: 0; margin: 0; }
.acces .marque { display: none; }
.badge-espace { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-600);
  font-size: .6875rem; font-weight: 700; margin-bottom: 14px; }
.badge-espace svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.acces h1 { font-family: var(--font-title); font-weight: 800; font-size: clamp(1.4rem, 3.2vh, 1.65rem); letter-spacing: -.02em; margin: 0 0 6px; color: var(--text); }
.acces .intro { color: var(--text-3); margin: 0 0 18px; font-size: .875rem; line-height: 1.5; }
.acces label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }
.acces .aide { font-weight: 400; color: var(--text-3); }
.acces input { width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: .95rem; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.acces .grille { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 480px) { .acces .grille { grid-template-columns: 1fr; } }
.acces button[type=submit] { margin-top: 20px; width: 100%; height: 48px; border: 0; border-radius: var(--r-md); cursor: pointer; font: inherit; font-weight: 700; color: #FFFFFF;
  background: linear-gradient(180deg, #2a57de, #1D3FA8); box-shadow: 0 8px 20px var(--primary-ring), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast); }
.acces button[type=submit]:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(36, 80, 211, .32); transform: translateY(-1px); }
.acces button[type=submit]:active { transform: translateY(0); }
.acces .msg { font-size: .82rem; margin-top: 16px; padding: 11px 14px; border-radius: var(--r-md); line-height: 1.5; animation: apparaitre .3s both; }
.acces .err { color: var(--neg-text); background: var(--neg-soft); border: 1px solid color-mix(in srgb, var(--neg) 30%, transparent); }
.acces .ok { color: var(--pos-text); background: var(--pos-soft); border: 1px solid color-mix(in srgb, var(--pos) 30%, transparent); }
.acces .liens { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: .82rem; }
.acces a { color: var(--primary-600); font-weight: 600; text-decoration: none; }
.acces a:hover { text-decoration: underline; }
.acces .bas { text-align: center; margin-top: 16px; font-size: .82rem; color: var(--text-3); }
.acces .partenaires { margin-top: 22px; font-size: .72rem; color: var(--text-3); text-align: center; }
.acces .partenaires .r { color: var(--warn-text); font-weight: 700; }
.acces .champ { position: relative; }
.acces .champ input { padding-right: 46px; }
.acces .oeil { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--text-3);
  display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.acces .oeil:hover { color: var(--text); background: var(--surface-2); }
.acces .oeil svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.acces .oeil .barre { display: none; } .acces .oeil[aria-pressed="true"] .barre { display: block; }
.acces .code-erreur { font-family: var(--font-title); font-size: 64px; font-weight: 800; letter-spacing: -3px; line-height: 1; margin-bottom: 10px; color: var(--primary-600); }
.acces .code-erreur span { color: var(--accent-rgz); }
.acces .bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; margin-top: 18px; border-radius: var(--r-md);
  background: var(--primary-600); color: #FFFFFF; font-weight: 700; }
.acces .bouton:hover { background: var(--primary); text-decoration: none; }
/* Téléphone et tablette : la vitrine devient un bandeau compact au-dessus du formulaire */
@media (max-width: 900px) {
  body.acces { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .vitrine { min-height: 0; padding: 20px 20px 22px; gap: 10px; }
  .vitrine .accroche { margin-top: 6px; }
  .vitrine .accroche h1 { font-size: 1.45rem; }
  .vitrine .accroche p, .vitrine .atouts, .vitrine .apercu, .vitrine footer { display: none; }
  .acces-zone { align-items: start; padding: 28px 20px 40px; }
}

/* ─── Animations ────────────────────────────────────────────────────────────────────────────── */
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes apparition { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes apparaitre { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes flotter { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(30px, -40px) scale(1.08); } 66% { transform: translate(-25px, 25px) scale(.95); } }
@keyframes pousser { to { transform: scaleY(1); } }
@keyframes planer { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); } 50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, .08); } }
.page.active, #contenu > *, .cadre-zone:not([hidden]) { animation: apparition var(--t-base) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .atouts li, .barres span { opacity: 1; transform: none; }
}
/* Correctifs : le titre de la vitrine reste blanc (la règle des titres de formulaire ne s'y applique pas) ; nom de l'application aéré */
body.acces .vitrine .accroche h1 { color: #FFFFFF; font-size: clamp(1.6rem, min(2.8vw, 5vh), 2.7rem); margin: 0 0 12px; }
@media (max-width: 900px) { body.acces .vitrine .accroche h1 { font-size: 1.45rem; } }
.brand-name, .vitrine .marque-v b { word-spacing: .14em; }
.brand-name i { margin-left: .22em; }
