/* =====================================================================================
   SIROC33 - feuille de style unique
   Charte : militaire mais sobre. Bleu marine, vert armée, sable. Aucun insigne.
   Toute couleur passe par une variable de :root. Une couleur nouvelle s'ajoute ici.
   Mobile d'abord, portrait ; la navigation latérale apparaît à partir de 1000 px.
   ===================================================================================== */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-condensed-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-700.woff2") format("woff2"); }

:root {
  /* charte */
  --marine: #1b2a41;
  --marine-2: #253a5a;
  --marine-3: #3a5680;
  --vert-armee: #4b5320;
  --vert-armee-2: #5d6729;
  --vert-clair: #8a9a4b;
  --sable: #c8b88a;
  --sable-clair: #e9e0c9;
  --sable-fond: #f6f2e8;
  --blanc: #ffffff;

  /* surfaces et textes */
  --fond: #eeeadf;
  --surface: #ffffff;
  --surface-2: #f8f6f0;
  --bord: #ddd5c2;
  --bord-fort: #c9bfa6;
  --texte: #1f2328;
  --texte-2: #5d6470;
  --texte-inverse: #f4efe2;
  --lien: #2f5d8a;
  --accent: var(--vert-armee);
  --accent-survol: var(--vert-armee-2);
  --accent-texte: #ffffff;
  --barre-fond: var(--marine);
  --barre-texte: #f4efe2;
  --barre-filet: var(--vert-armee);
  --focus: #c8a24a;

  /* états */
  --ok: #2f6b3a;
  --ok-fond: #e2eedf;
  --vigilance: #b7791f;
  --vigilance-texte: #8a5a12;
  --vigilance-fond: #f8ebd0;
  --critique: #a63a2a;
  --critique-fond: #f5dfda;
  --info: #2f5d8a;
  --info-fond: #e0e9f3;
  --neutre-fond: #ece7da;

  /* séries graphiques, dans l'ordre d'usage */
  --serie-1: #4b5320;
  --serie-2: #c8a24a;
  --serie-3: #1b2a41;
  --serie-4: #8a9a4b;
  --serie-5: #7a8ca8;
  --serie-6: #a8763e;
  --serie-engage: #c8b88a;
  --serie-budget: #a63a2a;
  --grille-graphe: #e4ddcc;

  /* forme */
  --police: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-titre: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --rayon: 10px;
  --rayon-petit: 6px;
  --ombre: 0 1px 2px rgba(27, 42, 65, .06), 0 6px 18px rgba(27, 42, 65, .07);
  --ombre-forte: 0 10px 40px rgba(14, 20, 29, .28);
  --haut-barre: 56px;
  --haut-onglets: 62px;
  --larg-laterale: 252px;
  --sur-haut: env(safe-area-inset-top, 0px);
  --sur-bas: env(safe-area-inset-bottom, 0px);
}

