:root {
  --bg: #e8edf3;
  --surface: #ffffff;
  --ink: #16202b;
  --muted: #566475;
  --line: #d2dae4;
  --accent: #1c4f8a;
  --accent-ink: #ffffff;

  --paid: #17693f;     --paid-bg: #dbf1e3;
  --due: #7c5200;      --due-bg: #ffefc2;
  --late: #9f1f19;     --late-bg: #fddfdc;
  --unknown: #52407f;  --unknown-bg: #e9e4f6;
  --session: #1c4f8a;  --session-bg: #e3edf9;
  --none-bg: #f3f5f8;

  /* Couleurs du bandeau et du menu : par défaut celles de la page ; Réglages → Couleurs de l'interface les remplace (voir /theme.css) */
  --top-bg: var(--surface); --top-ink: var(--ink); --top-muted: var(--muted); --top-err: var(--late);
  --tabs-bg: var(--surface); --tabs-ink: var(--ink); --tabs-muted: var(--muted); --tabs-line: var(--line); --tabs-active: var(--accent);

  --radius: 6px;
  font-family: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); line-height: 1.4; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
small { font-size: 0.8rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid #f5a623; outline-offset: 2px; }

/* ── En-tête ── */
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.6rem 2rem; align-items: start; padding: 0.9rem 1.5rem 0.8rem; background: var(--top-bg); color: var(--top-ink); border-bottom: 1px solid var(--line); }
.top .muted, .top h1 .ver, .top .account small { color: var(--top-muted); }
.top select, .top button.secondary { color: var(--ink); } /* champs et boutons clairs : leur texte reste foncé, même sur un bandeau foncé */
.top-left { display: grid; justify-items: start; align-content: start; text-align: left; gap: 0.15rem; }
.top-left h1 { font-size: 1.6rem; line-height: 1.15; margin: 0; }
.top-left h1 .ver { font-size: 0.75rem; font-weight: 500; white-space: nowrap; }
.top-left .subtitle { margin: 0; font-size: 1rem; color: var(--top-ink); }
.top-center { display: grid; justify-items: center; align-content: start; text-align: center; gap: 0.3rem; }
.top-center .muted { margin: 0; font-size: 0.9rem; }
.logo { display: block; height: 5.8rem; width: auto; max-width: 100%; object-fit: contain; }
.season { margin-top: 0.7rem; }
.season select { font-size: 0.95rem; font-weight: 500; padding: 0.25rem 0.55rem; border-color: var(--line); }
.help-link { margin: 0.4rem 0 0; }
.help-link a.btn { font-size: 0.8rem; padding: 0.2rem 0.6rem; }
@media print { .help-link { display: none !important; } }
.top-right { display: grid; justify-items: end; gap: 1.6rem; }
.sync { display: grid; justify-items: end; gap: 0.35rem; text-align: right; }
.sync .muted { font-size: 0.85rem; max-width: 22rem; }
.sync .err { color: var(--top-err); }
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr; justify-items: center; }
  .top-center { order: -1; } /* sur téléphone, le logo passe en premier */
  .top-left { justify-items: center; text-align: center; }
  .top-right { gap: 1rem; }
  .top-right, .sync { justify-items: center; text-align: center; }
}
@media print { .top { display: none !important; } .print-logo { height: 3.2rem; width: auto; display: block; margin-bottom: 0.4rem; } }

