:root {
  /* Thème noir (fixe) */
  --bg: #000000; --card: #0f0f10; --input: #18181a; --text: #f2f2f2; --muted: #9a9aa2; --line: #26262a;
  --primary: #e53935; --primary-d: #c62828; --ok: #2ecc71; --ok-bg: #0f2a1a; --err: #ff5a52; --err-bg: #2d0f0e;
  --warn-bg: #3a2b12; --top: #0a0a0a; --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; }
h2 { font-size: 1.05rem; margin: 0 0 .8em; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
main.narrow { max-width: 480px; padding-top: 8vh; }

.topbar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--top); color: #fff; padding: 10px 20px; }
.topbar a { color: #cfd5e1; }
.topbar .brand { color: #fff; font-weight: 700; font-size: 1.1rem; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar nav a { padding: 6px 10px; border-radius: 6px; }
.topbar nav a.on, .topbar nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who .link { color: #cfd5e1; }
.cross { color: var(--primary); }
.duty { font-size: .75rem; padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.duty.in { background: #1f8a4c; color: #fff; }
.duty.out { background: #4a5263; color: #dfe3ea; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; overflow-x: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; margin: 0; }

label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
input[type=checkbox] { width: auto; }
input.xs { width: 70px; }
.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; color: var(--text); }
.checks { display: flex; gap: 18px; flex-wrap: wrap; }
form.inline { display: inline; }

.btn { display: inline-block; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(.96); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.success { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }
.btn.danger { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn.big { width: 100%; padding: 14px; font-size: 1.05rem; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.link.danger { color: var(--err); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(198,40,40,.12); color: var(--primary); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
th.c, td.c { text-align: center; }
tr.clickable { cursor: pointer; }
tr.clickable:hover, tbody tr:hover { background: rgba(127,127,127,.06); }
tr.pending td:first-child { border-left: 3px solid #e8a317; }
tr.disabled { opacity: .5; }
td.actions { white-space: nowrap; }

.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; }
.warn { background: var(--warn-bg); padding: 2px 6px; border-radius: 6px; }

.auth h1 { text-align: center; }
.bigid { font-size: 2.6rem; font-weight: 800; letter-spacing: .05em; background: var(--bg); border: 2px dashed var(--primary); border-radius: 12px; padding: 14px; margin: 14px auto; display: inline-block; min-width: 200px; }

.badgeuse .status { font-weight: 600; margin: 0; }
.badgeuse .status.in { color: var(--ok); }
.badgeuse .status.out { color: var(--muted); }
.badgeuse .timer { font-size: 2.2rem; font-weight: 800; margin: .2em 0 .5em; font-variant-numeric: tabular-nums; }
.badgeuse.in { border-color: var(--ok); }
.stat .nums { display: flex; gap: 24px; }
.stat .n { display: block; font-size: 1.8rem; font-weight: 800; }
.stat .l, .entry .l { font-size: .78rem; color: var(--muted); text-transform: uppercase; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }

.search { display: flex; gap: 8px; padding: 12px; }
.sub { background: var(--bg); padding: 14px; border-radius: 8px; margin-bottom: 14px; }
.entry { border-top: 1px solid var(--line); padding: 12px 0; }

@media (max-width: 640px) {
  .row2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .topbar { gap: 10px; }
}

/* Cellules d'actions dans les tableaux */
td.actions { display: table-cell; }
td.actions > * { display: inline-block; margin: 2px 10px 2px 0; vertical-align: middle; }
.topbar .badge { background: rgba(255,255,255,.14); color: #fff; }

/* Marque SAMD */
.topbar { border-bottom: 2px solid var(--primary); }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand strong { letter-spacing: .08em; }
.brand-sub { font-size: .78rem; font-weight: 400; color: var(--muted); }
.logo { text-align: center; font-size: 2.6rem; font-weight: 800; letter-spacing: .12em; }
.logo.small { font-size: 1.6rem; }
.logo-sub { text-align: center; color: var(--muted); margin: -4px 0 18px; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; }
@media (max-width: 900px) { .brand-sub { display: none; } }

/* Dossier patient */
.req { color: var(--primary); }
.birth { display: flex; gap: 10px; align-items: flex-end; }
.birth label { flex: 1; }
.age-box { display: flex; flex-direction: column; min-width: 80px; }
.age-box .l { font-size: .78rem; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.age { font-size: 1.3rem; font-weight: 800; padding: 4px 0; }
.blood { display: inline-block; min-width: 38px; text-align: center; font-weight: 800; padding: 1px 8px; border-radius: 6px; background: rgba(229,57,53,.15); color: #ff6b66; }
.card.urgent { border-color: rgba(229,57,53,.5); }
details.extra { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
details.extra summary { cursor: pointer; font-weight: 600; color: var(--muted); }
details.extra[open] summary { margin-bottom: 12px; }

/* Interventions */
.card.meta { display: flex; gap: 32px; flex-wrap: wrap; padding: 14px 20px; }
.card.meta .l, .auto-info .l, .op .l { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.card.meta .badge { margin-left: 4px; }
.auto-info { display: flex; gap: 32px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.entry-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.entry-head .when { font-weight: 700; background: var(--input); border: 1px solid var(--line); padding: 2px 10px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.op { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--primary); background: var(--input); border-radius: 0 6px 6px 0; }
.op p { font-weight: 500; }

/* Photos de profil */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; color: #fff; font-weight: 700; flex-shrink: 0; vertical-align: middle; border: 2px solid var(--line); }
.me-link { display: inline-flex; align-items: center; gap: 8px; }
.photo-edit { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.photo-edit form { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-edit label.btn { display: inline-block; cursor: pointer; font-size: inherit; color: var(--text); }

/* Effectif */
.eff-stats { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.eff-stats strong { color: var(--text); }
.dot-in { color: var(--ok); margin-left: 10px; }
.my-photo summary { cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 600; list-style: none; }
.my-photo summary::-webkit-details-marker { display: none; }
.pad-top { padding-top: 16px; }
.eff-group { margin-bottom: 28px; }
.eff-title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .06em; padding-bottom: 8px; border-bottom: 2px solid var(--primary); }
.eff-title .count { font-size: .8rem; background: var(--input); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; color: var(--muted); }
.eff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.eff-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 12px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.eff-card.me { border-color: var(--primary); }
.eff-avatar { position: relative; margin-bottom: 4px; }
.duty-dot { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; background: #4a5263; border: 3px solid var(--card); }
.duty-dot.in { background: var(--ok); }
.eff-name { font-size: .98rem; line-height: 1.3; }

/* Ajustements barre du haut + grille effectif */
.topbar { gap: 16px; }
.topbar nav a { padding: 6px 8px; }
@media (max-width: 1400px) { .brand-sub { display: none; } }
@media (max-width: 1100px) { .topbar .duty { display: none; } }
.eff-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }

/* Effectif : visuels agrandis */
.eff-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.eff-card { padding: 24px 14px 18px; gap: 8px; }
.eff-avatar .avatar { border-width: 3px; box-shadow: 0 6px 24px rgba(0,0,0,.6); }
.eff-avatar.zoomable { cursor: zoom-in; }
.eff-avatar.zoomable:hover .avatar { border-color: var(--primary); }
.duty-dot { width: 26px; height: 26px; right: 10px; bottom: 10px; border-width: 4px; }
.eff-name { font-size: 1.15rem; }
@media (max-width: 640px) {
  .eff-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .eff-card { padding: 16px 8px 12px; }
  .eff-avatar .avatar { width: 120px !important; height: 120px !important; font-size: 44px !important; }
  .duty-dot { width: 20px; height: 20px; right: 6px; bottom: 6px; }
  .eff-name { font-size: .98rem; }
}
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { width: min(512px, 88vw); height: min(512px, 88vw); border-radius: 50%; object-fit: cover; border: 4px solid var(--primary); }
.lightbox figcaption { margin-top: 14px; font-size: 1.2rem; font-weight: 600; }

/* Recadrage de la photo */
.photo-current .avatar { border-width: 3px; }
.crop-modal { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.crop-modal[hidden] { display: none; }
.crop-box { width: min(440px, 100%); margin: 0; text-align: center; }
.crop-area { position: relative; width: min(340px, 78vw); aspect-ratio: 1; margin: 14px auto; overflow: hidden; background: #000; border-radius: 8px; cursor: grab; touch-action: none; user-select: none; }
.crop-area:active { cursor: grabbing; }
.crop-area img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.8); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 0 auto 14px; width: min(340px, 78vw); font-weight: 700; color: var(--muted); }
.crop-zoom input { flex: 1; padding: 0; accent-color: var(--primary); }

/* Inscription */
.notice { background: var(--warn-bg); border: 1px solid #6b4e16; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-size: .92rem; line-height: 1.5; }
.notice code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 4px; }

/* Espace civil */
.staff-note summary { cursor: pointer; }
.staff-note p { margin: 10px 0 0; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--input); border: 1px solid var(--line); font-size: .85rem; margin-right: 6px; }
.step.ok { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }
.slots { display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot select { width: 150px; }
.slot input[type=time] { width: 120px; }
.type-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.type-card { flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--input); color: var(--text); font-weight: 400; }
.type-card { position: relative; }
.type-card input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.type-card:has(input:checked) { border-color: var(--primary); background: rgba(229,57,53,.08); }
.type-card.disabled { opacity: .45; cursor: not-allowed; }
.type-title { font-weight: 700; font-size: 1.02rem; }

/* Statuts / types */
.status { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: #2a2a2e; color: #cfd2d8; }
.st-pending { background: #3a2b12; color: #ffb547; }
.st-scheduled { background: #102a44; color: #6cb6ff; }
.st-done { background: #0f2a1a; color: #4ade80; }
.st-refused, .st-cancelled { background: #2d0f0e; color: #ff8a84; }
.type-tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 6px; border: 1px solid var(--line); vertical-align: middle; }
.t-ppa { color: #ffb547; border-color: #6b4e16; }
.t-medical { color: #ff6b66; border-color: #5c2220; }
.t-recrutement { color: #6cb6ff; border-color: #1d4466; }
.count-pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 18px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.tab.on { border-color: var(--primary); background: rgba(229,57,53,.1); }
.tab:hover { text-decoration: none; }
.appt-alert { border-color: #6b4e16; background: #1a140a; }
.avail li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.refuse { border-top: 1px solid var(--line); padding-top: 12px; }

/* Attribut hidden toujours respecté */
[hidden] { display: none !important; }

/* Services publics */
.svc-tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; padding: 1px 7px; border-radius: 5px; vertical-align: middle; }
.svc-LSPD { --svc: #4c8dff; }
.svc-BCSO { --svc: #d4a24c; }
.svc-SAMD { --svc: #e53935; }
.svc-tag.svc-LSPD, .svc-tag.svc-BCSO, .svc-tag.svc-SAMD { color: var(--svc); background: color-mix(in srgb, var(--svc) 15%, transparent); border: 1px solid color-mix(in srgb, var(--svc) 45%, transparent); }
.agent-banner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-color: var(--svc); background: color-mix(in srgb, var(--svc) 8%, var(--card)); }
.svc-logo { font-weight: 900; font-size: 1.4rem; letter-spacing: .06em; color: var(--svc); border: 2px solid var(--svc); border-radius: 10px; padding: 8px 14px; }
.svc-name { font-weight: 700; font-size: 1.05rem; }
.agent-status { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.danger-text { color: var(--err) !important; font-weight: 600; }

/* Aptitudes */
.apt { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: #2a2a2e; color: #cfd2d8; white-space: nowrap; }
.apt-Apte { background: #0f2a1a; color: #4ade80; }
.apt-Apte-avec-restrictions { background: #3a2b12; color: #ffb547; }
.apt-Inapte-temporaire { background: #3a1d12; color: #ff9a5c; }
.apt-Inapte { background: #2d0f0e; color: #ff6b66; }
.apt-summary { margin-bottom: 16px; }
.apt-summary .l { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }

/* Onglet Agents publics */
.svc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.svc-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--text); border-top: 3px solid var(--svc, var(--line)); }
.svc-stat:hover { text-decoration: none; border-color: var(--svc, var(--muted)); }
.svc-stat.on { background: color-mix(in srgb, var(--svc, #888) 12%, var(--card)); border-color: var(--svc, var(--text)); }
.svc-stat .n { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.svc-stat .l { font-size: .82rem; }
.svc-stat.warn { --svc: #ffb547; }
.svc-stat.bad { --svc: #ff6b66; }

/* Menu Direction */
.dropdown { position: relative; }
.dropdown summary { list-style: none; cursor: pointer; padding: 6px 8px; border-radius: 6px; color: #cfd5e1; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary.on, .dropdown summary:hover, .dropdown[open] summary { background: rgba(255,255,255,.1); color: #fff; }
.dropdown .menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 220px; background: #111113; border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; box-shadow: 0 12px 32px rgba(0,0,0,.6); }
.dropdown .menu a { padding: 8px 10px; border-radius: 6px; }
.dropdown .menu a:hover, .dropdown .menu a.on { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }

/* Salaires */
.money { color: #4ade80; }
.n.big { font-size: 2rem; font-weight: 800; display: block; }
tr.dim td { opacity: .5; }
tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }
.paid-tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: #0f2a1a; color: #4ade80; }
.pay-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border-color: #1f4d33; }
.pay-card h2 { margin-bottom: 4px; }
.pay-card p { margin: 0; }
.pay-nums { display: flex; gap: 28px; flex-wrap: wrap; }
.pay-nums .n { display: block; font-size: 1.5rem; font-weight: 800; }
.pay-nums .l { font-size: .75rem; color: var(--muted); text-transform: uppercase; }
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.rate-row { flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); color: var(--text); font-weight: 400; }
.rate-input { display: flex; align-items: center; gap: 6px; }
.rate-input input { width: 110px; text-align: right; background: var(--bg); }
.rate-input input:disabled { opacity: .5; }

/* Le statut de la badgeuse n'est pas une pastille */
.badgeuse .status { background: none; padding: 0; border-radius: 0; font-size: 1rem; }
.badgeuse .status.in { color: var(--ok); }
.badgeuse .status.out { color: var(--muted); }

/* Facturation */
.pk-service { --pk: #4c8dff; }
.pk-gouvernement { --pk: #b98cff; }
.pk-entreprise { --pk: #2ec4b6; }
.payer-tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 5px; white-space: nowrap; color: var(--pk); border: 1px solid color-mix(in srgb, var(--pk) 45%, transparent); background: color-mix(in srgb, var(--pk) 12%, transparent); }
.group-title { margin: 22px 0 10px; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.payer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.payer-card { border-top: 3px solid var(--pk); margin-bottom: 0; display: flex; flex-direction: column; gap: 10px; }
.payer-card.inactive { opacity: .55; }
.payer-name { font-weight: 800; font-size: 1.1rem; }
.payer-nums { display: flex; gap: 24px; flex-wrap: wrap; }
.payer-nums .n { display: block; font-size: 1.5rem; font-weight: 800; }
.payer-nums .l { font-size: .75rem; color: var(--muted); }
.care-cell { max-width: 320px; }
.small-kv { grid-template-columns: 120px 1fr; font-size: .9rem; }
.terms { background: var(--input); border-radius: 6px; padding: 8px 10px; margin: 0; }
.rank { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--input); font-weight: 800; font-size: .85rem; }
.rank.r1 { background: #d4a24c; color: #000; }
.rank.r2 { background: #b8bcc4; color: #000; }
.rank.r3 { background: #a0673a; color: #fff; }

/* Relevé imprimable */
.no-print { margin-bottom: 14px; }
.statement { padding: 32px; }
.st-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid var(--primary); padding-bottom: 14px; margin-bottom: 18px; }
.st-title { text-align: right; }
.st-kind { font-size: 1.3rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.st-to { margin-bottom: 18px; font-size: 1.05rem; }
.st-to .l { display: block; font-size: .75rem; color: var(--muted); text-transform: uppercase; }
.st-table { margin-bottom: 20px; }
.st-table .r { text-align: right; }
.st-total { font-size: 1.3rem; }
.statement h3 { font-size: 1rem; margin: 10px 0; }
.st-sign { display: flex; justify-content: space-between; gap: 40px; margin-top: 40px; color: var(--muted); }
@media print {
  :root { --bg: #fff; --card: #fff; --input: #f3f3f3; --text: #000; --muted: #555; --line: #ccc; }
  body { background: #fff; color: #000; }
  .topbar, .no-print, .flash { display: none !important; }
  main { padding: 0; max-width: none; }
  .statement { border: 0; padding: 0; }
  .money { color: #000; }
}

/* Grille tarifaire / sélecteur d'actes */
.field-title { font-size: .85rem; font-weight: 600; color: var(--muted); }
.tariff-picker { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px 18px; }
.tp-cat-name { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 2px 0 4px; font-weight: 700; }
.tp-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; }
.tp-row.on { background: rgba(229,57,53,.12); }
.tp-row.on .tp-name { font-weight: 700; }
.tp-price { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.tp-qty { display: inline-flex; align-items: center; gap: 2px; }
.tp-qty input { width: 44px; text-align: center; padding: 4px; -moz-appearance: textfield; }
.tp-qty input::-webkit-inner-spin-button, .tp-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tp-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1rem; cursor: pointer; line-height: 1; }
.tp-btn:hover { border-color: var(--primary); }
.tp-summary { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.bill-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.bill-box summary { cursor: pointer; font-weight: 700; margin-bottom: 10px; }
.bill-who { margin-top: 12px; }
.bill-lines { margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--input); max-width: 560px; }
.bl-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; align-items: center; }
.bl-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.payer-chip { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: #102a44; color: #6cb6ff; margin-left: 6px; }
.payer-chip.self { background: #0f2a1a; color: #4ade80; }
.items-inline { font-weight: 500; }
.st-item { display: flex; justify-content: space-between; gap: 16px; }
.tariff-table input { padding: 6px 8px; }
.tariff-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tariff-view .card { margin: 0; }
.tariff-view .bl-row { border-bottom: 1px solid var(--line); padding: 6px 0; }

/* Renommer un membre */
.rename summary { cursor: pointer; list-style: none; }
.rename summary::-webkit-details-marker { display: none; }
.rename .pen { color: var(--muted); font-size: .85rem; margin-left: 4px; }
.rename summary:hover .pen { color: var(--primary); }
.rename-form { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.rename-form input { width: 130px; padding: 5px 8px; }
.eff-rename { width: 100%; }
.eff-rename .rename-form { flex-direction: column; align-items: stretch; }
.eff-rename .rename-form input { width: 100%; }

/* Barre du haut plus compacte (beaucoup d'onglets) */
.topbar { gap: 12px; padding: 10px 16px; }
.topbar nav { gap: 2px; }
.topbar nav a, .dropdown summary { padding: 6px 7px; font-size: .93rem; }
@media (max-width: 1700px) { .topbar .duty { display: none; } .who .badge { display: none; } }
.remember { font-size: .9rem; }

/* Absences */
.abs-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.abs-row:last-child { border-bottom: 0; }
.abs-decide { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.abs-decide input { width: 200px; padding: 5px 8px; }
.abs-pending { border-left: 3px solid #ffb547; padding-left: 12px; }
.abs-pending, .abs-approved { }
.status.abs-pending { background: #3a2b12; color: #ffb547; border: 0; padding: 2px 9px; }
.status.abs-approved { background: #0f2a1a; color: #4ade80; }
.status.abs-refused, .status.abs-cancelled { background: #2d0f0e; color: #ff8a84; }
.abs-tag { font-size: .78rem; font-weight: 700; color: #ffb547; background: #3a2b12; border-radius: 99px; padding: 2px 10px; }
.eff-card.is-absent .avatar { filter: grayscale(.8); opacity: .7; }
.dot-abs { color: #ffb547; margin-left: 10px; }
.abs-banner { border-color: #6b4e16; background: #1a140a; }
.notif-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px 18px; }
pre.code { background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: .85rem; line-height: 1.6; }
code { background: var(--input); padding: 1px 6px; border-radius: 4px; }

/* Matricules */
.mat-tag { display: inline-block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; font-weight: 700; letter-spacing: .03em; padding: 1px 8px; border-radius: 5px; background: #102a44; color: #6cb6ff; border: 1px solid #1d4466; }
.mat-tag.big { font-size: .95rem; padding: 3px 10px; }
.clock-in label { color: var(--muted); }
.my-mat select { width: 230px; }
.eff-rename select { width: 100%; }

/* Formations */
.training-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.training-card { margin: 0; color: var(--text); display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--primary); transition: border-color .15s; }
.training-card:hover { text-decoration: none; border-color: var(--primary); }
.tc-title { font-weight: 800; font-size: 1.1rem; }
.tc-progress { height: 6px; background: var(--input); border-radius: 99px; overflow: hidden; }
.tc-progress span { display: block; height: 100%; background: var(--ok); }
.training-content { line-height: 1.7; }
.training-content h3 { font-size: 1.25rem; margin: 1.2em 0 .4em; color: #fff; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.training-content h4 { font-size: 1.05rem; margin: 1em 0 .3em; }
.training-content h5 { font-size: .95rem; margin: .8em 0 .2em; color: var(--muted); text-transform: uppercase; }
.training-content p { margin: .4em 0; }
.training-content ul { margin: .3em 0 .6em; padding-left: 1.4em; }
.training-content .lead { font-size: 1.05rem; color: var(--muted); }
.member-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; max-height: 260px; overflow-y: auto; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.5; }
.errlog { max-height: 360px; overflow: auto; white-space: pre-wrap; font-size: .78rem; color: #ffb4b0; }

/* Suivi psy */
.confid { border-left: 3px solid #b98cff; padding-left: 10px; }
.psy-status { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; vertical-align: middle; }
.ps-Ouvert { background: #1d1533; color: #b98cff; }
.ps-En-pause { background: #3a2b12; color: #ffb547; }
.ps-Clôturé { background: #2a2a2e; color: #9a9aa2; }
.risk { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.r-Aucun { background: #0f2a1a; color: #4ade80; }
.r-Faible { background: #102a44; color: #6cb6ff; }
.r-Modéré { background: #3a2b12; color: #ffb547; }
.r-Élevé { background: #3a0f0e; color: #ff6b66; border: 1px solid #ff6b66; }
.risk-card { border-color: #6b4e16; }
.risk-alert { border-color: #ff6b66; background: #2a0d0c; color: #ffb4b0; }
.psy-patient { display: flex; gap: 28px; flex-wrap: wrap; padding: 14px 20px; border-left: 3px solid #b98cff; }
.psy-patient .l { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.psy-btn { border-color: #b98cff; color: #d5bcff; }
.psy-chart { width: 100%; height: auto; max-height: 220px; }
.psy-chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.psy-chart .axis { fill: var(--muted); font-size: 11px; }
.psy-chart polyline { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.psy-chart .l-mood { stroke: #4ade80; } .psy-chart .d-mood { fill: #4ade80; }
.psy-chart .l-anx { stroke: #ffb547; } .psy-chart .d-anx { fill: #ffb547; }
.lg-mood { color: #4ade80; } .lg-anx { color: #ffb547; margin-left: 10px; }
.score { font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--input); border: 1px solid var(--line); }
.sc-mood { color: #4ade80; } .sc-anx { color: #ffb547; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input { flex: 1; padding: 0; accent-color: #b98cff; }
.range-row output { font-weight: 800; color: var(--text); min-width: 22px; text-align: right; }

/* ---------- Agenda ---------- */
.ag-who { font-weight: 400; font-size: 1.1rem; }
.ag-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; overflow: visible; }
.ag-label { font-size: 1.1rem; margin-left: 6px; text-transform: capitalize; }
.ag-member select { min-width: 240px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: 6px 14px; color: var(--text); }
.seg a.on { background: var(--primary); color: #fff; }
.seg a:hover { text-decoration: none; }
.ag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.ag-main { padding: 12px; }
@media (max-width: 1000px) { .ag-layout { grid-template-columns: 1fr; } }
.ag-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--c, #888); flex: none; }
.ag-dot.big { width: 14px; height: 14px; margin-right: 10px; }
.ag-next li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ag-next li:last-child { border-bottom: 0; }
.ag-next a { color: var(--text); }
.ag-legend li { padding: 3px 0; }

.wk { min-width: 720px; }
.wk-head, .wk-grid { display: grid; grid-template-columns: 54px repeat(7, minmax(0, 1fr)); }
.wk-head { border-bottom: 1px solid var(--line); }
.wk-day { text-align: center; padding: 6px 0 8px; color: var(--muted); border-radius: 8px 8px 0 0; }
.wk-day strong { display: block; font-size: 1.3rem; color: var(--text); line-height: 1.2; }
.wk-day.today strong { color: #fff; background: var(--primary); border-radius: 99px; width: 34px; margin: 0 auto; }
.wk-day:hover { text-decoration: none; background: rgba(255,255,255,.04); }
.wk-scroll { height: 620px; overflow-y: auto; position: relative; }
.wk-grid { height: 1152px; position: relative; } /* 48px par heure */
.wk-hours div { height: 48px; font-size: .72rem; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.wk-hours div:first-child { transform: none; }
.wk-col { position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 48px), repeating-linear-gradient(to bottom, transparent 0 24px, #1a1a1d 24px 25px, transparent 25px 48px); }
.wk-col.today { background-color: rgba(229,57,53,.05); }
.ev { position: absolute; overflow: hidden; border-radius: 6px; padding: 3px 6px; font-size: .75rem; line-height: 1.25; color: var(--text); cursor: pointer;
  background: color-mix(in srgb, var(--c) 22%, #111); border-left: 3px solid var(--c); z-index: 1; }
.ev:hover { text-decoration: none; filter: brightness(1.2); z-index: 3; }
.ev strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-t { color: var(--c); font-weight: 700; font-size: .7rem; }
.ev-o, .ev-l { display: block; color: var(--muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.st-ev-cancelled, .mo-ev.st-ev-cancelled { opacity: .45; text-decoration: line-through; }
.ev.st-ev-done, .mo-ev.st-ev-done { opacity: .7; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--primary); z-index: 2; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

.mo { min-width: 720px; }
.mo-head, .mo-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-head div { color: var(--muted); font-size: .8rem; font-weight: 600; padding: 4px 8px; }
.mo-cell { min-height: 112px; border: 1px solid var(--line); margin: -1px 0 0 -1px; padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; }
.mo-cell.out { background: #070708; }
.mo-cell.out .mo-num { color: #55555c; }
.mo-cell.today { box-shadow: inset 0 0 0 2px var(--primary); }
.mo-top { display: flex; justify-content: space-between; align-items: center; }
.mo-num { color: var(--text); font-weight: 700; padding: 0 4px; }
.mo-add { color: var(--muted); padding: 0 6px; border-radius: 4px; opacity: 0; }
.mo-cell:hover .mo-add { opacity: 1; }
.mo-add:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.mo-ev { display: flex; align-items: center; gap: 3px; font-size: .74rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; padding: 1px 3px; }
.mo-ev:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.mo-ev .ev-t { margin-right: 2px; }
.mo-more { font-size: .72rem; color: var(--muted); padding-left: 4px; }
.status.st-ev-planned { background: #102a44; color: #6cb6ff; }
.status.st-ev-done { background: #0f2a1a; color: #4ade80; }
.status.st-ev-cancelled { background: #2d0f0e; color: #ff8a84; }

/* ---------- Évaluations ---------- */
.ev-ok { color: #4ade80; } .ev-ko { color: #ff8a84; }
.ev-q { font-weight: 600; margin-bottom: 6px; }
.ev-n { display: inline-block; min-width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: #1d1d21; color: var(--muted); font-size: .75rem; margin-right: 4px; }
.ev-field { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ev-field:last-child { border-bottom: 0; }
.ev-opts, .ev-notes { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-pill { flex-direction: row; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--input); color: var(--text); font-weight: 500; cursor: pointer; }
.ev-pill input { width: auto; margin: 0; accent-color: var(--primary); }
.ev-pill:has(input:checked) { border-color: var(--primary); background: rgba(229,57,53,.12); }
.ev-pill.warn:has(input:checked) { border-color: #ffb547; background: rgba(255,181,71,.12); }
.ev-pill.n2:has(input:checked), .ev-pill.ok:has(input:checked) { border-color: #2ecc71; background: rgba(46,204,113,.12); }
.ev-pill.n1:has(input:checked) { border-color: #ffb547; background: rgba(255,181,71,.12); }
.ev-pill.n0:has(input:checked), .ev-pill.ko:has(input:checked) { border-color: #ff5a52; background: rgba(255,90,82,.14); }
.ev-opts.big .ev-pill { font-size: 1.05rem; padding: 12px 22px; font-weight: 700; }
.ev-scen { border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ev-sit { margin: 0; font-style: italic; color: #d8d8de; }
.ev-exp summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.ev-exp ul { margin: 6px 0 0; padding-left: 20px; font-size: .88rem; color: #cfd2d8; }
.ev-final { border-color: #3a3a40; }
.ev-score { font-size: 1rem; }
.ev-head { border-top: 4px solid var(--line); }
.ev-head.ok { border-top-color: #2ecc71; } .ev-head.ko { border-top-color: #ff5a52; }
.ev-verdict { font-size: 1.4rem; font-weight: 800; padding: 10px 18px; border-radius: 10px; }
.ev-head.ok .ev-verdict { background: #0f2a1a; color: #4ade80; } .ev-head.ko .ev-verdict { background: #2d0f0e; color: #ff8a84; }
.ev-alerts { margin-top: 14px; background: var(--warn-bg); border-radius: 8px; padding: 10px 14px; color: #ffcf85; }
.ev-alerts ul { margin: 4px 0 0; padding-left: 20px; }
.ev-line { display: grid; grid-template-columns: minmax(200px, 40%) 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ev-line:last-child { border-bottom: 0; }
.ev-warn { color: #ffb547; font-weight: 700; }
@media (max-width: 640px) { .ev-line { grid-template-columns: 1fr; gap: 2px; } }
@media print { .no-print { display: none !important; } .ev-exp { display: none; } }

.ev-banner { color: var(--text); border-left: 4px solid #4c8dff; }
.ev-banner:hover { text-decoration: none; border-color: #4c8dff; }

/* ---------- Papiers ---------- */
.pp-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 18px; align-items: start; }
.pp-form { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.pp-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pp-form fieldset[hidden] { display: none; }
.pp-form legend { font-weight: 700; padding: 0 6px; color: var(--text); }
.pp-form legend.sub { padding: 0; margin-top: 6px; color: var(--primary); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.pp-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pp-cats button { font: inherit; font-weight: 600; font-size: .85rem; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--input); color: var(--text); cursor: pointer; }
.pp-cats button.on { border-color: var(--primary); background: rgba(229,57,53,.15); }
.pp-previews { display: flex; flex-direction: column; gap: 0; }
.pp-doc canvas { width: 100%; height: auto; display: block; margin-top: 12px; border-radius: 4px; box-shadow: 0 4px 24px rgba(0,0,0,.5); }
.pp-doc h2 { margin: 0; }
.pp-link { display: flex; gap: 6px; margin-top: 10px; }
.pp-link input { font-family: ui-monospace, monospace; font-size: .8rem; }
@media (max-width: 1000px) { .pp-layout { grid-template-columns: 1fr; } .pp-form { position: static; max-height: none; } }

/* ---------- Onglet LSPD ---------- */
.svc-chip { display: inline-block; background: #1e3a8a; color: #fff; font-size: .8rem; font-weight: 800; padding: 4px 10px; border-radius: 6px; vertical-align: middle; letter-spacing: .05em; }
.lspd-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 18px; }
.lspd-form { margin: 0; display: grid; grid-template-columns: 54px 1fr; gap: 12px; border-top: 3px solid #4c8dff; }
.lf-icon { font-size: 2rem; line-height: 1; }
.lf-actions { grid-column: 1 / -1; }
.ev-help { font-size: .84rem; color: #c9cbd3; background: #15161a; border-left: 3px solid #4c8dff; padding: 6px 10px; border-radius: 4px; margin-bottom: 8px; }
.ev-doconly { background: #1a1530; border: 1px solid #3b2f6b; color: #c9b8ff; padding: 8px 12px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem; }
.ev-pill.crit:has(input:checked) { border-color: #ff2d2d; background: rgba(255,45,45,.25); }
.ev-pill.crit { border-style: dashed; }
.flash.warn { background: var(--warn-bg); color: #ffcf85; }

/* ---------- Menus par catégorie ---------- */
.dropdown .menu { min-width: 270px; }
.dropdown .menu a { display: flex; align-items: center; gap: 10px; color: #dfe3ea; }
.mi-icon { width: 26px; text-align: center; font-size: 1.05rem; flex: none; }
.mi-text { display: flex; flex-direction: column; line-height: 1.25; }
.mi-label { font-weight: 600; }
.mi-desc { font-size: .76rem; color: var(--muted); }
.menu-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; }
.menu-head:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; }
@media (max-width: 640px) { .dropdown .menu { position: fixed; left: 8px; right: 8px; top: auto; min-width: 0; } }

/* ---------- Page d'attente (compte sans grade) ---------- */
.wait-card { max-width: 560px; margin: 6vh auto; text-align: center; padding: 34px 26px; }
.wait-icon { font-size: 3rem; }
.wait-id { display: inline-flex; align-items: center; gap: 14px; margin: 18px 0; padding: 14px 22px; border: 2px dashed var(--primary); border-radius: 12px; }
.wait-id .l { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; }
.wait-id .n { font-size: 2.6rem; font-weight: 800; color: #fff; }

/* ---------- Réponse attendue (mises en situation) ---------- */
.ev-guide { background: #0f1a12; border: 1px solid #1f4d2b; border-radius: 8px; padding: 12px 14px; }
.eg-title { font-weight: 700; color: #4ade80; margin-bottom: 6px; }
.eg-model { margin: 0 0 8px; color: #e4f5e8; line-height: 1.55; }
.eg-sub { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.ev-guide ul { margin: 4px 0 8px; padding-left: 20px; font-size: .88rem; color: #cfd2d8; }
.eg-zero { background: #2d0f0e; color: #ffb3ae; border-radius: 6px; padding: 6px 10px; font-size: .88rem; margin-top: 4px; }
.eg-scale { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: .76rem; }
.eg-scale span { padding: 2px 8px; border-radius: 99px; background: #1d1d21; }
.eg-scale .g2 { color: #4ade80; } .eg-scale .g1 { color: #ffb547; } .eg-scale .g0 { color: #ff8a84; }
@media print { .ev-exp { display: block; } }
.part-tag { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.part-tag.formation { background: #2b2410; color: #ffcf6e; }
.part-tag.medical { background: #2a1d33; color: #d0b3ff; } .part-tag.terrain { background: #102a44; color: #6cb6ff; }