/* ---------------------------------------------------------------- thème sombre --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0d131c;
    --surface: #152030;
    --surface-2: #1a283b;
    --bord: #273850;
    --bord-fort: #34496a;
    --texte: #ece6d6;
    --texte-2: #a3aab5;
    --lien: #9dbbe0;
    --sable-fond: #1a283b;
    --accent: #66742c;
    --accent-survol: #76863a;
    --barre-fond: #0a1018;
    --barre-filet: #66742c;
    --ok: #8fc49a; --ok-fond: #1d3324;
    --vigilance: #e0a94d; --vigilance-texte: #e8b968; --vigilance-fond: #3a2d14;
    --critique: #ec8f7e; --critique-fond: #3d1f1a;
    --info: #9dbbe0; --info-fond: #1b2d44;
    --neutre-fond: #223249;
    --serie-1: #9aab55; --serie-2: #d6b35c; --serie-3: #9db3d6; --serie-4: #c7d18f;
    --serie-5: #8fa3c4; --serie-6: #cf9a5c; --serie-engage: #6d6447; --serie-budget: #ec8f7e;
    --grille-graphe: #24344b;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --fond: #0d131c;
  --surface: #152030;
  --surface-2: #1a283b;
  --bord: #273850;
  --bord-fort: #34496a;
  --texte: #ece6d6;
  --texte-2: #a3aab5;
  --lien: #9dbbe0;
  --sable-fond: #1a283b;
  --accent: #66742c;
  --accent-survol: #76863a;
  --barre-fond: #0a1018;
  --barre-filet: #66742c;
  --ok: #8fc49a; --ok-fond: #1d3324;
  --vigilance: #e0a94d; --vigilance-texte: #e8b968; --vigilance-fond: #3a2d14;
  --critique: #ec8f7e; --critique-fond: #3d1f1a;
  --info: #9dbbe0; --info-fond: #1b2d44;
  --neutre-fond: #223249;
  --serie-1: #9aab55; --serie-2: #d6b35c; --serie-3: #9db3d6; --serie-4: #c7d18f;
  --serie-5: #8fa3c4; --serie-6: #cf9a5c; --serie-engage: #6d6447; --serie-budget: #ec8f7e;
  --grille-graphe: #24344b;
  --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
}

/* ---------------------------------------------------------------------- socle --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 400 15px/1.5 var(--police);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--police-titre); font-weight: 600; letter-spacing: .02em; line-height: 1.15; margin: 0; }
p { margin: 0 0 .8em; }
a { color: var(--lien); text-underline-offset: 2px; }
img, svg, canvas { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sprite { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.evitement:focus { left: 8px; }
.ico { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.ico-grand { width: 40px; height: 40px; }
[hidden] { display: none !important; }

/* --------------------------------------------------------------- barre du haut --- */
.barre {
  position: sticky; top: 0; z-index: 30;
  background: var(--barre-fond); color: var(--barre-texte);
  padding-top: var(--sur-haut);
  border-bottom: 3px solid var(--barre-filet);
}
.barre-in { display: flex; align-items: center; gap: 10px; min-height: var(--haut-barre); padding: 0 12px; max-width: 1180px; margin: 0 auto; }
.barre-titre { flex: 1; min-width: 0; }
.barre-titre h1 { font-size: 21px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-titre p { margin: 0; font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-actions { display: flex; gap: 4px; align-items: center; }
.barre-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: inherit; background: transparent; border: 0; cursor: pointer;
}
.barre-btn:hover { background: rgba(255, 255, 255, .08); }
.barre .btn-contour { color: var(--barre-texte); border-color: rgba(255, 255, 255, .35); }

.marque { display: inline-flex; align-items: baseline; text-decoration: none; font-family: var(--police-titre); font-weight: 700; font-size: 20px; letter-spacing: .08em; color: var(--barre-texte); }
.marque-num { color: var(--sable); margin-left: 1px; }
.marque-lat { font-size: 26px; color: var(--texte-inverse); }

/* ---------------------------------------------------------- navigation latérale --- */
.lateral { display: none; }
@media (min-width: 1000px) {
  .lateral {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--larg-laterale);
    background: var(--barre-fond); color: var(--texte-inverse); padding: 22px 14px; z-index: 40;
    border-right: 3px solid var(--barre-filet);
  }
  .lateral-sous { font-size: 12px; opacity: .6; margin: 2px 0 22px; letter-spacing: .03em; }
  .lateral ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .lateral a:not(.marque) {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
    color: var(--texte-inverse); text-decoration: none; font-weight: 500; opacity: .82;
  }
  .lateral a:not(.marque):hover { background: rgba(255, 255, 255, .06); opacity: 1; }
  .lateral a[aria-current="page"] { background: rgba(200, 184, 138, .14); opacity: 1; box-shadow: inset 3px 0 0 var(--sable); }
  .lateral-pied { margin-top: auto; font-size: 12px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 14px; }
  .lateral-pied .qui { word-break: break-all; opacity: .8; }
  .lateral-pied .qui span { color: var(--sable); }
  .lateral .lien-discret { color: var(--texte-inverse); }
  .page-app .barre, .page-app .contenu, .page-app .pied { margin-left: var(--larg-laterale); }
  .page-app .barre .marque { display: none; }
  .onglets, .tiroir { display: none !important; }
  body.page-app { padding-bottom: 0 !important; }
}

