/* Présences — système de design maison.
   Tokens (échelle de 4 px), thèmes clair/sombre, composants. Aucune dépendance, aucune image. */

/* ========== 1. Tokens ========== */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-pill: 999px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: .78rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.375rem; --fs-2xl: 1.75rem; --fs-3xl: 2.25rem;
  --dur-fast: 120ms; --dur: 200ms; --ease: cubic-bezier(.2, .8, .2, 1);
  --tap: 44px; --bar-h: 64px; --top-h: 56px;
  --shadow-1: 0 1px 2px rgb(40 30 20 / .06), 0 1px 3px rgb(40 30 20 / .08);
  --shadow-2: 0 4px 14px rgb(40 30 20 / .12);
  --shadow-3: 0 16px 40px rgb(40 30 20 / .22);
}

/* Thème clair (neutre chaud + accent vert-bleu) */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f5f2; --surface: #ffffff; --surface-2: #f1eee9; --border: #e0dbd2; --border-strong: #8a8378;
  --text: #1d1b19; --muted: #625c54;
  --accent: #0f766e; --accent-hover: #115e59; --accent-ink: #ffffff; --accent-soft: #d5f3ee; --accent-soft-ink: #0b4f49;
  --focus: #1d4ed8;
  --danger: #b42318; --danger-soft: #fdecea; --danger-ink: #7a1710;
  --warn: #8a4b08; --warn-soft: #fff4dc; --warn-ink: #5c3305;
  --ok: #166534; --ok-soft: #e3f5e8; --ok-ink: #0f4a26;
  --info-soft: #e5eefb; --info-ink: #17407f;
  --lu-bg: #dcf5e3; --lu-fg: #13502a; --lu-bd: #8fcea4;
  --tt-bg: #dbe8fb; --tt-fg: #17407f; --tt-bd: #93b6ec;
  --cp-bg: #ffe8c2; --cp-fg: #6b3a05; --cp-bd: #e8b668;
  --rc-bg: #d3f1f5; --rc-fg: #124f5a; --rc-bd: #82cbd6;
  --ma-bg: #fbdcdc; --ma-fg: #7a1710; --ma-bd: #eba3a3;
  --au-bg: #e9e0fa; --au-fg: #46268f; --au-bd: #b9a2ec;
  --fe-bg: #fbeeb3; --fe-fg: #5c4a05; --fe-bd: #dcc55f;
  --we-bg: #ece8e1; --we-fg: #57514a; --we-bd: #d2cbbf;
  --gbtn-bg: #ffffff; --gbtn-fg: #1f1f1f; --gbtn-bd: #747775;
}
/* Thème sombre : choix du système, sauf si l'utilisateur a forcé « clair » */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #151311; --surface: #1f1c19; --surface-2: #29251f; --border: #38332c; --border-strong: #8a8176;
    --text: #f1ede7; --muted: #aaa297;
    --accent: #2dd4bf; --accent-hover: #5eead4; --accent-ink: #042f2e; --accent-soft: #123a37; --accent-soft-ink: #a7f3ea;
    --focus: #93c5fd;
    --danger: #ff9b92; --danger-soft: #3d1815; --danger-ink: #ffd0cb;
    --warn: #f5b657; --warn-soft: #3b2a0c; --warn-ink: #ffdca1;
    --ok: #86d99b; --ok-soft: #12301c; --ok-ink: #bdeccb;
    --info-soft: #172a47; --info-ink: #bcd4f8;
    --lu-bg: #153a22; --lu-fg: #c4f0d1; --lu-bd: #2f6b45;
    --tt-bg: #172c4d; --tt-fg: #c4d9fa; --tt-bd: #34568c;
    --cp-bg: #46300d; --cp-fg: #ffddaa; --cp-bd: #7e5a1b;
    --rc-bg: #123c44; --rc-fg: #b8eaf1; --rc-bd: #2d6f7b;
    --ma-bg: #4a1c1c; --ma-fg: #ffcfcf; --ma-bd: #86393a;
    --au-bg: #34244f; --au-fg: #e0d4fb; --au-bd: #67509c;
    --fe-bg: #463d0c; --fe-fg: #f7e79a; --fe-bd: #7d6f1f;
    --we-bg: #27231e; --we-fg: #b3ab9f; --we-bd: #3f392f;
    --gbtn-bg: #131314; --gbtn-fg: #e3e3e3; --gbtn-bd: #8e918f;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4); --shadow-2: 0 4px 14px rgb(0 0 0 / .45); --shadow-3: 0 16px 40px rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151311; --surface: #1f1c19; --surface-2: #29251f; --border: #38332c; --border-strong: #8a8176;
  --text: #f1ede7; --muted: #aaa297;
  --accent: #2dd4bf; --accent-hover: #5eead4; --accent-ink: #042f2e; --accent-soft: #123a37; --accent-soft-ink: #a7f3ea;
  --focus: #93c5fd;
  --danger: #ff9b92; --danger-soft: #3d1815; --danger-ink: #ffd0cb;
  --warn: #f5b657; --warn-soft: #3b2a0c; --warn-ink: #ffdca1;
  --ok: #86d99b; --ok-soft: #12301c; --ok-ink: #bdeccb;
  --info-soft: #172a47; --info-ink: #bcd4f8;
  --lu-bg: #153a22; --lu-fg: #c4f0d1; --lu-bd: #2f6b45;
  --tt-bg: #172c4d; --tt-fg: #c4d9fa; --tt-bd: #34568c;
  --cp-bg: #46300d; --cp-fg: #ffddaa; --cp-bd: #7e5a1b;
  --rc-bg: #123c44; --rc-fg: #b8eaf1; --rc-bd: #2d6f7b;
  --ma-bg: #4a1c1c; --ma-fg: #ffcfcf; --ma-bd: #86393a;
  --au-bg: #34244f; --au-fg: #e0d4fb; --au-bd: #67509c;
  --fe-bg: #463d0c; --fe-fg: #f7e79a; --fe-bd: #7d6f1f;
  --we-bg: #27231e; --we-fg: #b3ab9f; --we-bd: #3f392f;
  --gbtn-bg: #131314; --gbtn-fg: #e3e3e3; --gbtn-bd: #8e918f;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4); --shadow-2: 0 4px 14px rgb(0 0 0 / .45); --shadow-3: 0 16px 40px rgb(0 0 0 / .6);
}

