@font-face { font-family: "Archivo"; src: url("../fonts/archivo.woff") format("woff"); font-weight: 400 800; font-stretch: 100% 125%; font-display: swap; }
/* Volant — identité visuelle
   Encre profonde + vert « feu vert » sur fond papier chaud. Une seule couleur d'accent,
   des statuts sémantiques sobres, une typographie système très lisible. */
:root {
  /* ---- Identité Guid'R : bleu dominant, violet en accent ---- */
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-light: #60A5FA;
  --violet: #7C3AED;
  --violet-dark: #6D28D9;
  --violet-light: #A78BFA;
  --gradient: linear-gradient(135deg, var(--blue) 0%, var(--violet) 100%);

  /* rôles : couleur principale (bleu) */
  --accent: var(--blue);
  --accent-hover: var(--blue-dark);
  --accent-text: var(--blue);
  --accent-soft: #EFF6FF;
  --accent-ink: #1D4ED8;
  --accent-line: #BFDBFE;
  --accent-ring: rgba(37, 99, 235, .22);
  --accent-bright: var(--blue-light);
  /* rôles : couleur secondaire (violet) */
  --accent-2: var(--violet);
  --accent-2-hover: var(--violet-dark);
  --accent-2-text: var(--violet-dark);
  --accent-2-soft: #F5F3FF;
  --accent-2-line: #DDD6FE;
  --accent-2-ring: rgba(124, 58, 237, .2);

  /* neutres */
  --ink: #0F172A;
  --ink-2: #1E293B;
  --text: #0F172A;
  --muted: #64748B;
  --faint: #94A3B8;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --neutral-soft: #F1F5F9;
  --disabled-bg: #E2E8F0;
  --disabled-text: #94A3B8;

  /* états (sémantiques) */
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --warn-line: #FDE68A;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --danger-line: #FECACA;
  --info: var(--violet-dark);
  --info-soft: var(--accent-2-soft);
  --info-line: var(--accent-2-line);

  /* surfaces sombres (menu, notifications) */
  --chrome: #0F172A;
  --chrome-2: #1E293B;
  --on-chrome: #CBD5E1;
  --on-chrome-strong: #FFFFFF;
  --on-chrome-faint: #94A3B8;

  /* données et planning */
  --noshow: #D97706;
  --planned: #93C5FD;
  --bar: #BFDBFE;
  --ev-planned: #EFF6FF;
  --ev-done: #F1F5F9;
  --today-bg: #F5F9FF;
  --hatch-a: rgba(15, 23, 42, .025);
  --hatch-b: rgba(15, 23, 42, .05);
  --map-bg: #E2E8F0;
  --topbar-bg: rgba(248, 250, 252, .88);
  --tabbar-bg: rgba(255, 255, 255, .96);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, .22);
  --shadow-accent: 0 8px 24px rgba(37, 99, 235, .28);
  --font: "Archivo", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --wide: 118%;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar: 248px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* ------------------------------------------------------------------ thème sombre */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --accent-text: #60A5FA;
  --accent-soft: #14213D;
  --accent-ink: #93C5FD;
  --accent-line: #1E3A8A;
  --accent-ring: rgba(96, 165, 250, .32);
  --accent-2-text: #C4B5FD;
  --accent-2-soft: #1E1538;
  --accent-2-line: #3B2A6B;
  --accent-2-ring: rgba(167, 139, 250, .3);
  --ink: #F1F5F9;
  --ink-2: #E2E8F0;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --faint: #64748B;
  --bg: #0B1120;
  --surface: #111A2E;
  --surface-2: #162038;
  --line: #1F2A44;
  --line-strong: #2E3B5B;
  --neutral-soft: #1A2440;
  --disabled-bg: #1F2A44;
  --disabled-text: #64748B;
  --warn: #FBBF24;
  --warn-soft: #2A1F0B;
  --warn-line: #4D3A12;
  --danger: #F87171;
  --danger-soft: #2D1418;
  --danger-line: #5B2228;
  --info: #C4B5FD;
  --chrome: #070C18;
  --chrome-2: #111A2E;
  --noshow: #F59E0B;
  --planned: #1E40AF;
  --bar: #1E3A8A;
  --ev-planned: #14213D;
  --ev-done: #162038;
  --today-bg: #0F1A33;
  --hatch-a: rgba(255, 255, 255, .02);
  --hatch-b: rgba(255, 255, 255, .045);
  --map-bg: #162038;
  --topbar-bg: rgba(11, 17, 32, .86);
  --tabbar-bg: rgba(17, 26, 46, .96);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
  --shadow-accent: 0 8px 28px rgba(37, 99, 235, .35);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent-text: #60A5FA;
  --accent-soft: #14213D;
  --accent-ink: #93C5FD;
  --accent-line: #1E3A8A;
  --accent-ring: rgba(96, 165, 250, .32);
  --accent-2-text: #C4B5FD;
  --accent-2-soft: #1E1538;
  --accent-2-line: #3B2A6B;
  --accent-2-ring: rgba(167, 139, 250, .3);
  --ink: #F1F5F9;
  --ink-2: #E2E8F0;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --faint: #64748B;
  --bg: #0B1120;
  --surface: #111A2E;
  --surface-2: #162038;
  --line: #1F2A44;
  --line-strong: #2E3B5B;
  --neutral-soft: #1A2440;
  --disabled-bg: #1F2A44;
  --disabled-text: #64748B;
  --warn: #FBBF24;
  --warn-soft: #2A1F0B;
  --warn-line: #4D3A12;
  --danger: #F87171;
  --danger-soft: #2D1418;
  --danger-line: #5B2228;
  --info: #C4B5FD;
  --chrome: #070C18;
  --chrome-2: #111A2E;
  --noshow: #F59E0B;
  --planned: #1E40AF;
  --bar: #1E3A8A;
  --ev-planned: #14213D;
  --ev-done: #162038;
  --today-bg: #0F1A33;
  --hatch-a: rgba(255, 255, 255, .02);
  --hatch-b: rgba(255, 255, 255, .045);
  --map-bg: #162038;
  --topbar-bg: rgba(11, 17, 32, .86);
  --tabbar-bg: rgba(17, 26, 46, .96);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
  --shadow-accent: 0 8px 28px rgba(37, 99, 235, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 8px; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ démarrage */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ connexion */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { background: var(--chrome); color: var(--on-chrome); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 56px solid rgba(124, 58, 237, .14); }
.auth-side h2 { color: var(--on-chrome-strong); font-size: 30px; line-height: 1.2; max-width: 420px; letter-spacing: -.02em; }
.auth-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; max-width: 420px; }
.auth-side li { display: flex; gap: 12px; align-items: flex-start; color: var(--on-chrome); }
.auth-side li .ico { color: var(--blue-light); margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card form { margin-top: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: inherit; }
.brand svg { width: 30px; height: 30px; }

/* ------------------------------------------------------------------ structure */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--chrome); color: var(--on-chrome); display: flex; flex-direction: column; padding: 20px 14px; }
.sidebar .brand { color: #fff; padding: 4px 10px 22px; }
.sidebar .school { font-size: 12px; color: var(--on-chrome-faint); font-weight: 500; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--on-chrome); font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(37, 99, 235, .38), rgba(124, 58, 237, .16)); color: #fff; box-shadow: inset 2px 0 0 var(--blue-light); }
.nav a.active .ico { color: var(--blue-light); }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 12px 8px; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { font-size: 13px; line-height: 1.3; min-width: 0; }
.sidebar-foot .who b { color: #fff; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot button { margin-left: auto; color: var(--on-chrome-faint); }
.sidebar-foot button:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 32px; background: var(--topbar-bg); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .crumbs { font-size: 14px; color: var(--muted); }
.topbar .mobile-brand { display: none; }
.content { padding: 8px 32px 48px; width: 100%; max-width: 1240px; animation: fadein .25s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 24px; }
.page-head p { color: var(--muted); margin-top: 4px; }

.tabbar { display: none; }

/* ------------------------------------------------------------------ boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger-line); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--neutral-soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.loading { opacity: .7; pointer-events: none; }
.btn[disabled], .btn:disabled { background: var(--disabled-bg); border-color: var(--disabled-bg); color: var(--disabled-text); box-shadow: none; cursor: not-allowed; pointer-events: none; }
.btn.loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--neutral-soft); color: var(--ink); }
.dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }

/* ------------------------------------------------------------------ cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; }
.card-body { padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }

.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.15; }
.kpi .value small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi .hint { font-size: 13px; color: var(--muted); }
.kpi.alert .value { color: var(--warn); }
a.kpi { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--line-strong); box-shadow: var(--shadow); text-decoration: none; }

/* ------------------------------------------------------------------ listes */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list > li.clickable { cursor: pointer; transition: background .12s; }
.list > li.clickable:hover { background: var(--surface-2); }
.list .title { font-weight: 600; color: var(--ink); }
.list .sub { font-size: 13px; color: var(--muted); }
.time-chip { flex: none; width: 58px; text-align: center; padding: 6px 0; border-radius: 9px; background: var(--neutral-soft); font-weight: 700; color: var(--ink); font-size: 14px; line-height: 1.15; }
.time-chip small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.date-chip { flex: none; width: 52px; text-align: center; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.date-chip b { display: block; font-size: 19px; color: var(--ink); line-height: 1.3; padding-top: 2px; }
.date-chip span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: #fff; background: var(--accent); padding: 1px 0; }

.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent-ink); background: var(--accent-soft); letter-spacing: .02em; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.dark { background: var(--chrome-2); color: #fff; }
.sidebar .avatar.dark { background: rgba(255, 255, 255, .1); }

/* ------------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.green { background: var(--accent-2-soft); color: var(--accent-2-text); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--accent-soft); color: var(--accent-ink); }

/* ------------------------------------------------------------------ tableaux */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------------ formulaires */
.form { display: grid; gap: 16px; }
.form .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form .cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 12.5px; color: var(--muted); }
.field .error { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636a64' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--danger); }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.form-error { padding: 10px 12px; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 500; display: flex; gap: 8px; align-items: flex-start; }
.form-error .ico { margin-top: 2px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.segmented { display: inline-flex; padding: 3px; background: var(--neutral-soft); border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.segmented button:hover { color: var(--ink); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input-icon { flex: 1; min-width: 200px; max-width: 360px; }

/* ------------------------------------------------------------------ onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 1px 7px; }

/* ------------------------------------------------------------------ fiche */
.profile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 20px; }
.profile-head h1 { font-size: 24px; }
.profile-head .meta { display: flex; gap: 8px 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 4px; align-items: center; }
.profile-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.stat-strip > div { padding: 14px 20px; border-left: 1px solid var(--line); }
.stat-strip > div:first-child { border-left: 0; }
.stat-strip .label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-strip .value { font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.stat-strip .value.warn { color: var(--warn); }
.stat-strip .value.good { color: var(--accent-text); }

.dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px 16px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ heures / progression */
.meter { height: 10px; border-radius: 6px; background: var(--neutral-soft); overflow: hidden; display: flex; }
.meter > span { display: block; height: 100%; transition: width .5s var(--ease); }
.meter .done { background: var(--accent); }
.meter .noshow { background: var(--noshow); }
.meter .planned { background: var(--planned); }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.comp { display: grid; gap: 14px; }
.comp-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.comp-row .code { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--neutral-soft); color: var(--ink-2); }
.comp-row .name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.steps { display: flex; gap: 4px; margin-top: 7px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--neutral-soft); }
.steps i.on { background: var(--accent); }
.lvl-0 .code { background: var(--neutral-soft); }
.lvl-1 .code { background: var(--info-soft); color: var(--info); }
.lvl-2 .code { background: var(--warn-soft); color: var(--warn); }
.lvl-3 .code { background: var(--accent-soft); color: var(--accent-ink); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -4px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); }
.timeline .when { font-size: 13px; color: var(--muted); }
.note { padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; margin-top: 8px; }
.note b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.note.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.note.good { background: var(--accent-soft); border-color: var(--accent-line); }

/* ------------------------------------------------------------------ calendrier */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-head .period { font-weight: 700; font-size: 16px; color: var(--ink); min-width: 200px; }
.cal { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; box-shadow: var(--shadow-sm); }
.cal-dayhead { position: sticky; top: 60px; z-index: 5; padding: 10px 8px; text-align: center; background: var(--surface); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 600; }
.cal-dayhead b { display: block; font-size: 20px; color: var(--ink); font-weight: 700; line-height: 1.2; }
.cal-dayhead.today b { color: #fff; background: var(--accent); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; margin: 2px auto 0; font-size: 17px; }
.cal-corner { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 60px; z-index: 5; }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 8px; font-size: 11.5px; color: var(--faint); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour); cursor: default; }
.cal-col.can-add { cursor: copy; }
.cal-col.today { background-color: var(--today-bg); }
.cal-off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(-45deg, var(--hatch-a) 0 6px, var(--hatch-b) 6px 12px); pointer-events: none; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 5px 8px; font-size: 12.5px; line-height: 1.3; overflow: hidden; cursor: pointer; border: 1px solid; border-left-width: 3px; transition: box-shadow .15s, transform .1s; z-index: 2; }
.ev:hover { box-shadow: var(--shadow); z-index: 4; }
.ev b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { color: inherit; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ev.planned { background: var(--ev-planned); border-color: var(--accent-line); border-left-color: var(--accent); color: var(--accent-ink); }
.ev.done { background: var(--ev-done); border-color: var(--line); border-left-color: var(--faint); color: var(--ink-2); }
.ev.no_show { background: var(--warn-soft); border-color: var(--warn-line); border-left-color: var(--noshow); color: var(--warn); }
.ev.examen, .ev.examen_blanc { background: var(--info-soft); border-color: var(--info-line); border-left-color: var(--info); color: var(--info); }
.ev.cancelled { background: repeating-linear-gradient(-45deg, var(--surface) 0 6px, var(--surface-2) 6px 12px); border-color: var(--line); border-left-color: var(--line-strong); color: var(--faint); text-decoration: line-through; }
.agenda .day { margin-bottom: 18px; }
.agenda .day > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px 4px; }
.agenda .day.today > h3 { color: var(--accent-text); }
.day-picker { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.day-picker button { flex: none; width: 48px; padding: 6px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.day-picker button b { display: block; font-size: 17px; color: var(--ink); text-transform: none; }
.day-picker button.on { background: var(--accent); border-color: var(--accent); color: rgba(255, 255, 255, .8); box-shadow: var(--shadow-accent); }
.day-picker button.on b { color: #fff; }
.day-picker button .pip { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin: 3px auto 0; }

/* créneaux de réservation */
.slot-day { margin-bottom: 20px; }
.slot-day h3 { font-size: 14px; margin-bottom: 10px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { height: 42px; min-width: 84px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 650; cursor: pointer; transition: all .15s; font-variant-numeric: tabular-nums; }
.slot:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* disponibilités */
.avail-day { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.avail-day:first-child { border-top: 0; }
.avail-day .dname { font-weight: 600; padding-top: 8px; }
.avail-ranges { display: flex; flex-direction: column; gap: 8px; }
.avail-range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.avail-range .input { width: 120px; }

/* documents */
.doc { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc:first-child { border-top: 0; }
.doc .doc-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--muted); flex: none; }
.doc.valide .doc-ico { background: var(--accent-soft); color: var(--accent-text); }
.doc.recu .doc-ico { background: var(--info-soft); color: var(--info); }
.doc.refuse .doc-ico { background: var(--danger-soft); color: var(--danger); }
.doc .doc-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }

/* graphique barres */
.bars { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 10px; align-items: end; height: 150px; padding-top: 8px; }
.bars .bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar i { display: block; width: 100%; max-width: 38px; border-radius: 6px 6px 3px 3px; background: var(--bar); min-height: 3px; transition: height .5s var(--ease); }
.bars .bar.today i { background: var(--accent); }
.bars .bar span { font-size: 12px; color: var(--muted); font-weight: 600; }
.bars .bar em { font-style: normal; font-size: 12px; color: var(--ink); font-weight: 650; }

/* ------------------------------------------------------------------ états */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .empty-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--neutral-soft); display: grid; place-items: center; margin: 0 auto 12px; color: var(--faint); }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }
.empty.sm { padding: 24px 16px; }
.skeleton { background: linear-gradient(90deg, var(--neutral-soft) 0%, var(--surface-2) 50%, var(--neutral-soft) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line { height: 14px; margin: 10px 0; }
.sk-block { height: 96px; }
.banner { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; margin-bottom: 16px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner.good { background: var(--accent-soft); color: var(--accent-ink); }
.banner .btn { margin-left: auto; }
.offline { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 100; background: var(--chrome); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; min-width: 260px; max-width: 400px; padding: 12px 14px; border-radius: 12px; background: var(--chrome); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastin .25s var(--ease); }
.toast .ico { color: var(--blue-light); margin-top: 1px; }
.toast.error .ico { color: #FCA5A5; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .2s; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ modales */
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow-lg); background: var(--surface); color: var(--text); overflow: hidden; }
dialog.modal.wide { width: min(760px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modalin .22s var(--ease); display: flex; flex-direction: column; }
@keyframes modalin { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 4px; }
.modal-head h2 { font-size: 18px; }
.modal-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.modal-head .icon-btn { margin: -6px -8px 0 auto; }
.modal-body { padding: 16px 22px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; background: var(--surface-2); }
.secret { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--line-strong); background: var(--surface-2); font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: .02em; }
.secret span { flex: 1; overflow-wrap: anywhere; }

/* notifications */
.popover { position: absolute; top: 52px; right: 24px; width: min(380px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; animation: modalin .18s var(--ease); }
.popover .list { max-height: 420px; overflow-y: auto; }
.popover .list li { font-size: 14px; align-items: flex-start; }
.popover .list li.unread { background: var(--accent-soft); }
.popover .list li .ico { color: var(--accent-text); margin-top: 2px; }

/* reçu imprimable */
.receipt { font-size: 14px; }
.receipt .r-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.receipt .r-amount { font-size: 28px; font-weight: 800; color: var(--ink); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; height: 56px; }
  .topbar .mobile-brand { display: flex; color: var(--ink); }
  .topbar .crumbs { display: none; }
  .content { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 22px; }
  .page-head { margin: 8px 0 18px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--tabbar-bg); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 10px; min-width: 0; }
  .tabbar a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .tabbar a.active { color: var(--accent-text); }
  .tabbar .ico { width: 22px; height: 22px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .form .cols, .form .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(3) { border-left: 0; }
  .stat-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .profile-head .actions { margin-left: 0; width: 100%; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .avail-day { grid-template-columns: minmax(0, 1fr); }
  .avail-day .dname { padding-top: 0; }
  .toasts { left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .popover { right: 12px; top: 50px; }
  .hide-mobile { display: none !important; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.responsive tr:last-child { border-bottom: 0; }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; }
  .table.responsive td.primary { font-size: 15px; text-align: left; padding-bottom: 6px; }
  .table.responsive td.primary::before { display: none; }
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  dialog.modal[open] { animation: sheetin .26s var(--ease); }
  .modal-foot .btn { flex: 1; }
}
@keyframes sheetin { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 861px) { .only-mobile { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 24px; }
  dialog.modal { box-shadow: none; }
}

/* ------------------------------------------------------------------ pilotage (direction) */
.bars.tall { height: 210px; gap: 6px; }
.bars .bar em { white-space: nowrap; font-size: 11.5px; }
.bars .bar:focus-visible i, .bars .bar:hover i { background: var(--accent-hover); }
.bars .bar i { cursor: default; border-radius: 4px 4px 2px 2px; }
.trend { font-weight: 700; font-size: 12.5px; }
.trend.up { color: var(--accent-text); }
.trend.down { color: var(--danger); }
.kpi .value.warn { color: var(--warn); }
.rate { display: grid; gap: 8px; }
.rate-value { font-size: 22px; font-weight: 700; color: var(--ink); }
.meter.inline { width: 96px; height: 8px; }
.dl.compact { grid-template-columns: minmax(0, 1fr) auto; }
.dl.compact dd { text-align: right; }
.role-group { padding: 10px 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--line); }
.role-group:first-child { border-top: 0; border-radius: var(--radius) var(--radius) 0 0; }
@media (max-width: 860px) { .bars.tall { height: 170px; gap: 3px; } .bars.tall .bar em { display: none; } .bars.tall .bar span { font-size: 10px; } }

/* carte mise en avant (prochaine leçon de l'élève), à la manière de l'accent plein */
.card.hero { background: var(--gradient); border-color: transparent; color: #fff; box-shadow: var(--shadow-accent); }
.card.hero h2, .card.hero .muted, .card.hero .label { color: #fff; }
.card.hero .muted, .card.hero .label { opacity: .88; }
.card.hero .date-chip { background: var(--surface); border-color: transparent; }
.card.hero .ico { color: #fff; }

/* ------------------------------------------------------------------ véhicules / carte */
.fleet { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.map { position: relative; height: 580px; overflow: hidden; border-radius: var(--radius); background: var(--map-bg); background-image: linear-gradient(var(--hatch-a) 1px, transparent 1px), linear-gradient(90deg, var(--hatch-a) 1px, transparent 1px); background-size: 48px 48px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; outline-offset: -3px; }
.map.dragging { cursor: grabbing; }
.map-tiles, .map-markers { position: absolute; inset: 0; }
.map-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.map-track { position: absolute; inset: 0; pointer-events: none; }
.map-track polyline { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.map-marker { position: absolute; left: 0; top: 0; border: 0; background: none; padding: 0; cursor: pointer; display: flex; align-items: center; gap: 6px; margin: -14px 0 0 -14px; }
.map-pin { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .35); display: grid; place-items: center; transition: transform .15s; }
.map-marker.arret .map-pin { background: var(--info); }
.map-marker.hors_ligne .map-pin, .map-marker.aucun_signal .map-pin { background: var(--faint); }
.map-marker.selected .map-pin { transform: scale(1.25); box-shadow: 0 0 0 4px var(--accent-ring), 0 2px 8px rgba(15, 23, 42, .35); }
.map-arrow { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #fff; display: block; }
.map-label { background: var(--chrome); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow-sm); }
.map-controls { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.map-btn { width: 38px; height: 38px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.map-btn:last-child { border-bottom: 0; }
.map-btn:hover { background: var(--surface-2); }
.map-btn[disabled] { color: var(--faint); cursor: default; }
.map-attrib { position: absolute; right: 0; bottom: 0; background: var(--tabbar-bg); font-size: 11px; color: var(--muted); padding: 2px 6px; border-top-left-radius: 6px; }
.map-notice { position: absolute; left: 12px; bottom: 12px; right: 120px; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--muted); box-shadow: var(--shadow-sm); }
.vehicle { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 14px 16px; border: 0; border-top: 1px solid var(--line); cursor: pointer; transition: background .12s; text-align: left; width: 100%; background: none; }
.vehicle:first-child { border-top: 0; }
.vehicle:hover { background: var(--surface-2); }
.vehicle.selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.vehicle .v-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--neutral-soft); display: grid; place-items: center; grid-row: span 3; color: var(--ink-2); }
.vehicle.en_route .v-ico { background: var(--accent-soft); color: var(--accent-text); }
.vehicle .v-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-weight: 650; color: var(--ink); }
.vehicle .v-sub { font-size: 13px; color: var(--muted); }
.plate { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 1px 6px; border: 1.5px solid var(--ink-2); border-radius: 4px; color: #0F172A; background: #fff; letter-spacing: .03em; }
.code-block { font-family: var(--mono); font-size: 12.5px; background: var(--chrome); color: #E2E8F0; border-radius: 10px; padding: 12px 14px; overflow-x: auto; white-space: pre; }
@media (max-width: 1100px) { .fleet { grid-template-columns: minmax(0, 1fr); } .map { height: 460px; } }
@media (max-width: 860px) { .map { height: 360px; } }

/* petits écrans : les groupes d'actions passent à la ligne au lieu de déborder */
.card-head { flex-wrap: wrap; }
.card-head > .row, .avail-ranges .row { flex-wrap: wrap; }

/* tablette paysage / petit portable : menu latéral réduit aux icônes pour laisser la place au contenu */
@media (min-width: 861px) and (max-width: 1200px) {
  .shell { --sidebar: 76px; }
  .sidebar { padding: 18px 10px; align-items: center; }
  .sidebar .brand { padding: 2px 0 20px; }
  .sidebar .brand > div, .nav a span, .sidebar-foot .who { display: none; }
  .nav a { justify-content: center; padding: 11px; }
  .nav-sep { width: 32px; margin: 10px auto; }
  .sidebar-foot { flex-direction: column; padding: 12px 0 0; }
  .sidebar-foot button { margin-left: 0; }
  .topbar, .content { padding-left: 24px; padding-right: 24px; }
}

/* ------------------------------------------------------------------ ajouts : premier lancement, bandeau d'exemple, aperçus */
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-bar { display: flex; align-items: center; gap: 10px; margin: 16px 32px 0; padding: 9px 14px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: 13.5px; font-weight: 500; border: 1px solid var(--info-line); }
.demo-bar a { font-weight: 650; white-space: nowrap; color: var(--info); text-decoration: underline; text-underline-offset: 2px; }
.pdf-view { display: block; width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.pdf-view p { padding: 24px; }
.btn.danger.solid:hover { filter: brightness(1.08); }
@media (max-width: 860px) {
  .demo-bar { margin: 8px 16px 0; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.demo-bar { max-width: 1176px; }
.note.storage { display: flex; gap: 10px; align-items: flex-start; margin-top: 0; font-size: 13.5px; }
.note.storage .ico { flex: none; margin-top: 2px; }
.select.sm { height: 32px; font-size: 13px; padding: 0 30px 0 10px; width: auto; max-width: 100%; }
.demo-bar .select.sm { background-color: var(--surface); }
.auth-extra .or { margin: 28px 0 14px; }
.auth-extra .btn { min-width: 160px; }
@media (max-width: 860px) { .demo-bar { flex-wrap: wrap; } .demo-bar .select.sm { order: 3; width: 100%; } }
/* logo */
.brand img.logo { width: 30px; height: 30px; border-radius: 7px; flex: none; display: block; }
.logo-full { display: block; width: 200px; max-width: 70%; height: auto; }
/* abonnement */
.billing-bar.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.billing-bar.warn a { color: var(--warn); }
.billing-bar.bad { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.support-bar { background: #EDE9FE; color: #5B21B6; border-color: #DDD6FE; }
.support-bar a { color: #5B21B6; }
:root[data-theme="dark"] .support-bar { background: rgba(124, 58, 237, .18); color: #DDD6FE; border-color: rgba(167, 139, 250, .3); }
:root[data-theme="dark"] .support-bar a { color: #DDD6FE; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .support-bar { background: rgba(124, 58, 237, .18); color: #DDD6FE; border-color: rgba(167, 139, 250, .3); } :root:not([data-theme="light"]) .support-bar a { color: #DDD6FE; } }
.billing-bar.bad a { color: var(--danger); }
.billing-status { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.billing-status .ico { flex: none; margin-top: 2px; width: 22px; height: 22px; }
.billing-status b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.billing-status p { color: var(--muted); font-size: 14px; }
.billing-status.good { background: var(--accent-soft); border-color: var(--accent-line); } .billing-status.good .ico { color: var(--accent-text); }
.billing-status.warn { background: var(--warn-soft); border-color: var(--warn-line); } .billing-status.warn .ico { color: var(--warn); }
.billing-status.bad { background: var(--danger-soft); border-color: var(--danger-line); } .billing-status.bad .ico { color: var(--danger); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-tag { position: absolute; top: -11px; left: 18px; background: var(--gradient); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.plan h3 { font-size: 17px; }
.plan-price b { font-size: 28px; color: var(--ink); letter-spacing: -.02em; }
.plan-price span { color: var(--muted); font-size: 13.5px; }
.small.accent { color: var(--accent-ink); font-weight: 600; }
.plan-feats { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 7px; font-size: 13.5px; flex: 1; }
.plan-feats li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feats .ico { flex: none; margin-top: 2px; color: var(--accent-text); }
.plan-feats .ico.no, .plan-feats li span.muted { color: var(--faint); }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ identité bleu / violet : états des composants */
::selection { background: rgba(124, 58, 237, .2); }
a:hover { color: var(--accent-2-text); }
:focus-visible { outline-color: var(--accent); }

/* boutons secondaires : accents violets */
.btn { transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--accent-2-soft); border-color: var(--accent-2-line); color: var(--accent-2-text); }
.btn:active { background: var(--accent-2-soft); border-color: var(--violet-light); }
.btn:focus-visible { outline: none; border-color: var(--violet-light); box-shadow: 0 0 0 3px var(--accent-2-ring); }
/* bouton principal : bleu */
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; box-shadow: var(--shadow-accent); }
.btn.primary:active { background: #1E40AF; border-color: #1E40AF; color: #fff; box-shadow: none; }
.btn.primary:focus-visible { border-color: var(--accent-hover); box-shadow: 0 0 0 3px var(--accent-ring); }
/* bouton violet plein, pour les actions secondaires mises en avant */
.btn.secondary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.secondary:hover, .btn.secondary:active { background: var(--accent-2-hover); border-color: var(--accent-2-hover); color: #fff; }
.btn.danger:hover, .btn.danger:active { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.btn.danger:focus-visible { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.btn.danger.solid:hover, .btn.danger.solid:active { color: #fff; background: var(--danger); border-color: var(--danger); filter: brightness(1.08); }
.btn.ghost:hover, .btn.ghost:active { background: var(--neutral-soft); border-color: transparent; color: var(--ink); }
.btn[disabled], .btn:disabled, .btn.primary[disabled], .btn.secondary[disabled] { background: var(--disabled-bg); border-color: var(--disabled-bg); color: var(--disabled-text); box-shadow: none; filter: none; cursor: not-allowed; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

/* champs */
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--neutral-soft); color: var(--disabled-text); border-color: var(--line); cursor: not-allowed; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--danger); }
.field.invalid .input:focus, .field.invalid .select:focus, .field.invalid .textarea:focus { box-shadow: 0 0 0 3px var(--danger-soft); }

/* sélecteurs, onglets, éléments actifs */
.segmented button.on { color: var(--accent-text); }
.segmented button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); }
.tabs a:hover { color: var(--accent-text); }
.slot:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.tabbar a.active .ico { color: var(--accent-text); }

/* touches décoratives */
.spinner { border-top-color: var(--accent); border-right-color: var(--accent-2); }
.avatar { background: var(--accent-2-soft); color: var(--accent-2-text); }
.bars .bar:focus-visible i, .bars .bar:hover i { background: var(--accent); }
.card.hero .date-chip span { background: var(--accent); }

/* ------------------------------------------------------------------ animation d'entrée */
.intro { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--chrome); overflow: hidden; cursor: pointer; transition: opacity .45s var(--ease), visibility .45s; }
.intro.out { opacity: 0; visibility: hidden; }
.intro-glow { position: absolute; inset: -20%; background: radial-gradient(40% 35% at 35% 40%, rgba(37, 99, 235, .45), transparent 70%), radial-gradient(35% 30% at 65% 60%, rgba(124, 58, 237, .35), transparent 70%); animation: introGlow 1.4s var(--ease) both; }
.intro-mark { position: relative; display: grid; justify-items: center; gap: 22px; animation: introMark .7s var(--ease) both; }
.intro-mark .logo-full { width: 220px; max-width: 60vw; }
.intro-bar { width: 140px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.intro-bar i { display: block; height: 100%; width: 100%; background: var(--gradient); transform-origin: left; animation: introBar 1.05s .15s var(--ease) both; }
.intro.out .intro-mark { transform: scale(1.04); transition: transform .45s var(--ease); }
@keyframes introGlow { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
@keyframes introMark { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes introBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* apparition en douceur de la page, juste après l'intro (ou au premier affichage) */
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.entered .auth-side > *, .entered .auth-card > *, .entered .content > *, .entered .sidebar .nav a { animation: riseIn .55s var(--ease) both; }
.entered .auth-side > *:nth-child(2), .entered .auth-card > *:nth-child(2), .entered .content > *:nth-child(2) { animation-delay: .07s; }
.entered .auth-side > *:nth-child(3), .entered .auth-card > *:nth-child(3), .entered .content > *:nth-child(3) { animation-delay: .14s; }
.entered .auth-card > *:nth-child(n+4), .entered .content > *:nth-child(n+4) { animation-delay: .2s; }
.entered .sidebar .nav a { animation-name: fadeIn; animation-duration: .5s; }
.entered .sidebar .nav a:nth-child(n+3) { animation-delay: .06s; }
.entered .sidebar .nav a:nth-child(n+6) { animation-delay: .12s; }
.entered .sidebar .nav a:nth-child(n+9) { animation-delay: .18s; }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } }
.field .check { align-items: flex-start; font-weight: 450; line-height: 1.5; }
.field .check input { flex: none; margin-top: 2px; }
.field.invalid .check { color: var(--danger); }
.auth-legal { margin-top: 28px; text-align: center; }
.auth-legal a { color: var(--muted); }
.auth-side > a { display: inline-block; }
/* espace propriétaire */
.owner-table td .sub { color: var(--muted); font-size: 12.5px; }
.owner-warn { display: grid; gap: 8px; }

/* ------------------------------------------------------------------ finition « premium » : typographie et sobriété */
body { font-feature-settings: "kern", "liga", "calt", "lnum"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; letter-spacing: -.003em; }
h1, h2, h3, .kpi .value, .brand { font-family: var(--font); }
.page-head h1, .auth-card h1, .modal-head h2 { font-stretch: var(--wide); font-weight: 700; letter-spacing: -.022em; }
.page-head h1 { font-size: 30px; }
.card-head h2 { font-weight: 650; letter-spacing: -.01em; }
.kpi .value { font-stretch: 112%; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums lining-nums; }
.kpi .label { letter-spacing: 0; }
.table td.num, .num, .money, .plan-price b { font-variant-numeric: tabular-nums lining-nums; }
.brand { font-stretch: var(--wide); letter-spacing: -.01em; }

/* menu : élément actif sobre, repère bleu fin */
.nav a.active { background: rgba(255, 255, 255, .07); box-shadow: inset 2px 0 0 var(--blue); color: #fff; }
.nav a.active .ico { color: var(--blue-light); }

/* cartes : ombre plus douce, pas de dégradé décoratif */
.card.hero { background: var(--blue); box-shadow: 0 1px 2px rgba(15, 23, 42, .1), 0 12px 32px -12px rgba(37, 99, 235, .45); }
.plan-tag { background: var(--ink); }
.bars .bar.today i { background: var(--blue); }

/* écran de connexion : panneau sobre, ligne de route en pointillés */
.auth-side { background: var(--chrome); }
.auth-side::after { display: none; }
.auth-side::before { content: ""; position: absolute; left: 48px; right: 48px; bottom: 96px; height: 3px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 28px, transparent 28px 52px); pointer-events: none; }
.auth-side h2 { font-stretch: var(--wide); font-weight: 700; letter-spacing: -.025em; }
.auth-side h2 span { color: #fff !important; }

/* animation d'entrée : logo et une ligne de route qui défile, sans halo */
.intro-glow { display: none; }
.intro-bar { width: 180px; height: 3px; background: none; border-radius: 0; }
.intro-bar i { height: 3px; background: repeating-linear-gradient(90deg, #fff 0 18px, transparent 18px 32px); opacity: .7; }
.content:focus, .content:focus-visible, main[tabindex="-1"]:focus { outline: none; }