/* ------------------------------------------------------------ onglets du bas --- */
body.page-app { padding-bottom: calc(var(--haut-onglets) + var(--sur-bas)); }
.onglets {
  position: fixed; inset: auto 0 0 0; z-index: 35;
  display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--bord);
  padding-bottom: var(--sur-bas); box-shadow: 0 -4px 18px rgba(27, 42, 65, .08);
}
.onglets a, .onglets button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--haut-onglets); color: var(--texte-2); text-decoration: none;
  font: 600 10.5px/1.1 var(--police); letter-spacing: .01em; background: none; border: 0; cursor: pointer; position: relative;
}
.onglets .ico { width: 23px; height: 23px; }
.onglets [aria-current="page"] { color: var(--accent); }
.onglets [aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .onglets [aria-current="page"] { color: var(--serie-1); } }
:root[data-theme="dark"] .onglets [aria-current="page"] { color: var(--serie-1); }

.tiroir { position: fixed; inset: 0; z-index: 60; }
.tiroir-fond { position: absolute; inset: 0; background: rgba(10, 16, 24, .5); }
.tiroir-panneau {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 8px 10px calc(14px + var(--sur-bas)); box-shadow: var(--ombre-forte); animation: monte .2s ease-out;
}
.tiroir-poignee { width: 42px; height: 4px; border-radius: 2px; background: var(--bord-fort); margin: 4px auto 10px; }
.tiroir-lien {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 12px; border-radius: 10px;
  color: var(--texte); text-decoration: none; font: 500 16px var(--police); background: none; border: 0; cursor: pointer; text-align: left;
}
.tiroir-lien:hover { background: var(--surface-2); }
.ico-fin { margin-left: auto; opacity: .5; }
@keyframes monte { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ contenu --- */
.contenu { max-width: 1180px; margin: 0 auto; padding: 14px 14px 24px; }
@media (min-width: 1000px) { .contenu { padding: 24px 28px 32px; } }
.pied { max-width: 1180px; margin: 0 auto; padding: 8px 16px 18px; font-size: 12px; color: var(--texte-2); }
.pied p { margin: 2px 0; }
.contenu > .pied { padding-left: 0; padding-right: 0; }

.fraicheur { font-size: 12.5px; color: var(--texte-2); margin: 0 0 12px; line-height: 1.5; }
.fraicheur .ico { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; }

.entete-page { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.entete-page h2 { font-size: 26px; text-transform: uppercase; color: var(--marine); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .entete-page h2 { color: var(--texte); } }
:root[data-theme="dark"] .entete-page h2 { color: var(--texte); }
.entete-page .sur-titre { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--texte-2); margin: 0 0 2px; font-weight: 600; }

/* ------------------------------------------------------------------- blocs --- */
.bloc {
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 14px 14px 16px; margin-bottom: 14px; min-width: 0;
}
@media (min-width: 700px) { .bloc { padding: 18px 20px 20px; } }
.bloc-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.bloc-tete h2 {
  font-size: 18px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte);
  display: flex; align-items: center; gap: 9px;
}
.bloc-tete h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--accent); flex: none; }
.bloc-intro { color: var(--texte-2); font-size: 13.5px; margin-top: -4px; }

.grille { display: grid; gap: 14px; }
@media (min-width: 900px) {
  .grille-2 { grid-template-columns: 1fr 1fr; }
  .grille-3 { grid-template-columns: repeat(3, 1fr); }
  .grille-2-1 { grid-template-columns: 2fr 1fr; }
  .grille > .bloc { margin-bottom: 0; }
  .grille { margin-bottom: 14px; }
}

