/* Suivi intermittence : une seule feuille, jetons de couleurs clair / sombre.
   A10 (artiste) = bleu, A8 (technicien) = ambre. good / warn / crit réservés aux états. */
:root {
  --bg: #ECEEF1;
  --surface: #FFFFFF;
  --surface-2: #F6F7F9;
  --text: #15171C;
  --muted: #5A606B;
  --line: #D5D9DF;
  --nav-bg: #15171C;
  --nav-text: #C9CDD6;
  --nav-hover: #262A33;
  --primary: #15171C;
  --primary-text: #FFFFFF;
  --link: #3346A8;
  --a10: #3346A8;
  --a8: #C27612;
  --good: #1F6B40; --good-bg: #E1F0E6;
  --warn: #8A4B06; --warn-bg: #FDF1E0;
  --crit: #A3231B; --crit-bg: #FBE4E1;
  --focus: #3346A8;
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-cond: "IBM Plex Sans Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216; --surface: #1A1D23; --surface-2: #22262E; --text: #E8EAEE; --muted: #A0A7B3;
    --line: #2F343D; --nav-bg: #0B0C0F; --nav-text: #A9AFBA; --nav-hover: #1F2229;
    --primary: #E8EAEE; --primary-text: #101216; --link: #93A2F0;
    --a10: #6F80E0; --a8: #C9801C;
    --good: #7FD1A0; --good-bg: #173324; --warn: #F2B866; --warn-bg: #3A2A12; --crit: #F29A92; --crit-bg: #3D1A17;
    --focus: #93A2F0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101216; --surface: #1A1D23; --surface-2: #22262E; --text: #E8EAEE; --muted: #A0A7B3;
  --line: #2F343D; --nav-bg: #0B0C0F; --nav-text: #A9AFBA; --nav-hover: #1F2229;
  --primary: #E8EAEE; --primary-text: #101216; --link: #93A2F0;
  --a10: #6F80E0; --a8: #C9801C;
  --good: #7FD1A0; --good-bg: #173324; --warn: #F2B866; --warn-bg: #3A2A12; --crit: #F29A92; --crit-bg: #3D1A17;
  --focus: #93A2F0; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.75rem; font-weight: 600; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; margin-top: 1.5rem; }
code { font-size: .9em; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muet { color: var(--muted); }
.visuel-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico-sm { width: 16px; height: 16px; }

/* ---- cadre ---- */
.cadre { display: flex; min-height: 100vh; }
.barre { width: 232px; flex-shrink: 0; background: var(--nav-bg); color: var(--nav-text); padding: 20px 12px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.marque { display: flex; align-items: center; gap: 10px; color: #FFFFFF; text-decoration: none; font-family: var(--font-cond); font-size: 1.15rem; font-weight: 600; padding: 0 10px; }
.nav-liste { display: flex; flex-direction: column; gap: 2px; }
.nav-lien { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 6px; color: var(--nav-text); text-decoration: none; font-size: .95rem; min-height: 44px; }
a.nav-lien:hover { background: var(--nav-hover); color: #FFFFFF; }
.nav-lien.actif { background: #FFFFFF; color: #15171C; font-weight: 600; }
.nav-inactif { color: #8A909C; cursor: default; }
.nav-inactif .pastille { margin-left: auto; }
.lib-court { display: none; }
.barre-pied { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.bouton-discret { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px; border: 0; background: none; color: var(--nav-text); font: inherit; font-size: .9rem; border-radius: 6px; cursor: pointer; text-align: left; }
.bouton-discret:hover { background: var(--nav-hover); color: #FFFFFF; }
.ico-soleil { display: none; }
:root[data-theme="dark"] .ico-lune { display: none; }
:root[data-theme="dark"] .ico-soleil { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-lune { display: none; }
  :root:not([data-theme="light"]) .ico-soleil { display: block; }
}

.contenu { flex: 1; min-width: 0; padding: 28px 32px 24px; display: flex; flex-direction: column; gap: 20px; max-width: 1180px; }
.entete { display: flex; flex-direction: column; gap: 4px; }
.surtitre { margin: 0; color: var(--muted); font-size: .9rem; }
.pied { margin-top: auto; padding-top: 16px; font-size: .8rem; color: var(--muted); }

/* ---- blocs ---- */
.panneau { background: var(--surface); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.panneau p { margin: 0; }
.vide { border: 2px dashed var(--line); background: var(--surface-2); align-items: flex-start; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tuile { background: var(--surface); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.tuile p { margin: 0; }
.tuile-warn { box-shadow: inset 0 0 0 2px var(--warn); }
.tuile-attente { background: var(--surface-2); }
.etiquette { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.chiffre { font-family: var(--font-cond); font-size: 2.1rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.chiffre.muet { color: var(--muted); font-weight: 600; }
.note { font-size: .85rem; color: var(--warn); background: var(--warn-bg); padding: 6px 10px; border-radius: 6px; margin-top: 4px !important; }
.tuile .note:not(:first-child) { align-self: stretch; }
.note-neutre { color: var(--muted); background: var(--surface-2); }

.alerte { padding: 12px 16px; border-radius: 8px; font-size: .95rem; }
.alerte-good { background: var(--good-bg); color: var(--good); }
.alerte-warn { background: var(--warn-bg); color: var(--warn); }
.alerte-crit { background: var(--crit-bg); color: var(--crit); }
.pastille { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: .72rem; font-weight: 600; background: var(--nav-hover); color: var(--nav-text); }
.pastille-warn { background: var(--warn-bg); color: var(--warn); }

/* ---- bulles d'aide ---- */
.aide { position: relative; display: inline-flex; color: var(--muted); cursor: help; vertical-align: middle; }
.aide .bulle { display: none; position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 260px; padding: 8px 10px; background: var(--text); color: var(--bg); font-size: .82rem; font-weight: 400; line-height: 1.4; border-radius: 6px; white-space: normal; text-align: left; }
.aide:hover .bulle, .aide:focus .bulle { display: block; }

/* ---- formulaires ---- */
.formulaire { display: flex; flex-direction: column; gap: 16px; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.champ { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.champ-large { grid-column: 1 / -1; }
.champ > label, .champ > legend { font-size: .9rem; font-weight: 500; display: flex; align-items: center; gap: 6px; padding: 0; }
.choix { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.choix label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
input[type="text"], input[type="date"], input[type="month"], input[type="password"], select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; min-height: 44px; width: 100%;
}
input:focus, select:focus { border-color: var(--focus); }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 6px; background: var(--primary); color: var(--primary-text); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.bouton:hover { opacity: .9; }
.bouton-lien { border: 0; background: none; color: var(--link); font: inherit; font-size: .88rem; cursor: pointer; padding: 6px 0; text-decoration: underline; }
.erreur { color: var(--crit); margin: 0; }

/* ---- tableaux ---- */
.tableau-defile { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tableau td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tableau .nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau .source { font-size: .85rem; max-width: 320px; }
.ligne-hist td { background: var(--surface-2); font-size: .88rem; }

/* ---- connexion ---- */
.page-connexion { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.connexion { width: 100%; max-width: 360px; background: var(--surface); border-radius: var(--radius); padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.connexion h1 { font-family: var(--font-cond); font-size: 1.5rem; }
.connexion > img { border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.connexion .formulaire { width: 100%; }

/* ---- téléphone : barre en haut, navigation en bas ---- */
@media (max-width: 760px) {
  .cadre { flex-direction: column; }
  .barre { width: auto; height: auto; position: sticky; top: 0; z-index: 30; flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); gap: 8px; }
  .marque { padding: 0; font-size: 1.05rem; }
  .barre-pied { margin: 0; flex-direction: row; }
  .barre-pied form { display: contents; }
  .bouton-discret { width: 44px; justify-content: center; padding: 0; }
  .bouton-discret span { display: none; }
  .nav-liste { position: fixed; left: 0; right: 0; bottom: 0; flex-direction: row; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); z-index: 30; }
  .nav-lien { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: .74rem; color: var(--muted); text-align: center; justify-content: flex-start; white-space: nowrap; min-width: 0; }
  .nav-lien.actif { background: none; color: var(--text); }
  .nav-inactif { color: var(--muted); }
  .nav-inactif .ico { opacity: .6; }
  .nav-inactif .pastille { display: none; }
  .lib-long { display: none; }
  .lib-court { display: block; line-height: 1.2; }
  .contenu { padding: 20px 16px calc(92px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 1.4rem; }
  .panneau { padding: 18px; }
  .chiffre { font-size: 1.8rem; }
  /* le barème devient une pile de fiches */
  .tableau thead { display: none; }
  .tableau, .tableau tbody, .tableau tfoot, .tableau tr, .tableau td, .tableau tbody th, .tableau tfoot th { display: block; width: 100%; }
  .tableau tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .tableau td { border: 0; padding: 2px 0; text-align: left !important; white-space: normal !important; max-width: none !important; }
  .tableau td[data-label]:not([data-label="Paramètre"])::before { content: attr(data-label) " : "; color: var(--muted); font-size: .85rem; }
  .ligne-hist { background: var(--surface-2); padding-inline: 10px !important; }
  .ligne-hist td { background: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===== v0.2 : compteur, histogramme, contrats ===== */
.petit { font-size: .85rem; }
.entete-action { flex-direction: row; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.panneau-tete { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.bouton-second { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.bouton-danger { background: var(--crit); color: #FFFFFF; }
.lien-danger { color: var(--crit); }
.actions-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

.seg-a10 { background: var(--a10); }
.seg-a8 { background: var(--a8); }
.seg-futur { background: repeating-linear-gradient(135deg, var(--muted) 0 3px, transparent 3px 8px); box-shadow: inset 0 0 0 1px var(--muted); }

.compteur { gap: 18px; }
.compteur-tete { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.compteur-valeur { display: flex; align-items: baseline; gap: 10px; }
.chiffre-geant { font-family: var(--font-cond); font-size: 4rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.compteur-seuil { font-family: var(--font-cond); font-size: 1.5rem; font-weight: 600; color: var(--muted); }
.jauge { position: relative; height: 36px; margin: 26px 0 4px; }
.jauge-fond { position: absolute; inset: 0; background: var(--surface-2); border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.jauge-barre { position: absolute; inset: 0; display: flex; border-radius: 4px; overflow: hidden; }
.jauge-barre .seg { height: 100%; flex-shrink: 0; }
.jauge-barre .seg + .seg { border-left: 2px solid var(--surface); }
.jauge-seuil { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--text); transform: translateX(-1px); }
.jauge-seuil span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-family: var(--font-cond); font-size: .85rem; font-weight: 600; white-space: nowrap; padding-bottom: 2px; }
.legende { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: .95rem; }
.legende li { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.pastille-couleur { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.regime { margin: 0; color: var(--muted); font-size: .92rem; }
.regime strong { color: var(--text); }

.histo { position: relative; display: grid; grid-template-rows: 180px auto; padding-left: 34px; margin-top: 8px; }
.histo-grille { grid-row: 1; grid-column: 1; position: relative; margin-left: -34px; }
.histo-ligne { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.histo-ligne span { position: absolute; left: 0; top: -9px; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; background: var(--surface); padding-right: 4px; }
.histo-colonnes { grid-row: 1; grid-column: 1; position: relative; display: flex; align-items: flex-end; gap: 6px; }
.histo-col { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline-offset: 2px; border-radius: 4px; }
.histo-col:hover, .histo-col:focus { background: var(--surface-2); }
.histo-pile { width: 70%; max-width: 40px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.histo-pile span { display: block; min-height: 2px; }
.histo-pile span:first-child { border-radius: 4px 4px 0 0; }
.histo-total { position: absolute; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); bottom: calc(var(--h, 0%) + 2px); }
.bulle-histo { display: none; position: absolute; z-index: 20; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; padding: 8px 10px; background: var(--text); color: var(--bg); font-size: .8rem; line-height: 1.45; border-radius: 6px; pointer-events: none; }
.histo-col:hover .bulle-histo, .histo-col:focus .bulle-histo { display: block; }
.histo-mois { grid-row: 2; grid-column: 1; display: flex; gap: 6px; padding-top: 6px; }
.histo-mois span { flex: 1; text-align: center; font-size: .75rem; color: var(--muted); }
.detail-tableau summary { cursor: pointer; color: var(--link); font-size: .9rem; min-height: 44px; display: flex; align-items: center; text-decoration: underline; }

.puce { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.puce-a10 { background: var(--a10); color: #FFFFFF; }
.puce-a8 { background: var(--a8); color: #FFFFFF; }
.puce-autre { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.etat { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .78rem; font-weight: 500; white-space: nowrap; }
.etat-compte { background: var(--good-bg); color: var(--good); }
.etat-cours { background: var(--warn-bg); color: var(--warn); }
.etat-prevu { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.etat-ancien { color: var(--muted); }
.etat-crit { background: var(--crit-bg); color: var(--crit); }
.ligne-ancien td, .ligne-hors td { color: var(--muted); }
.tableau-contrats td { vertical-align: middle; }
.lien-ligne { font-weight: 500; white-space: nowrap; }
.dates { white-space: nowrap; }

.choix-annexe { gap: 8px; }
.option-annexe { padding: 8px 14px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.option-annexe:has(input:checked) { box-shadow: inset 0 0 0 2px var(--text); font-weight: 500; }
.indice { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
.indice button { margin-left: 6px; }
.total-direct { margin: -4px 0 0; font-size: .92rem; color: var(--muted); min-height: 1.4em; }

@media (max-width: 760px) {
  .chiffre-geant { font-size: 3rem; }
  .histo { grid-template-rows: 150px auto; padding-left: 28px; }
  .histo-grille { margin-left: -28px; }
  .histo-colonnes, .histo-mois { gap: 2px; }
  .histo-mois span { font-size: .62rem; }
  .histo-total { display: none; }
  .tableau-contrats td[data-label="Dates"]::before, .tableau-contrats td[data-label="Employeur"]::before { content: none !important; }
  .tableau-contrats td[data-label="Dates"] { font-size: 1rem; }
  .actions-form .bouton { width: 100%; }
}
.tableau-contrats td[data-label="Employeur"] { min-width: 13rem; }
@media (max-width: 760px) { .tableau-contrats td[data-label="Employeur"] { min-width: 0; } }

/* ===== v0.3 : droits, sources, documents ===== */
.hausse { color: var(--good); font-weight: 600; }
.baisse { color: var(--crit); font-weight: 600; }
.alertes-docs { display: flex; flex-direction: column; gap: 8px; }
.lien-alerte { display: block; text-decoration: none; font-weight: 500; }
.lien-alerte:hover { text-decoration: underline; }
.source-puce { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 4px; font-size: .72rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.source-ft, .source-aem { background: var(--good-bg); color: var(--good); box-shadow: none; }
.source-bulletin { background: var(--surface-2); color: var(--text); }
.puce-ecart { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 4px; font-size: .72rem; font-weight: 600; background: var(--warn-bg); color: var(--warn); cursor: help; }
.ligne-courante td { background: var(--surface-2); }
.liste-docs { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 6px; }
.case { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.case input { width: 18px; height: 18px; }
.choix-colonne { flex-direction: column; align-items: flex-start; gap: 4px; }
.choix-colonne label { min-height: 40px; display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 10px; padding-top: 8px; }
.choix-colonne label input[type="radio"] { margin-top: 4px; flex-shrink: 0; }
.choix-colonne label.choix-select { flex-wrap: wrap; align-items: center; padding-top: 0; }
.choix-colonne label.choix-select input[type="radio"] { margin-top: 0; }
.choix-colonne select { width: auto; min-height: 40px; padding: 6px 10px; max-width: 100%; }
.panneau-attention { box-shadow: inset 0 0 0 2px var(--warn); }
.filtres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.filtre { padding: 6px 12px; border-radius: 6px; font-size: .88rem; text-decoration: none; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); min-height: 36px; display: inline-flex; align-items: center; gap: 6px; }
.filtre.actif { background: var(--primary); color: var(--primary-text); box-shadow: none; }
.filtre.actif .muet { color: inherit; opacity: .7; }
.vide-simple { padding: 20px 0 8px; display: flex; flex-direction: column; gap: 4px; }
.vide-simple p { margin: 0; }
.verif { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.verif-apercu { position: sticky; top: 16px; }
.apercu-image { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); background: #FFFFFF; }
.apercu-pdf { width: 100%; height: 70vh; border: 0; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); background: #FFFFFF; }
.fiche-texte { white-space: pre-wrap; word-break: break-word; font-size: .82rem; line-height: 1.5; background: var(--surface-2); padding: 12px; border-radius: 6px; max-height: 50vh; overflow: auto; margin: 0; }
.fiche-champs { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 20px; }
.fiche-champs div { display: flex; flex-direction: column; gap: 2px; }
.fiche-champs dt { font-size: .85rem; color: var(--muted); }
.fiche-champs dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.tableau-mois td { padding: 6px 8px 6px 0; border: 0; }
.tableau-mois input { min-width: 90px; width: 100%; }
.zone-fichier { padding: 14px; border-radius: 8px; border: 2px dashed var(--line); background: var(--surface-2); }
.zone-fichier input[type="file"] { font: inherit; font-size: .9rem; max-width: 100%; }
.tableau-droits td, .tableau-sources td { vertical-align: middle; }
[data-types][hidden] { display: none !important; }

@media (max-width: 960px) {
  .verif { grid-template-columns: minmax(0, 1fr); }
  .verif-apercu { position: static; }
  .apercu-pdf { height: 55vh; }
}
@media (max-width: 760px) {
  .tableau-mois thead { display: none; }
  .tableau-mois tr { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px; }
  .tableau-mois td { display: flex !important; flex-direction: column; gap: 2px; }
  .tableau-mois td::before { content: attr(data-label) !important; font-size: .8rem; }
  .tableau-mois tr { border-bottom: 1px solid var(--line); padding: 8px 0 12px !important; }
  .tableau-mois input { min-width: 0; }
  .ligne-courante { padding-inline: 10px !important; background: var(--surface-2); }
}

/* ===== v0.4 : import ===== */
.liste-erreurs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.liste-erreurs li:last-child { border-bottom: 0; padding-bottom: 0; }
.liste-erreurs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.liste-erreurs form { display: inline; }
.emplacement { margin-top: 12px; }
.emplacement code { word-break: break-all; font-size: .8rem; }

input[type="file"] { padding: 8px; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 500; margin-right: 12px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2, var(--bg)); color: var(--text); cursor: pointer; }
.modele { font-family: ui-monospace, monospace; font-size: .9em; white-space: nowrap; }

/* Validation par lot */
.legende-lot { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .9rem; color: var(--muted); }
.legende-lot li { display: flex; align-items: center; gap: 8px; }
.lot-outils { display: flex; gap: 20px; margin: 8px 0; }
.tableau-lot td { vertical-align: top; }
.tableau-lot .case-lot { width: 44px; }
.tableau-lot .case-lot input { width: 22px; height: 22px; margin: 4px 0 0; accent-color: var(--primary); cursor: pointer; }
.tableau-lot tr.cochee td { background: var(--good-bg); }
.select-lot { min-width: 200px; max-width: 280px; padding: 8px; min-height: 40px; }
.texte-warn { color: var(--warn); }
.barre-lot { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 16px -24px -24px; padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0,0,0,.06); }
@media (max-width: 760px) {
  .barre-lot { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); margin: 16px -16px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; }
  .legende-lot { font-size: .85rem; gap: 6px 12px; }
  .barre-lot .bouton { width: 100%; }
  .select-lot { max-width: none; width: 100%; }
  .tableau-lot .case-lot { width: auto; }
}
.entete-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.pastille-bouton { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 11px; background: var(--primary-text); color: var(--primary); font-size: .8rem; font-weight: 700; text-align: center; }
@media (max-width: 760px) { .entete-boutons { width: 100%; } .entete-boutons .bouton { flex: 1 1 auto; } }
.titre-section { font-size: 1.15rem; margin: 28px 0 12px; }
.groupe-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.groupe-doublon .tableau td input[type=radio] { width: 22px; height: 22px; accent-color: var(--primary); }

/* Actualisation (v0.5) */
.nav-mois { display: flex; align-items: center; gap: 8px; }
.nav-mois .bouton { min-width: 44px; padding-inline: 12px; }
.nav-mois input[type=month] { width: auto; }
.actu-grille { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px; }
.actu-grille > .panneau { margin: 0; }
@media (min-width: 1100px) { .actu-grille { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.grand-chiffre { font-family: var(--font-cond, inherit); font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.totaux-decl { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.totaux-decl dt { color: var(--muted); font-size: .9rem; margin-bottom: 4px; }
.totaux-decl dd { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.montant-actu { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.montant-actu .grand-chiffre { font-size: 2.4rem; color: var(--primary); }
.etapes-calcul { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.etapes-calcul li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.etapes-calcul li strong { white-space: nowrap; }
.etapes-calcul .sous-total { border-bottom-style: solid; font-weight: 600; }
.etapes-calcul .total { border-bottom: 0; border-top: 2px solid var(--text); margin-top: 4px; font-weight: 700; }
@media (max-width: 760px) {
  .totaux-decl { grid-template-columns: 1fr; }
  .nav-mois { width: 100%; }
  .nav-mois form { flex: 1; }
  .nav-mois input[type=month] { width: 100%; }
}

/* Travail prévu sans contrat (v0.5.2) : même teinte que l'annexe, hachuré ; contrats signés à venir : teinte claire */
.seg-a10-venir { background: color-mix(in srgb, var(--a10) 45%, transparent); }
.seg-a8-venir { background: color-mix(in srgb, var(--a8) 45%, transparent); }
.seg-a10-prevu { background: repeating-linear-gradient(135deg, var(--a10) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1.5px var(--a10); }
.seg-a8-prevu { background: repeating-linear-gradient(135deg, var(--a8) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1.5px var(--a8); }
.pastille-double { display: inline-flex; gap: 3px; flex-shrink: 0; }
.pastille-inline { display: inline-block; vertical-align: -2px; margin-right: 3px; }
.legende-projection { padding-left: 0; }
.actions-compteur { margin: 8px 0 0; }
.ligne-prevue td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.etat-sans-contrat { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, transparent 4px 8px); color: var(--text); box-shadow: inset 0 0 0 1px var(--muted); }
.case-prevu { padding: 12px; border: 1px dashed var(--line); border-radius: 8px; margin-bottom: 8px; align-items: flex-start; }

/* Calendrier (v0.6) */
.legende-compacte { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; padding: 0; list-style: none; font-size: .88rem; color: var(--muted); }
.legende-compacte li { display: flex; align-items: center; gap: 6px; }
.calendrier-panneau { padding: 12px; }
.calendrier { display: flex; flex-direction: column; gap: 4px; }
.cal-ligne { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-entete div { font-size: .78rem; color: var(--muted); text-align: center; padding: 2px 0; }
.cal-jour { min-height: 96px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--surface); }
.cal-jour.hors-mois { opacity: .45; background: transparent; }
.cal-jour.aujourdhui { box-shadow: inset 0 0 0 2px var(--text); }
.cal-num { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; font-weight: 600; color: var(--text); text-decoration: none; border-radius: 4px; padding: 0 2px; min-height: 22px; }
.cal-plus { opacity: 0; color: var(--muted); font-weight: 400; }
.cal-jour:hover .cal-plus, .cal-num:focus .cal-plus { opacity: 1; }
.cal-num:hover, .cal-num:focus { background: var(--surface-2); }
.cal-travail { display: block; font-size: .74rem; line-height: 1.25; padding: 2px 5px; border-radius: 4px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.cal-travail.cal-a10.cal-document { background: var(--a10); }
.cal-travail.cal-a8.cal-document { background: var(--a8); }
.cal-travail.cal-saisi { background: var(--surface); color: var(--text); }
.cal-travail.cal-a10.cal-saisi, .cal-contour.cal-a10 { box-shadow: inset 0 0 0 1.5px var(--a10); }
.cal-travail.cal-a8.cal-saisi, .cal-contour.cal-a8 { box-shadow: inset 0 0 0 1.5px var(--a8); }
.cal-travail.cal-a10.cal-prevu { background: repeating-linear-gradient(135deg, var(--a10) 0 2px, transparent 2px 5px) left / 7px 100% no-repeat, var(--surface); padding-left: 10px; box-shadow: inset 0 0 0 1.5px var(--a10); color: var(--text); }
.cal-travail.cal-a8.cal-prevu { background: repeating-linear-gradient(135deg, var(--a8) 0 2px, transparent 2px 5px) left / 7px 100% no-repeat, var(--surface); padding-left: 10px; box-shadow: inset 0 0 0 1.5px var(--a8); color: var(--text); }
.cal-travail.cal-hors, .cal-hors { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--muted); }
.cal-travail:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
@media (max-width: 760px) {
  .calendrier-panneau { padding: 6px; }
  .cal-ligne { gap: 2px; }
  .cal-jour { min-height: 58px; padding: 2px; }
  .cal-travail { font-size: 0; padding: 0; height: 8px; border-radius: 2px; }
  .cal-plus { display: none; }
}

/* Bilan (v0.6) */
.seg-revenu { background: color-mix(in srgb, var(--text) 70%, transparent); }
.seg-aj { background: color-mix(in srgb, var(--good) 80%, transparent); }
.barre-annee { display: flex; height: 10px; border-radius: 3px; overflow: hidden; background: var(--surface-2); margin-bottom: 6px; max-width: 320px; }
.barre-annee span { display: block; height: 100%; }
.tableau-annees th[scope=row] { font-weight: 600; white-space: nowrap; vertical-align: top; }
.tableau-annees td { vertical-align: top; min-width: 180px; }
.filtres-plage { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filtres-plage select { width: auto; }
.tuiles-revenus { margin-bottom: 20px; }
.tableau-revenus tfoot th, .tableau-revenus tfoot td { border-top: 2px solid var(--text); font-weight: 600; }
.bloc-impots { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.bloc-impots h3 { margin: 0 0 8px; }
.formulaire-ligne { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 10px; }
.formulaire-ligne input { width: 160px; }
.seulement-imprimer { display: none; }
.feuille-nom { font-size: 1.3rem; font-weight: 700; margin: 0; }
@media print {
  .barre, .nav-liste, .pas-imprimer, .pied, .alerte, .filtres, .bouton, .detail-annee:not([open]) { display: none !important; }
  .seulement-imprimer { display: block; }
  body, .contenu, .panneau { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .cadre { display: block; }
  .contenu { padding: 0; max-width: none; }
  .panneau { border: 0; padding: 0; }
  .tuile { border: 1px solid #999; }
  a { color: #000; text-decoration: none; }
  details > summary { list-style: none; font-weight: 700; margin-top: 12px; }
}

/* Histogramme cliquable (v0.6) */
.histo-col { cursor: pointer; border: 0; font: inherit; color: inherit; background: none; padding: 0; }
.histo-col[aria-expanded="true"] { background: var(--surface-2); }
.histo-col[aria-expanded="true"] .bulle-histo { display: none !important; }
.detail-mois p { margin-top: 10px; }
.detail-annee { margin-top: 8px; }
.sim-tuiles .chiffre { white-space: nowrap; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.detail-mois { margin-top: 12px; }
.detail-mois h3 { font-size: 1rem; margin: 0 0 8px; }

/* Navigation à 8 entrées sur téléphone */
@media (max-width: 760px) { .nav-lien { font-size: .62rem; padding: 6px 0; gap: 2px; letter-spacing: -.01em; } .nav-lien .ico { width: 20px; height: 20px; } }
@media (max-width: 760px) {
  .cal-travail.cal-a10.cal-prevu { background: repeating-linear-gradient(135deg, var(--a10) 0 2px, transparent 2px 4px); padding: 0; }
  .cal-travail.cal-a8.cal-prevu { background: repeating-linear-gradient(135deg, var(--a8) 0 2px, transparent 2px 4px); padding: 0; }
}
@media (max-width: 760px) {
  .tableau-revenus tfoot td { border-top: 0; }
  .tableau-revenus tfoot tr { border-top: 2px solid var(--text); }
  .tableau-annees td { min-width: 0; }
}

/* Pleine largeur (v0.7) */
html[data-largeur="pleine"] .contenu { max-width: none; }
@media (max-width: 760px) { #bascule-largeur { display: none; } }
.jauge-mini { height: 14px; margin: 8px 0 10px; }
.jauge-mini .jauge-barre, .jauge-mini .jauge-fond { height: 14px; }