/* ========== 2. Base ========== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: var(--fs-md)/1.5 var(--font);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-lg); } h3 { font-size: var(--fs-md); }
p { margin: 0 0 var(--s3); }
a { color: var(--accent); text-underline-offset: 3px; } a:hover { color: var(--accent-hover); }
code { font: .85em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
img { max-width: 100%; }
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s4); top: -100px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: var(--s3) var(--s4); border-radius: var(--r); }
.skip:focus { top: var(--s2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main { max-width: 1120px; margin: 0 auto; padding: var(--s4); outline: none; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.row.between { justify-content: space-between; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin: var(--s2) 0 var(--s4); }
.page-head p { margin: 0; }
.section { margin-top: var(--s8); }
.section > h2 { margin-bottom: var(--s3); }

/* ========== 3. Icônes ========== */
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
.ic-sm { width: 1em; height: 1em; } .ic-lg { width: 1.75em; height: 1.75em; }
.icons-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ========== 4. Navigation ========== */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s4);
  min-height: var(--top-h); padding: 0 var(--s4); background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: var(--fs-lg); color: var(--text); text-decoration: none; }
.brand .ic { color: var(--accent); width: 1.5em; height: 1.5em; }
.topnav { display: none; gap: var(--s1); flex: 1; }
.topnav a { display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s3); border-radius: var(--r); color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.topnav a:hover { background: var(--surface-2); }
.topnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-soft-ink); }
.top-actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.userbtn { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
  height: calc(var(--bar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgb(0 0 0 / .06);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tap);
  background: none; border: 0; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.tabbar .ic { width: 1.5rem; height: 1.5rem; }
.tabbar [aria-current="page"] { color: var(--accent); }
.tabbar .tab-main .fab {
  display: grid; place-items: center; width: 52px; height: 52px; margin-top: -22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-2);
}
.tabbar .tab-main { color: var(--text); }
@media (min-width: 880px) {
  body { padding-bottom: 0; }
  .topnav { display: flex; }
  .tabbar { display: none; }
  .mobile-only { display: none !important; }
}
@media (max-width: 879px) { .desktop-only { display: none !important; } .topbar { padding: 0 var(--s3); } }

/* ========== 5. Boutons, champs ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4);
  border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-soft-ink); }
.btn-danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger-ink); }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: var(--fs-sm); }
.btn-icon { width: var(--tap); padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
@media (pointer: fine) { .btn-sm { min-height: 36px; } }
.field { display: grid; gap: var(--s1); min-width: 0; }
.field > label, .field > .label { font-size: var(--fs-sm); font-weight: 600; }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.field .error { font-size: var(--fs-sm); color: var(--danger); font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: var(--s2) var(--s3); background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r); font: inherit;
}
textarea { min-height: 88px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
input[type="file"] { padding: var(--s2); }
input:disabled, select:disabled { opacity: .6; }
[aria-invalid="true"] { border-color: var(--danger); }
.form-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
.check { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); font-weight: 500; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: var(--fs-sm); font-weight: 600; padding: 0; margin-bottom: var(--s2); }

/* Choix par pastilles (boutons radio) */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2); }
.choice { position: relative; }
.choice input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-box {
  display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: var(--s2) var(--s3);
  border: 2px solid var(--border-strong); border-radius: var(--r); background: var(--surface); font-weight: 600; font-size: var(--fs-sm);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.choice input:checked + .choice-box { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-soft-ink); }
