/* Charte Groupe Mounier — noir atelier, blanc, liseré tricolore. */
:root {
  --bleu: #0e418e;
  --bleu-vif: #2f6fd6;
  --rouge: #e70918;
  --vert: #1f9d55;
  --orange: #d97706;
  --radius: 14px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-d: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}
.theme-dark {
  --bg: #0b0b0d; --bg-2: #131317; --surface: #18181d; --surface-2: #212128; --line: #2c2c35;
  --ink: #f5f5f7; --ink-2: #b4b4bf; --ink-3: #7c7c88; --accent: #ffffff; --accent-ink: #0b0b0d;
  --field: #101014; --chip: #24242c;
  color-scheme: dark;
}
.theme-light {
  --bg: #f3f3f5; --bg-2: #ffffff; --surface: #ffffff; --surface-2: #f6f6f8; --line: #e3e3e8;
  --ink: #111114; --ink-2: #4b4b55; --ink-3: #85858f; --accent: #111114; --accent-ink: #ffffff;
  --field: #ffffff; --chip: #eeeef2;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .display { font-family: var(--font-d); font-weight: 700; letter-spacing: .01em; line-height: 1.1; margin: 0; }
h1 { font-size: 30px; } h2 { font-size: 24px; } h3 { font-size: 19px; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.small { font-size: 14px; } .xs { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.upper { text-transform: uppercase; letter-spacing: .08em; }
.hidden { display: none !important; }

/* Liseré tricolore — signature du logo */
.tricolore { display: flex; height: 3px; width: 100%; }
.tricolore i { flex: 1; } .tricolore i:nth-child(1) { background: var(--bleu-vif); } .tricolore i:nth-child(2) { background: #fff; } .tricolore i:nth-child(3) { background: var(--rouge); }
.theme-light .tricolore i:nth-child(2) { background: #d9d9de; }

/* Barre d'en-tête */
.topbar { position: sticky; top: 0; z-index: 20; background: #0b0b0d; color: #fff; }
.topbar .in { display: flex; align-items: center; gap: 12px; padding: 12px 16px; max-width: 1240px; margin: 0 auto; }
.topbar img.logo { height: 30px; width: auto; display: block; }
.topbar .role { margin-left: auto; font-family: var(--font-d); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #b4b4bf; text-align: right; }
.demo-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--rouge); color: #fff; padding: 2px 7px; border-radius: 4px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; transition: transform .08s ease, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.lg { min-height: 58px; font-size: 18px; font-family: var(--font-d); letter-spacing: .04em; text-transform: uppercase; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.soft { background: var(--surface-2); color: var(--ink); }
.btn.blue { background: var(--bleu); color: #fff; }
.btn.red { background: var(--rouge); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn svg { width: 20px; height: 20px; flex: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* Formulaires */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.input, select.input, textarea.input { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--field); font-size: 16px; outline: none; }
.input:focus { border-color: var(--bleu-vif); box-shadow: 0 0 0 3px rgba(47, 111, 214, .25); }
.input.plate { font-family: var(--font-d); font-size: 22px; letter-spacing: .12em; text-transform: uppercase; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 10px; cursor: pointer; background: var(--field); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--bleu-vif); flex: none; }
.check span { font-size: 14px; color: var(--ink-2); }
.check b { color: var(--ink); font-weight: 600; }

/* Cartes / surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.list { display: grid; gap: 0; }
.list > * { padding: 13px 0; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--chip); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: rgba(31, 157, 85, .15); color: #2fbf6f; }
.theme-light .chip.ok { color: #157a41; }
.chip.warn { background: rgba(217, 119, 6, .15); color: #f59e0b; }
.theme-light .chip.warn { color: #b45309; }
.chip.bad { background: rgba(231, 9, 24, .14); color: #ff5a64; }
.theme-light .chip.bad { color: #c00714; }
.chip.blue { background: rgba(47, 111, 214, .16); color: #6ea0f0; }
.theme-light .chip.blue { color: var(--bleu); }
.plate-tag { display: inline-flex; align-items: stretch; border: 1.5px solid #c9c9d1; border-radius: 5px; overflow: hidden; background: #fff; color: #111; font-family: var(--font-d); font-weight: 700; font-size: 15px; letter-spacing: .08em; line-height: 1; }
.plate-tag::before { content: "F"; background: #1f4ab8; color: #fff; font-size: 10px; padding: 5px 4px 0; letter-spacing: 0; }
.plate-tag span { padding: 4px 7px; }
.plate-tag::after { content: ""; width: 7px; background: #1f4ab8; }

/* Progression vers le palier */
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--bleu-vif), #8fb4f2); transition: width .8s cubic-bezier(.2, .8, .2, 1); }

/* Notifications */
.toast-wrap { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: #fff; color: #111; border-radius: 12px; padding: 13px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font-weight: 600; display: flex; gap: 10px; align-items: center; animation: tin .25s ease; border-left: 5px solid var(--vert); }
.toast.err { border-left-color: var(--rouge); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* Modale (feuille) */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--bg-2); color: var(--ink); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 22px 18px 28px; animation: up .25s cubic-bezier(.2, .8, .2, 1); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }
.sheet h2 { margin-bottom: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }

.empty { text-align: center; padding: 30px 10px; color: var(--ink-3); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