.tabs { display: flex; gap: 0.25rem; padding: 0 1.5rem; background: var(--tabs-bg); border-bottom: 1px solid var(--tabs-line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 0.7rem 0.9rem; font: inherit; color: var(--tabs-muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--tabs-ink); font-weight: 650; border-bottom-color: var(--tabs-active); }
.tabs .badge { display: inline-block; min-width: 1.35rem; padding: 0 0.4rem; margin-left: 0.3rem; border-radius: 99px; background: var(--late); color: #fff; font-size: 0.75rem; text-align: center; }

main { padding: 1.2rem 1.5rem 3rem; max-width: 1500px; margin: 0 auto; }
main:focus { outline: none; }

/* ── Boutons et champs ── */
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.btn, button.primary, button.secondary { border-radius: var(--radius); padding: 0.45rem 0.85rem; border: 1px solid var(--line); background: var(--surface); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.secondary:hover, .btn:hover { background: var(--none-bg); }
a.btn { display: inline-block; color: inherit; text-decoration: none; cursor: pointer; }
button.primary:hover { filter: brightness(1.12); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button[aria-busy="true"]:disabled { cursor: progress; } /* le sablier seulement pendant une action en cours */
button.danger { color: var(--late); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: transparent; }
button.link:hover { text-decoration-color: currentColor; }
input, select, textarea { border: 1px solid #b7c2cf; border-radius: var(--radius); padding: 0.4rem 0.55rem; background: #fff; width: 100%; }
input[type="checkbox"] { width: auto; }
textarea { min-height: 5rem; resize: vertical; }

/* ── Synthèse ── */
.band { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.panel h3 { margin-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.panel h3 span { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.meter { display: flex; height: 0.85rem; border-radius: 3px; overflow: hidden; background: var(--none-bg); gap: 2px; }
.meter i { display: block; min-width: 4px; }
.meter .paid { background: var(--paid); } .meter .due { background: #d9a10f; } .meter .late { background: var(--late); }
.meter .unknown { background: #7b66b3; } .meter .exempt { background: #aab4c0; } .meter .session { background: #5b8ac4; } .meter .trial { background: #c5cedb; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; padding: 0; margin: 0.55rem 0 0; font-size: 0.88rem; }
.legend li::before { content: ""; display: inline-block; width: 0.6rem; height: 0.6rem; margin-right: 0.35rem; border-radius: 2px; background: var(--c, #aab4c0); }
.legend .paid { --c: var(--paid); } .legend .due { --c: #d9a10f; } .legend .late { --c: var(--late); }
.legend .unknown { --c: #7b66b3; } .legend .exempt { --c: #aab4c0; } .legend .session { --c: #5b8ac4; } .legend .trial { --c: #c5cedb; }
.money-total { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.money-projected { font-size: 0.85rem; margin: 0.15rem 0 0; }
.money-origin-title { font-size: 0.78rem; margin: 0.7rem 0 0; text-transform: uppercase; letter-spacing: 0.02em; }
.money-lines { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.88rem; display: grid; gap: 0.1rem; }
.money-lines li { display: flex; justify-content: space-between; gap: 1rem; }

.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.notice.warn { background: var(--due-bg); border-color: #e2bd63; color: #4d3400; }
.notice.bad { background: var(--late-bg); border-color: #e59a94; color: #6d1410; }
.notice p { flex: 1 1 18rem; }

/* ── Barre d'outils ── */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin-bottom: 0.8rem; }
.toolbar .grow { flex: 1 1 14rem; min-width: 10rem; }
.toolbar label { display: grid; gap: 2px; font-size: 0.8rem; color: var(--muted); }
.toolbar select, .toolbar input { width: auto; min-width: 9rem; }
.toolbar .grow input { width: 100%; }
.actionbar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0 0 1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); } /* trait de séparation avec les cartes de synthèse au-dessus ; alignée à gauche, au-dessus de la colonne « Participant » */
.actionbar-right { display: flex; gap: 0.5rem; margin-left: auto; }
.fq-inline { flex: 1 1 12rem; min-width: 9rem; max-width: 18rem; }
.filter-pop { position: relative; }
.filter-pop-panel { position: absolute; z-index: 30; top: calc(100% + 0.4rem); left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 22px rgba(20, 30, 45, 0.16); padding: 0.9rem; display: grid; gap: 0.6rem; min-width: 15rem; max-width: min(22rem, calc(100vw - 2rem)); }
.filter-pop-panel label { display: grid; gap: 2px; font-size: 0.8rem; color: var(--muted); }
.filter-pop-panel select { width: 100%; }
.opt-title { margin: 0.4rem 0 0.1rem; font-size: 0.8rem; color: var(--muted); }
.opt-list { display: grid; gap: 2px; max-height: 15rem; overflow-y: auto; }
.opt-list .opt { all: unset; box-sizing: border-box; width: 100%; padding: 0.3rem 0.45rem; border-radius: 4px; cursor: pointer; font-size: 0.92rem; }
.opt-list .opt:hover { background: var(--none-bg); }
.opt-list .opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.opt-list .opt.opt-on { background: var(--th-bg); font-weight: 700; }
.toggle-btn { position: relative; }
.toggle-btn.toggle-on { background: var(--th-bg); border-color: var(--accent); font-weight: 700; }
.filter-pop-panel hr { width: 100%; border: none; border-top: 1px solid var(--line); margin: 0.1rem 0; }
.filter-pop-panel > button { width: 100%; text-align: left; }
@media (max-width: 640px) { .filter-pop-panel { left: auto; right: 0; } }

/* ── Registre (tableau) ── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 0.5rem 0.7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
/* En-têtes de colonnes : fond teinté de la couleur principale, texte gras, trait marqué : elles ressortent dans toutes les tables */
:root { --th-bg: #dbe6f3; }
@supports (background: color-mix(in srgb, red 10%, white)) { :root { --th-bg: color-mix(in srgb, var(--accent) 17%, #ffffff); } }
thead th { position: sticky; top: 0; background: var(--th-bg); color: var(--ink); font-weight: 700; font-size: 0.9rem; z-index: 1; white-space: nowrap; border-bottom: 3px solid var(--accent); }
thead th small { display: block; font-weight: 400; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td.who { min-width: 12rem; }
td.who small, td.cell small { display: block; color: inherit; opacity: 0.85; }
td.who small { color: var(--muted); opacity: 1; }
td.cell { min-width: 9.5rem; font-weight: 600; }
td.cell small { font-weight: 400; }
td.cell.paid, td.cell.uptodate { background: var(--paid-bg); color: var(--paid); }
td.cell.due { background: var(--due-bg); color: var(--due); }
td.cell.late { background: var(--late-bg); color: var(--late); box-shadow: inset 4px 0 0 var(--late); }
td.cell.unknown { background: var(--unknown-bg); color: var(--unknown); }
td.cell.session { background: var(--session-bg); color: var(--session); }
td.cell.trial { background: #eef1f6; color: #4a5a72; }
td.cell.exempt, td.cell.none { background: var(--none-bg); color: var(--muted); font-weight: 400; }
td.cell button.cellbtn { all: unset; display: block; width: 100%; cursor: pointer; }
td.cell button.cellbtn:hover { text-decoration: underline; }
.tag { display: inline-block; font-size: 0.75rem; padding: 0 0.4rem; border-radius: 3px; background: var(--none-bg); color: var(--muted); border: 1px solid var(--line); margin-top: 0.15rem; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 0.3rem; }

.src { font-size: 0.75rem; padding: 0.05rem 0.4rem; border-radius: 3px; border: 1px solid var(--line); background: var(--none-bg); white-space: nowrap; }
.src.ha { background: #e3edf9; border-color: #b5cbea; color: #163f70; }
.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.ignored td { opacity: 0.5; text-decoration: line-through; }

/* ── Réglages ── */
.settings { display: grid; gap: 1rem; max-width: 900px; }
.settings .panel { padding: 1rem 1.2rem; }
.settings .panel > header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.settings .help { color: var(--muted); font-size: 0.86rem; margin-bottom: 0.7rem; max-width: 62ch; }
.list-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.list-row:first-of-type { border-top: 0; }
.list-row .btns { display: flex; gap: 0.4rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.7rem 1rem; }
.field { display: grid; gap: 3px; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 0.85rem; font-weight: 600; }
.field .help { margin: 0; font-size: 0.8rem; color: var(--muted); }
.field.check label { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; }

/* ── Fenêtres ── */
dialog.modal { border: 0; border-radius: 8px; padding: 0; width: min(720px, 94vw); max-height: 92vh; box-shadow: 0 20px 60px rgba(10, 20, 40, 0.35); color: var(--ink); }
dialog.modal.wide { width: min(980px, 96vw); }
dialog.modal::backdrop { background: rgba(15, 25, 40, 0.5); }
dialog.modal form { display: flex; flex-direction: column; max-height: 92vh; }
dialog.modal header { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--line); }
dialog.modal .body { padding: 1rem 1.2rem; overflow: auto; display: grid; gap: 1rem; }
dialog.modal footer { display: flex; gap: 0.6rem; justify-content: flex-end; align-items: center; padding: 0.8rem 1.2rem; border-top: 1px solid var(--line); background: #f7f9fb; }
dialog.modal footer .err { margin-right: auto; color: var(--late); font-weight: 600; font-size: 0.9rem; }
.icon { border: 0; background: none; font-size: 1.5rem; line-height: 1; padding: 0 0.3rem; color: var(--muted); }
.sub-table { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.sub-table table th { position: static; }

#toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: 0.5rem; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 0.65rem 1rem; border-radius: var(--radius); max-width: 26rem; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.toast.error { background: var(--late); }

.print-head { display: none; }

@media (max-width: 720px) {
  .top, main { padding-left: 0.9rem; padding-right: 0.9rem; }
  .tabs { padding: 0 0.5rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .meter i { transition: flex-grow 0.35s ease; }
}

/* ── Impression / PDF ── */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 10.5px; }
  .top, .tabs, .toolbar, .actionbar, .filter-chip, .notice, #toasts, .noprint { display: none !important; }
  main { padding: 0; max-width: none; }
  .print-head { display: block; margin-bottom: 8px; }
  .print-head h1 { font-size: 16px; }
  .print-head p { color: #333; }
  .print-head[data-filter]:not([data-filter=""])::after { content: "Filtre appliqué : " attr(data-filter); display: block; font-weight: 600; }
  .band { grid-template-columns: repeat(4, 1fr); margin-bottom: 8px; gap: 8px; }
  .panel, .table-wrap { border-color: #999; }
  .table-wrap { overflow: visible; border-radius: 0; }
  thead { display: table-header-group; }
  thead th { position: static; }
  tr { break-inside: avoid; }
  th, td { padding: 3px 5px; }
  td.cell { min-width: 0; }
  button.link, td.cell button.cellbtn { color: inherit; text-decoration: none; }
}

/* ── Compte connecté ── */
.account { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; flex-wrap: wrap; }
.account small { color: var(--muted); }
.account button { padding: 0.3rem 0.7rem; }
.presence { font-size: 0.85rem; max-width: 22rem; text-align: right; margin-top: -1.1rem; } /* rapproche la ligne de présence du compte, juste au-dessus */
.list-row input { min-width: 14rem; }
@media print { .account, .presence { display: none !important; } }

/* ── Page de connexion ── */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--bg, #e8edf4); padding: 1rem; }
.login-card { width: min(24rem, 100%); background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 1.8rem 1.6rem; display: grid; gap: 1rem; box-shadow: 0 6px 24px rgba(20, 40, 80, 0.08); }
.login-card form { display: grid; gap: 0.9rem; }
.login-card .field { display: grid; gap: 4px; }
.login-card input { padding: 0.55rem 0.7rem; }
.login-error { color: var(--late); font-weight: 600; font-size: 0.92rem; }
td.who small.wish { font-style: italic; color: var(--muted); }
.grp-fields { display: flex; gap: 0.5rem; flex-wrap: wrap; flex: 1 1 26rem; }
.grp-fields input { flex: 1 1 12rem; }

/* Doublons probables */
.dup-pair { border: 1px solid var(--line); border-radius: 8px; padding: 0.7rem 0.9rem; margin: 0.7rem 0; background: #fafbfd; }
.dup-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.8rem; margin: 0.4rem 0 0.6rem; }
.dup-person { display: grid; gap: 2px; padding: 0.5rem 0.7rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.dup-person small { color: var(--muted); }

/* Colonne « Abonnements et stages » : un bloc coloré par abonnement ou stage */
td.cell.merged { padding: 0; min-width: 13rem; font-weight: 400; }
td.cell.stages { min-width: 17rem; } /* les stages ont un nom long : la colonne leur laisse la place */
.part.vide { background: transparent; color: var(--muted); font-weight: 400; } /* colonne « Stages » sans stage */
.part { padding: 0.5rem 0.7rem; font-weight: 600; }
.part small { display: block; font-weight: 400; opacity: 0.85; }
.part + .part { border-top: 2px solid var(--surface); }
.part.paid, .part.uptodate { background: var(--paid-bg); color: var(--paid); }
.part.due { background: var(--due-bg); color: var(--due); }
.part.late { background: var(--late-bg); color: var(--late); box-shadow: inset 4px 0 0 var(--late); }
.part.unknown { background: var(--unknown-bg); color: var(--unknown); }
.part.session { background: var(--session-bg); color: var(--session); }
.part.trial { background: #eef1f6; color: #4a5a72; }
.part.exempt { background: var(--none-bg); color: var(--muted); font-weight: 400; }

/* Organisation d'un stage : compteurs et outils au-dessus de la liste */
.stage-strip { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 0.7rem 1rem; margin: 0.4rem 0 0.7rem; }
.stage-strip .ok { color: var(--paid); font-weight: 600; } .stage-strip .warn { color: var(--due); font-weight: 600; }
@media print { .stage-strip .btns { display: none; } }

/* Retards : l'expression en rouge, et une pastille près du nom */
.late-note { color: var(--late); font-weight: 700; }
.late-note button.cellbtn { color: inherit; font-weight: inherit; }
.tag.late { background: var(--late); color: #fff; border-color: var(--late); }
.helpbox { background: #eef2f8; border-radius: 8px; padding: 0.6rem 0.9rem; margin-bottom: 0.8rem; }
.helpbox ul { margin: 0.3rem 0 0 1.1rem; padding: 0; display: grid; gap: 0.25rem; }

.login-logo { display: block; margin: 0 auto; height: 5.5rem; width: auto; max-width: 100%; object-fit: contain; }
.login-card h1 { text-align: center; }

/* Réglages : logo */
.logo-edit { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.logo-preview { height: 5.5rem; width: auto; max-width: 16rem; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem; background: #fff; }

/* Réglages : couleurs de l'interface */
.theme-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0.9rem; }
.theme-chip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.7rem; }
.theme-chip .sw3 { display: inline-flex; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.theme-chip .sw3 i { display: block; width: 0.8rem; height: 1rem; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.9rem 1.4rem; margin-bottom: 0.9rem; }
.theme-item label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.theme-row { display: flex; align-items: center; gap: 0.7rem; }
.theme-row input[type="color"] { width: 3.2rem; height: 2.2rem; padding: 0.1rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.theme-item .err { color: var(--late); font-size: 0.82rem; margin-top: 0.25rem; }

/* Réglages : combinaisons de couleurs mémorisées */
.theme-sub { font-size: 0.85rem; font-weight: 650; color: var(--muted); margin: 0.6rem 0 0.1rem; }
.theme-chip-wrap { display: inline-flex; }
.theme-chip-wrap .theme-chip { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.theme-del { border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0.3rem 0.6rem; font-weight: 700; }
.theme-store { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 0.2rem 0 0.9rem; }
.theme-store input { width: min(22rem, 100%); }

/* Bandeau « Hors connexion » : couleurs fixes (indépendantes du thème), toujours visible en haut de l'écran */
.top-bars { position: sticky; top: 0; z-index: 60; } /* les bandeaux « Hors connexion » et « Mise à jour » restent visibles en haut de l'écran */
.offline-bar { padding: 0.55rem 1.5rem; background: #fff1c2; color: #5c3f00; border-bottom: 2px solid #d9a10f; font-size: 0.92rem; text-align: center; }
.offline-bar button { margin-left: 0.6rem; padding: 0.2rem 0.7rem; }
@media print { .top-bars { display: none !important; } }

/* Carte « Stages » : les prochains stages, avec leurs inscrits */
.card-lines { list-style: none; margin: 0.7rem 0 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.86rem; }
.card-lines li { display: grid; gap: 0; }
.card-lines .stage-nums { color: var(--muted); }
.card-lines .link { text-align: left; font-weight: 600; padding: 0; }

/* Cartes du haut : lignes de légende cliquables, filtre actif */
.legend-btn { all: unset; cursor: pointer; border-radius: 4px; padding: 0 0.25rem; margin: 0 -0.25rem; }
.legend-btn:hover { text-decoration: underline; background: var(--none-bg); }
.legend-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.legend-btn.on { font-weight: 700; background: var(--th-bg); box-shadow: inset 0 -2px 0 var(--accent); }
.filter-chip { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 0.55rem 1rem; margin: 0.4rem 0 0.7rem; }
.qty { color: var(--muted); font-weight: 400; }

/* Avis de mise à jour : annonce (orange) puis « mise à jour effectuée » (vert). Couleurs fixes, indépendantes du thème. */
.notice-bar { padding: 0.6rem 1.5rem; font-size: 0.95rem; text-align: center; border-bottom: 2px solid; }
.notice-bar.annonce { background: #ffdcb0; color: #5a2d00; border-color: #e07b00; }
.notice-bar.fait { background: #d9efe2; color: #14532d; border-color: #1b7a4a; }
.notice-bar small { margin-left: 0.4rem; opacity: 0.85; }
.notice-bar button { margin-left: 0.6rem; padding: 0.2rem 0.7rem; }

/* Mise à jour : redémarrage */
.restart-row { margin: 0.9rem 0 0.4rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.helpbox.good { background: #d9efe2; color: #14532d; }
.helpbox.bad { background: #fde0dd; color: #7a1710; }
#restartMsg { margin-top: 0.7rem; }

/* Test de faisabilité d'une mise à jour depuis l'outil */
.feas-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.2rem; }
.feas-list .ok { color: var(--paid); } .feas-list .bad { color: var(--late); }

/* Installer une mise à jour depuis l'outil */
.helpbox p.ok { color: var(--paid); }
.helpbox p.err { color: var(--late); }
.helpbox code { font-size: 0.85em; background: var(--none-bg); padding: 0.1rem 0.3rem; border-radius: 3px; word-break: break-all; }