/* -------------------------------------------------------------------- KPI --- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.kpi {
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 12px 13px 12px; position: relative; overflow: hidden; min-width: 0;
}
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--sable); }
.kpi-ok::before { background: var(--ok); }
.kpi-vigilance::before { background: var(--vigilance); }
.kpi-critique::before { background: var(--critique); }
.kpi-accent::before { background: var(--accent); }
.kpi-lib { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-2); }
.kpi-lib .ico { width: 15px; height: 15px; }
.kpi-val { font-family: var(--police-titre); font-weight: 600; font-size: 31px; line-height: 1.05; margin: 0; color: var(--texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-val small { font-size: .55em; font-weight: 500; color: var(--texte-2); margin-left: 3px; }
.kpi-det { margin: 4px 0 0; font-size: 12px; color: var(--texte-2); }
@media (min-width: 760px) { .kpi-val { font-size: 36px; } }

/* bandeau d'état (budget, potentiel) */
.etat {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center;
  border-radius: var(--rayon); padding: 14px; margin-bottom: 14px; background: var(--surface); box-shadow: var(--ombre);
  border-left: 5px solid var(--sable);
}
.etat-ok { border-left-color: var(--ok); }
.etat-vigilance { border-left-color: var(--vigilance); }
.etat-critique { border-left-color: var(--critique); }
.etat-anneau { grid-row: span 2; width: 92px; height: 92px; position: relative; }
.etat-anneau .graphe, .etat-anneau .graphe-cadre { width: 92px; height: 92px !important; }
.etat-anneau b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 22px var(--police-titre); }
.etat h3 { font-size: 19px; text-transform: uppercase; letter-spacing: .04em; }
.etat p { margin: 0; font-size: 13.5px; color: var(--texte-2); }
.etat p strong { color: var(--texte); }

/* ------------------------------------------------------------- graphiques --- */
.graphe { margin: 0; }
.graphe-cadre { position: relative; width: 100%; }
.graphe-petit .graphe-cadre { height: 190px; }
.graphe-moyen .graphe-cadre { height: 250px; }
.graphe-grand .graphe-cadre { height: 320px; }
.graphe-anneau .graphe-cadre { height: 300px; max-width: 420px; margin: 0 auto; }
@media (min-width: 560px) { .graphe-anneau .graphe-cadre { height: 230px; } }
@media (min-width: 900px) { .graphe-moyen .graphe-cadre { height: 290px; } .graphe-grand .graphe-cadre { height: 360px; } }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--texte-2); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------------------------------------------------------------- jauges --- */
.jauge { height: 8px; border-radius: 5px; background: var(--neutre-fond); overflow: hidden; }
.jauge span { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--accent); transition: width .6s ease; }
.jauge-ok span { background: var(--ok); }
.jauge-vigilance span { background: var(--vigilance); }
.jauge-critique span { background: var(--critique); }

