/* ==========================================================
   Feuille de style globale — thèmes clair et sombre
   ========================================================== */
:root {
  --blue: #5a50e0;
  --blue-dark: #3a32a8;
  --white: #ffffff;
  --red: #c62828;
  --green: #1b7f3b;

  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --border: #dde1ea;
  --text: #1a1d29;
  --muted: #5b6376;
  --link: #4a40d4;
  --primary: #5a50e0;
  --primary-hover: #4a40d0;
  --primary-text: #ffffff;
  --hdr: #2e2878;
  --nav-bg: #ffffff;
  --hover: #f1effd;
  --result: #efedfd;
  --input-bg: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06);
  --danger-bg: #fdecec;
  --ok-bg: #e6f4ea;

  --chip: #eef2ff;
  --chip-bg: #eef2ff;

  --pill-bg: #eef2ff;     --pill-bd: #c7d2fe;     --pill-tx: #3730a3;
  --pill-ok-bg: #dcfce7;   --pill-ok-bd: #86efac;   --pill-ok-tx: #166534;
  --pill-err-bg: #fee2e2;  --pill-err-bd: #fca5a5;  --pill-err-tx: #991b1b;
  --pill-info-bg: #e0f2fe; --pill-info-bd: #7dd3fc; --pill-info-tx: #075985;
  --pill-muted-bg: #f1f5f9;--pill-muted-bd: #cbd5e1;--pill-muted-tx: #334155;
  --pill-warn-bg: #fef3c7; --pill-warn-bd: #fcd34d; --pill-warn-tx: #7a5a00;

  --thead-bg: var(--surface-2);
  --thead-tx: var(--link);
  --tbl-alt: var(--surface-2);
  --tbl-row-hover: var(--hover);
  --tbl-wrap-bg: var(--surface);
  --bulk-bg: #eef2ff;
  --bulk-bd: #c7d2fe;
  --modal-head-bg: #eef2ff;
  --modal-foot-bg: #f8faff;
  --fiche-bg: #eef2ff;
  --fiche-bd: var(--link);
  --bloc-retenir-bg: #e7f2fb; --bloc-retenir-bd: #1a5c94; --bloc-retenir-tx: #1a5c94;
  --bloc-vigilance-bg: #fbe8dd; --bloc-vigilance-bd: #8a3a16; --bloc-vigilance-tx: #8a3a16;

  --a-info-bg: #efedfd;      --a-info-bd: #c9c4f5;      --a-info-tx: #3a32a8;
  --a-attention-bg: #fff6d6; --a-attention-bd: #ecd77b; --a-attention-tx: #5c4700;
  --a-important-bg: #ffe9d2; --a-important-bd: #f0b27a; --a-important-tx: #7a3a00;
  --a-urgent-bg: #fde3e3;    --a-urgent-bd: #ee9a9a;    --a-urgent-tx: #8c1414;

  --radius: 6px;
  --maxw: 1050px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #151515;
  --surface: #1e1e20;
  --surface-2: #262629;
  --border: #35363d;
  --text: #eeeef1;
  --muted: #a3a5b0;
  --link: #b3afff;
  --primary: #5a50e0;
  --primary-hover: #6d64ee;
  --hdr: #131313;
  --nav-bg: #1a1a1c;
  --hover: #25252b;
  --result: #1e2030;
  --input-bg: #181819;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --danger-bg: #34191b;
  --ok-bg: #152a1f;

  --chip: #2a2a33;
  --chip-bg: #2a2a33;

  --pill-bg: #232444;     --pill-bd: #3a3975;     --pill-tx: #c9c4ff;
  --pill-ok-bg: #163020;   --pill-ok-bd: #245038;   --pill-ok-tx: #86efac;
  --pill-err-bg: #391616;  --pill-err-bd: #662022;  --pill-err-tx: #fca5a5;
  --pill-info-bg: #0d2838; --pill-info-bd: #1f516b; --pill-info-tx: #7dd3fc;
  --pill-muted-bg: #202227;--pill-muted-bd: #3a3d45;--pill-muted-tx: #cbd5e1;
  --pill-warn-bg: #342a0a; --pill-warn-bd: #6a5711; --pill-warn-tx: #fde68a;

  --thead-bg: var(--surface-2);
  --thead-tx: var(--link);
  --tbl-alt: #222226;
  --tbl-row-hover: #24252a;
  --tbl-wrap-bg: var(--surface);
  --bulk-bg: #232444;
  --bulk-bd: #3a3975;
  --modal-head-bg: #23223a;
  --modal-foot-bg: #202025;
  --fiche-bg: #23223a;
  --fiche-bd: var(--link);
  --bloc-retenir-bg: #16253a; --bloc-retenir-bd: #2f72b5; --bloc-retenir-tx: #9dc5f3;
  --bloc-vigilance-bg: #361e14; --bloc-vigilance-bd: #a6582d; --bloc-vigilance-tx: #f2b78e;

  --a-info-bg: #1f2238;      --a-info-bd: #3a3d63;      --a-info-tx: #cfd2ff;
  --a-attention-bg: #372f12; --a-attention-bd: #6b5a1c; --a-attention-tx: #ffe89a;
  --a-important-bg: #3a2614; --a-important-bd: #7a4a22; --a-important-tx: #ffcfa0;
  --a-urgent-bg: #3d1a1a;    --a-urgent-bd: #7d2e2e;    --a-urgent-tx: #ffb3b3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
:root[data-theme="dark"] :focus-visible { outline-color: #8b83f0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.caret { font-size: 10px; opacity: .8; }

/* ---------- Boutons & formulaires ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--hover); }
.btn-danger { background: var(--red); color: #fff; }
:root[data-theme="dark"] .btn-danger { background: #c94444; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-pill { border-radius: 999px; height: 44px; padding: 0 22px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
input, select, textarea {
  width: 100%; height: 40px; padding: 8px 12px; font: inherit; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius);
}
textarea { height: auto; resize: vertical; }
input[type="file"] { height: auto; padding: 8px; }
input:invalid.touched, select:invalid.touched, textarea:invalid.touched { border-color: var(--red); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-form .span2 { grid-column: 1 / -1; }
.form-error { background: var(--danger-bg); color: var(--red); border: 1px solid var(--red); padding: 10px 12px; border-radius: var(--radius); }
.form-ok { background: var(--ok-bg); color: var(--green); border: 1px solid var(--green); padding: 10px 12px; border-radius: var(--radius); }

/* ---------- Menus déroulants ---------- */
.dd { position: relative; display: inline-block; isolation: isolate; }
.dd > button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
.dd-menu {
  display: none; position: absolute; left: 0; top: 100%; z-index: 99998 !important; min-width: 220px; padding: 6px 0;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
}
.dd.open > .dd-menu { display: block; }
.dd-menu.dd-right { left: auto; right: 0; }
.dd-menu a, .dd-menu button { display: block; width: 100%; text-align: left; padding: 9px 16px; color: var(--text); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; pointer-events: auto; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--hover); }
.dd-info { padding: 8px 16px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: inherit; font-size: 17px; cursor: pointer; text-decoration: none; pointer-events: auto; }
.icon-btn:hover { background: rgba(255, 255, 255, .15); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: inline; }

/* ==========================================================
   INTRANET — Couches z-index stratifiées TRÈS HAUTES
   (évite que les cartes, widgets ou sticky du contenu
    passent par-dessus les dropdowns de navigation,
    notamment sur index.php où le panneau principal est
    collé juste sous la barre de navigation).
   Ordre, du plus bas au plus haut :
   contenu < notice < chat-fab < alert-bar < nav < header
   < dropdown < backdrop < modal < toasts
   ========================================================== */
.wrap, main, .card, .panel, .tab-panel, .card.panel,
.widgets-grid, .widget-card, .stack, .news-row, .gf-card, .table-wrap,
.acc, .acc-head, .acc-body, .gf-module-sommaire {
  position: static;
  z-index: auto;
  transform: none;
  opacity: 1;
  isolation: auto;
  contain: none;
  will-change: auto;
  filter: none;
  perspective: none;
  backdrop-filter: none;
}
/* Pour les éléments qui ont BESOIN d'être sticky, on garde la
   fonctionnalité mais on leur assigne un z-index modéré (ils
   doivent rester SOUS la nav, le header et les dropdowns). */
.gf-module-sommaire { position: sticky; z-index: 80; top: 12px; }
.table thead th { position: sticky; z-index: 80; }

