/* Leer, feuille de style commune du prototype.
   Les couleurs de l'école se règlent dans assets/js/ecole.js (variable --accent). */

/* Polices hébergées avec le site : rien à télécharger ailleurs, utile sur une connexion faible. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/inter-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2"); }

/* ---------- Jetons ---------- */
:root {
  --accent: #0F5B4F;
  --accent-strong: color-mix(in srgb, var(--accent) 82%, #000000);
  --on-accent: #FFFFFF;

  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #12161C;
  --muted: #5A6472;
  --line: #E3E6EA;
  --soft: #F1F3F5;

  --ok: #1B7A4B;   --ok-bg: #E8F5EE;
  --warn: #8A5300; --warn-bg: #FDF3E2;
  --late: #B42318; --late-bg: #FDECEA;
  --info: #1D56C4; --info-bg: #EAF1FD;
  --danger: #B42318;

  --series-2: #7C8794;
  --series-3: #C3CAD3;
  --sun: #F5C451;
  --sparkle: #E9B949;

  --tint: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --tint2: color-mix(in srgb, var(--accent) 26%, var(--surface));
  --scrim: rgba(18, 22, 28, 0.55);

  --radius-s: 10px;
  --radius-m: 12px;
  --radius-l: 16px;
  --shadow-pop: 0 20px 50px rgba(0, 0, 0, 0.22);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1116; --surface: #161A21; --ink: #F2F4F7; --muted: #A3ACB9; --line: #2A303A; --soft: #1D222B;
    --ok: #4CC38A; --ok-bg: #14301F; --warn: #F0B35A; --warn-bg: #33260F;
    --late: #F97066; --late-bg: #3A1513; --info: #7AA7F7; --info-bg: #152443; --danger: #D92D20;
    --series-2: #6B7685; --series-3: #3A424E;
    --tint: color-mix(in srgb, var(--accent) 18%, var(--surface));
    --tint2: color-mix(in srgb, var(--accent) 34%, var(--surface));
    --scrim: rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1116; --surface: #161A21; --ink: #F2F4F7; --muted: #A3ACB9; --line: #2A303A; --soft: #1D222B;
  --ok: #4CC38A; --ok-bg: #14301F; --warn: #F0B35A; --warn-bg: #33260F;
  --late: #F97066; --late-bg: #3A1513; --info: #7AA7F7; --info-bg: #152443; --danger: #D92D20;
  --series-2: #6B7685; --series-3: #3A424E;
  --tint: color-mix(in srgb, var(--accent) 18%, var(--surface));
  --tint2: color-mix(in srgb, var(--accent) 34%, var(--surface));
  --scrim: rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.strike { text-decoration: line-through; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Marque de l'école ---------- */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
}
.brand-mark.sm { width: 36px; height: 36px; border-radius: 9px; font-size: 14px; }
.brand-mark.inverse { background: var(--on-accent); color: var(--accent); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.brand-sub { color: var(--muted); font-size: 13px; }

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { flex: 1 1 260px; }
.topbar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Pastilles ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--soft); color: var(--muted);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-late { background: var(--late-bg); color: var(--late); }
.pill-info { background: var(--info-bg); color: var(--info); }
.count {
  display: inline-flex; min-width: 22px; justify-content: center;
  padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-m);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; font-weight: 600; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000000); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--soft); }