.choice input:focus-visible + .choice-box { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ========== 6. Badges de statut (couleur + icône + libellé) ========== */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--we-bd);
  background: var(--we-bg); color: var(--we-fg); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.badge .ic { width: 1em; height: 1em; }
.st-LU { --b: var(--lu-bg); --f: var(--lu-fg); --d: var(--lu-bd); } .st-TT { --b: var(--tt-bg); --f: var(--tt-fg); --d: var(--tt-bd); }
.st-CP { --b: var(--cp-bg); --f: var(--cp-fg); --d: var(--cp-bd); } .st-RC { --b: var(--rc-bg); --f: var(--rc-fg); --d: var(--rc-bd); }
.st-MA { --b: var(--ma-bg); --f: var(--ma-fg); --d: var(--ma-bd); } .st-AU { --b: var(--au-bg); --f: var(--au-fg); --d: var(--au-bd); }
.st-FE { --b: var(--fe-bg); --f: var(--fe-fg); --d: var(--fe-bd); } .st-WE { --b: var(--we-bg); --f: var(--we-fg); --d: var(--we-bd); }
.badge[class*="st-"] { background: var(--b); color: var(--f); border-color: var(--d); }
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.tag.warn { background: var(--warn-soft); color: var(--warn-ink); } .tag.bad { background: var(--danger-soft); color: var(--danger-ink); } .tag.ok { background: var(--ok-soft); color: var(--ok-ink); }

/* ========== 7. Cartes, alertes, compteurs ========== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-1); }
.card h2, .card h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: var(--s2); }
.cards { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2); font-size: var(--fs-3xl); font-weight: 800; line-height: 1.1; margin: 0; }
.stat small { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.card.warn { border-color: var(--warn); } .card.bad { border-color: var(--danger); }
.progress { height: 10px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin: var(--s3) 0 var(--s2); }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width var(--dur) var(--ease); }
.card.warn .progress > i { background: var(--warn); } .card.bad .progress > i { background: var(--danger); }
.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--info-soft); color: var(--info-ink); margin: var(--s3) 0; }
.notice .ic { margin-top: 2px; }
.notice.ok { background: var(--ok-soft); color: var(--ok-ink); } .notice.err, .notice.bad { background: var(--danger-soft); color: var(--danger-ink); } .notice.warn { background: var(--warn-soft); color: var(--warn-ink); }
.notice > div { flex: 1; min-width: 0; } .notice p:last-child { margin: 0; }
.todo { display: grid; gap: var(--s2); }
.todo a, .todo .item {
  display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: var(--s3) var(--s4); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: var(--r); background: var(--surface); color: var(--text); text-decoration: none;
}
.todo a:hover { background: var(--surface-2); color: var(--text); }
.todo .warn { border-left-color: var(--warn); } .todo .bad { border-left-color: var(--danger); } .todo .info { border-left-color: var(--accent); }
.todo .grow { flex: 1; min-width: 0; } .todo .count { font-weight: 800; font-size: var(--fs-lg); }
.empty { text-align: center; padding: var(--s10) var(--s4); color: var(--muted); }
.empty .ic { width: 2.5rem; height: 2.5rem; margin-bottom: var(--s3); color: var(--border-strong); }
.empty h2, .empty h3 { color: var(--text); font-size: var(--fs-lg); text-transform: none; letter-spacing: 0; margin-bottom: var(--s1); }
.skeleton { display: block; height: 1em; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ========== 8. Tableaux (cartes empilées sur mobile : plus aucune colonne masquée) ========== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--s3) var(--s4); text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .actions { white-space: nowrap; text-align: right; }
@media (max-width: 719px) {
  .table-wrap { border: 0; background: none; overflow: visible; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table tr { margin-bottom: var(--s3); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: var(--s2) var(--s4); box-shadow: var(--shadow-1); }
  .table td { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s2) 0; border: 0; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-align: left; flex: none; }
  .table td.actions { justify-content: flex-end; padding-top: var(--s3); }
  .table td.actions::before, .table td[data-label=""]::before { content: none; }
  .table td.wide { display: block; text-align: left; }
}
.pager { display: flex; align-items: center; justify-content: center; gap: var(--s4); margin: var(--s4) 0; }

/* ========== 9. Calendrier ========== */
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); list-style: none; margin: 0 0 var(--s4); padding: 0; }
.months { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s3); }
.month h2 { font-size: var(--fs-md); margin-bottom: var(--s2); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal .dow { text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 36px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; border: 1px solid transparent;
}
.cell[class*="st-"] { background: var(--b); color: var(--f); border-color: var(--d); }
.cell .ic { width: .8rem; height: .8rem; }
.cell.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cell.empty-day { border: 1px dashed var(--danger); background: transparent; }
.cell.blank { background: none; border: 0; pointer-events: none; }
.cell.off { background: var(--we-bg); color: var(--we-fg); font-weight: 500; }
.cell sup { position: absolute; top: 1px; right: 3px; font-size: .6rem; color: inherit; opacity: .8; }
.cal-big .cell { min-height: 64px; align-items: flex-start; justify-content: space-between; padding: 6px; font-size: var(--fs-md); }
.cal-big .cell .chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; }
.cal-big .cell .chip .ic { width: .95rem; height: .95rem; }
.cal-big .cell .hol { font-size: .68rem; font-weight: 600; line-height: 1.1; text-align: left; }
@media (max-width: 719px) { .cal-big .cell { min-height: 54px; padding: 4px; } .cal-big .cell .chip .lbl, .cal-big .cell .hol { display: none; } .months { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } .cell { min-height: 40px; } }

