/* Plateforme CLAC — charte graphique des Centres de lecture et d'animation culturelle.
   Couleurs du logo : jaune, vert, violet, rouge, bleu + noir. Titres en Montserrat (hébergée localement). */
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url(fonts/montserrat-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url(fonts/montserrat-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url(fonts/montserrat-latin-800-normal.woff2) format("woff2"); }

:root {
  /* Couleurs de la charte (relevées sur le logo) */
  --jaune: #f7d617;
  --vert: #22ac7b;
  --violet: #7f1c70;
  --rouge: #ec100e;
  --bleu: #085d96;
  --noir: #111111;
  /* Variantes lisibles pour du texte sur fond blanc */
  --vert-texte: #137450;
  --rouge-texte: #c00d0b;
  --jaune-texte: #6e5800;
  /* Teintes claires */
  --jaune-soft: #fef8d4;
  --vert-soft: #e2f5ee;
  --violet-soft: #f5e8f2;
  --rouge-soft: #fde8e7;
  --bleu-soft: #e5eff6;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #5d6169;
  --line: #e3e5e9;
  --line-soft: #eff0f2;
  --brand: var(--bleu);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 3px 10px rgba(17, 17, 17, .04);
  --stripe: linear-gradient(90deg, var(--jaune) 0 20%, var(--vert) 20% 40%, var(--violet) 40% 60%, var(--rouge) 60% 80%, var(--bleu) 80% 100%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --title: "Montserrat", var(--font);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--bleu); }
h1, h2, h3, h4 { font-family: var(--title); font-weight: 700; line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.005em; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
code { font: 12.5px/1 ui-monospace, Menlo, Consolas, monospace; background: #eef0f3; padding: 2px 5px; border-radius: 4px; }
small, .small { font-size: .82em; }
.muted { color: var(--muted); }
.pos { color: var(--vert-texte); }
.neg { color: var(--rouge-texte); }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.stripe { height: 5px; background: var(--stripe); }

/* Couleur de module (fil conducteur : menu, titres, indicateurs) */
.c-bleu { --m: var(--bleu); --m-soft: var(--bleu-soft); --m-text: var(--bleu); }
.c-vert { --m: var(--vert); --m-soft: var(--vert-soft); --m-text: var(--vert-texte); }
.c-violet { --m: var(--violet); --m-soft: var(--violet-soft); --m-text: var(--violet); }
.c-rouge { --m: var(--rouge); --m-soft: var(--rouge-soft); --m-text: var(--rouge-texte); }
.c-jaune { --m: var(--jaune); --m-soft: var(--jaune-soft); --m-text: var(--jaune-texte); }
.c-noir { --m: var(--noir); --m-soft: #eceef1; --m-text: var(--noir); }

/* ---------- Structure ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side > .stripe { flex: none; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 16px 14px; text-decoration: none; color: var(--ink); text-align: center; border-bottom: 1px solid var(--line-soft); }
.brand img { width: 96px; height: 96px; object-fit: contain; }
.brand span { font-family: var(--title); font-weight: 800; font-size: .92rem; line-height: 1.25; text-transform: uppercase; letter-spacing: .02em; }
.side nav { padding: 10px; flex: 1; }
.side nav a, .side-foot a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: #2b2e33; text-decoration: none; margin-bottom: 2px; font-weight: 500; }
.side nav a .ico-wrap { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--m-soft); color: var(--m-text); flex: none; }
.side nav a:hover { background: #f4f5f7; }
.side nav a.on { background: var(--m-soft); color: var(--ink); font-weight: 700; box-shadow: inset 4px 0 0 var(--m); }
.side nav a.on .ico-wrap { background: var(--m); color: #fff; }
.side nav a.on.c-jaune .ico-wrap { color: var(--noir); }
.nav-sep { font-family: var(--title); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 16px 10px 6px; }
.side-foot { padding: 10px; border-top: 1px solid var(--line-soft); }
.side-foot a { color: #2b2e33; }
.side-foot a:hover { background: #f4f5f7; }
.side-foot span small { display: block; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--stripe); }
.top h1 { font-size: 1.3rem; font-weight: 800; margin: 0; flex: 1; display: flex; align-items: center; gap: 12px; }
.top h1::before { content: ""; width: 6px; height: 26px; border-radius: 3px; background: var(--m, var(--noir)); flex: none; }
.top-r { display: flex; align-items: center; gap: 10px; }
.burger { display: none; background: none; border: 0; padding: 6px; color: var(--ink); cursor: pointer; }
.clac-switch label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); margin: 0; }
.clac-switch select { min-width: 200px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bleu-soft); color: var(--bleu); padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .86rem; font-family: var(--title); }
.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 28px 0; }
.content { padding: 20px 28px 40px; flex: 1; max-width: 1280px; width: 100%; }
.foot { padding: 14px 28px; color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: 10px; }
.foot .stripe { width: 60px; height: 4px; border-radius: 2px; }
.lead { color: var(--muted); margin: 0 0 16px; font-size: 1rem; }

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.card.dim { opacity: .75; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 18px; }
.scroll { overflow-x: auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--m, var(--line)); border-radius: var(--radius); padding: 13px 16px 14px; box-shadow: var(--shadow); }
.kpi span { display: block; color: var(--muted); font-size: .84rem; font-weight: 500; }
.kpi b { display: block; font-family: var(--title); font-weight: 800; font-size: 1.75rem; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi b i { font-style: normal; font-family: var(--font); font-size: .9rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi small { color: var(--muted); }
.kpi b.money { font-size: 1.22rem; padding: 6px 0 5px; white-space: nowrap; }
.kpi em.warn { color: var(--rouge-texte); font-style: normal; font-weight: 700; }
.kpis.small .kpi { box-shadow: none; background: #fafbfc; border-top-width: 1px; }
.kpis.small .kpi b { font-size: 1.3rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 9px; border: 1px solid #d5d8de; background: var(--surface); color: var(--ink); font: 700 .86rem/1.2 var(--title); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #b9bdc5; background: #f7f8fa; }
.btn.primary { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.btn.primary:hover { background: #064a78; }
.btn.primary.alt { background: var(--rouge-texte); border-color: var(--rouge-texte); }
.btn.primary.alt:hover { background: #a00a09; }
.btn.primary.ok { background: var(--vert-texte); border-color: var(--vert-texte); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--rouge-texte); border-color: #f2b9b8; background: transparent; }
.btn.small { padding: 5px 10px; font-size: .8rem; }
.btn.big { padding: 14px 28px; font-size: 1.35rem; font-weight: 800; }
.btn.wide { width: 100%; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--jaune); outline-offset: 1px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: flex; gap: 6px; }

label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .88rem; }
label small { font-weight: 400; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea { font: 400 .95rem/1.4 var(--font); color: var(--ink); background: #fff; border: 1px solid #cfd3da; border-radius: 9px; padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--bleu); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--bleu); transform: scale(1.15); }
input[disabled], select[disabled], textarea[disabled] { background: #f3f4f6; color: var(--muted); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset.radios legend { font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
fieldset.radios { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
fieldset.radios label { flex-direction: row; align-items: center; gap: 7px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid h2, .form-grid h3 { margin: 0; }
.span2 { grid-column: 1 / -1; }
.sub { border-top: 1px dashed var(--line); padding-top: 12px; }
form.inline { display: flex; gap: 8px; align-items: center; }
form.inline.wrap { flex-wrap: wrap; margin-top: 8px; }
form.inline input { width: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; }

.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-family: var(--title); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl th.r, .tbl td.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.muted td { color: var(--muted); }
.tbl tr.warn-row td { background: var(--rouge-soft); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.tag.ok { background: var(--vert-soft); color: var(--vert-texte); }
.tag.warn { background: var(--jaune-soft); color: var(--jaune-texte); box-shadow: inset 0 0 0 1px #f0dc6a; }
.tag.blue { background: var(--bleu-soft); color: var(--bleu); }
.tag.grey { background: #eceef1; color: var(--muted); }

.flash { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; background: var(--vert-soft); color: #0f5c40; border: 1px solid #b5e3d0; border-left: 5px solid var(--vert); }
.flash.err { background: var(--rouge-soft); color: #8f0a08; border-color: #f6c2c1; border-left-color: var(--rouge); }
.flash.warn { background: var(--jaune-soft); color: #5a4800; border-color: #f2e08a; border-left-color: var(--jaune); }
.flash a { color: inherit; font-weight: 700; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font: 700 .86rem var(--title); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-color: var(--m, var(--bleu)); }
.tabs a b { font-weight: 600; color: var(--muted); font-size: .78rem; margin-left: 3px; font-family: var(--font); }

details.more summary { cursor: pointer; font-weight: 700; color: var(--bleu); padding: 8px 0; }
details.more[open] summary { margin-bottom: 10px; }

.pager { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 18px; }
.pager a, .pager span { padding: 6px 11px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: .88rem; }
.pager span.on { background: var(--bleu); color: #fff; border-color: var(--bleu); }

/* Listes */
.list { list-style: none; padding: 0; margin: 0; }
.list li { border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border: 0; }
.list li > a { display: flex; gap: 12px; align-items: center; padding: 9px 0; text-decoration: none; color: var(--ink); }
.list li > a:hover strong { color: var(--bleu); text-decoration: underline; }
.list small { display: block; color: var(--muted); }
.list.incidents li { padding: 10px 0; }
.list.incidents p { margin: 4px 0 6px; }
.date-badge { width: 50px; flex: none; text-align: center; background: var(--violet-soft); color: var(--violet); border-radius: 9px; padding: 4px 0; font-size: .7rem; font-weight: 600; text-transform: uppercase; }
.date-badge b { display: block; font-family: var(--title); font-size: 1.15rem; font-weight: 800; line-height: 1.1; }
.roles { margin: 0; padding-left: 18px; }
.roles li { margin-bottom: 4px; }

/* Graphiques */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #eceef1; stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); }
.chart rect.s0 { fill: var(--violet); }
.chart rect.s1 { fill: var(--bleu); }
.chart rect.s-jaune { fill: var(--jaune); stroke: #c9ab00; stroke-width: 1; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: 0 0 6px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.s0 { background: var(--violet); } .legend i.s1 { background: var(--bleu); }
.hbar { display: grid; grid-template-columns: 1fr 120px auto; align-items: center; gap: 10px; font-size: .88rem; padding: 4px 0; }
.hbar i { height: 10px; border-radius: 3px; display: block; min-width: 3px; }
.hbar i.recette { background: var(--vert); } .hbar i.depense { background: var(--rouge); }
.hbar b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* Compteurs de fréquentation */
.counters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 10px 0 6px; }
.counter { border: 1px solid var(--line); border-top: 6px solid var(--cc); border-radius: 14px; padding: 16px; text-align: center; background: #fff; }
.counter > span { display: block; font-family: var(--title); font-weight: 700; color: var(--muted); }
.counter > b { display: block; font-family: var(--title); font-weight: 800; font-size: 3rem; line-height: 1.15; font-variant-numeric: tabular-nums; margin: 4px 0 10px; color: var(--cc); }
.counter.entrees_f { --cc: var(--violet); } .counter.entrees_h { --cc: var(--bleu); } .counter.numerique { --cc: var(--vert-texte); }
.counter-btns { display: flex; justify-content: center; gap: 10px; align-items: center; }
.counter-btns form { margin: 0; }
.counter .btn.primary { background: var(--cc); border-color: var(--cc); }

/* Calendrier des animations */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.cal-h { font-family: var(--title); font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; text-align: center; padding: 4px 0; letter-spacing: .06em; }
.cal-d { min-height: 92px; border: 1px solid #e8eaee; border-radius: 9px; padding: 4px 5px 6px; background: #fff; position: relative; display: flex; flex-direction: column; gap: 3px; }
.cal-d.out { background: transparent; border-color: transparent; }
.cal-d.today { border-color: var(--violet); box-shadow: inset 0 0 0 1px var(--violet); }
.cal-d.today .n { color: var(--violet); }
.cal-d .n { font-family: var(--title); font-size: .76rem; font-weight: 700; color: var(--muted); }
.cal-d .add { position: absolute; top: 2px; right: 6px; text-decoration: none; color: #a8adb6; font-weight: 700; display: none; }
.cal-d:hover .add { display: block; }
.ev { display: block; font-size: .74rem; line-height: 1.25; padding: 3px 5px; border-radius: 5px; text-decoration: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 4px solid; background: #f4f5f7; }
.ev.st-annulee { text-decoration: line-through; opacity: .55; }
.ev.st-realisee { font-weight: 700; }
.t-projection { border-color: var(--bleu) !important; } .legend i.t-projection { background: var(--bleu); }
.t-conference { border-color: var(--violet) !important; } .legend i.t-conference { background: var(--violet); }
.t-spectacle { border-color: #e2c000 !important; } .legend i.t-spectacle { background: var(--jaune); box-shadow: inset 0 0 0 1px #c9ab00; }
.t-concours { border-color: var(--rouge) !important; } .legend i.t-concours { background: var(--rouge); }
.t-atelier { border-color: var(--vert) !important; } .legend i.t-atelier { background: var(--vert); }
.cal + .legend { margin-top: 12px; }

/* Fiche abonné */
.member-card { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.member-card h2 { margin: 0 0 2px; }
.member-card p { margin: 2px 0; }
.avatar { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-family: var(--title); font-weight: 800; font-size: 1.2rem; color: #fff; background: var(--violet); flex: none; }
.avatar.h { background: var(--bleu); }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.quick-return { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; border-left: 5px solid var(--jaune); }
.quick-return label { flex: 1 1 280px; }

/* Rapport mensuel (reproduit la fiche papier, avec l'en-tête du CLAC) */
.fiche { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 28px 26px; margin-bottom: 18px; box-shadow: var(--shadow); overflow: hidden; }
.fiche > .stripe { margin: 0 -28px 18px; height: 6px; }
.fiche-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.fiche-brand img { width: 74px; height: 74px; object-fit: contain; }
.fiche-brand div { flex: 1; }
.fiche-brand strong { display: block; font-family: var(--title); font-weight: 800; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .02em; }
.fiche-brand span { color: var(--muted); font-size: .88rem; }
.fiche-title { text-align: center; background: var(--noir); color: #fff; display: table; margin: 0 auto 14px; padding: 6px 22px; font-size: 1.05rem; font-weight: 800; letter-spacing: .06em; }
.fiche-head { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px 18px; border-top: 2px solid var(--noir); border-bottom: 2px solid var(--noir); padding: 8px 0; margin-bottom: 14px; font-size: .92rem; }
.fiche-head > div:nth-child(4) { grid-column: 1 / 2; }
.fiche-head > div:nth-child(5) { grid-column: 2 / 4; }
.band { font-family: var(--title); font-weight: 800; background: var(--noir); color: #fff; display: inline-block; padding: 4px 18px; font-size: .86rem; letter-spacing: .06em; margin: 10px 0 8px; border-left: 6px solid var(--m, var(--bleu)); }
.ft { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: .9rem; }
.ft th, .ft td { padding: 6px 8px; border-bottom: 1px solid #e6e8ec; text-align: center; }
.ft th { font-weight: 600; text-align: left; }
.ft thead th { background: #dfe2e7; text-align: center; font-size: .78rem; font-family: var(--title); font-weight: 700; }
.ft .lbl { width: 22%; font-weight: 700; text-align: left; background: transparent; font-family: var(--title); font-size: .8rem; }
.ft td { font-variant-numeric: tabular-nums; min-width: 54px; }
.ft td.w { width: 140px; border: 1px solid #b9bec6; }
.ft tr.tot th, .ft tr.tot td { font-weight: 700; }
.ft tr.big th, .ft tr.big td, .ft td.big { font-size: 1.02rem; background: #f3f4f6; }
.ft table.mini { border-collapse: collapse; margin-left: auto; }
.ft table.mini th { background: #dfe2e7; text-align: center; font-size: .76rem; padding: 3px 14px; }
.ft table.mini td { border: 1px solid #b9bec6; padding: 5px 14px; }
.ft td.sub { text-align: right; }
.fiche-block { border-top: 1px solid var(--noir); padding-top: 10px; margin-top: 10px; }
.fiche-block h4 { font-size: .9rem; margin-bottom: 6px; }
.fiche-block ul { margin: 0 0 10px; padding-left: 18px; }
.anim-list li { margin-bottom: 4px; }
.fiche-sign { margin-top: 16px; margin-left: auto; width: 46%; border: 1px solid var(--noir); min-height: 80px; padding: 8px 10px; font-style: italic; font-size: .9rem; }
.print-only { display: none; }

/* Connexion / installation */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth > .flash { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 0 30px 28px; width: 100%; max-width: 420px; box-shadow: 0 14px 40px rgba(17, 17, 17, .08); overflow: hidden; }
.auth-card > .stripe { margin: 0 -30px 24px; height: 6px; }
.auth-card.wide-card { max-width: 580px; }
.auth-logo { display: block; width: 150px; height: 150px; object-fit: contain; margin: 0 auto 10px; }
.auth-card h1 { font-size: 1.3rem; font-weight: 800; text-align: center; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 2px; }
.auth-card .tagline { text-align: center; margin: 0 0 18px; }
.auth-card h3 { margin: 8px 0 0; color: var(--bleu); }
.checks { list-style: none; padding: 0; margin: 14px 0; }
.checks li.ok { color: var(--vert-texte); } .checks li.ko { color: var(--rouge-texte); font-weight: 700; }
.logo-preview { display: flex; align-items: center; gap: 16px; }
.logo-preview img { width: 84px; height: 84px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: #fff; }

/* ---------- Mobile ---------- */
@media screen and (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 24px rgba(0, 0, 0, .18); }
  .side:not(.open) { box-shadow: none; visibility: hidden; }
  .side.open { transform: none; visibility: visible; }
  .brand img { width: 72px; height: 72px; }
  .burger { display: block; }
  .top { padding: 12px 16px 10px; flex-wrap: wrap; gap: 10px; }
  .top h1 { font-size: 1.12rem; }
  .top h1::before { height: 20px; }
  .top-logo { display: block !important; width: 34px; height: 34px; object-fit: contain; }
  .top-r { width: 100%; }
  .clac-switch, .clac-switch label, .clac-switch select { width: 100%; min-width: 0; }
  .actions-bar { padding: 12px 16px 0; }
  .actions-bar .btn { flex: 1 1 auto; }
  .content { padding: 16px 16px 32px; }
  .grid2, .form-grid { grid-template-columns: 1fr; }
  .counters { grid-template-columns: 1fr; }
  .counter { display: grid; grid-template-columns: 1fr auto; align-items: center; text-align: left; gap: 4px 12px; border-top-width: 1px; border-left: 6px solid var(--cc); }
  .counter > b { margin: 0; font-size: 2.4rem; grid-row: span 2; grid-column: 2; }
  .counter-btns { justify-content: flex-start; }
  .cal { display: flex; flex-direction: column; }
  .cal-h, .cal-d.out { display: none; }
  .cal-d { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cal-d:not(:has(.ev)) { display: none; }
  .cal-d .n { width: 28px; }
  .cal-d .ev { white-space: normal; flex: 1 1 200px; }
  .fiche { padding: 0 12px 16px; overflow-x: auto; }
  .fiche > .stripe { margin: 0 -12px 14px; }
  .fiche-brand img { width: 56px; height: 56px; }
  .fiche-head { grid-template-columns: 1fr; }
  .fiche-head > div { grid-column: auto !important; }
  .fiche-sign { width: 100%; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: 6px; }
  .hbar { grid-template-columns: 1fr 70px auto; }
  .auth-logo { width: 120px; height: 120px; }
}
.top-logo { display: none; }

/* ---------- Impression (rapport mensuel) ---------- */
@media print {
  @page { size: A4; margin: 11mm; }
  body { background: #fff; font-size: 10.5px; }
  .side, .top, .actions-bar, .foot, .no-print, .flash, .burger, .tabs, .filters, .pager { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .fiche { border: 0; box-shadow: none; padding: 0; overflow: visible; }
  .fiche > .stripe { margin: 0 0 10px; }
  .fiche-brand { margin-bottom: 8px; }
  .fiche-brand img { width: 58px; height: 58px; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  .ft th, .ft td { padding: 3px 6px; }
  .ft, .fiche-block { break-inside: avoid; }
  .band { display: table; margin: 4px 0; break-after: avoid; page-break-after: avoid; }
  .fiche-head { margin-bottom: 8px; }
  .fiche-sign { min-height: 60px; }
  .stripe, .band, .fiche-title, .ft thead th, .ft table.mini th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Boutons aux couleurs du module (le bouton principal prend la couleur de la page) */
.btn.tone, .shell:not(.c-noir) .actions-bar .btn.primary:not(.alt):not(.ok) { background: var(--m-text); border-color: var(--m-text); color: #fff; }
.btn.tone.c-jaune, .shell.c-jaune .actions-bar .btn.primary:not(.alt):not(.ok) { background: var(--jaune); border-color: #dcbd00; color: var(--noir); }
.btn.tone:hover, .shell:not(.c-noir) .actions-bar .btn.primary:hover { filter: brightness(.94); }