.top-notice { position: relative; z-index: 9996; background: #eaf1fd; color: var(--blue-dark); font-size: 13px; padding: 10px 28px; border-top: 2px solid var(--blue-dark); isolation: isolate; }
:root[data-theme="dark"] .top-notice { background: #1b1d33; color: #cfd2ff; border-top-color: #5a50e0; }
.hdr { position: relative; z-index: 9995; background: var(--hdr); color: #fff; height: 58px; display: flex; align-items: center; gap: 20px; padding: 0 28px; border-bottom: 1px solid rgba(255,255,255,.08); isolation: isolate; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand .badge { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.4); border-radius: 4px; background: rgba(255,255,255,.08); font-weight: 700; font-size: 13px; }
.brand strong { display: block; font-size: 16px; line-height: 1.15; }
.brand small { display: block; font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; z-index: 9995; flex: 0 1 560px; margin-left: 8px; }
.search svg { position: absolute; left: 14px; top: 11px; color: var(--muted); pointer-events: none; }
.search input { height: 38px; border-radius: 999px; padding-left: 42px; background: var(--surface); color: var(--text); border: 1px solid var(--border); pointer-events: auto; }
.hdr-icons { position: relative; z-index: 9995; margin-left: auto; display: flex; align-items: center; gap: 6px; }
.userbtn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15) !important; color: #fff !important; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: var(--primary); font-weight: 700; font-size: 11px; }
.uname { font-weight: 600; font-size: 14px; }

.nav { position: relative; z-index: 9994; display: flex; background: var(--nav-bg); border-bottom: 1px solid var(--border); height: 40px; padding: 0 12px; isolation: isolate; }
.nav .dd { position: relative; z-index: 9994; isolation: isolate; }
.nav .dd > button { height: 40px; padding: 0 18px; font-weight: 600; font-size: 14px; color: var(--text); border-right: 1px solid var(--border); border-radius: 0; pointer-events: auto; }
.nav .dd:first-child > button { border-left: 1px solid var(--border); }
.nav .dd > button:hover { background: var(--hover); }
.nav .dd-menu { top: 100%; z-index: 99999 !important; }

.alert-bar { position: relative; z-index: 9992; padding: 9px 28px; font-size: 14px; border-bottom: 1px solid; display: flex; gap: 12px; flex-wrap: wrap; isolation: isolate; }
.alert-bar a { margin-left: auto; }
.alert-info { background: var(--a-info-bg); border-color: var(--a-info-bd); color: var(--a-info-tx); }
.alert-attention { background: var(--a-attention-bg); border-color: var(--a-attention-bd); color: var(--a-attention-tx); }
.alert-important { background: var(--a-important-bg); border-color: var(--a-important-bd); color: var(--a-important-tx); }
.alert-urgent { background: var(--a-urgent-bg); border-color: var(--a-urgent-bd); color: var(--a-urgent-tx); }
.alert-bar a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 24px auto; padding: 0 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.panel { padding: 0 0 8px; }
.panel > :not(.tabs):not(.tab-panel):not(hr) { margin-left: 30px; margin-right: 30px; }
.panel > .h1:first-child, .panel > .h1 { margin-top: 26px; }
.tab-panel { padding: 24px 30px 20px; }
.tab-panel .h1 { margin-top: 0; }
.panel > hr { margin-left: 30px; margin-right: 30px; }
.h1 { font-size: 24px; color: var(--link); }
.h2 { font-size: 17px; margin: 26px 0 6px; color: var(--link); }
.lead { color: var(--muted); }
.lead strong { color: var(--text); }

.tabs { display: flex; align-items: stretch; background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; padding: 0 12px; }
.tabs > button { font: inherit; font-weight: 500; padding: 14px 20px 12px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; }
.tabs > button.active { color: var(--link); border-bottom-color: var(--link); font-weight: 600; }
.tabs > button:hover { color: var(--link); }
.tabs-plus { margin-left: auto; align-self: center; }
.tabs-plus > button { font-size: 20px; padding: 4px 14px; color: var(--muted); }

.acc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); margin-bottom: 8px; }
.acc-head { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 0 18px; background: none; border: 0; cursor: pointer; font: inherit; font-size: 15px; color: var(--link); text-align: left; }
.acc-head .acc-title { flex: 1; }
.acc-ico { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border); background: var(--surface); border-radius: 4px; font-size: 16px; }
.acc-danger .acc-title { color: var(--red); }
.acc .caret { transition: transform .15s; }
.acc.open .caret { transform: rotate(180deg); }
.acc-body { display: none; padding: 6px 20px 18px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.acc.open .acc-body { display: block; padding-top: 18px; }

.results { display: grid; gap: 8px; margin: 10px 0 20px; }
.result { background: var(--result); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 16px; }

.stack { display: grid; gap: 12px; }
.news-row { border: 1px solid; border-radius: var(--radius); padding: 12px 16px; }
.news-row p { margin: 4px 0 6px; }
.news-row.expired { opacity: .6; }
.news-row form { margin-top: 6px; }

.act-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; margin-bottom: 10px; align-items: center; }
.bilan-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 14px 18px; }
.bilan-card header { margin-bottom: 8px; color: var(--link); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bilan-card dl { display: grid; grid-template-columns: 130px 1fr; gap: 3px 12px; margin: 0 0 8px; }
.bilan-card dt { color: var(--muted); }
.bilan-card dd { margin: 0; }
.bilan-card h3 { font-size: 14px; margin: 10px 0 4px; color: var(--link); }
.bilan-card ul { margin: 0; padding-left: 20px; }
.doc-ref { margin-left: auto; font-size: 13px; }
.doc-ref strong { color: var(--link); }
.statut-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid; margin-left: auto; }
.statut-envoye { color: var(--green); border-color: var(--green); background: var(--ok-bg); }
.statut-echec { color: var(--red); border-color: var(--red); background: var(--danger-bg); }
.statut-en_attente { color: #7a5a00; border-color: #c9a436; background: var(--a-attention-bg); }
.bilan-actions { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.bilan-actions .btn-sm { height: 36px; font-size: 13px; }

.doc-page .toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.doc-page .toolbar .field { margin: 0; flex: 1 1 220px; min-width: 0; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th, .doc-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.doc-table thead th { background: var(--surface-2); font-weight: 600; color: var(--link); font-size: 13px; }
.doc-table tbody tr:hover { background: var(--hover); }
.doc-table .actions { white-space: nowrap; text-align: right; display: flex; gap: 6px; justify-content: flex-end; }
.doc-table .actions .btn-sm { height: 32px; padding: 0 10px; font-size: 12px; }
.doc-empty { padding: 24px; text-align: center; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius); }
.type-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: var(--a-info-bg); color: var(--a-info-tx); border: 1px solid var(--a-info-bd); }


.site-foot { max-width: 1050px; margin: 40px auto 24px; padding: 18px 16px 0; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.site-foot p { margin: 0 0 8px; }
.site-foot strong { color: var(--link); }

.toast-wrap { position: fixed; top: 72px; right: 20px; z-index: 9200; display: grid; gap: 8px; }
.toast { padding: 11px 16px; border-radius: var(--radius); border: 1px solid; background: var(--surface); box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 14px; transition: opacity .4s; }
.toast-ok { border-color: var(--green); color: var(--green); background: var(--ok-bg); }
.toast-err { border-color: var(--red); color: var(--red); background: var(--danger-bg); }
.toast.hide { opacity: 0; }

/* ==========================================================
   SITE PUBLIC & CONNEXION
   ========================================================== */
.pub-wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.pub-wrap.narrow { max-width: 760px; }
.pub-hdr { background: var(--hdr); color: #fff; }
.pub-hdr-in { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.pub-brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.pub-brand strong { display: block; font-size: 18px; letter-spacing: .01em; }
.pub-brand small { display: block; font-size: 13px; opacity: .85; letter-spacing: .03em; }
.pub-actions { display: flex; align-items: center; gap: 12px; }
.pub-nav { background: var(--nav-bg); border-bottom: 1px solid var(--border); }
.pub-nav-in { display: flex; align-items: center; height: 52px; gap: 6px; }
.pub-nav a, .pub-nav .dd > button { display: inline-flex; align-items: center; gap: 6px; height: 52px; padding: 0 18px; font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; border-bottom: 2px solid transparent; }
.pub-nav a.on { border-bottom-color: var(--primary); }
.pub-nav a.accent { color: var(--link); }
:root[data-theme="light"] .pub-nav a.accent { color: var(--blue); }
.pub-nav a:hover, .pub-nav .dd > button:hover { background: var(--hover); }

.hero { padding: 72px 0; background: radial-gradient(ellipse at 50% 0%, rgba(90, 80, 224, .10), transparent 65%); }
.hero-in { display: flex; align-items: center; gap: 56px; max-width: 1000px; }
.hero-emblem { flex: 0 0 auto; }
.hero h1 { font-size: 38px; letter-spacing: -.01em; }
.hero .hl { color: var(--link); }
:root[data-theme="light"] .hero .hl { color: var(--blue); }
.hero p { color: var(--muted); font-size: 16px; max-width: 620px; }
.pub-section { padding: 56px 0; }
.pub-section.alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pub-section h2 { font-size: 28px; margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.pcard { padding: 20px; }
.pcard h3 { font-size: 17px; color: var(--link); }
.pcard p { margin: 0; color: var(--muted); }
.link-card { display: block; text-decoration: none; color: inherit; }
.link-card:hover { border-color: var(--link); }
.news { display: grid; gap: 12px; }
.news-item { padding: 16px 20px; }
.news-item time { font-size: 13px; color: var(--muted); }
.news-item h3 { margin: 4px 0; }
.news-item p { margin: 0; color: var(--muted); }
.pub-foot { border-top: 1px solid var(--border); padding: 22px 0; font-size: 13px; color: var(--muted); }
.pub-foot .pub-wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pub-foot p { margin: 0; }
.chat-fab { position: fixed; right: 24px; bottom: 24px; z-index: 9000; background: var(--primary); color: #fff; padding: 12px 22px; border-radius: 22px; text-decoration: none; box-shadow: 0 6px 20px rgba(0,0,0,.25); pointer-events: auto; }
.chat-fab strong, .chat-fab small { display: block; }
.chat-fab small { font-size: 12px; opacity: .9; }
.notice-chip { position: fixed; left: 18px; bottom: 18px; z-index: 8990; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; color: var(--text); pointer-events: none; }

.auth-main { display: grid; place-items: center; min-height: 60vh; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.auth-card h1 { font-size: 24px; color: var(--link); }

/* ---------- Adaptatif ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .hero-in { flex-direction: column; text-align: center; }
  .hero-emblem svg { width: 140px; height: 140px; }
  .hdr { padding: 0 14px; gap: 10px; }
  .brand small, .uname { display: none; }
  .nav { overflow-x: auto; z-index: 9994; }
  .nav .dd-menu { position: fixed; z-index: 99999 !important; }
}
@media (max-width: 640px) {
  .grid-3, .grid-4, .grid-form { grid-template-columns: 1fr; }
  .act-row { grid-template-columns: 1fr; }
  .search { flex: 1; }
  .tab-panel { padding: 18px 16px; }
  .panel > :not(.tabs):not(.tab-panel) { margin-left: 16px; margin-right: 16px; }
  .hero h1 { font-size: 28px; }
  .pub-nav-in { overflow-x: auto; }
  .bilan-card dl { grid-template-columns: 1fr; }
}
/* ==========================================================
   GENDFORM / DOC PRO / PROCÉDURES (Étape 1 — ES)
   ========================================================== */

/* Barres de progression */
.progbar { position: relative; width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; height: 8px; }
.progbar > span, .progbar-fill { display: block; height: 100%; background: linear-gradient(90deg, #5a50e0, #7c74f0); border-radius: 999px; transition: width .4s; }
.progbar-label { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.progbar-label strong { color: var(--text); font-weight: 600; }

/* Badge filière */
.filiere-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid; }
.filiere-mobile { color: var(--pill-warn-tx); border-color: var(--pill-warn-bd); background: var(--pill-warn-bg); }
.filiere-departementale { color: var(--pill-ok-tx); border-color: var(--pill-ok-bd); background: var(--pill-ok-bg); }
.filiere-commune { color: var(--pill-muted-tx); border-color: var(--pill-muted-bd); background: var(--pill-muted-bg); }

/* Badge statut GendForm */
.statut-gf-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid; margin-left: 6px; vertical-align: middle; }
/* Badges de statut & pills — compatibilité clair/sombre */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--pill-bd); color: var(--pill-tx); background: var(--pill-bg); cursor: pointer; transition: filter .12s, transform .12s; }
.pill:hover { filter: brightness(1.04); }
.pill-ok     { color: var(--pill-ok-tx);     background: var(--pill-ok-bg);     border-color: var(--pill-ok-bd); }
.pill-err    { color: var(--pill-err-tx);    background: var(--pill-err-bg);    border-color: var(--pill-err-bd); }
.pill-info   { color: var(--pill-info-tx);   background: var(--pill-info-bg);   border-color: var(--pill-info-bd); }
.pill-muted  { color: var(--pill-muted-tx);  background: var(--pill-muted-bg);  border-color: var(--pill-muted-bd); }
.pill-warn   { color: var(--pill-warn-tx);   background: var(--pill-warn-bg);   border-color: var(--pill-warn-bd); }

.statut-gf-badge, .statut-badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; border: 1px solid; }
.statut-gf-afaire    { color: var(--pill-muted-tx);  border-color: var(--pill-muted-bd); background: var(--pill-muted-bg); }
.statut-gf-inscrit   { color: var(--pill-tx);        border-color: var(--pill-bd);       background: var(--pill-bg); }
.statut-gf-encours   { color: var(--pill-info-tx);   border-color: var(--pill-info-bd);  background: var(--pill-info-bg); }
.statut-gf-termine   { color: var(--pill-ok-tx);     border-color: var(--pill-ok-bd);    background: var(--pill-ok-bg); }
.statut-gf-atteste   { color: var(--pill-info-tx);   border-color: var(--pill-info-bd);  background: var(--pill-info-bg); }
.statut-gf-abandon   { color: var(--pill-err-tx);    border-color: var(--pill-err-bd);   background: var(--pill-err-bg); }
.statut-gf-verrou    { color: var(--pill-muted-tx);  border-color: var(--pill-muted-bd); background: var(--pill-muted-bg); }
.statut-gf-dispo     { color: var(--pill-ok-tx);     border-color: var(--pill-ok-bd);    background: var(--pill-ok-bg); opacity:.9; }
.statut-gf-afaire,.statut-gf-inscrit,.statut-gf-encours,.statut-gf-termine,.statut-gf-atteste,.statut-gf-abandon,.statut-gf-verrou,.statut-gf-dispo{
  display:inline-block;padding:2px 9px;border-radius:4px;font-size:12px;font-weight:600;border:1px solid;margin-right:5px;
}
.type-presentiel, .type-distance, .type-hybride, .type-quiz, .type-module { display:inline-block; padding:2px 9px; border-radius:4px; font-size:12px; font-weight:600; border:1px solid; margin-right:5px;}
.type-presentiel { color: var(--pill-info-tx); border-color: var(--pill-info-bd); background: var(--pill-info-bg); }
.type-distance   { color: var(--pill-muted-tx); border-color: var(--pill-muted-bd); background: var(--pill-muted-bg); }
.type-hybride    { color: var(--pill-tx);        border-color: var(--pill-bd);       background: var(--pill-bg); }
.type-quiz       { color: var(--pill-warn-tx);   border-color: var(--pill-warn-bd);  background: var(--pill-warn-bg); }
.type-module     { color: var(--pill-ok-tx);     border-color: var(--pill-ok-bd);    background: var(--pill-ok-bg); }

.niveau-badge { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 12px; font-weight: 600; border: 1px solid; margin-right: 5px; }
.niveau-initial, .niv-1, .niv-initial       { color: var(--pill-info-tx);   border-color: var(--pill-info-bd);  background: var(--pill-info-bg); }
.niveau-confirme, .niv-2, .niv-confirme     { color: var(--pill-warn-tx);   border-color: var(--pill-warn-bd);  background: var(--pill-warn-bg); }
.niveau-specialise, .niv-3, .niv-specialise { color: var(--pill-err-tx);    border-color: var(--pill-err-bd);   background: var(--pill-err-bg); }

.pct-inline { float: right; color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* Encadrés retenir / vigilance (à utiliser dans contenu module HTML) */
.bloc-retenir, .bloc-vigilance { margin: 16px 0; padding: 14px 16px; border-left: 4px solid; border-radius: 0 6px 6px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.bloc-retenir { border-color: var(--bloc-retenir-bd); background: var(--bloc-retenir-bg); color: var(--text); }
.bloc-retenir::before { content: "À RETENIR"; display: block; color: var(--bloc-retenir-tx); font-weight: 700; font-size: 12.5px; letter-spacing: .05em; margin-bottom: 6px; }
.bloc-vigilance { border-color: var(--bloc-vigilance-bd); background: var(--bloc-vigilance-bg); color: var(--text); }
.bloc-vigilance::before { content: "VIGILANCE"; display: block; color: var(--bloc-vigilance-tx); font-weight: 700; font-size: 12.5px; letter-spacing: .05em; margin-bottom: 6px; }

/* Onglets filière GendForm */
.gf-tabs { background: transparent; border-bottom: 1px solid var(--border); padding: 0; gap: 2px; }
.gf-tabs > button { border-radius: 6px 6px 0 0; padding: 10px 18px; }

/* Filtres catalogue */
.gf-filters { padding: 16px 18px; }
.gf-filters .grid-form { margin: 0; }

/* Parcours */
.gf-parcours { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.gf-parcours-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.gf-parcours-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.gf-parcours-head strong { color: var(--link); font-size: 15px; }
.gf-parcours-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.gf-parcours-list li { padding: 6px 8px 6px 22px; border-radius: 4px; position: relative; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.gf-parcours-list li::before { content: "▸"; position: absolute; left: 8px; top: 6px; color: var(--muted); }
.gf-parcours-list li.ok { background: #eafaf0; border-color: #3ba760; color: #1f7a3a; }
.gf-parcours-list li.ok::before { content: "✔"; color: #1f7a3a; }
.gf-parcours-list li.encours { background: #e8efff; border-color: #4574d0; }
.gf-parcours-list li.encours::before { content: "◐"; color: #0a3d8c; }
.gf-parcours-list a { color: inherit; text-decoration: none; }
.gf-parcours-list a:hover { text-decoration: underline; }

/* Cartes formations catalogue */
.gf-formations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.gf-formation-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; gap: 10px; }
.card-hover { transition: transform .15s ease, box-shadow .15s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(11,31,107,.08); }
.gf-formation-card header { margin-bottom: 2px; }
.gf-formation-card .gf-fmetas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.gf-formation-card h3 { margin: 4px 0 2px; font-size: 16px; line-height: 1.3; }
.gf-formation-card h3 a { color: var(--link); text-decoration: none; }
.gf-formation-card h3 a:hover { text-decoration: underline; }
.gf-cat { margin: 0 0 2px; }
.gf-desc { margin: 0; font-size: 13.5px; line-height: 1.55; color: #2f2f2f; min-height: 44px; }
.gf-formation-card footer { margin-top: auto; display: grid; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.gf-fduree { color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; }
.gf-factions { display: flex; justify-content: flex-end; }

/* Header formation */
.gf-form-head { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.gf-form-head-actions { display: flex; align-items: center; gap: 14px; }

/* Liste modules formation */
.gf-modules-list { display: grid; gap: 8px; }
.gf-module-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.gf-module-row.statut-verrouille { opacity: .65; background: var(--surface-2); }
.gf-module-row.statut-termine { border-color: #3ba760; background: #f8fdf8; }
.gf-mod-idx { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2); color: var(--link); font-weight: 700; border: 1px solid var(--border); }
.gf-module-row.statut-termine .gf-mod-idx { background: #1f7a3a; color: #fff; border-color: #1f7a3a; }
.gf-mod-title { margin: 0 0 2px; font-size: 15px; }
.gf-mod-title a { color: var(--link); text-decoration: none; }
.gf-mod-title a:hover { text-decoration: underline; }

/* KPI suivi */
.gf-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 6px; background: transparent; border: 0; box-shadow: none; }
.gf-kpis.card { padding: 16px; border: 1px solid var(--border); background: var(--surface); }
.gf-kpi { padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.kpi-num { display: block; font-size: 26px; font-weight: 700; color: var(--link); line-height: 1.1; margin-bottom: 4px; }
.kpi-label { font-size: 12.5px; color: var(--muted); }

/* Lecteur module */
.gf-module-head { padding: 18px 20px; }
.gf-module-layout { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; margin-top: 18px; }
@media (max-width: 960px) { .gf-module-layout { grid-template-columns: 1fr; } }
.gf-module-sommaire { position: sticky; top: 12px; padding: 14px 16px; }
.gf-module-sommaire h3 { font-size: 14px; color: var(--link); text-transform: uppercase; letter-spacing: .04em; }
.gf-module-sommaire ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.gf-module-sommaire li a { display: block; padding: 6px 8px; border-radius: 4px; color: inherit; text-decoration: none; font-size: 13.5px; }
.gf-module-sommaire li.sommaire-n3 a { padding-left: 20px; color: var(--muted); font-size: 13px; }
.gf-module-sommaire li a:hover { background: var(--hover); }
.gf-module-contenu { padding: 24px 28px; line-height: 1.7; font-size: 14.5px; }
.gf-module-contenu h2 { margin-top: 28px; color: var(--link); font-size: 18px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.gf-module-contenu h3 { margin-top: 20px; color: var(--text); font-size: 16px; }
.gf-module-contenu p { margin: 10px 0; }
.gf-module-contenu ul, .gf-module-contenu ol { padding-left: 22px; margin: 10px 0; }
.gf-module-contenu table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
.gf-module-contenu th, .gf-module-contenu td { border: 1px solid var(--border); padding: 7px 10px; }
.gf-module-contenu th { background: var(--surface-2); color: var(--link); }
.gf-module-contenu blockquote { border-left: 4px solid var(--link); background: var(--surface-2); padding: 10px 14px; margin: 12px 0; border-radius: 0 4px 4px 0; }
.gf-module-contenu code { background: var(--surface-2); padding: 1px 5px; border-radius: 3px; font-size: 12.5px; }
.gf-module-contenu img { max-width: 100%; border-radius: 4px; border: 1px solid var(--border); }
.gf-module-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.gf-module-nav > span:last-child { text-align: right; }

/* Quiz */
.gf-quiz-form { display: grid; gap: 14px; }
.gf-quiz-question { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.gf-quiz-question legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
.gf-quiz-texte { font-size: 15px; margin: 4px 0 10px; line-height: 1.55; font-weight: 500; }
.gf-quiz-reponses { display: grid; gap: 8px; padding-left: 4px; }
.gf-quiz-reponse { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.gf-quiz-reponse:hover { background: var(--hover); }
.gf-quiz-reponse input { margin-top: 5px; }

.gf-quiz-correction { display: grid; gap: 12px; margin-top: 10px; }
.gf-quiz-correction-item { border-radius: var(--radius); border: 1px solid var(--border); padding: 12px 16px; background: var(--surface); }
.gf-quiz-correction-item.ok { border-color: #3ba760; background: #f3fbf5; }
.gf-quiz-correction-item.no { border-color: #d26a6a; background: #fdf3f3; }
.gf-quiz-correction-item h4 { margin: 0 0 6px; color: var(--link); }
.gf-quiz-correction-item ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.gf-quiz-correction-item li { padding: 6px 8px; border-radius: 4px; font-size: 13.5px; }
.gf-quiz-correction-item li.bonne { background: #eafaf0; color: #1f7a3a; }
.gf-quiz-correction-item li.mauvaise { background: #fde7e7; color: #862121; }

.btn-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ==== Widgets accueil OUTILS ==== */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.widget-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.widget-title { margin: 0 0 10px; font-size: 14.5px; color: var(--link); font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.widget-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.widget-list li { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.wl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.wl-head a { font-weight: 600; font-size: 13.5px; }
.wl-head code { font-size: 11px; background: var(--chip); padding: 2px 6px; border-radius: 4px; color: var(--muted); }
.widget-more { margin: 10px 0 0; text-align: right; }
.bj-quick { margin-top: 6px; flex-wrap: wrap; }
.bj-quick .btn { flex: 1 1 auto; min-width: 140px; }

/* ==== Back-office : Tableaux bulk + filtres ==== */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.toolbar .field { margin: 0; flex: 1 1 160px; min-width: 140px; }
.toolbar .field label { font-size: 12px; color: var(--muted); margin-bottom: 3px; display: block; }
.toolbar .actions { display: flex; gap: 6px; align-items: flex-end; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--tbl-wrap-bg); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; color: var(--text); }
.table thead th { background: var(--thead-bg); font-weight: 600; color: var(--thead-tx); position: sticky; top: 0; font-size: 12.5px; z-index: 80; }
.table tbody tr { background: var(--tbl-wrap-bg); color: var(--text); }
.table tbody tr:hover { background: var(--tbl-row-hover) !important; }
.table tbody tr:nth-child(even),
.table-striped tbody tr:nth-child(even) { background: var(--tbl-alt) !important; }
.table tbody td, .table tbody th { color: var(--text) !important; }
.table td code, .table th code { background: var(--chip); color: var(--text); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.table .row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.table .row-actions .btn-sm { padding: 4px 8px; font-size: 12px; }
.table .bulk-check { width: 36px; text-align: center; }
.bulk-bar { margin: 10px 0 16px; padding: 10px 12px; background: var(--bulk-bg); border: 1px solid var(--bulk-bd); border-radius: var(--radius); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--text); }
.bulk-bar label { font-weight: 600; color: var(--link); margin-right: 4px; font-size: 13px; }
.bulk-bar select, .bulk-bar input { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.bulk-bar .btn { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==== Modals fiches procédures + docpro (couche isolée) ==== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: transparent;
  z-index: 9100;
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
  pointer-events: none;
  transition: background .18s ease;
}
.modal-backdrop:target {
  display: flex;
  background: rgba(11,31,107,0.45);
  pointer-events: auto;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%; max-width: 880px;
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  border: 1px solid var(--border);
  z-index: 9150;
  margin-top: 40px;
  pointer-events: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--modal-head-bg); border-radius: var(--radius) var(--radius) 0 0; gap: 12px; }
.modal-header h3 { margin: 0; color: var(--link); font-size: 16px; }
.modal-header .modal-close { color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 4px; font-weight: 700; }
.modal-header .modal-close:hover { background: var(--hover); color: inherit; }
.modal-body { padding: 16px 18px; max-height: 70vh; overflow-y: auto; color: var(--text); }
.modal-footer { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--modal-foot-bg); border-radius: 0 0 var(--radius) var(--radius); }

.fiche-refs { background: var(--fiche-bg); border-left: 3px solid var(--fiche-bd); padding: 10px 14px; margin: 10px 0 14px; font-size: 13px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--text); }
.fiche-refs strong { color: var(--link); }
.fiche-contenu { line-height: 1.6; font-size: 14px; white-space: pre-wrap; }
.fiche-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 12px; margin-bottom: 10px; font-size: 13px; color: var(--text); }
.fiche-meta span.muted { color: var(--muted); font-size: 12px; }

/* ==== Badges habilitation PJ ==== */
.hab-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; border: 1px solid; }
.hab-aucune { background: var(--pill-muted-bg); color: var(--pill-muted-tx); border-color: var(--pill-muted-bd); }
.hab-apj { background: var(--pill-warn-bg); color: var(--pill-warn-tx); border-color: var(--pill-warn-bd); }
.hab-opj { background: var(--pill-ok-bg); color: var(--pill-ok-tx); border-color: var(--pill-ok-bd); }
.type-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.type-garde_vue { background: var(--pill-err-bg); color: var(--pill-err-tx); }
.type-audition  { background: var(--pill-info-bg); color: var(--pill-info-tx); }
.type-constat   { background: var(--pill-ok-bg); color: var(--pill-ok-tx); }
.type-procedure { background: var(--pill-bg); color: var(--pill-tx); }

.statut-badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.statut-envoye     { background: var(--pill-ok-bg); color: var(--pill-ok-tx); }
.statut-echec      { background: var(--pill-err-bg); color: var(--pill-err-tx); }
.statut-en_attente { background: var(--pill-warn-bg); color: var(--pill-warn-tx); }

/* ==== Doc Pro : pillbox tags ==== */
.tag-pill { display: inline-block; padding: 2px 8px; background: var(--chip); border-radius: 10px; font-size: 11.5px; color: var(--muted); margin-right: 4px; }

/* ==== Boutons ==== */
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-danger { background: var(--pill-err-tx); color: #fff; border-color: var(--pill-err-tx); }
.btn-danger:hover { filter: brightness(0.92); border-color: var(--pill-err-tx); color: #fff; }
.btn-outline-danger { background: var(--surface); color: var(--pill-err-tx); border: 1px solid var(--pill-err-bd); }
.btn-outline-danger:hover { background: var(--pill-err-bg); }

/* ==== BJ champs formulaires ==== */
.bj-fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.bj-fieldset legend { font-weight: 600; color: var(--link); padding: 0 8px; }

@media (max-width: 720px) {
  .widgets-grid { grid-template-columns: 1fr; }
  .modal { margin-top: 0; border-radius: 0; height: 100vh; max-height: 100vh; }
  .modal-body { max-height: calc(100vh - 120px); }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ==========================================================
   LOGO (couleur en thème clair / noir en thème sombre)
   ========================================================== */
.site-logo { display: inline-grid; flex: 0 0 auto; width: var(--logo-size, 52px); height: var(--logo-size, 52px); }
.site-logo img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: contain; display: block; }
.site-logo .logo-dark { display: none; }
:root[data-theme="dark"] .site-logo .logo-light { display: none; }
:root[data-theme="dark"] .site-logo .logo-dark { display: block; }
.brand .site-logo { --logo-size: 40px; }
.hero-emblem .site-logo { filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .25)); }

/* ==========================================================
   FAVORIS (étoile en haut à gauche) & menus
   ========================================================== */
.page-tools { max-width: var(--maxw); margin: 14px auto -12px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.page-tools form { margin: 0; }
.fav-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fav-btn:hover { border-color: #e0a800; color: var(--text); }
.fav-star { font-size: 18px; line-height: 1; color: #c99700; }
.fav-btn.on { border-color: #e0a800; background: #fff8dc; color: #6b5200; }
:root[data-theme="dark"] .fav-btn.on { background: #3a3010; color: #ffe08a; }
.page-edit { margin-left: auto; font-size: 13px; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--border); color: var(--muted); }
.page-edit:hover { color: var(--link); border-color: var(--link); }
.dd-sep { border-top: 1px solid var(--border); margin: 6px 0 2px; padding: 6px 16px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dd-sep:empty { padding: 0; margin: 4px 0; }
.dd-empty { margin: 0; padding: 10px 16px; font-size: 13px; color: var(--muted); max-width: 280px; }

/* ==========================================================
   GRILLES & DIVERS
   ========================================================== */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.wrap-wide { max-width: 1240px; }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.inline-form input { height: 34px; }
.cms-content { line-height: 1.65; }
.cms-content img { max-width: 100%; height: auto; }
.cms-content table { border-collapse: collapse; width: 100%; }
.cms-content th, .cms-content td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.cms-page .cms-content { margin-bottom: 24px; }
.cms-admin-note { background: var(--a-attention-bg); color: var(--a-attention-tx); border: 1px solid var(--a-attention-bd); border-radius: var(--radius); padding: 6px 12px; margin-top: 18px; }
.cms-admin-note a { color: inherit; font-weight: 600; }

/* ==========================================================
   PARAMÈTRES DU SITE
   ========================================================== */
.tabs > .tab-link { padding: 14px 18px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; white-space: nowrap; }
.tabs > .tab-link.active { color: var(--link); border-bottom-color: var(--link); font-weight: 600; }
.tabs > .tab-link:hover { color: var(--link); }
.tabs { overflow-x: auto; }
.settings-form .field > label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill-mod { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--pill-info-bg); color: var(--pill-info-tx); border: 1px solid var(--pill-info-bd); }
label.check { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
label.check input { width: auto; height: auto; }
.img-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); }
.img-preview { width: 96px; height: 96px; object-fit: contain; border-radius: 8px; padding: 6px; }
.img-logo_light { background: #ffffff; border: 1px solid #dde1ea; }
.img-logo_dark { background: #151515; border: 1px solid #35363d; }
.list-editor { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.list-editor legend { padding: 0 6px; }
.le-rows { display: grid; gap: 10px; margin-bottom: 10px; }
.le-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.le-cell { flex: 1 1 160px; display: flex; flex-direction: column; gap: 4px; margin: 0; font-weight: 400 !important; }
.le-cell > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.le-textarea { flex: 3 1 320px; }
.le-select { flex: 0 1 170px; }
.le-date { flex: 0 1 160px; }
.le-cell textarea { min-height: 40px; }
.le-actions { display: flex; gap: 4px; }
.le-actions .btn-sm { padding: 0 10px; }
.sticky-save { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0; border-top: 1px solid var(--border); z-index: 50; }
.code-area { font-family: Consolas, "Courier New", monospace; font-size: 13px; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .page-tools { margin-top: 10px; }
  .fav-label { display: none; }
  .fav-btn { padding: 0 10px; }
}@media (max-width: 900px) { .hero-emblem .site-logo { width: 150px !important; height: 150px !important; } .pub-brand .site-logo { width: 42px !important; height: 42px !important; } }

/* ==========================================================
   SITE PUBLIC v2 — multi-pages
   ========================================================== */
.mode-public main { overflow-x: clip; }
.pub-hdr { position: sticky; top: 0; z-index: 9500; background: var(--hdr); box-shadow: 0 2px 18px rgba(0,0,0,.18); }
.pub-nav { position: sticky; top: 80px; z-index: 9400; background: color-mix(in srgb, var(--nav-bg) 92%, transparent); backdrop-filter: blur(8px); }
.pub-nav a, .pub-nav .dd > button { letter-spacing: .04em; font-size: 13px; }
.pub-nav a.on { color: var(--link); border-bottom-color: var(--primary); }
.pub-nav a.accent { margin-left: auto; color: #fff !important; background: var(--primary); border-radius: 999px; height: 36px; padding: 0 18px; border-bottom: 0; }
.pub-nav a.accent:hover { background: var(--primary-hover); }
.kicker { display: inline-block; margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--link); }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; border-radius: 10px; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--hover); }
.btn-light { background: #fff; color: #2e2878; }
.btn-light:hover { background: #f1effd; }

/* Hero */
.hero { position: relative; padding: 96px 0 110px; background: none; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 420px at 85% 20%, rgba(90, 80, 224, .28), transparent 60%),
    radial-gradient(700px 380px at 5% 90%, rgba(90, 80, 224, .14), transparent 60%),
    linear-gradient(180deg, transparent 70%, var(--bg));
}
.hero-in { max-width: 1240px; justify-content: space-between; gap: 48px; }
.hero h1 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.08; letter-spacing: -.02em; margin-bottom: 18px; }
.hero .hl { background: linear-gradient(90deg, var(--primary), #9b8cff); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.hero-lead { font-size: 18px !important; max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-emblem .site-logo { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .hero-emblem .site-logo { animation: none; } }

/* Chiffres clés */
.stats-strip { margin-top: -54px; position: relative; z-index: 2; }
.stats-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 40px rgba(20, 16, 70, .12); overflow: hidden; padding: 0; }
.stat { padding: 24px 20px; text-align: center; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-size: 34px; line-height: 1; color: var(--link); margin-bottom: 6px; }
.stat span { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* Sections */
.pub-section { padding: 72px 0; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); margin: 0; }
.section-head.row { display: flex; align-items: flex-end; justify-content: space-between; text-align: left; gap: 16px; flex-wrap: wrap; }
.card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.feature-card { display: flex; flex-direction: column; gap: 8px; padding: 26px; text-decoration: none; color: inherit; border-radius: 14px; position: relative; overflow: hidden; }
.feature-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--primary), #9b8cff); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.feature-card:hover, .mission-card:hover, .peloton-card:hover, .news-card:hover, .pcard:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(20, 16, 70, .14); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.feature-card:hover::before { transform: scaleX(1); }
.feature-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 26px; background: var(--chip-bg); }
.feature-card h3 { margin: 6px 0 0; font-size: 19px; color: var(--link); }
.feature-card p { margin: 0; color: var(--muted); flex: 1; }
.feature-more { font-weight: 600; font-size: 14px; color: var(--link); margin-top: 6px; }
.pcard { border-radius: 14px; }
.news-card { padding: 22px; border-radius: 14px; }
.news-card time, .timeline-item time { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
.news-card h3 { margin: 8px 0 6px; font-size: 18px; }
.news-card p { margin: 0; color: var(--muted); }

/* Bandeau des pages */
.page-banner { position: relative; padding: 70px 0 64px; color: #fff; background:
  radial-gradient(700px 300px at 90% 0%, rgba(155, 140, 255, .45), transparent 60%),
  linear-gradient(135deg, #2e2878 0%, #5a50e0 100%); overflow: hidden; }
:root[data-theme="dark"] .page-banner { background: radial-gradient(700px 300px at 90% 0%, rgba(90, 80, 224, .45), transparent 60%), linear-gradient(135deg, #17153a 0%, #2b2675 100%); }
.page-banner::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; border: 40px solid rgba(255,255,255,.06); }
.page-banner h1 { font-size: clamp(30px, 4vw, 46px); margin: 0 0 12px; letter-spacing: -.01em; }
.page-banner .kicker { color: #d9d4ff; }
.banner-text { max-width: 720px; font-size: 17px; opacity: .92; margin: 0; }
.crumbs { font-size: 13px; margin-bottom: 18px; opacity: .85; }
.crumbs a { color: #fff; }
.crumbs span { margin: 0 6px; }

/* Missions */
.mission-list { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.mission-card { display: flex; gap: 18px; padding: 26px; border-radius: 14px; }
.mission-ico { flex: 0 0 auto; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; font-size: 26px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), #9b8cff); box-shadow: 0 8px 20px rgba(90, 80, 224, .35); }
.mission-card h3 { margin: 2px 0 8px; font-size: 19px; color: var(--link); }
.mission-card p { margin: 0; color: var(--muted); }

/* L'escadron */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: center; }
.about-logo { display: grid; place-items: center; }
.about-text { font-size: 17px; }
.peloton-card { padding: 28px 24px; border-radius: 16px; text-align: center; }
.peloton-sigle { display: inline-grid; place-items: center; min-width: 72px; height: 72px; padding: 0 12px; border-radius: 50%; font-size: 24px; font-weight: 800; letter-spacing: .04em; color: #fff; background: linear-gradient(135deg, #2e2878, var(--primary)); box-shadow: 0 10px 24px rgba(90, 80, 224, .35); margin-bottom: 14px; }
.peloton-card h3 { margin: 0 0 8px; color: var(--link); }
.peloton-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* Actualités (frise) */
.timeline { position: relative; display: grid; gap: 22px; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--primary), transparent); }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -28px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 20%, transparent); }
.timeline-card { margin-top: 8px; padding: 18px 22px; border-radius: 12px; }
.timeline-card h3 { margin: 0 0 6px; }
.timeline-card p { margin: 0; color: var(--muted); }

/* Recrutement */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: s; }
.step { padding: 26px 22px; border-radius: 14px; position: relative; }
.step-num { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-weight: 800; color: #fff; background: var(--primary); margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; font-size: 18px; color: var(--link); }
.step p { margin: 0; color: var(--muted); }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 40px 44px; border-radius: 20px; color: #fff;
  background: radial-gradient(600px 240px at 100% 0%, rgba(155, 140, 255, .5), transparent 60%), linear-gradient(135deg, #2e2878, #5a50e0); box-shadow: 0 20px 44px rgba(46, 40, 120, .3); }
.cta-band h2 { margin: 0 0 6px; font-size: clamp(22px, 2.6vw, 30px); }
.cta-band p { margin: 0; opacity: .9; }

/* Pied de page */
.pub-foot { padding: 48px 0 0; background: var(--surface-2); }
.pub-foot-grid { display: grid !important; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.pub-foot-brand { display: flex; gap: 16px; align-items: flex-start; }
.pub-foot-brand strong { font-size: 17px; color: var(--text); }
.pub-foot-brand p { margin: 6px 0 0; font-size: 14px; max-width: 420px; }
.pub-foot h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text); }
.pub-foot-grid a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; font-size: 14px; }
.pub-foot-grid a:hover { color: var(--link); }
.pub-foot-bottom { border-top: 1px solid var(--border); margin-top: 32px; padding: 18px 24px !important; font-size: 13px; }

@media (max-width: 900px) {
  .pub-nav { top: 0; position: relative; }
  .pub-hdr { position: relative; }
  .pub-nav a.accent { margin-left: 0; }
  .hero { padding: 56px 0 90px; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-in { flex-direction: column-reverse; }
  .about-grid, .pub-foot-grid { grid-template-columns: 1fr !important; }
  .about-logo .site-logo { width: 160px !important; height: 160px !important; }
  .mission-list { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--border); }
  .cta-band { padding: 28px 24px; }
}
.pub-nav a.nav-home { padding: 0 16px; color: var(--text); }
.pub-nav a.nav-home svg { width: 22px; height: 22px; display: block; }
.pub-nav a.nav-home.on, .pub-nav a.nav-home:hover { color: var(--link); }

/* ==========================================================
   INTRANET — présentation institutionnelle (accueil, annuaire)
   ========================================================== */
:root { --inst-navy: #0b3a6e; --inst-folder: #6a64c8; --inst-folder-line: #3f3a8a; --inst-chef: #e8901a; --inst-agent: #7f9a78; }
:root[data-theme="dark"] { --inst-navy: #b3c8ff; --inst-folder: #a49ff0; --inst-folder-line: #6a64c8; --inst-chef: #f0a540; --inst-agent: #a3b89c; }

.inst-head { border-bottom: 2px solid var(--inst-navy); padding-bottom: 10px; margin-bottom: 18px; }
.inst-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--inst-navy); letter-spacing: .01em; }
.inst-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.inst-h2 { margin: 28px 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--inst-navy); }
.inst-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 12px 0 6px; }
.inst-tile { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--inst-navy); border-radius: 4px; color: var(--text); font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s; }
.inst-tile:hover { background: var(--chip-bg); text-decoration: none; }
.inst-tile-go { color: var(--muted); font-size: 20px; line-height: 1; }
.inst-note { margin: 4px 0 0; }
.inst-empty { padding: 14px 16px; border: 1px dashed var(--border); border-radius: 4px; color: var(--muted); }
.inst-intro { margin-top: 18px; color: var(--muted); }
.mode-intranet .widget-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--inst-navy); border-bottom: 1px solid var(--border); padding-bottom: 8px; }

.ann-title { margin: 6px 0 22px; text-align: center; font-size: 26px; font-weight: 700; color: var(--inst-navy); }
.ann-tree { font-size: 16px; }
.ann-node > summary { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; padding: 6px 12px 6px 6px; margin: 4px 0; border-radius: 6px; font-weight: 700; cursor: pointer; list-style: none; }
.ann-node > summary::-webkit-details-marker { display: none; }
.ann-node > summary:hover { background: var(--chip-bg); }
.ann-node > summary:focus-visible { outline: 2px solid var(--inst-navy); }
.ann-folder { flex: 0 0 auto; fill: var(--inst-folder); stroke: var(--inst-folder-line); stroke-width: 1.2; }
.ann-count { font-weight: 400; color: var(--muted); font-size: 14px; }
.ann-children, .ann-people { margin: 0 0 6px 15px; padding: 2px 0 2px 18px; border-left: 1px dashed var(--border); }
.ann-people { list-style: none; }
.ann-people li { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.ann-results { margin-left: 0; border-left: 0; padding-left: 0; }
.ann-ico { flex: 0 0 auto; fill: var(--inst-agent); }
.ann-ico.ann-chef { fill: var(--inst-chef); }
.ann-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 22px; }
.ann-legend .ann-ico { width: 9px; height: 14px; }
/* Icônes calendrier / horloge des champs date et heure : lisibles dans les deux thèmes */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .8; }
input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Bilan de service */
.bs-wrap { max-width: 1400px; }
.bs-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.bs-cols > .bs-card { margin-bottom: 0; }
.bs-col-liste { position: sticky; top: 12px; }
.bs-liste-defil { max-height: calc(100vh - 140px); overflow-y: auto; padding-right: 4px; }
@media (max-width: 1000px) {
  .bs-cols { grid-template-columns: 1fr; }
  .bs-col-liste { position: static; }
  .bs-liste-defil { max-height: none; overflow: visible; }
}
.bs-title { margin: 4px 0 18px; padding-bottom: 14px; border-bottom: 2px solid var(--border); text-align: center; font-size: 24px; color: var(--inst-navy); }
.bs-card { border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px 20px; margin-bottom: 22px; }
.bs-sub { margin: 0 0 16px; text-align: center; font-size: 18px; color: var(--text); }
.bs-center { text-align: center; }
.bs-field { margin-bottom: 14px; }
.bs-field label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14px; }
.bs-field input, .bs-field select, .bs-field textarea { width: 100%; }
.bs-field small { display: block; margin-top: 4px; }
.bs-h3 { margin: 18px 0 8px; font-size: 16px; }
.bs-attributs { margin: 6px 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; }
.bs-attributs legend { padding: 2px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--chip-bg); color: var(--inst-navy); font-weight: 700; font-size: 13px; }
.bs-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.bs-checks label { display: flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }
.bs-checks input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
#activities .act-row { display: grid; grid-template-columns: 130px 1fr 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
#activities .act-row input { width: 100%; }
.bs-trash { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 4px; background: #d33a3a; color: #fff; cursor: pointer; }
.bs-trash:hover { background: #b52c2c; }
.btn.bs-add, .btn.bs-cancel { background: #6c737d; border-color: #6c737d; color: #fff; }
.btn.bs-add:hover, .btn.bs-cancel:hover { background: #5a6068; }
.bs-add { margin: 2px 0 16px; }
.bs-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.bs-item { background: var(--chip-bg); border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; margin-bottom: 12px; }
.bs-item p { margin: 0 0 6px; }
.bs-item ul { margin: 0 0 8px; padding-left: 20px; }
.bs-selection { margin: 0 0 10px; font-size: 14px; }
.bs-mil-filtre { width: 100%; margin-bottom: 8px; }
.bs-mil-dd { position: relative; }
.bs-mil-dd > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--input-bg, var(--bg)); cursor: pointer; list-style: none; font-size: 14px; }
.bs-mil-dd > summary::-webkit-details-marker { display: none; }
.bs-mil-dd[open] > summary { border-color: var(--inst-navy); }
.bs-mil-caret { color: var(--muted); transition: transform .15s; }
.bs-mil-dd[open] .bs-mil-caret { transform: rotate(180deg); }
.bs-mil-panneau { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); box-shadow: 0 12px 28px rgba(0, 0, 0, .25); }
.bs-mil-panneau .bs-mil-liste { max-height: 260px; }
.bs-mil-liste { max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px; }
.bs-mil-unite { margin: 8px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--inst-navy); }
.bs-mil { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 14px; cursor: pointer; }
.bs-mil input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.bs-mil-moi { cursor: default; font-weight: 600; }
.bs-verrou { margin: 4px 0 12px; font-size: 13px; color: var(--muted); text-align: right; }
.bs-numero { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px !important; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; color: var(--inst-navy); letter-spacing: .03em; }
.bs-verrouille { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 2px 6px; }
.bs-liste-filtre { width: 100%; margin-bottom: 10px; }
details.bs-item { padding: 0; margin-bottom: 6px; }
details.bs-item > summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
details.bs-item > summary::-webkit-details-marker { display: none; }
details.bs-item > summary::before { content: "›"; font-size: 18px; line-height: 1; color: var(--muted); transition: transform .15s; }
details.bs-item[open] > summary::before { transform: rotate(90deg); }
details.bs-item > summary:hover { background: color-mix(in srgb, var(--chip-bg) 60%, var(--border)); }
.bs-numero-txt { font-weight: 700; color: var(--inst-navy); letter-spacing: .03em; }
.bs-cree { margin-left: auto; font-size: 13px; color: var(--muted); }
.bs-pastille { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: #b8bcc6; }
.bs-pastille-envoye { background: #2f9e44; }
.bs-pastille-echec { background: #d33a3a; }
.bs-detail { padding: 4px 16px 14px 36px; border-top: 1px solid var(--border); }
.bs-verrouille-ligne { display: flex; align-items: center; gap: 8px; margin: 10px 0 !important; }
.bs-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }

@media (max-width: 600px) {
  .ann-title { font-size: 21px; }
  #activities .act-row { grid-template-columns: 96px 1fr 34px; }
  .bs-card { padding: 14px; }
  .ann-children, .ann-people { margin-left: 8px; padding-left: 12px; }
  .ann-people li { font-size: 14px; }
}

/* ==========================================================
   Modules Logistique / RH / Ambiance + Textes des pages
   ========================================================== */
/* Galons (épaulette stylisée) */
.galon { display: inline-flex; flex-direction: column; justify-content: center; gap: 2px; flex: none; width: 15px; height: 20px; padding: 3px; margin-right: 6px; border-radius: 2px 2px 5px 5px; background: #17214a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); vertical-align: middle; }
.galon .gb { display: block; height: 2px; border-radius: 1px; background: #dfe3ea; }
.galon .gb-o { background: #d8ab35; }
.galon .gb-r { height: 4px; background: linear-gradient(#dfe3ea 0 30%, #c8372d 30% 70%, #dfe3ea 70%); }
.galon .gb-R { height: 4px; background: linear-gradient(#d8ab35 0 30%, #c8372d 30% 70%, #d8ab35 70%); }
.galon .gb-m { height: 5px; background: linear-gradient(#d8ab35 0 18%, #dfe3ea 18% 36%, #c8372d 36% 64%, #dfe3ea 64% 82%, #d8ab35 82%); }
.galon-gen { align-items: center; gap: 0; color: #d8ab35; font-size: 6px; line-height: 1; }
.galon-gen b { display: block; font-weight: 400; }
.galon-lg { width: 36px; height: 48px; padding: 7px 6px; gap: 4px; border-radius: 3px 3px 10px 10px; margin-right: 0; }
.galon-lg .gb { height: 4px; }
.galon-lg .gb-r, .galon-lg .gb-R { height: 8px; }
.galon-lg .gb-m { height: 10px; }
.galon-lg.galon-gen { font-size: 11px; }
.mil { display: inline-flex; align-items: center; }
.ann-people .galon { margin-right: 0; }

/* Pages des modules */
.mod-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.mod-kpi { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.mod-kpi strong { display: block; font-size: 24px; line-height: 1.1; color: var(--link); }
.mod-kpi span { font-size: 12.5px; color: var(--muted); }
.mod-form { margin: 18px 0; padding: 18px 20px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.mod-form > .h2:first-child { margin-top: 0; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.mod-grid .full { grid-column: 1 / -1; }
.mod-inline { flex-wrap: wrap; }
.mod-inline input { height: 32px; }
.ta-right { text-align: right; }
.page-edit + .page-edit { margin-left: 0; }

.veh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.veh-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-top: 4px solid var(--pill-ok-bd); }
.veh-card.veh-mission { border-top-color: var(--pill-info-bd); }
.veh-card.veh-entretien { border-top-color: var(--pill-warn-bd); }
.veh-card.veh-indisponible { border-top-color: var(--pill-err-bd); }
.veh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.veh-top h3 { margin: 0; font-size: 15px; color: var(--link); }
.veh-meta { font-size: 13px; color: var(--muted); line-height: 1.5; }
.veh-card details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--link); }
.veh-form { display: grid; gap: 8px; margin-top: 10px; }
.veh-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }

.dossier-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding-top: 22px; }
.dossier-head .h1 { margin: 0; }
.dossier-head .kicker { margin-bottom: 4px; }
.dossier-choix { margin-left: auto !important; }
.dossier-infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 16px 0; }
.dossier-infos > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.dossier-infos span { display: block; font-size: 12px; color: var(--muted); }
.dossier-colonnes { align-items: start; }
.dossier-col { padding: 4px 18px 16px; border-top: 4px solid var(--pill-info-bd); }
.dossier-col.dossier-decoration { border-top-color: #d8ab35; }
.dossier-col.dossier-recompense { border-top-color: var(--pill-ok-bd); }
.dossier-col.dossier-sanction { border-top-color: var(--pill-err-bd); }
.dossier-liste { list-style: none; margin: 0; padding: 0; }
.dossier-liste li { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dossier-liste li:last-child { border-bottom: 0; }
.dossier-liste form { margin: 4px 0 0; }
.dossier-ajout { margin-top: 10px; }
.dossier-ajout summary { cursor: pointer; font-weight: 600; color: var(--link); font-size: 14px; margin-bottom: 10px; }
.notation { padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.notation-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.notation-head > strong { font-size: 20px; color: var(--link); }
.notation p { margin: 10px 0 0; }

.radio-alpha { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 14px; }
.radio-alpha > div { padding: 10px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.radio-alpha strong { display: block; font-size: 22px; color: var(--link); }
.radio-alpha span { font-size: 13px; }
.indicatif { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; }

/* Textes des pages (admin) */
.tx-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.tx-side { position: sticky; top: 16px; padding: 10px 0; max-height: calc(100vh - 32px); overflow-y: auto; }
.tx-zone { margin: 12px 18px 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tx-link { display: block; padding: 7px 18px; font-size: 14px; color: var(--text); text-decoration: none; border-left: 3px solid transparent; }
.tx-link:hover { background: var(--hover); color: var(--link); }
.tx-link.on { border-left-color: var(--primary); background: var(--hover); color: var(--link); font-weight: 600; }
.tx-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.tx-head .h1 { margin: 0; }
.tx-card { padding: 4px 22px 8px; margin-bottom: 18px; }
.tx-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }
.tx-fields > .tx-full { grid-column: 1 / -1; }
.tx-aide { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.le-thumb { display: block; max-width: 140px; max-height: 90px; margin-bottom: 6px; border-radius: 6px; object-fit: cover; }

/* Site public : traditions & galerie */
.trad-insigne { width: 240px; height: 240px; object-fit: contain; }
.trad-devise { font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; color: var(--link); margin: 0 0 16px; }
.trad-texte { max-width: 860px; }
.memorial { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.memorial li { padding: 16px 20px; border-left: 4px solid var(--primary); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.memorial strong { font-size: 17px; }
.memorial span { margin-left: 10px; color: var(--muted); font-size: 14px; }
.memorial p { margin: 6px 0 0; color: var(--muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.gallery-item { margin: 0; overflow: hidden; border-radius: 14px; }
.gallery-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s ease; }
.gallery-item a:hover img { transform: scale(1.04); }
.gallery-item figcaption { padding: 12px 16px; font-size: 14px; }
.gallery-item time { display: block; font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .tx-layout { grid-template-columns: 1fr; }
  .tx-side { position: static; max-height: none; }
  .dossier-choix { margin-left: 0 !important; }
}

/* Mode maintenance */
.maint { display: grid; place-items: center; min-height: calc(100vh - 260px); padding: 48px 16px; }
.maint-card { max-width: 620px; width: 100%; padding: 44px 36px; text-align: center; border-radius: 18px; border-top: 5px solid var(--primary); }
.maint-ico { display: inline-grid; place-items: center; width: 72px; height: 72px; margin-bottom: 14px; border-radius: 50%; color: var(--link); background: var(--chip-bg); }
.maint-card h1 { margin: 0 0 14px; font-size: clamp(24px, 3.4vw, 34px); color: var(--link); }
.maint-msg { color: var(--muted); }
.maint-retour { margin: 16px 0 22px; padding: 10px 16px; display: inline-block; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.maint-chip { position: fixed; left: 50%; transform: translateX(-50%); white-space: nowrap; bottom: 18px; z-index: 8995; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; color: var(--pill-warn-tx); background: var(--pill-warn-bg); border: 1px solid var(--pill-warn-bd); box-shadow: var(--shadow); }
.maint-chip:hover { filter: brightness(1.05); }
@media (max-width: 640px) { .maint-card { padding: 32px 20px; } .maint-chip { left: 12px; right: 12px; transform: none; white-space: normal; text-align: center; } }

/* NATINF : liste déroulante de suggestions sous un champ */
.natinf-ac { position: relative; }
.natinf-ac > textarea, .natinf-ac > input { width: 100%; }
.natinf-ac-liste { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.natinf-ac-liste li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.natinf-ac-liste li.actif, .natinf-ac-liste li:hover { background: var(--surface-2); }
.natinf-ac-liste li.natinf-ac-vide { color: var(--muted); cursor: default; background: none; }
.natinf-ac-code { flex: 0 0 52px; font-family: ui-monospace, Consolas, monospace; color: var(--link); }
.natinf-ac-qual { flex: 1; min-width: 0; }
.natinf-ac-liste .pill { flex: 0 0 auto; white-space: nowrap; font-size: 11px; }

/* ==========================================================
   Thèmes du site (html[data-saison]) — Administration → Thèmes du site
   Chaque thème reprend les couleurs de son logo (assets/img/logos/) :
   --s1 couleur principale, --s2 accent, --s3 couleur profonde,
   --s-deco petits décors des bandeaux du site public.
   Liste des thèmes et calendrier : includes/saisons.php
   ========================================================== */
.site-logo .logo-saison { display: none; }
:root[data-saison] .site-logo.avec-saison .logo-light,
:root[data-saison] .site-logo.avec-saison .logo-dark { display: none; }
:root[data-saison] .site-logo .logo-saison { display: block; }

/* Bouton du thème dans l'en-tête (chacun peut le masquer pour lui-même) */
.saison-btn { filter: grayscale(1) opacity(.75); transition: filter .2s, transform .2s; }
.saison-btn:hover { filter: none; transform: rotate(-12deg) scale(1.1); }
:root[data-saison] .saison-btn { filter: drop-shadow(0 0 6px var(--s2)); }
/* Thèmes de nuit : le bouton clair / sombre n'a plus d'effet */
:root:is([data-saison="halloween"], [data-saison="noel"], [data-saison="fete_musique"]) [data-theme-toggle] { display: none; }

/* ---------- Base commune ---------- */
:root[data-saison] {
  --s-glow: color-mix(in srgb, var(--s1) 22%, transparent);
  --s-halo: color-mix(in srgb, var(--s1) 12%, transparent);
  --s-hero:
    radial-gradient(900px 420px at 85% 20%, color-mix(in srgb, var(--s1) 30%, transparent), transparent 60%),
    radial-gradient(700px 380px at 5% 90%, color-mix(in srgb, var(--s2) 22%, transparent), transparent 60%);
  --s-banner:
    radial-gradient(700px 300px at 90% 0%, color-mix(in srgb, var(--s2) 40%, transparent), transparent 60%),
    linear-gradient(135deg, var(--s3) 0%, var(--s1) 100%);
  --s-cta:
    radial-gradient(600px 240px at 100% 0%, color-mix(in srgb, var(--s2) 45%, transparent), transparent 60%),
    linear-gradient(135deg, var(--s3), var(--s1));
}
:root[data-saison] body {
  background: radial-gradient(1100px 500px at 50% -120px, var(--s-halo), transparent 70%), var(--bg);
  background-attachment: fixed;
}
:root[data-saison] ::selection { background: var(--s1); color: #fff; }
:root[data-saison] .hdr,
:root[data-saison] .pub-hdr { border-bottom: 2px solid var(--s1); box-shadow: 0 2px 22px var(--s-glow); }
:root[data-saison] .hero-bg { background: var(--s-hero), linear-gradient(180deg, transparent 70%, var(--bg)); }
:root[data-saison] .hero .hl { background: linear-gradient(90deg, var(--s1), var(--s2)); -webkit-background-clip: text; background-clip: text; }
:root[data-saison] .hero-emblem .site-logo { filter: drop-shadow(0 0 28px color-mix(in srgb, var(--s1) 50%, transparent)); }
:root[data-saison] .feature-card::before,
:root[data-saison] .progbar > span,
:root[data-saison] .progbar-fill { background: linear-gradient(90deg, var(--s1), var(--s2)); }
:root[data-saison] .feature-card:hover,
:root[data-saison] .mission-card:hover,
:root[data-saison] .peloton-card:hover,
:root[data-saison] .news-card:hover,
:root[data-saison] .pcard:hover { box-shadow: 0 16px 34px var(--s-glow); }
:root[data-saison] .mission-ico { background: linear-gradient(135deg, var(--s1), var(--s3)); box-shadow: 0 8px 20px var(--s-glow); }
:root[data-saison] .peloton-sigle { background: linear-gradient(135deg, var(--s3), var(--s1)); box-shadow: 0 10px 24px var(--s-glow); }
:root[data-saison] .page-banner { background: var(--s-banner); }
:root[data-saison] .page-banner .kicker { color: color-mix(in srgb, var(--s2) 55%, #fff); }
:root[data-saison] .cta-band { background: var(--s-cta); box-shadow: 0 20px 44px var(--s-glow); }
:root[data-saison] .btn-light { background: #fff; color: var(--s3); }
:root[data-saison] .btn-light:hover { background: color-mix(in srgb, var(--s2) 18%, #fff); }
:root[data-saison] { --b-accent: var(--s1); }

/* Petits décors dans les bandeaux du site public */
:root[data-saison] .page-banner::before,
:root[data-saison] .hero::after {
  content: var(--s-deco, none);
  position: absolute; top: 18px; right: 8%; z-index: 0;
  font-size: 22px; letter-spacing: 6px; white-space: pre; opacity: .6; pointer-events: none;
  animation: saison-flotte 7s ease-in-out infinite;
}
:root[data-saison] .hero::after { z-index: -1; }
@keyframes saison-flotte { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-14px, 8px); } }

/* Liseré bleu-blanc-rouge sous l'en-tête (commémorations, fête de la musique) */
:root:is([data-saison="souvenir"], [data-saison="hommage"], [data-saison="fete_musique"]) :is(.hdr, .pub-hdr) {
  border-bottom: 3px solid; border-image: linear-gradient(90deg, #0055a4 33.3%, #fff 33.3% 66.6%, #ef4135 66.6%) 1;
}

/* Neige (Hiver, Noël) : deux couches de flocons sur le site public et sur le fond du bureau */
:root:is([data-saison="hiver"], [data-saison="noel"]) :is(.mode-public, .mode-auth)::before,
:root:is([data-saison="hiver"], [data-saison="noel"]) :is(.mode-public, .mode-auth)::after,
:root:is([data-saison="hiver"], [data-saison="noel"]) .b-wall::before {
  content: ""; position: fixed; left: 0; right: 0; top: -300px; height: calc(100vh + 300px);
  z-index: 9000; pointer-events: none; will-change: transform;
  background-image:
    radial-gradient(circle at 20px 30px, var(--neige) 1.6px, transparent 2.6px),
    radial-gradient(circle at 150px 80px, var(--neige) 2.2px, transparent 3.2px),
    radial-gradient(circle at 240px 190px, var(--neige) 1.3px, transparent 2.3px),
    radial-gradient(circle at 90px 240px, var(--neige) 2.5px, transparent 3.5px),
    radial-gradient(circle at 200px 280px, var(--neige) 1.5px, transparent 2.5px);
  background-size: 300px 300px;
  opacity: .75;
  animation: saison-neige 18s linear infinite;
}
:root:is([data-saison="hiver"], [data-saison="noel"]) :is(.mode-public, .mode-auth)::after {
  background-size: 420px 300px; background-position: 130px 0; opacity: .45; animation-duration: 11s;
}
:root:is([data-saison="hiver"], [data-saison="noel"]) .b-wall::before { position: absolute; height: calc(100% + 300px); z-index: 0; }
:root[data-saison="noel"], :root[data-saison="hiver"][data-theme="dark"] { --neige: rgba(255, 255, 255, .9); }
:root[data-saison="hiver"] { --neige: rgba(120, 180, 230, .75); }
:root[data-saison="hiver"] .b-wall { --neige: rgba(255, 255, 255, .9); }
@keyframes saison-neige { to { transform: translateY(300px); } }

/* Guirlande lumineuse sous l'en-tête (Noël) */
:root[data-saison="noel"] :is(.hdr, .pub-hdr, .b-top)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 12px; z-index: 2; pointer-events: none;
  background:
    radial-gradient(circle at 6px 7px, #ff4d4d 0 3.2px, transparent 4.2px) 0 0 / 48px 12px repeat-x,
    radial-gradient(circle at 18px 7px, #ffd23f 0 3.2px, transparent 4.2px) 0 0 / 48px 12px repeat-x,
    radial-gradient(circle at 30px 7px, #4dd2ff 0 3.2px, transparent 4.2px) 0 0 / 48px 12px repeat-x,
    radial-gradient(circle at 42px 7px, #5cff8a 0 3.2px, transparent 4.2px) 0 0 / 48px 12px repeat-x;
  filter: drop-shadow(0 0 3px rgba(255, 220, 140, .9));
  animation: saison-guirlande 1.4s steps(1) infinite;
}
@keyframes saison-guirlande { 50% { background-position: 12px 0, 12px 0, 12px 0, 12px 0; } }

/* Moins d'animations : réglage de l'administration ou de l'appareil du visiteur */
:root[data-saison-calme] .page-banner::before, :root[data-saison-calme] .hero::after,
:root[data-saison-calme] :is(.hdr, .pub-hdr, .b-top)::after { animation: none; }
:root[data-saison-calme] :is(.mode-public, .mode-auth, .b-wall)::before,
:root[data-saison-calme] :is(.mode-public, .mode-auth)::after { display: none; }
@media (prefers-reduced-motion: reduce) {
  :root[data-saison] .page-banner::before, :root[data-saison] .hero::after,
  :root[data-saison] :is(.hdr, .pub-hdr, .b-top)::after { animation: none; }
  :root[data-saison] :is(.mode-public, .mode-auth, .b-wall)::before,
  :root[data-saison] :is(.mode-public, .mode-auth)::after { display: none; }
}

/* ---------- Thèmes de nuit (forcent le thème sombre) ---------- */
:root[data-saison="halloween"] {
  --s1: #f26b0f; --s2: #f5b041; --s3: #6e1a0e;
  --s-deco: "🦇   🦇      🦇";
  --s-banner: radial-gradient(700px 300px at 90% 0%, rgba(245, 176, 65, .35), transparent 60%), linear-gradient(135deg, #1a0907 0%, #6e1a0e 55%, #d4560c 100%);
  --blue: #f26b0f; --blue-dark: #b8450a; --red: #c0261b;
  --bg: #0c0806; --surface: #17100c; --surface-2: #211710; --border: #3b2a1d;
  --text: #f4ebdf; --muted: #b8a48e; --link: #ff9a3c;
  --primary: #f26b0f; --primary-hover: #ff8424; --primary-text: #ffffff;
  --hdr: #0a0504; --nav-bg: #130c08; --hover: #2a1c12; --result: #2a1a0f; --input-bg: #120c09;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --chip: #2c1d12; --chip-bg: #2c1d12;
  --pill-bg: #33200f; --pill-bd: #6b3a12; --pill-tx: #ffc58a;
  --tbl-alt: #1c130d; --tbl-row-hover: #2a1c12; --bulk-bg: #33200f; --bulk-bd: #6b3a12;
  --modal-head-bg: #2a1a0f; --modal-foot-bg: #1c130d; --fiche-bg: #2a1a0f;
  --a-info-bg: #2a1a0f; --a-info-bd: #6b3a12; --a-info-tx: #ffd2a6;
  --inst-navy: #ffb067; --inst-folder: #f28a3a; --inst-folder-line: #a8470c;
}
:root[data-saison="noel"] {
  --s1: #c8102e; --s2: #e3b448; --s3: #0f3d26;
  --s-deco: "🎄   🎁      ⭐";
  --blue: #c8102e; --blue-dark: #8f0b21; --red: #c8102e;
  --bg: #0b1410; --surface: #121e18; --surface-2: #19281f; --border: #2b3d31;
  --text: #f3efe6; --muted: #b3b8a6; --link: #f0c75e;
  --primary: #c8102e; --primary-hover: #e01f3d; --primary-text: #ffffff;
  --hdr: #08100c; --nav-bg: #0f1a14; --hover: #1d2e24; --result: #22301f; --input-bg: #0d1712;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --chip: #1d2e24; --chip-bg: #1d2e24;
  --pill-bg: #3a1414; --pill-bd: #7a2020; --pill-tx: #ffc9c9;
  --tbl-alt: #101b15; --tbl-row-hover: #1d2e24; --bulk-bg: #3a1414; --bulk-bd: #7a2020;
  --modal-head-bg: #1f2a1c; --modal-foot-bg: #101b15; --fiche-bg: #1f2a1c;
  --a-info-bg: #1d2e24; --a-info-bd: #3b5a40; --a-info-tx: #d9efc8;
  --inst-navy: #f0c75e; --inst-folder: #c8102e; --inst-folder-line: #7a0a1b;
}
:root[data-saison="fete_musique"] {
  --s1: #3d6bff; --s2: #ff3d6e; --s3: #12124a;
  --s-deco: "🎵   🎶      🎸";
  --blue: #3d6bff; --blue-dark: #2a4fd0; --red: #ff3d6e;
  --bg: #0a0a18; --surface: #12122a; --surface-2: #1a1a38; --border: #2c2c55;
  --text: #eef0ff; --muted: #a6a9cc; --link: #8fb0ff;
  --primary: #3d6bff; --primary-hover: #5a82ff; --primary-text: #ffffff;
  --hdr: #07071a; --nav-bg: #0f0f24; --hover: #1e1e40; --result: #1c1c3c; --input-bg: #0d0d20;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --chip: #1e1e40; --chip-bg: #1e1e40;
  --pill-bg: #2a1c40; --pill-bd: #5a3a8a; --pill-tx: #e3c9ff;
  --tbl-alt: #111126; --tbl-row-hover: #1e1e40; --bulk-bg: #2a1c40; --bulk-bd: #5a3a8a;
  --modal-head-bg: #1c1c3c; --modal-foot-bg: #111126; --fiche-bg: #1c1c3c;
  --a-info-bg: #1c1c3c; --a-info-bd: #3a3a75; --a-info-tx: #cfd8ff;
  --inst-navy: #8fb0ff; --inst-folder: #ff3d6e; --inst-folder-line: #a8204a;
}
:root[data-saison="fete_musique"] .page-banner h1 { text-shadow: 0 0 18px rgba(61, 107, 255, .8), 0 0 4px rgba(255, 61, 110, .6); }

/* ---------- Thèmes clairs ou sombres (suivent le choix du visiteur) ---------- */
:root[data-saison="hiver"] {
  --s1: #2f8fd6; --s2: #bfe6ff; --s3: #0d2a45; --s-deco: "❄   ❄      ❄";
  --bg: #f2f7fc; --primary: #1f78c8; --primary-hover: #1866ad; --link: #1765a8; --blue: #1f78c8; --hdr: #0d2a45;
  --hover: #e6f1fb; --result: #dfeefb; --chip: #e3f0fb; --chip-bg: #e3f0fb;
  --pill-bg: #e1effb; --pill-bd: #a9cdee; --pill-tx: #134d80; --inst-navy: #0d3a66;
}
:root[data-saison="hiver"][data-theme="dark"] {
  --bg: #0f1620; --surface: #151e2a; --surface-2: #1b2634; --border: #2a3a4e;
  --primary: #2f8fd6; --primary-hover: #46a3e8; --link: #8cc8ff; --hdr: #0a1420; --nav-bg: #121b26;
  --hover: #1a2838; --result: #182a3c; --chip: #1a2a3c; --chip-bg: #1a2a3c;
  --pill-bg: #142a40; --pill-bd: #24507a; --pill-tx: #a9d6ff; --inst-navy: #9fd0ff;
}
:root[data-saison="printemps"] {
  --s1: #5fae2e; --s2: #f29cb8; --s3: #2f5a1c; --s-deco: "🌸   🌼      🌸";
  --bg: #f7fbf2; --primary: #4f9a23; --primary-hover: #42841c; --link: #3f7f1b; --blue: #4f9a23; --hdr: #2f5a1c;
  --hover: #eef7e4; --result: #e8f4dc; --chip: #edf6e2; --chip-bg: #edf6e2;
  --pill-bg: #ebf6e0; --pill-bd: #b9dd9c; --pill-tx: #2f6114; --inst-navy: #2f5a1c; --inst-folder: #e07fa0;
}
:root[data-saison="printemps"][data-theme="dark"] {
  --bg: #121710; --surface: #182016; --surface-2: #1f291c; --border: #31402c;
  --primary: #5fae2e; --primary-hover: #72c33f; --link: #a6dc7c; --hdr: #0e140c; --nav-bg: #151c13;
  --hover: #213020; --result: #1f2e1b; --chip: #22301e; --chip-bg: #22301e;
  --pill-bg: #1f3318; --pill-bd: #3d6128; --pill-tx: #c4ec9f; --inst-navy: #b4e38c;
}
:root[data-saison="paques"] {
  --s1: #8f5fd6; --s2: #f5c400; --s3: #4a2f7a; --s-deco: "🐣   🥚      🌷";
  --bg: #fffcf3; --primary: #7c4dbd; --primary-hover: #6a3fa8; --link: #6a3fa8; --blue: #7c4dbd; --hdr: #4a2f7a;
  --hover: #f6f0fc; --result: #f1e9fb; --chip: #f3ecfb; --chip-bg: #f3ecfb;
  --pill-bg: #f1e9fb; --pill-bd: #d4bff0; --pill-tx: #55308f; --inst-navy: #4a2f7a; --inst-folder: #e0b400;
}
:root[data-saison="paques"][data-theme="dark"] {
  --bg: #15121a; --surface: #1c1823; --surface-2: #241f2d; --border: #383046;
  --primary: #8f5fd6; --primary-hover: #a273e6; --link: #cdb3ff; --hdr: #100d16; --nav-bg: #18141e;
  --hover: #2a2336; --result: #281f36; --chip: #2a2336; --chip-bg: #2a2336;
  --pill-bg: #2a1f3c; --pill-bd: #4f3a75; --pill-tx: #dcc9ff; --inst-navy: #d8c3ff;
}
:root[data-saison="ete"] {
  --s1: #0aa2c0; --s2: #f2b705; --s3: #0b3d55; --s-deco: "☀️   🌴      ⛵";
  --bg: #f3fbfc; --primary: #087a92; --primary-hover: #066a80; --link: #066f86; --blue: #087a92; --hdr: #0b3d55;
  --hover: #e3f5f8; --result: #daf1f6; --chip: #e0f3f7; --chip-bg: #e0f3f7;
  --pill-bg: #ddf2f7; --pill-bd: #99d6e4; --pill-tx: #075668; --inst-navy: #0b4a63; --inst-folder: #f2b705;
}
:root[data-saison="ete"][data-theme="dark"] {
  --bg: #0e171a; --surface: #142024; --surface-2: #1a292e; --border: #2a4048;
  --primary: #0a8fab; --primary-hover: #18a8c6; --link: #7fe0f2; --hdr: #0a1316; --nav-bg: #111c20;
  --hover: #1a2d33; --result: #183238; --chip: #1a2d33; --chip-bg: #1a2d33;
  --pill-bg: #12303a; --pill-bd: #1f5866; --pill-tx: #9feaf7; --inst-navy: #8fe3f3;
}
:root[data-saison="automne"] {
  --s1: #c8561b; --s2: #e0a030; --s3: #4a2410; --s-deco: "🍂   🍁      🍂";
  --bg: #fcf7f1; --primary: #b84a12; --primary-hover: #9e3f0f; --link: #a3420f; --blue: #b84a12; --hdr: #4a2410;
  --hover: #fbefe4; --result: #f8e6d6; --chip: #f9ebdd; --chip-bg: #f9ebdd;
  --pill-bg: #fbe9d9; --pill-bd: #efc39c; --pill-tx: #7a3410; --inst-navy: #6b2f0f; --inst-folder: #e0a030;
}
:root[data-saison="automne"][data-theme="dark"] {
  --bg: #17110d; --surface: #1f1712; --surface-2: #281e17; --border: #3e2f24;
  --primary: #c8561b; --primary-hover: #dc6a2c; --link: #ffb27a; --hdr: #120c08; --nav-bg: #1a130e;
  --hover: #2c2018; --result: #2e1f14; --chip: #2c2018; --chip-bg: #2c2018;
  --pill-bg: #36200f; --pill-bd: #6b3a17; --pill-tx: #ffc896; --inst-navy: #ffbf8a;
}
:root[data-saison="ruban_bleu"] {
  --s1: #1e7be0; --s2: #5ab0ff; --s3: #0f2f5c;
  --bg: #f4f8fd; --primary: #1e6fd0; --primary-hover: #185ab0; --link: #165fb8; --blue: #1e6fd0; --hdr: #0f2f5c;
  --hover: #eaf2fd; --result: #e1edfc; --chip: #e6f0fd; --chip-bg: #e6f0fd;
  --pill-bg: #e3eefc; --pill-bd: #a8c8f2; --pill-tx: #14468a; --inst-navy: #0f3a70;
}
:root[data-saison="ruban_bleu"][data-theme="dark"] {
  --bg: #10141b; --surface: #161c25; --surface-2: #1d2430; --border: #2c3647;
  --primary: #1e7be0; --primary-hover: #3a8ff0; --link: #8cc0ff; --hdr: #0b1426; --nav-bg: #131a24;
  --hover: #1a2638; --result: #17263c; --chip: #1a2638; --chip-bg: #1a2638;
  --pill-bg: #13284a; --pill-bd: #24497e; --pill-tx: #a9cfff; --inst-navy: #9cc7ff;
}
:root[data-saison="souvenir"] {
  --s1: #c62828; --s2: #d4af37; --s3: #14213d;
  --bg: #f7f6f2; --primary: #a51d24; --primary-hover: #8c1820; --link: #1d3f8a; --blue: #1d3f8a; --hdr: #14213d;
  --hover: #f3f2ef; --result: #efece6; --chip: #f2efe8; --chip-bg: #f2efe8;
  --pill-bg: #f4ece2; --pill-bd: #d8c3a3; --pill-tx: #5e4520; --inst-navy: #14213d;
}
:root[data-saison="souvenir"][data-theme="dark"] {
  --bg: #13120f; --surface: #1b1915; --surface-2: #23211c; --border: #3a362e;
  --primary: #c62828; --primary-hover: #d84040; --link: #e9cf86; --hdr: #0e0d0b; --nav-bg: #17150f;
  --hover: #29261f; --result: #2a251a; --chip: #29261f; --chip-bg: #29261f;
  --pill-bg: #33291a; --pill-bd: #64512c; --pill-tx: #f0d9a0; --inst-navy: #e9cf86;
}
:root[data-saison="hommage"] {
  --s1: #3557b8; --s2: #f2c46d; --s3: #0b1230;
  --bg: #f5f6fa; --primary: #1f3f8f; --primary-hover: #183375; --link: #1f3f8f; --blue: #1f3f8f; --hdr: #10162b;
  --hover: #eef1f8; --result: #e6ebf6; --chip: #eaeef7; --chip-bg: #eaeef7;
  --pill-bg: #e8ecf7; --pill-bd: #b7c3e3; --pill-tx: #1f3375; --inst-navy: #10204a;
}
:root[data-saison="hommage"][data-theme="dark"] {
  --bg: #0f1015; --surface: #16171e; --surface-2: #1d1f28; --border: #2e313e;
  --primary: #3557b8; --primary-hover: #4a6ccc; --link: #f2c46d; --hdr: #0b0c10; --nav-bg: #14151b;
  --hover: #22242e; --result: #232530; --chip: #22242e; --chip-bg: #22242e;
  --pill-bg: #2b2516; --pill-bd: #5c4a22; --pill-tx: #f6d590; --inst-navy: #f2c46d;
}
:root[data-saison="dsi_paris"] {
  --s1: #2f4fd8; --s2: #ffd400; --s3: #0b1a4a;
  --bg: #f4f6fc; --primary: #1f3fbf; --primary-hover: #1a35a3; --link: #1f3fbf; --blue: #1f3fbf; --hdr: #0b1a4a;
  --hover: #eef1fc; --result: #e5eafb; --chip: #e9edfb; --chip-bg: #e9edfb;
  --pill-bg: #e6ebfb; --pill-bd: #b3c1f0; --pill-tx: #1a2f8a; --inst-navy: #0b1a4a; --inst-folder: #e0b400;
}
:root[data-saison="dsi_paris"][data-theme="dark"] {
  --bg: #0c0f1c; --surface: #121626; --surface-2: #191e31; --border: #2a3150;
  --primary: #2f4fd8; --primary-hover: #4766e6; --link: #ffd84d; --hdr: #080b16; --nav-bg: #10142a;
  --hover: #1d2340; --result: #1c2346; --chip: #1d2340; --chip-bg: #1d2340;
  --pill-bg: #2a2810; --pill-bd: #5c5418; --pill-tx: #ffe680; --inst-navy: #ffd84d;
}

/* Bandeau « Aperçu du thème » (administrateur) */
.apercu-chip { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 8996; max-width: calc(100vw - 24px); padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--surface); border: 2px solid var(--primary); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); text-align: center; }
.maint-chip + .apercu-chip { bottom: 62px; }
.in-frame .apercu-chip { display: none; }

/* Administration → Thèmes du site */
.th-etat { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 22px; padding: 16px 18px; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); background: var(--surface-2); }
.th-etat img { width: 64px; height: 64px; object-fit: contain; }
.th-etat > div { flex: 1 1 260px; }
.th-etat p { margin: 2px 0 0; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 26px; }
.th-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 400 !important; transition: border-color .15s, box-shadow .15s; }
.th-card:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.th-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.th-card input[type="radio"] { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; accent-color: var(--primary); }
.th-vue { display: grid; place-items: center; height: 120px; border-radius: 8px; background: radial-gradient(circle at 70% 20%, color-mix(in srgb, var(--c2) 45%, transparent), transparent 60%), linear-gradient(135deg, var(--c0), var(--c1)); }
.th-vue img { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.th-vue span { font-size: 44px; }
.th-vue-neutre { background: linear-gradient(135deg, #2e2878, #5a50e0); }
.th-card strong { font-size: 15.5px; padding-right: 26px; }
.th-card small { color: var(--muted); line-height: 1.4; }
.th-card .th-dates { font-size: 12.5px; font-weight: 600; color: var(--link); }
.th-card .th-actuel { position: absolute; top: 18px; left: 18px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; background: var(--primary); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.th-card a { margin-top: auto; font-size: 13px; font-weight: 600; }
.th-table td { vertical-align: middle; }
.th-table input[type="text"] { width: 76px; height: 34px; text-align: center; }
.th-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.th-table .th-logo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.th-table .th-logo img { width: 44px; height: 44px; object-fit: contain; }
.th-table .th-logo input[type="file"] { max-width: 220px; font-size: 12.5px; }
.th-options { display: grid; gap: 10px; margin-bottom: 18px; }
.th-options label.check { font-weight: 400 !important; }

/* ==========================================================
   Accueil intranet (épuré)
   ========================================================== */
.home-hello { margin: 4px 0 18px; padding-bottom: 14px; border-bottom: 2px solid var(--inst-navy); }
.home-date { margin: 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.home-title { margin: 4px 0 2px; font-size: 26px; font-weight: 700; color: var(--inst-navy); }
.home-sub { margin: 0; color: var(--muted); font-size: 14px; }
.home-k { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--inst-navy); }


.home-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-top: 16px; }
.home-block { padding: 18px 22px; }
.home-info { padding: 10px 0; border-top: 1px solid var(--border); }
.home-k + .home-info { border-top: 0; padding-top: 0; }
.home-info-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.home-info .cms-content { margin-top: 4px; color: var(--muted); }
.home-links { display: flex; flex-direction: column; }
.home-links a { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; border-top: 1px solid var(--border); color: var(--text); font-weight: 600; text-decoration: none; }
.home-links a:first-child { border-top: 0; }
.home-links a:hover { color: var(--link); }
.home-links a span { color: var(--muted); font-size: 18px; }
.home-more { margin: 12px 0 0; text-align: right; }


@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   Accueil : colonne de droite (Pulsar + raccourcis)
   ========================================================== */
.home-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-dispos { list-style: none; margin: 0; padding: 0; }
.home-dispos li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.home-dispos li:first-child { border-top: 0; padding-top: 0; }

/* ==========================================================
   Pulsar — disponibilités (calendrier mensuel)
   ========================================================== */
.pulsar { padding: 22px 24px 26px; }
.pulsar-title { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 2px solid var(--border); font-size: 22px; color: var(--inst-navy); }
.pulsar-grid { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.pulsar-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pulsar-box { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.pulsar-h { margin: 0 0 12px; font-size: 16px; line-height: 1.35; color: var(--inst-navy); }
.pulsar-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pulsar-list li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 34px 8px 10px; border-left: 3px solid var(--pill-ok-tx); border-radius: 0 6px 6px 0; background: var(--surface); }
.pulsar-list li.mine { border-left-color: var(--primary); }
.pulsar-hr { font-weight: 700; font-size: 14px; }
.pulsar-who { font-size: 13.5px; }
.pulsar-list form { position: absolute; top: 6px; right: 6px; margin: 0; }
.pulsar-del { width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; }
.pulsar-del:hover { color: var(--pill-err-tx); border-color: var(--pill-err-bd); }
.pulsar-add { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.pulsar-ro { background: var(--surface-2) !important; color: var(--muted) !important; }
.pulsar-btns { display: flex; gap: 8px; }
.btn-ok { background: #1b7f3b; color: #fff; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-grey { background: #6b7280; color: #fff; }
.btn-grey:hover { filter: brightness(1.08); }
.pulsar-cal { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); min-width: 0; }
.pulsar-cal-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 14px; }
.pulsar-cal-h strong { font-size: 22px; color: var(--inst-navy); }
.pulsar-cal-h a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 26px; line-height: 1; color: var(--inst-navy); text-decoration: none; }
.pulsar-cal-h a:hover { background: var(--hover); }
.pulsar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.pulsar-dow { padding: 6px 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--inst-navy); }
.pulsar-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; border: 1px solid transparent; border-radius: 6px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; }
.pulsar-day:hover { border-color: var(--inst-navy); text-decoration: none; }
.pulsar-day.hors { opacity: .45; }
.pulsar-day.auj { border: 2px solid #e8901a; }
.pulsar-day.sel { background: var(--inst-navy); color: var(--surface); font-weight: 700; }
.pulsar-dot { display: inline-grid; place-items: center; min-width: 9px; height: 9px; padding: 0; border-radius: 999px; background: #2e9e57; color: #fff; font-style: normal; font-size: 10px; font-weight: 700; line-height: 1; }
.pulsar-dot:not(:empty) { min-width: 16px; height: 16px; padding: 0 4px; }

/* CRO : deux champs côte à côte */
.cro-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Journal & logs */
.logs-table td { vertical-align: top; }
.logs-detail { max-width: 360px; word-break: break-word; }
.logs-exemple { overflow-x: auto; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; line-height: 1.5; }
.logs-cases { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.logs-cases label { display: inline-flex; align-items: center; gap: 6px; }
.logs-bot details { margin-top: 12px; }
.logs-bot details summary { cursor: pointer; font-weight: 600; }

/* ==========================================================
   Responsive intranet — tablette & téléphone
   ========================================================== */
.nav-toggle { display: none; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; }
.nav-search { display: none; }

/* Tablette : le menu passe sur deux lignes si besoin (les sous-menus restent sous leur bouton) */
@media (max-width: 1200px) and (min-width: 901px) {
  .nav { flex-wrap: wrap; height: auto; }
  .nav .dd > button { padding: 0 12px; font-size: 13.5px; white-space: nowrap; }
  .search { flex: 0 1 360px; }
}

/* Téléphone & petite tablette : menu burger */
@media (max-width: 900px) {
  .hdr { height: 56px; padding: 0 10px; gap: 8px; }
  .nav-toggle { display: grid; }
  .brand { gap: 8px; min-width: 0; flex: 1 1 auto; }
  .brand strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand .site-logo { --logo-size: 32px; }
  .hdr .search { display: none; }
  .hdr-icons { gap: 2px; }
  .hdr-icons .icon-btn { width: 34px; height: 34px; }
  .userbtn { padding: 3px 6px 3px 3px; }

  .nav { display: none; height: auto; padding: 0; overflow: visible; flex-direction: column; border-bottom: 2px solid var(--border); }
  body.nav-open .nav { display: flex; max-height: calc(100vh - 56px); overflow-y: auto; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
  .nav-search { display: block; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .nav-search input { height: 40px; border-radius: 999px; }
  .nav .dd { display: block; width: 100%; }
  .nav .dd > button, .nav .dd:first-child > button { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 50px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--border); text-align: left; font-size: 15px; }
  .nav .dd.open > button { background: var(--hover); color: var(--link); }
  .nav .dd-menu { position: static !important; min-width: 0; padding: 4px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; background: var(--surface-2); }
  .nav .dd-menu a { padding: 12px 30px; font-size: 15px; }

  .page-tools { flex-wrap: wrap; gap: 8px; }
  .wrap { margin: 14px auto; padding: 0 12px; }
  .tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .tabs > button, .tabs > a { flex: 0 0 auto; }
  .pulsar { padding: 16px; }
  .pulsar-grid { grid-template-columns: 1fr; }
  .pulsar-cal { order: -1; }
  .home-grid { grid-template-columns: 1fr; }
  .site-foot { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 640px) {
  .brand small { display: none; }
  .hdr-icons .saison-btn, .hdr-icons .hdr-infos { display: none; }
  .home-title { font-size: 22px; }
  .h1, .bs-title, .pulsar-title { font-size: 20px; }
  .mod-grid, .cro-2 { grid-template-columns: 1fr; }
  .bs-card { padding: 14px 12px 16px; }
  .pulsar { padding: 12px; }
  .pulsar-cal { padding: 8px; }
  .pulsar-cal-h strong { font-size: 18px; }
  .pulsar-days { gap: 2px; }
  .pulsar-day { min-height: 44px; font-size: 13px; }
  .pulsar-dow { font-size: 11px; }
  .table { font-size: 12.5px; }
  .notice-chip { font-size: 11px; padding: 4px 10px; left: 8px; bottom: 8px; }
}

/* ==========================================================
   Administration — liste des utilisateurs & fenêtre « Modifier »
   ========================================================== */
.users-table td { vertical-align: middle; }
.users-table .u-check { width: 38px; text-align: center; }
.users-table .u-who { min-width: 200px; }
.users-table .u-actions { width: 1%; white-space: nowrap; }
.u-btns { display: flex; gap: 6px; align-items: center; }
.u-btns form { margin: 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--pill-bd); background: var(--pill-bg); color: var(--pill-tx); white-space: nowrap; }
.badge-ok { color: var(--pill-ok-tx); background: var(--pill-ok-bg); border-color: var(--pill-ok-bd); }
.badge-off { color: var(--pill-err-tx); background: var(--pill-err-bg); border-color: var(--pill-err-bd); }
.badge-hab-opj { color: var(--pill-warn-tx); background: var(--pill-warn-bg); border-color: var(--pill-warn-bd); }
.badge-hab-apj { color: var(--pill-info-tx); background: var(--pill-info-bg); border-color: var(--pill-info-bd); }
.badge-hab-aucune { color: var(--pill-muted-tx); background: var(--pill-muted-bg); border-color: var(--pill-muted-bd); }
.bulk-left { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 auto; }
.bulk-left select { width: auto; min-width: 160px; }
.bulk-right { margin-left: auto; }

dialog.dlg { width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
dialog.dlg::backdrop { background: rgba(10, 8, 6, .6); }
.dlg-form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); margin: 0; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--border); }
.dlg-head h2 { margin: 0; font-size: 19px; color: var(--inst-navy); }
.dlg-head p { margin: 2px 0 0; }
.dlg-x { width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); color: var(--text); cursor: pointer; }
.dlg-body { padding: 6px 22px 10px; overflow-y: auto; }
.dlg-h { margin: 14px 0 8px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--inst-navy); }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.dlg-grid .field input, .dlg-grid .field select { width: 100%; }
.dlg-grid .field small { display: block; margin-top: 4px; }
.dlg-checks { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.dlg-checks .check-inline { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.dlg-checks input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.dlg-suppr { margin-right: auto; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 22px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }

/* Tablette & téléphone : chaque militaire devient une fiche */
@media (max-width: 900px) {
  .users-wrap { border: 0; background: transparent; overflow: visible; }
  .users-table, .users-table tbody { display: block; }
  .users-table thead { display: none; }
  .users-table tr { display: grid; grid-template-columns: 30px 1fr; gap: 6px 10px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface) !important; }
  .users-table td { display: block; padding: 0; border: 0; }
  .users-table td.u-check { grid-row: 1; grid-column: 1; width: auto; text-align: left; padding-top: 2px; }
  .users-table td.u-who { grid-row: 1; grid-column: 2; min-width: 0; }
  .users-table td[data-label] { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; }
  .users-table td[data-label]::before { content: attr(data-label); min-width: 96px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .users-table td.u-actions { grid-column: 1 / -1; width: auto; white-space: normal; padding-top: 8px; border-top: 1px solid var(--border); }
  .u-btns { flex-wrap: wrap; }
  .u-btns > * { flex: 1 1 auto; }
  .u-btns .btn { width: 100%; }
}
@media (max-width: 640px) {
  dialog.dlg { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border-radius: 0; }
  .dlg-form { max-height: 100%; height: 100%; }
  .dlg-body { flex: 1 1 auto; }
  .dlg-grid { grid-template-columns: 1fr; }
  .dlg-foot { border-radius: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .dlg-foot .btn { flex: 1 1 0; }
  .dlg-foot .dlg-suppr { flex: 1 1 100%; margin-right: 0; }
  .bulk-left select { flex: 1 1 100%; min-width: 0; }
  .bulk-right, .bulk-right .btn { width: 100%; }
}

/* ==========================================================
   Application installée (PWA) : carte d'installation + plein écran
   ========================================================== */
.pwa-card { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 16px; border-left: 4px solid var(--primary); }
.pwa-card img { flex: 0 0 auto; border-radius: 12px; }
.pwa-card-txt { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.pwa-card-btns { display: flex; gap: 8px; flex: 0 0 auto; }
@media (max-width: 640px) {
  .pwa-card { flex-wrap: wrap; }
  .pwa-card-btns { width: 100%; }
  .pwa-card-btns .btn { flex: 1 1 0; }
}

/* Plein écran (lancée depuis l'écran d'accueil) : respect de l'encoche et de la barre du bas */
@media (display-mode: standalone) {
  html { -webkit-tap-highlight-color: transparent; }
  body { overscroll-behavior-y: none; padding-bottom: env(safe-area-inset-bottom); }
  .hdr { position: sticky; top: 0; height: calc(58px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .pub-hdr { padding-top: env(safe-area-inset-top); }
  .toast-wrap { top: calc(72px + env(safe-area-inset-top)); }
  .notice-chip { display: none; }
  .page-tools .page-edit { display: none; }
}
@media (display-mode: standalone) and (max-width: 900px) {
  .hdr { height: calc(56px + env(safe-area-inset-top)); }
  body.nav-open .nav { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 9994; max-height: calc(100vh - 56px - env(safe-area-inset-top)); }
}

/* ==========================================================
   Interface « bureau » : page affichée dans une fenêtre (iframe)
   L'en-tête, le menu et le pied de page sont fournis par le bureau.
   ========================================================== */
html.in-frame .hdr,
html.in-frame .nav,
html.in-frame .site-foot,
html.in-frame .notice-chip,
html.in-frame .maint-chip { display: none !important; }
html.in-frame .page-tools { margin-top: 10px; }
html.in-frame .toast-wrap { top: 12px; }
html.in-frame body { min-height: 100vh; }

/* Insignes de grade (images assets/img/grades/) */
.galon-img { display: inline-block; flex: none; width: 22px; height: 22px; margin-right: 6px; border-radius: 4px; vertical-align: middle; object-fit: contain; }
.galon-img.galon-lg { width: 56px; height: 56px; margin-right: 0; border-radius: 8px; }
.ann-people .galon-img { margin-right: 0; }

/* Annuaire : fiche d'un militaire (clic sur son nom) */
.ann-fiche { width: 100%; }
.ann-fiche > summary { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; padding: 2px 8px 2px 2px; border-radius: 6px; cursor: pointer; list-style: none; }
.ann-fiche > summary::-webkit-details-marker { display: none; }
.ann-fiche > summary:hover { background: var(--chip-bg); }
.ann-fiche > summary:focus-visible { outline: 2px solid var(--inst-navy); }
.ann-fiche[open] > summary { font-weight: 700; }
.ann-fiche-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 18px; margin: 6px 0 8px 22px; padding: 10px 14px; border: 1px solid var(--border); border-left: 3px solid var(--inst-navy); border-radius: 8px; background: var(--surface-2); font-size: 14px; }
.ann-fiche-body dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ann-fiche-body dd { margin: 0; font-weight: 600; }
.ann-fiche-body a { color: var(--link); }

/* ==========================================================
   Pages d'entrée à grandes tuiles (Pulsar, BDSP, AGORH@)
   ========================================================== */
.hub { max-width: 760px; }
.hub-t { margin: 8px 0 18px; font-size: 22px; font-weight: 700; color: var(--inst-navy); }
.hub-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.hub-tuile {
  position: relative; display: flex; align-items: center; gap: 18px; min-height: 120px; padding: 14px 22px 14px 16px;
  border-radius: 10px; border: 1px solid rgba(0, 0, 0, .25); text-decoration: none; color: #111; overflow: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .7);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.hub-tuile::before { /* reflet brillant sur la moitié haute */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 48%; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .12));
  border-radius: 10px 10px 40% 40% / 10px 10px 18px 18px;
}
.hub-tuile:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 10px 22px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .7); }
.hub-tuile:active { transform: translateY(1px); box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
.hub-tuile:focus-visible { outline: 3px solid var(--inst-navy); outline-offset: 3px; }
.hub-tuile svg { position: relative; flex: 0 0 auto; width: 84px; height: 84px; fill: #111; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.hub-tuile span { position: relative; display: grid; font-size: 34px; font-weight: 800; letter-spacing: .04em; line-height: 1.05; }
.hub-long span { font-size: 24px; letter-spacing: .01em; }
.hub-tuile small { font-size: 13px; font-weight: 600; letter-spacing: 0; opacity: .75; }
.hub-orange { background: linear-gradient(180deg, #ffad3b 0%, #ff8a00 55%, #f07400 100%); }
.hub-bleu { background: linear-gradient(180deg, #8ec9f2 0%, #5aa9e2 55%, #3f8fcc 100%); }
.hub-vert { background: linear-gradient(180deg, #c8ec6a 0%, #a5d63a 55%, #86bd1f 100%); }
.hub-jaune { background: linear-gradient(180deg, #ffe680 0%, #ffd23a 55%, #f0bb00 100%); }
.hub-gris { background: linear-gradient(180deg, #d9dde3 0%, #b4bac4 55%, #959daa 100%); }
.hub-rouge { background: linear-gradient(180deg, #ff9a9a 0%, #f06464 55%, #d94545 100%); }
@media (max-width: 640px) {
  .hub-tuile { min-height: 96px; }
  .hub-tuile svg { width: 64px; height: 64px; }
  .hub-tuile span { font-size: 28px; }
}