/* ========== 10. Dialogues, toasts ========== */
dialog.sheet {
  width: min(560px, 100%); max-height: 92dvh; padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-3); overflow: auto;
}
dialog.sheet::backdrop { background: rgb(20 15 10 / .5); }
dialog.sheet[open] { animation: sheet-in var(--dur) var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s4) var(--s2); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-body { padding: var(--s2) var(--s4) var(--s4); display: grid; gap: var(--s4); }
@media (max-width: 719px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: none; border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
.menu-list { display: grid; padding: var(--s2) var(--s2) var(--s4); }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: 0 var(--s3); border: 0; border-radius: var(--r); background: none; color: var(--text); font: inherit; text-decoration: none; cursor: pointer; text-align: left; width: 100%; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.toasts { position: fixed; z-index: 60; left: var(--s4); right: var(--s4); bottom: calc(var(--bar-h) + var(--s4) + env(safe-area-inset-bottom)); display: grid; gap: var(--s2); justify-items: center; pointer-events: none; }
@media (min-width: 880px) { .toasts { bottom: var(--s6); left: auto; right: var(--s6); justify-items: end; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s3); max-width: 480px; padding: var(--s3) var(--s4); border-radius: var(--r);
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-3); animation: sheet-in var(--dur) var(--ease);
}
.toast.err { background: var(--danger); color: var(--bg); }
.toast button { background: none; border: 0; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; min-height: var(--tap); padding: 0 var(--s2); }