/* ---------------------------------------------------------------- pastilles --- */
.pastille { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.pastille-ok { background: var(--ok-fond); color: var(--ok); }
.pastille-vigilance { background: var(--vigilance-fond); color: var(--vigilance-texte); }
.pastille-critique { background: var(--critique-fond); color: var(--critique); }
.pastille-neutre { background: var(--neutre-fond); color: var(--texte-2); }
.pastille-info { background: var(--info-fond); color: var(--info); }

/* --------------------------------------------------------------- filtres --- */
.filtres { display: grid; gap: 10px; margin-bottom: 14px; }
.puces { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px 2px; }
.puces::-webkit-scrollbar { display: none; }
@media (min-width: 1000px) { .puces { margin: 0; padding: 0; flex-wrap: wrap; } }
.puce {
  flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--bord-fort); background: var(--surface);
  color: var(--texte); text-decoration: none; font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.puce[aria-pressed="true"] { background: var(--marine); border-color: var(--marine); color: var(--texte-inverse); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .puce[aria-pressed="true"] { background: var(--sable); border-color: var(--sable); color: var(--marine); } }
:root[data-theme="dark"] .puce[aria-pressed="true"] { background: var(--sable); border-color: var(--sable); color: var(--marine); }
.periode { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.periode label { display: flex; align-items: center; gap: 6px; }
.periode span { color: var(--texte-2); }
.periode select { padding: 7px 28px 7px 10px; min-height: 36px; }
.periode-an { font-family: var(--police-titre); font-weight: 600; font-size: 18px; color: var(--texte) !important; }
.js .sans-js { display: none; }

/* --------------------------------------------------------------- tableaux --- */
.table-defil { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
@media (min-width: 700px) { .table-defil { margin: 0; padding: 0; } }
table.donnees { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.donnees th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-2); font-weight: 600;
  padding: 8px 10px; border-bottom: 2px solid var(--bord-fort); white-space: nowrap; position: sticky; top: 0; background: var(--surface);
}
table.donnees td { padding: 9px 10px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
table.donnees tbody tr:hover { background: var(--surface-2); }
table.donnees .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.donnees tfoot td { font-weight: 700; border-top: 2px solid var(--bord-fort); border-bottom: 0; }
table.donnees a { color: var(--texte); font-weight: 600; text-decoration: none; }
table.donnees a:hover { text-decoration: underline; }

/* tableau qui devient une pile de cartes sur téléphone */
@media (max-width: 699px) {
  table.cartes thead { display: none; }
  table.cartes, table.cartes tbody, table.cartes tr, table.cartes td { display: block; width: 100%; }
  table.cartes tr { border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); }
  table.cartes td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.cartes td::before { content: attr(data-l); color: var(--texte-2); font-size: 12px; text-align: left; flex: none; }
  table.cartes td.cle { display: block; text-align: left; font-weight: 600; font-size: 15px; padding-bottom: 6px; }
  table.cartes td.cle::before { content: none; }
  table.cartes tfoot { display: block; }
}

/* ------------------------------------------------- listes de réservistes --- */
.liste { list-style: none; margin: 0; padding: 0; }
.ligne {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--bord); text-decoration: none; color: var(--texte);
}
.ligne:last-child { border-bottom: 0; }
a.ligne:hover { background: var(--surface-2); }
.ligne-grade {
  width: 44px; height: 44px; border-radius: 9px; display: grid; place-items: center;
  background: var(--sable-fond); border: 1px solid var(--bord); font: 700 13px var(--police-titre); letter-spacing: .04em; color: var(--marine);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ligne-grade { color: var(--sable); } }
:root[data-theme="dark"] .ligne-grade { color: var(--sable); }
.ligne-nom { font-weight: 600; line-height: 1.25; }
.ligne-nom small { display: block; font-weight: 400; color: var(--texte-2); font-size: 12.5px; }
.ligne-chiffre { text-align: right; font: 600 20px var(--police-titre); line-height: 1; }
.ligne-chiffre small { display: block; font: 500 11px var(--police); color: var(--texte-2); margin-top: 3px; }
.ligne-pastilles { grid-column: 2 / 4; display: flex; gap: 5px; flex-wrap: wrap; }

/* activités en cartes */
.act { padding: 12px 0; border-bottom: 1px solid var(--bord); display: grid; grid-template-columns: 54px 1fr auto; gap: 2px 12px; }
.act:last-child { border-bottom: 0; }
.act-date { text-align: center; border-radius: 8px; background: var(--sable-fond); border: 1px solid var(--bord); padding: 5px 0 4px; align-self: start; }
.act-date b { display: block; font: 700 22px/1 var(--police-titre); color: var(--texte); }
.act-date span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-2); font-weight: 600; }
.act-titre { font-weight: 600; line-height: 1.3; margin: 0; }
.act-meta { font-size: 12.5px; color: var(--texte-2); margin: 2px 0 0; }
.act-jours { text-align: right; font: 600 20px/1 var(--police-titre); }
.act-jours small { display: block; font: 500 11px var(--police); color: var(--texte-2); margin-top: 3px; }