.btn-ghost-danger { border-color: transparent; background: transparent; color: var(--late); }
.btn-lg { min-height: 56px; font-size: 17px; border-radius: 14px; }
.btn-xl { min-height: 60px; font-size: 18px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn svg { flex: none; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.card-pad { padding: 20px; }
.card-title { font-size: 16px; font-weight: 600; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 8px; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  min-height: 44px; padding: 0 12px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.textarea { padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input-lg { min-height: 56px; font-size: 24px; font-weight: 600; padding: 0 16px; border-radius: var(--radius-m); }
.check { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.search {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px;
  border-radius: var(--radius-m); border: 2px solid var(--line); background: var(--surface);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 17px; }
.choice {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px;
  border-radius: var(--radius-s); border: 1px solid var(--line); cursor: pointer;
}
.choice:has(input:checked) { border: 2px solid var(--accent); background: var(--soft); padding: 0 13px; }

/* ---------- Groupes segmentés ---------- */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius-m); background: var(--soft); }
.segmented.full { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.segmented button {
  min-height: 40px; padding: 0 14px; border-radius: 9px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer;
}
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] {
  background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.segmented.lg button { min-height: 44px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 8px;
}
.table td { padding: 13px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table.compact td { padding-top: 11px; padding-bottom: 11px; font-size: 14px; }
.table tr.is-muted td { color: var(--muted); }
.table .sub { display: block; font-size: 13px; color: var(--muted); }

/* ---------- Mise en page avec menu latéral ---------- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side-nav {
  flex: 1 1 220px; max-width: 260px; min-width: 0;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.side-nav .brand { padding: 0 8px 20px; }
.side-nav .brand-name { font-size: 14px; }
.nav-link {
  min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px; border-radius: var(--radius-s); color: var(--muted); text-decoration: none;
}
.nav-link:hover { background: var(--soft); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--soft); color: var(--ink); font-weight: 600; }
.side-nav .spacer { flex: 1; }
.side-nav .who { padding: 8px 12px; font-size: 13px; color: var(--muted); }
.content { flex: 999 1 640px; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }

@media (max-width: 720px) {
  .side-nav { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .side-nav .brand { flex-basis: 100%; padding: 0 4px 8px; }
  .side-nav .spacer, .side-nav .who { display: none; }
  .content { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
}

/* ---------- Indicateurs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big-amount { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }

.bar-split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }

.rates { display: grid; grid-template-columns: 64px 1fr 48px; gap: 12px; align-items: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.rate-track { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.rate-fill { height: 100%; border-radius: 5px; background: var(--accent); }
.rate-fill.low { background: var(--late); }
.rate-fill.mid { background: var(--warn); }

/* ---------- Bandeaux ---------- */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-m); }
.banner-ok { background: var(--ok-bg); color: var(--ok); }
.banner-warn { background: var(--warn-bg); color: var(--warn); }
.banner-late { background: var(--late-bg); color: var(--late); }
.banner-info { background: var(--info-bg); color: var(--info); }
.note { padding: 12px 14px; border-radius: var(--radius-s); background: var(--soft); color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- États vides et illustrations ---------- */
.illu { width: 100%; height: auto; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 24px 16px 32px; }
.empty .illu { max-width: 300px; }
.empty h2 { font-size: 22px; font-weight: 700; }
.empty ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }

/* ---------- Guichet ---------- */
.guichet { display: flex; flex-wrap: wrap; gap: 20px; padding: 20px 24px; align-items: flex-start; }
.col-search { flex: 1 1 300px; max-width: 380px; min-width: 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.col-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-side { flex: 1 1 340px; max-width: 420px; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
@media (max-width: 900px) { .col-search, .col-side { max-width: none; } .col-side { position: static; } }
.result {
  width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--radius-m);
  border: 1px solid transparent; background: transparent; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.result:hover { background: var(--soft); }
.result[aria-current="true"] { border-color: var(--accent); background: var(--soft); }
.result-name { font-weight: 600; display: block; }
.result-meta { font-size: 13px; color: var(--muted); display: block; }
.student-head { padding: 24px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; }
.student-name { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.due-box { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.change-box { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: var(--radius-m); background: var(--ok-bg); color: var(--ok); }
.change-box.short { background: var(--warn-bg); color: var(--warn); }
.change-amount { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* Suivi en direct */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 14px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--line); background: var(--surface); color: #FFFFFF; flex: none; }
.tl-line { flex: 1; width: 2px; min-height: 28px; background: var(--line); }
.tl-body { display: flex; flex-direction: column; gap: 2px; padding-bottom: 18px; }
.timeline li.done .tl-dot { background: var(--ok); border-color: var(--ok); }
.timeline li.done .tl-line { background: var(--ok); }
.timeline li.active .tl-dot { background: var(--info); border-color: var(--info); animation: pulse 1.8s infinite; }
.timeline li.active .tl-title { color: var(--info); }
.timeline li.todo .tl-title { color: var(--muted); }
.timeline li:last-child .tl-line { display: none; }
.timeline li:last-child .tl-body { padding-bottom: 0; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--info) 45%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Bulle SMS */
.sms { padding: 12px 14px; border-radius: 16px 16px 16px 4px; background: var(--soft); font-size: 15px; line-height: 1.5; max-width: 520px; }

/* ---------- Connexion ---------- */
.login { display: flex; flex-wrap: wrap; min-height: 100vh; }
.login-side { flex: 1 1 420px; background: var(--accent); color: var(--on-accent); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-clock { font-size: 72px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.login-main { flex: 1 1 520px; padding: 48px 24px; display: flex; align-items: center; justify-content: center; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 28px; align-items: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; }
.pin-dots { display: flex; gap: 18px; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); transition: background-color 0.12s, border-color 0.12s; }
.pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.pin-dots.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.keypad button { min-height: 64px; border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--surface); font-size: 24px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.keypad button:hover { background: var(--soft); }
.keypad .key-text { border: 0; background: transparent; font-size: 15px; color: var(--muted); }
@media (max-width: 720px) { .login-side { padding: 28px 20px; } .login-clock { font-size: 48px; } }

/* ---------- Clôture ---------- */
.count-grid { display: grid; grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr); gap: 10px 16px; align-items: center; font-variant-numeric: tabular-nums; }
.count-grid .input { text-align: right; }

/* ---------- Pages parent (mobile d'abord) ---------- */
.parent { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.parent-hero { background: var(--accent); color: var(--on-accent); padding: 28px 20px 56px; display: flex; flex-direction: column; gap: 14px; }
.parent-hero h1 { font-size: 22px; font-weight: 700; line-height: 1.3; }
.parent-body { flex: 1; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.parent-body.lifted { margin-top: -36px; }
.parent-footer { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 16px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.parent-plain { padding: 24px 16px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.child-line { display: flex; align-items: center; gap: 12px; min-height: 48px; border-top: 1px solid var(--line); cursor: pointer; }
.powered { font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Dialogues ---------- */
dialog {
  border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink);
  width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: var(--scrim); }
.dialog-body { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
fieldset { margin: 0; padding: 0; border: 0; }

/* ---------- Notifications ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(480px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius-m); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-pop); font-weight: 500; animation: toast-in 0.2s ease-out; }
.toast.ok svg { color: #4CC38A; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Bouton de thème ---------- */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Pages de marque Leer ---------- */
.leer-dark { background: #10151C; color: #F2F4F7; }
.leer-dark .muted { color: #A3ACB9; }
.leer-word { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.cover { min-height: 100vh; padding: 48px 64px; display: flex; flex-direction: column; gap: 48px; }
.cover-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; flex: 1; }
.cover h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.cover-lead { font-size: 20px; line-height: 1.5; color: #C9D0D9; max-width: 560px; }
.kicker { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sun); }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.value { border: 1px solid #2A303A; border-radius: var(--radius-l); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.value-n { font-size: 13px; font-weight: 700; color: var(--sun); }
.value-t { font-size: 18px; font-weight: 600; }
.value-d { font-size: 15px; line-height: 1.5; color: #A3ACB9; }
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.screen-link { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius-m); border: 1px solid #2A303A; color: #F2F4F7; text-decoration: none; }
.screen-link:hover { border-color: var(--sun); }
.screen-link span:last-child { font-size: 13px; color: #A3ACB9; }
@media (max-width: 720px) { .cover { padding: 28px 20px; gap: 32px; } }

.illu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.illu-card { margin: 0; padding: 16px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.illu-card figcaption { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Reçu thermique ---------- */
.ticket-page { background: var(--soft); min-height: 100vh; padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ticket { width: 302px; background: #FFFFFF; color: #000000; font-family: var(--mono); font-size: 12px; line-height: 1.45; padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.ticket .t-row { display: flex; justify-content: space-between; gap: 8px; }
.ticket .t-cut { border-top: 1px dashed #000000; }
.ticket .t-rule { border-top: 1px solid #000000; }
.ticket .t-total { font-weight: 700; font-size: 15px; }
.ticket .t-mark { width: 44px; height: 44px; border-radius: 10px; background: #000000; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.qr { display: grid; grid-template-columns: repeat(21, 4px); grid-auto-rows: 4px; padding: 6px; border: 1px solid #000000; }
.qr i { display: block; width: 4px; height: 4px; }
.qr i.on { background: #000000; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  .ticket-page { background: #FFFFFF; padding: 0; }
  .ticket { box-shadow: none; width: 80mm; }
  .no-print { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Ajustements après relecture ---------- */
.table th.right, .table td.right { text-align: right; }
.row-between > span:last-child { white-space: nowrap; }
.row-between > span:first-child { min-width: 0; }
.quick .btn { white-space: nowrap; padding: 0 8px; }
.result-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count-grid { max-width: 680px; }
.nav-link { white-space: nowrap; }
.table.nowrap td { white-space: nowrap; }

/* ---------- Moyens de paiement ---------- */
.pay-mark {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 8px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.pay-mark.sm { width: 22px; height: 22px; border-radius: 6px; }
.pay-mark.lg { width: 40px; height: 40px; border-radius: 10px; }
.pay-mark img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.pay-initials { font-size: 10px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
.pay-mark.sm .pay-initials { font-size: 8.5px; }
.pay-mark.lg .pay-initials { font-size: 12px; }
.pay-modes button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; font-size: 14px; white-space: nowrap; }
.pay-options { display: grid; gap: 8px; }
.pay-option {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 14px;
  border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.pay-option:has(input:checked) { border: 2px solid var(--accent); padding: 0 13px; }
.pay-option input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.pay-option .grow { display: flex; flex-direction: column; }
:root { --series-4: #E8A33D; --series-5: #6C8EBF; }
:root[data-theme="dark"] { --series-4: #C98A2E; --series-5: #5B7CAD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-4: #C98A2E; --series-5: #5B7CAD; } }
.segmented.full.pay-modes { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