/* ========== 11. Écrans particuliers ========== */
.yearnav { display: flex; align-items: center; gap: var(--s2); }
.yearnav strong { min-width: 5ch; text-align: center; }
.login { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.login .logo { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto var(--s4); border-radius: 20px; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-2); }
.login .logo .ic { width: 2.4rem; height: 2.4rem; }
.login h1 { font-size: var(--fs-3xl); }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 var(--s6); border-radius: var(--r-pill);
  background: var(--gbtn-bg); color: var(--gbtn-fg); border: 1px solid var(--gbtn-bd); font: 500 .9rem/1 Roboto, var(--font); text-decoration: none; cursor: pointer;
}
.btn-google:hover { box-shadow: var(--shadow-2); color: var(--gbtn-fg); }
.btn-google svg { width: 20px; height: 20px; }
.preview { display: grid; justify-items: start; gap: var(--s3); }
.preview img { border: 1px solid var(--border); border-radius: var(--r); max-height: 70vh; }
.two { display: grid; gap: var(--s6); grid-template-columns: minmax(280px, 520px) 1fr; } @media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.checklist li { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.checklist .ok { color: var(--ok); } .checklist .ko { color: var(--danger); }

/* ========== 12. Mouvement réduit ========== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Choix de statut : la couleur du statut apparaît une fois sélectionné (l'icône et le libellé restent toujours visibles) */
.choice-box[class*="st-"] .ic { color: var(--f); }
.choice input:checked + .choice-box[class*="st-"] { background: var(--b); color: var(--f); border-color: var(--d); }

/* Boutons de choix de fichier (le champ reste atteignable au clavier) */
.file-btn { position: relative; }
.file-btn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
#quick-hint:empty { display: none; }
details.legend-box { margin-bottom: var(--s4); } details.legend-box > summary { list-style: none; cursor: pointer; margin-bottom: var(--s2); }
details.legend-box > summary::-webkit-details-marker { display: none; }

/* Cibles tactiles : 44 px minimum sur mobile / écran tactile */
@media (max-width: 879px), (pointer: coarse) {
  .btn-sm { min-height: var(--tap); }
  .cell { min-height: 44px; }
  .table .actions .btn { min-width: var(--tap); }
}

[hidden] { display: none !important; }

/* Mobile : cartes et filtres plus compacts */
.form-grid.cols2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 719px) {
  .form-grid.cols2 { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .table tr { padding: var(--s2) var(--s4); margin-bottom: var(--s2); }
  .table td { padding: 3px 0; line-height: 1.35; }
  .table td.actions { padding-top: var(--s2); gap: var(--s2); }
}

/* Classes utilitaires (la politique de sécurité interdit les attributs style=) */
.m0 { margin: 0; } .mt2 { margin-top: var(--s2); } .mt4 { margin-top: var(--s4); } .mtn1 { margin-top: calc(var(--s1) * -1); }
.gap2 { gap: var(--s2); } .nowrap { flex-wrap: nowrap; } .narrow { max-width: 640px; }
.cols2-fixed { grid-template-columns: 1fr 1fr; }
.filelist { margin: var(--s1) 0 0; padding-left: var(--s5); }
/* Barres de progression natives */
progress.bar { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 10px; border: 0; border-radius: var(--r-pill); margin: var(--s3) 0 var(--s2); background: var(--surface-2); overflow: hidden; color: var(--accent); }
progress.bar::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--r-pill); }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: var(--r-pill); transition: width var(--dur) var(--ease); }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: var(--r-pill); }
.card.warn progress.bar::-webkit-progress-value { background: var(--warn); } .card.warn progress.bar::-moz-progress-bar { background: var(--warn); }
.card.bad progress.bar::-webkit-progress-value { background: var(--danger); } .card.bad progress.bar::-moz-progress-bar { background: var(--danger); }
.w70 { width: 70%; }

/* ========== 13. Vue semaine et glisser-déposer ========== */
.week-grid { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 880px) { .week-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.wday { display: grid; gap: var(--s2); align-content: start; padding: var(--s3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.wday.off { background: var(--surface-2); box-shadow: none; }
.wday.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wday header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
@media (min-width: 880px) { .wday header { flex-direction: column; align-items: flex-start; } }
.wday h2 { font-size: var(--fs-md); } .wday h2 a { color: var(--text); text-decoration: none; }
.wday p { margin: 0; }
.wactions { display: flex; flex-wrap: wrap; gap: var(--s1); }
.wactions .btn { border-color: var(--d, var(--border-strong)); background: var(--b, var(--surface)); color: var(--f, var(--text)); }
.wactions .btn.on { box-shadow: inset 0 0 0 3px var(--f); }
.dnd-palette { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: var(--s3) 0 var(--s2); }
.dnd-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-pill);
  border: 1px solid var(--d, var(--border-strong)); background: var(--b, var(--surface)); color: var(--f, var(--text));
  font-size: var(--fs-sm); font-weight: 600; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none;
}
.dnd-help { margin-bottom: var(--s4); }
[data-day][data-status]:not([data-status=""]) { cursor: grab; -webkit-touch-callout: none; }
.dnd-ghost { position: fixed; z-index: 90; pointer-events: none; opacity: .92; transform: translate(-50%, -130%); box-shadow: var(--shadow-3); }
body.dragging, body.dragging * { user-select: none; -webkit-user-select: none; cursor: grabbing !important; }
.dnd-over { outline: 3px dashed var(--focus); outline-offset: 2px; }
[data-day] { -webkit-user-drag: none; }

/* Aperçu PDF intégré */
.pdf-frame { display: block; width: 100%; height: min(75vh, 900px); min-height: 360px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface-2); }
.pdf-preview > summary { cursor: pointer; font-weight: 600; margin-bottom: var(--s3); }
.mb4 { margin-bottom: var(--s4); }