/* --------------------------------------------------------------- boutons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-texte); font: 600 15px var(--police); text-decoration: none; cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.btn:hover { background: var(--accent-survol); }
.btn:active { transform: translateY(1px); }
.btn-contour { background: transparent; color: var(--texte); border-color: var(--bord-fort); }
.btn-contour:hover { background: var(--surface-2); }
.btn-petit { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn-danger { background: var(--critique); }
.btn-danger:hover { background: var(--critique); filter: brightness(1.08); }
.btn-plein { width: 100%; }
.btn .ico { width: 18px; height: 18px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.lien-discret { background: none; border: 0; padding: 4px 0; color: var(--texte-2); font: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ------------------------------------------------------------ formulaires --- */
input, select, textarea { font: inherit; color: var(--texte); }
.champ { display: grid; gap: 6px; margin-bottom: 14px; }
.champ > span, .champ > label { font-size: 13px; font-weight: 600; color: var(--texte); }
.champ small { color: var(--texte-2); font-size: 12px; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--bord-fort);
  background: var(--surface); font-size: 16px;
}
select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--texte-2) 50%), linear-gradient(135deg, var(--texte-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px;
}
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--focus); outline-offset: 0; }
.case { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14.5px; cursor: pointer; }
.case input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.form-ligne { display: grid; gap: 10px; }
@media (min-width: 700px) { .form-ligne { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.mdp { position: relative; }
.mdp button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--texte-2); font: 600 12.5px var(--police); padding: 8px; cursor: pointer; }
.regles { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12.5px; color: var(--texte-2); display: grid; gap: 3px; }
.regles li::before { content: "○"; margin-right: 7px; }
.regles li.ok { color: var(--ok); }
.regles li.ok::before { content: "●"; }

/* ------------------------------------------------------------------ notes --- */
.note { border-radius: 8px; padding: 11px 14px; margin-bottom: 12px; font-size: 14px; border-left: 4px solid; }
.note-succes { background: var(--ok-fond); border-color: var(--ok); color: var(--texte); }
.note-erreur { background: var(--critique-fond); border-color: var(--critique); color: var(--texte); }
.note-info { background: var(--info-fond); border-color: var(--info); color: var(--texte); }
.note-alerte { background: var(--vigilance-fond); border-color: var(--vigilance); color: var(--texte); }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.vide { text-align: center; padding: 26px 10px; color: var(--texte-2); }
.vide .ico { opacity: .45; margin-bottom: 6px; }

/* ----------------------------------------------------- fiche et définition --- */
.fiche-tete { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.fiche-grade { width: 62px; height: 62px; border-radius: 12px; display: grid; place-items: center; background: var(--marine); color: var(--sable); font: 700 18px var(--police-titre); letter-spacing: .05em; flex: none; }
.fiche-tete h2 { font-size: 26px; text-transform: uppercase; }
.fiche-tete p { margin: 2px 0 0; color: var(--texte-2); font-size: 13.5px; }
dl.defs { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.defs dt { color: var(--texte-2); }
dl.defs dd { margin: 0; font-weight: 500; text-align: right; }
.potentiel { display: grid; gap: 8px; }
.potentiel-chiffres { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--texte-2); }
.potentiel-barre { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--neutre-fond); }
.potentiel-barre span { display: block; height: 100%; width: 0; transition: width .6s ease; }
.pb-valide { background: var(--serie-1); }
.pb-engage { background: var(--serie-2); }
.pb-depasse { background: var(--critique); }

/* --------------------------------------------------------- onglets de page --- */
.onglets-page { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--bord); margin: 0 -14px 14px; padding: 0 14px; scrollbar-width: none; }
.onglets-page::-webkit-scrollbar { display: none; }
@media (min-width: 1000px) { .onglets-page { margin: 0 0 16px; padding: 0; } }
.onglets-page a { flex: none; padding: 10px 14px; text-decoration: none; color: var(--texte-2); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglets-page a[aria-current="page"] { color: var(--texte); border-bottom-color: var(--accent); }

/* tuiles d'administration */
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .tuiles { grid-template-columns: repeat(4, 1fr); } }
.tuile {
  display: grid; gap: 8px; padding: 16px 14px; border-radius: var(--rayon); background: var(--surface); box-shadow: inset 0 3px 0 var(--sable), var(--ombre);
  text-decoration: none; color: var(--texte);
}
.tuile:hover { box-shadow: inset 0 3px 0 var(--accent), var(--ombre); }
.tuile .ico { width: 28px; height: 28px; color: var(--accent); }
.tuile b { font: 600 18px var(--police-titre); text-transform: uppercase; letter-spacing: .04em; }
.tuile span { font-size: 12.5px; color: var(--texte-2); }

