/* Police Inter (licence SIL Open Font License 1.1), hébergée sur le site : aucun appel à Google Fonts. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ============ Cockpit — feuille de style de l'application ============
   Identité propre au produit, indépendante de toute auto-école.
   La couleur d'accent peut être remplacée par celle de l'établissement (réglages → --accent). */
:root {
  --ink: #0f172a;
  --primary: #0f172a;
  --primary-2: #334155;
  --accent: #3b5bdb;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, #ffffff);
  --accent-strong: color-mix(in srgb, var(--accent) 80%, #000000);
  --bg: #f5f6f8;
  --surface: #ffffff;
  --soft: #eef1f5;
  --muted: #64748b;
  --line: #e3e7ed;
  --ok: #15803d;
  --ok-soft: #e7f5ec;
  --err: #b91c1c;
  --err-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fff6e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(15 23 42 / .05), 0 4px 16px rgb(15 23 42 / .06);
  --focus: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  --max: 1160px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 1rem; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--accent-strong); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
.container { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.opt { font-weight: 400; color: var(--muted); font-size: .85em; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5em; justify-content: center; padding: .75em 1.25em; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; font-size: .95rem; line-height: 1.2; transition: background .15s, border-color .15s, box-shadow .15s; font-family: inherit; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #1e293b; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: #cbd5e1; background: var(--soft); }
.btn-sm { padding: .5em .9em; font-size: .85rem; }
.btn-lg { padding: .9em 1.4em; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.logo img { width: 32px; height: 32px; flex: none; }
.logo span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo b { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo small { font-size: .75rem; font-weight: 500; color: var(--muted); }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: 1rem; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field input[type=color] { padding: 4px; height: 46px; cursor: pointer; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.field textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; color: var(--muted); }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.form-status { font-size: .925rem; min-height: 1.4em; }
.form-status.ok { color: var(--ok); background: var(--ok-soft); padding: 12px 14px; border-radius: 10px; }
.form-status.err { color: var(--err); background: var(--err-soft); padding: 12px 14px; border-radius: 10px; }
.seg { display: flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 10px; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; font-size: .875rem; padding: 7px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ============ Espace en ligne (élève / auto-école) ============ */
body.app { background: var(--bg); }
.btn-xl { padding: 1.1em 1.6em; font-size: 1.15rem; border-radius: 16px; }
.btn-danger { background: var(--err); color: #fff; }
.stack { display: grid; gap: 10px; margin-top: 12px; }

/* ---------- Connexion ---------- */
.auth-page { min-height: 100dvh; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-wrap { width: min(100% - 32px, 440px); margin: 0 auto; padding: 40px 0 32px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--ink); margin-bottom: 24px; }
.auth-brand img { width: 44px; height: 44px; }
.auth-brand span { display: flex; flex-direction: column; line-height: 1.1; }
.auth-brand b { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.auth-brand small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.auth-card { padding: 28px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: .2em; }
.auth-foot { text-align: center; margin-top: 20px; font-size: .8rem; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 88px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--bg); color: var(--ink); font: inherit; font-size: .8rem; font-weight: 600; padding: 7px 10px; border-radius: 8px; cursor: pointer; }

/* ---------- En-tête de l'application ---------- */
.app-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.app-header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.app-header .logo img { width: 32px; height: 32px; }
.app-user { display: flex; align-items: center; gap: 10px; }
.app-user-name { font-weight: 600; color: var(--primary); }
.app-main { padding-top: 24px; padding-bottom: 48px; max-width: 880px; }
.app-title { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 .2em; }
.app-sub { margin: 0 0 20px; }
.app-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.app-main .card { margin-bottom: 20px; }
.card-title { font-size: 1.15rem; margin-bottom: 14px; }
.back { display: inline-block; margin-bottom: 12px; font-weight: 600; text-decoration: none; }

/* Onglets (haut sur ordinateur, bas sur mobile) */
.app-tabs { display: flex; justify-content: center; gap: 4px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 65px; z-index: 39; }
.app-tabs a { position: relative; display: flex; align-items: center; gap: 8px; padding: 14px 18px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
.app-tabs a svg { width: 20px; height: 20px; }
.app-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge { background: var(--accent); color: #fff; font-style: normal; font-size: .7rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 99px; display: inline-grid; place-items: center; padding: 0 6px; }

/* ---------- Élève : tableau de bord ---------- */
.hours-card { display: flex; align-items: center; gap: 24px; }
.ring { --p: 0; flex: none; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--soft) 0); }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring b { font-size: 1.45rem; color: var(--primary); line-height: 1; }
.ring small { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.hours-info h2 { font-size: 1.15rem; margin-bottom: 6px; }
.hours-info p { margin: 0 0 12px; }
.mini-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-stats span { background: var(--bg); padding: 6px 12px; border-radius: 99px; font-size: .85rem; }
.mini-stats b { color: var(--primary); }
.app-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.info-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.tile small { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 4px; }
.tile b { color: var(--primary); font-size: .98rem; }
.tile b.ok { color: var(--ok); }

.comp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.comp { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.comp p { margin: 0 0 6px; font-size: .92rem; line-height: 1.35; }
.comp-num { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.comp-bar { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.comp-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; }
.comp-cours .comp-bar i { width: 50%; background: #d97706; }
.comp-acquis .comp-bar i { width: 100%; background: var(--ok); }
.comp-acquis .comp-num { background: var(--ok-soft); color: var(--ok); }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--soft); color: var(--primary-2); white-space: nowrap; }
.badge-non { background: var(--soft); color: var(--muted); }
.badge-cours { background: var(--warn-soft); color: #7a5300; }
.badge-acquis { background: var(--ok-soft); color: var(--ok); }
.badge-type { background: var(--ink); color: #fff; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 18px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--accent); }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-head strong { color: var(--primary); }
.timeline p { margin: 4px 0 0; }
.timeline blockquote { margin: 8px 0 0; padding: 10px 14px; background: var(--bg); border-radius: 10px; border-left: 3px solid var(--accent); font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); }
.icon-del { margin-left: auto; border: 0; background: none; cursor: pointer; font-size: 1rem; opacity: .55; padding: 6px; border-radius: 8px; }
.icon-del:hover { opacity: 1; background: var(--err-soft); }

/* ---------- Auto-école : listes ---------- */
.search-row { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.eleve-list > li, .demande-list > li { min-width: 0; }
.search-row input[type=search] { flex: 1 1 200px; min-width: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; font-size: 1rem; }
.search-row input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.eleve-list, .demande-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.eleve-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
a.eleve-row:hover { border-color: #cbd5e1; box-shadow: var(--shadow); }
.eleve-row.inactive { opacity: .55; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-weight: 700; font-size: .95rem; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.2rem; }
.er-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.er-main b { color: var(--primary); }
.er-main small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.er-hours { text-align: right; flex: none; }
.er-hours b { display: block; color: var(--primary); }
.er-hours small { color: var(--muted); font-size: .78rem; }
.bar { display: block; height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.bar-lg { height: 10px; margin-top: 10px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; background: #fff; border-radius: 14px; border: 1px dashed var(--line); }

/* Fiche élève */
.fiche-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.fiche-contact { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: .95rem; }
#valider { margin-bottom: 20px; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.hours-line { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hours-line b { color: var(--primary); font-size: 1.2rem; }
.warn { color: var(--warn); font-weight: 600; }
.comp-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.comp-edit p { margin: 0 0 8px; font-size: .92rem; line-height: 1.35; }
.comp-edit b { color: var(--primary); }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--soft); padding: 4px; border-radius: 12px; }
.seg3 button { border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 600; padding: 10px 6px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.seg3 button[aria-pressed="true"].lvl-non { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg3 button[aria-pressed="true"].lvl-cours { background: #d97706; color: #fff; }
.seg3 button[aria-pressed="true"].lvl-acquis { background: var(--ok); color: #fff; }
.fold summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "+"; font-size: 1.5rem; color: var(--primary); line-height: 1; }
.fold[open] summary::after { content: "–"; }
.fold summary .card-title { margin: 0; }
.fold[open] summary { margin-bottom: 16px; }

/* Demandes */
.demande { padding: 18px; margin: 0 !important; }
.demande.done { opacity: .6; }
.dm-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.demande h3 { margin: 0 0 4px; font-size: 1.1rem; }
.dm-detail { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0; font-size: .92rem; }
.dm-detail dt { color: var(--muted); }
.dm-detail dd { margin: 0; }

/* ---------- Fenêtres ---------- */
.app-dialog { border: 0; border-radius: 20px; padding: 28px; width: min(100% - 32px, 520px); max-height: calc(100dvh - 48px); overflow-y: auto; box-shadow: 0 30px 80px rgb(0 0 0 / .3); }
.app-dialog::backdrop { background: rgb(15 23 42 / .5); backdrop-filter: blur(2px); }
.app-dialog h2 { font-size: 1.35rem; padding-right: 36px; }
.dlg-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg); font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--primary); }
.dlg-msg { font-size: 1.05rem; margin: 8px 36px 20px 0; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.app-dialog fieldset { border: 0; padding: 0; margin: 0; }
.app-dialog legend { font-weight: 600; font-size: .9rem; margin-bottom: 8px; padding: 0; }
.seg-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-choice input, .chip-choice input { position: absolute; opacity: 0; pointer-events: none; }
.seg-choice span { display: block; text-align: center; padding: 14px 8px; border: 2px solid var(--line); border-radius: 12px; font-weight: 700; color: var(--primary); cursor: pointer; font-size: 1.05rem; }
.seg-choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-choice span { display: inline-block; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 99px; font-size: .88rem; font-weight: 600; color: var(--primary); cursor: pointer; }
.chip-choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg-choice input:focus-visible + span, .chip-choice input:focus-visible + span { outline: none; box-shadow: var(--focus); }
.small-details summary { cursor: pointer; font-size: .9rem; color: var(--accent-strong); }
.creds { background: var(--bg); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.creds dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.creds dt { color: var(--muted); font-size: .9rem; }
.creds dd { margin: 0; font-weight: 600; word-break: break-all; }
.creds .pw { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; color: var(--accent); }

/* Notifications */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 100; transition: opacity .25s, transform .25s; box-shadow: 0 10px 30px rgb(0 0 0 / .25); max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-err { background: var(--err); }

/* ---------- Planning, paiements, dossier (25/09/2026) ---------- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head .card-title { margin: 0; }
.card-head .btn { white-space: nowrap; flex: none; }
.card-warn { border: 1.5px solid #f3c77a; background: var(--warn-soft); }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-strong); text-decoration: underline; cursor: pointer; }
.select-sm { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: .9rem; background: #fff; max-width: 55%; }
.badge-abs { background: var(--err-soft); color: var(--err); }

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin-bottom: 16px; }
.week-nav > div { text-align: center; display: flex; flex-direction: column; }
.week-nav b { color: var(--primary); }
.week-nav small { color: var(--muted); font-size: .8rem; }
.week-nav .btn { min-width: 44px; font-size: 1.1rem; }
.day { margin-bottom: 18px; }
.day-title { font-size: 1rem; margin: 0 0 8px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.day.past .day-title { color: var(--muted); }
.day-empty { margin: 0; padding: 10px 14px; color: var(--muted); font-size: .88rem; background: #fff; border: 1px dashed var(--line); border-radius: 12px; }

.rdv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rdv { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 14px; }
.card .rdv { background: var(--bg); border-color: transparent; border-left-color: var(--accent); }
.rdv-faite { border-left-color: var(--ok); opacity: .75; }
.rdv-absent { border-left-color: var(--err); opacity: .75; }
.rdv-time { flex: none; width: 52px; display: flex; flex-direction: column; }
.rdv-time b { color: var(--primary); font-size: 1.05rem; }
.rdv-time small { color: var(--muted); font-size: .8rem; }
.rdv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rdv-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rdv-who a { text-decoration: none; color: var(--primary); }
.rdv-main > small { color: var(--muted); font-size: .85rem; }
.rdv-main .rdv-note { color: var(--ink); font-style: italic; }
.rdv-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.money-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.money-line > div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.money-line small { display: block; color: var(--muted); font-size: .78rem; }
.money-line b { color: var(--primary); font-size: 1.05rem; }
.money-line b.ok { color: var(--ok); }
.money-line b.warn { color: var(--warn); }
.pay-list { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); }
.pay-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pay-list li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-list b { color: var(--primary); }
.pay-list small { color: var(--muted); font-size: .82rem; }

.doc-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.doc-check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--bg); border-radius: 12px; cursor: pointer; }
.doc-check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--ok); }
.doc-check span, .doc-item span { display: flex; flex-direction: column; }
.doc-check b, .doc-item b { font-size: .95rem; color: var(--ink); }
.doc-check small, .doc-item small { color: var(--muted); font-size: .82rem; }
.doc-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--bg); border-radius: 12px; }
.doc-item i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .8rem; background: var(--warn-soft); color: #7a5300; }
.doc-item.ok i { background: var(--ok-soft); color: var(--ok); }
.doc-item { align-items: center; }
.doc-item > span { flex: 1; min-width: 0; }
.doc-item .btn { flex: none; }
.doc-item.wait i { background: var(--accent-soft); color: var(--accent-strong); }
.doc-item.ko i { background: var(--err-soft); color: var(--err); }
.doc-item.ko small { color: var(--err); }
.piece-envoi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0 30px; font-size: .82rem; }
.piece-envoi .badge { font-size: .72rem; }
.piece-apercu { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 10px; }
.inline-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.inline-form > div { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; }

/* Élève : prochaine leçon mise en avant */
.next-lesson { background: linear-gradient(135deg, var(--ink), #1e293b); color: #fff; border: 0; }
.next-lesson .card-title { color: #fff; }
.next-lesson .nl-date { font-size: 1.25rem; font-weight: 800; margin: 0; }
.next-lesson p { margin: 4px 0 0; color: #cbd5e1; }
.next-lesson .rdv-note { color: #fff; font-style: italic; }
.upcoming { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid rgb(255 255 255 / .2); display: grid; gap: 6px; font-size: .92rem; color: #cbd5e1; }
.next-lesson .small a { color: #fff; }

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  .app-header-inner { height: 58px; }
  .app-header .logo small { display: none; }
  .app-user-name { display: none; }
  .app-main { padding-top: 18px; }
  .app-staff .app-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .app-tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 50; justify-content: space-around; border-top: 1px solid var(--line); border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px rgb(16 24 40 / .08); }
  .app-tabs a { flex-direction: column; gap: 3px; padding: 9px 4px 8px; font-size: .72rem; border-bottom: 0; border-top: 3px solid transparent; flex: 1; }
  .app-tabs a.active { border-top-color: var(--accent); }
  .app-tabs a svg { width: 22px; height: 22px; }
  .tab-badge { position: absolute; top: 4px; left: calc(50% + 6px); }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }

  .hours-card { flex-direction: column; text-align: center; gap: 16px; }
  .mini-stats { justify-content: center; }
  .app-actions { grid-template-columns: 1fr; }
  .info-tiles { grid-template-columns: 1fr 1fr; }
  .info-tiles .tile:last-child { grid-column: span 2; }
  .comp { grid-template-columns: auto 1fr; }
  .comp .badge { grid-column: 2; justify-self: start; }
  .money-line b { font-size: .95rem; }
  .money-line > div { padding: 8px 10px; }

  .app-toolbar .btn { padding: .7em 1em; font-size: .9rem; }
  .eleve-row { padding: 12px; gap: 12px; }
  .avatar { width: 40px; height: 40px; }
  .eleve-row:has(.row-actions) { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-start; }

  /* Fenêtre en panneau depuis le bas */
  .app-dialog { position: fixed; inset: auto 0 0 0; width: auto; max-width: none; margin: 0; border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 92dvh; }
  .app-dialog[open] { animation: sheet .25s ease; }
  @keyframes sheet { from { transform: translateY(100%); } }
}

/* ---------- Console plateforme ---------- */
.ecole-card.is-off { opacity: .7; }
.ecole-card .info-tiles { margin: 12px 0; }
.ecole-card p.small { margin: 8px 0; }
.ecole-card code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* ---------- Élève : annonce, parcours, contact ---------- */
.annonce { background: var(--warn-soft); border: 1px solid #f3d9a4; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.annonce b { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #7a5300; }
.annonce p { margin: 4px 0 0; white-space: pre-line; }

.steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.step { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.step i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .85rem; background: var(--soft); color: var(--muted); }
.step span { display: flex; flex-direction: column; min-width: 0; }
.step b { font-size: .9rem; color: var(--primary); }
.step small { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-fait i { background: var(--ok-soft); color: var(--ok); }
.step-cours { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step-cours i { background: var(--accent); color: #fff; }
.step-todo { opacity: .7; }

.nl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.upcoming li { display: flex; justify-content: space-between; gap: 10px; }
.pay-bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 12px; }
.pay-bar i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }

.school-name { font-weight: 700; color: var(--primary); margin: -6px 0 10px; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list svg { flex: none; width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.contact-list a { color: var(--primary); font-weight: 600; }
.school-sub { font-size: .95rem; margin: 18px 0 6px; }
.horaires { white-space: pre-line; margin: 0; }

/* Bouton d'appel en haut de l'espace élève */
.call-hero { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; padding: 14px 18px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); text-decoration: none; box-shadow: var(--shadow); }
.call-hero:hover { background: var(--accent-strong); }
.call-hero .call-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .18); }
.call-hero svg { width: 22px; height: 22px; }
.call-hero > span:last-child { display: flex; flex-direction: column; }
.call-hero b { font-size: 1.05rem; }
.call-hero small { opacity: .85; font-size: .85rem; }

/* Bulle de l'assistant */
.chat-bubble { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgb(15 23 42 / .28); }
.chat-bubble:hover { background: var(--accent-strong); }
.chat-bubble:focus-visible { outline: none; box-shadow: var(--focus), 0 8px 24px rgb(15 23 42 / .28); }
body.has-bubble .app-main { padding-bottom: 96px; }

/* ---------- Assistant (chatbot) ---------- */
.fold-set { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; display: grid; gap: 14px; }
.fold-set legend { font-weight: 700; color: var(--primary); padding: 0 6px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-strong); text-decoration: underline; cursor: pointer; }

.assistant-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; cursor: pointer; padding: 18px 20px; }
.assistant-card > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.assistant-card b { color: var(--primary); font-size: 1.05rem; }
.assistant-card small { color: var(--muted); font-size: .88rem; }
.assistant-card > i { font-style: normal; font-size: 1.6rem; color: var(--muted); }
.chat-avatar { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 1.1rem; }

.app-dialog.dlg-chat { width: min(100% - 16px, 560px); height: min(100dvh - 16px, 760px); max-height: calc(100dvh - 16px); padding: 0; overflow: hidden; }
.chat { display: flex; flex-direction: column; height: 100%; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 64px 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head h2 { font-size: 1rem; margin: 0; }
.chat-head small { color: var(--muted); font-size: .78rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: .95rem; line-height: 1.45; overflow-wrap: anywhere; }
.msg-assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg-err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.msg-wait { display: flex; gap: 4px; }
.msg-wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: chat-dot 1s infinite ease-in-out; }
.msg-wait i:nth-child(2) { animation-delay: .15s; }
.msg-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px; background: var(--bg); }
.chat-sugg:not(:empty) { padding-bottom: 12px; }
.chip-btn { font: inherit; font-size: .82rem; font-weight: 600; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--accent); background: #fff; color: var(--accent-strong); cursor: pointer; text-align: left; }
.chat-form { display: flex; gap: 8px; padding: 12px 14px 4px; border-top: 1px solid var(--line); background: #fff; }
.chat-form textarea { flex: 1; resize: none; font: inherit; font-size: 1rem; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; max-height: 120px; }
.chat-form textarea:focus { outline: none; border-color: var(--accent); }
.chat-form .btn { padding: 0 16px; }
.chat-foot { margin: 0; padding: 4px 16px calc(10px + env(safe-area-inset-bottom)); font-size: .72rem; color: var(--muted); background: #fff; }

/* ---------- Tableau de bord du gérant ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--accent); }
.kpi small { color: var(--muted); font-size: .78rem; font-weight: 600; }
.kpi b { font-size: 1.5rem; color: var(--primary); line-height: 1.2; }
.kpi span { color: var(--muted); font-size: .8rem; }
.kpi-warn { border-color: #f3d9a4; background: var(--warn-soft); }
.alerte { display: block; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); color: #7a5300; text-decoration: none; }
.bord-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.bord-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bord-list li { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.bord-list li a { color: var(--primary); text-decoration: none; }
.bord-list li span { color: var(--muted); text-align: right; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto auto; gap: 10px; align-items: center; font-size: .9rem; }
.bars .bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.bars small { color: var(--muted); }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; } .bars li { grid-template-columns: 1fr auto; } .bars .bar, .bars small { display: none; } }

/* ---------- Installation de l'application ---------- */
.install-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 52px 16px 16px; }
.install-card img { border-radius: 12px; flex: none; }
.install-card div { flex: 1; display: flex; flex-direction: column; }
.install-card b { color: var(--primary); }
.install-card small { color: var(--muted); font-size: .85rem; }
.install-close { top: 50%; right: 10px; transform: translateY(-50%); width: 32px; height: 32px; font-size: 1.2rem; }

/* ---------- Disponibilités et réservation en ligne ---------- */
.dispo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 8px; }
.dispo-chips .chip { background: var(--ok-soft); color: var(--ok); }
.dispo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.dispo-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg); border-radius: 10px; font-size: .9rem; }
.resa-jours { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.resa-jours button { flex: none; font: inherit; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 12px; cursor: pointer; text-align: center; color: var(--primary); }
.resa-jours button small { display: block; color: var(--muted); font-size: .72rem; }
.resa-jours button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.resa-creneaux { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.resa-creneaux button { font: inherit; padding: 12px 8px; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; cursor: pointer; color: var(--primary); font-weight: 700; }
.resa-creneaux button small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.resa-creneaux button:hover { border-color: var(--accent); }
.upcoming .annuler { color: #fecaca; background: none; border: 0; font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; padding: 0; }

/* Journal des modifications (Compte du gérant) */
.journal-liste { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.journal-liste li { padding: 8px 0; border-top: 1px solid var(--line, #e2e8f0); overflow-wrap: anywhere; }
.journal-liste li:first-child { border-top: 0; }
.annonce .btn { margin-top: 8px; }