/* imports */
.imports { display: grid; gap: 10px; }
@media (min-width: 800px) { .imports { grid-template-columns: 1fr 1fr; } }
.import-carte { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px; background: var(--surface); }
.import-carte h3 { font-size: 17px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.import-carte p { font-size: 12.5px; color: var(--texte-2); margin-bottom: 10px; }
.depot {
  display: flex; align-items: center; gap: 10px; border: 1.5px dashed var(--bord-fort); border-radius: 8px; padding: 10px 12px; cursor: pointer;
  font-size: 13.5px; color: var(--texte-2); background: var(--surface-2); margin-bottom: 10px; position: relative;
}
.depot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.depot.choisi { border-style: solid; border-color: var(--accent); color: var(--texte); }

/* ----------------------------------------------------------- pages publiques --- */
.page-publique {
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(200, 184, 138, .16), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 14px),
    var(--marine);
  color: var(--texte-inverse);
}
.publique { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + var(--sur-haut)) 16px calc(24px + var(--sur-bas)); }
.porte { width: 100%; max-width: 410px; }
.porte-marque { text-align: center; margin-bottom: 22px; }
.porte-marque .sigle { font: 700 52px/1 var(--police-titre); letter-spacing: .1em; }
.porte-marque .sigle span { color: var(--sable); }
.porte-marque p { margin: 8px 0 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.porte-marque .chevrons { display: block; width: 46px; margin: 0 auto 12px; color: var(--sable); }
.porte-carte { background: var(--surface); color: var(--texte); border-radius: 14px; padding: 24px 20px 22px; box-shadow: inset 0 4px 0 var(--vert-armee), var(--ombre-forte); }
.porte-carte h2 { font-size: 23px; text-transform: uppercase; margin-bottom: 6px; }
.porte-carte .intro { color: var(--texte-2); font-size: 14px; }
.porte-liens { display: grid; gap: 6px; text-align: center; margin-top: 16px; font-size: 14px; }
.porte-liens a { color: var(--sable-clair); }
.porte-pied { text-align: center; font-size: 11.5px; opacity: .6; margin-top: 22px; }
.porte-pied a { color: inherit; }

.carte-erreur { text-align: center; max-width: 480px; margin: 40px auto; }
.erreur-code { font: 700 64px/1 var(--police-titre); color: var(--sable); margin: 0; }

/* ---------------------------------------------------------- utilitaires --- */
.discret { color: var(--texte-2); font-size: 13px; }
.droite { text-align: right; }
.gras { font-weight: 600; }
.mt { margin-top: 14px; }
.sans-marge { margin: 0; }
.nowrap { white-space: nowrap; }
.chiffre { font-variant-numeric: tabular-nums; }
.separateur { height: 1px; background: var(--bord); margin: 14px 0; border: 0; }
.deux-col { display: grid; gap: 14px; }
@media (min-width: 700px) { .deux-col { grid-template-columns: 1fr 1fr; } }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.compteur { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--critique); color: var(--blanc); font-size: 12px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .barre, .onglets, .lateral, .filtres, .pied, .btn { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  .bloc, .kpi { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .page-app .contenu { margin: 0; }
}

/* activité cliquable */
a.act { text-decoration: none; color: var(--texte); }
a.act:hover .act-titre { text-decoration: underline; }

/* lignes dépliables des paramètres et des contrôles */
.ligne-param { border-bottom: 1px solid var(--bord); padding: 4px 0; }
.ligne-param:last-child { border-bottom: 0; }
.ligne-param > summary { list-style: none; padding: 10px 4px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-weight: 400; }
.ligne-param > summary::-webkit-details-marker { display: none; }
.ligne-param > summary::after { content: "›"; margin-left: auto; color: var(--texte-2); font-size: 20px; line-height: 1; transition: transform .15s; }
.ligne-param[open] > summary::after { transform: rotate(90deg); }
.ligne-param[open] { background: var(--surface-2); border-radius: 8px; padding: 4px 10px 12px; margin: 4px -10px; }
.bloc h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-2); margin-bottom: 8px; }
details > summary .ico { width: 16px; height: 16px; }
