/* Vigils+ — langage visuel v2 « Clinique nette ».
   Surfaces claires, encre profonde, une seule couleur d'accent (celle de l'hôpital),
   chiffres en Space Grotesk à chasse fixe, icônes au trait, densité confortable.
   Polices auto-hébergées (aucun appel externe : confidentialité et réseaux lents). */
@font-face { font-family: "Nunito Sans"; src: url("../fonts/nunito-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 200 1000; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito Sans"; src: url("../fonts/nunito-sans-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 1000; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Encre et surfaces */
  --ink: #0E1B24; --muted: #435561; --soft: #5A6B76; --faint: #8796A0;
  --line: #DFE6EA; --line2: #EDF1F3; --bg: #F5F7F8; --surface: #FFFFFF; --sunk: #F0F4F5;
  --navy: #0E2430; --navy2: #17323F;
  /* Accent : couleur de l'hôpital (remplacée par la mise en page) */
  --brand: #0B6B67; --brand-ink: #FFFFFF; --brand-l: #E4F2F1; --brand-d: #084F4C;
  --teal: var(--brand); --teal-l: var(--brand-l); --teal-b: #14A39B;
  /* États (toujours accompagnés d'un libellé ou d'une icône) */
  --ok: #12704F; --ok-l: #DDF3EC; --warn: #8A3D07; --warn-l: #FDEBD3; --bad: #A11D1D; --bad-l: #FBE3E3;
  --info: #2D3D80; --info-l: #E5E9F7;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 27, 36, .05), 0 1px 1px rgba(14, 27, 36, .03);
  --shadow-lg: 0 10px 30px rgba(14, 27, 36, .10);
  --num: "Nunito Sans", system-ui, sans-serif;
  --font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15.5px; line-height: 1.5; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--num); margin: 0; letter-spacing: -.015em; font-weight: 900; }
h1 { font-size: 30px; line-height: 1.15; } h2 { font-size: 17px; font-weight: 850; } h3 { font-size: 15.5px; font-weight: 850; }
a { color: var(--brand); text-underline-offset: 2px; } a:hover { color: var(--brand-d); }
.num, .kpi b, td.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.i.lg { width: 22px; height: 22px; }

/* ---------- Coquille : menu latéral + barre du haut ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--surface) 255px, var(--line) 255px, var(--line) 256px, var(--bg) 256px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 6px; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; font-family: var(--num); }
.brand b { font-family: var(--num); font-size: 15px; display: block; line-height: 1.2; }
.brand small { color: var(--soft); font-size: 12px; display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group > span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em; color: var(--faint); padding: 6px 10px; text-transform: uppercase; }
.nav-group a { display: flex; gap: 10px; align-items: center; min-height: 38px; padding: 0 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-group a .i { color: var(--faint); }
.nav-group a > span:first-of-type { flex: 1; }
.nav-group a:hover:not(.on) { background: var(--sunk); color: var(--ink); }
.nav-group a.on { background: var(--brand-l); color: var(--brand-d); font-weight: 650; }
.nav-group a.on .i { color: var(--brand); }
.count { font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 999px; background: #B45309; color: #fff; font-family: var(--num); }
.content { min-width: 0; display: flex; flex-direction: column; }
.topnav { position: sticky; top: 0; z-index: 5; background: rgba(245, 247, 248, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 10px 28px; min-height: 60px; }
.topnav .where { flex: 1; min-width: 0; font-size: 13px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #B45309; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--num); }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 12px; min-height: 44px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--surface); }
.user-menu .who { line-height: 1.2; } .user-menu .who b { font-size: 14px; display: block; } .user-menu .who small { font-size: 12px; color: var(--soft); }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; display: flex; flex-direction: column; }
.user-menu .menu a, .user-menu .menu button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left; width: 100%; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--sunk); }
.nav-toggle { display: none; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--num); }
.avatar.light { background: var(--brand-l); color: var(--brand-d); }
.me { display: none; }
.main { padding: 24px 28px 56px; display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 1480px; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 20; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(14, 27, 36, .35); z-index: 15; }
  .nav-toggle { display: inline-flex; }
  .topnav { padding: 8px 14px; } .main { padding: 18px 14px 40px; }
  .user-menu .who { display: none; }
}
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.head .sub { font-size: 13px; color: var(--soft); display: block; margin-bottom: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Blocs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card > h2:first-child, .card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-head small { color: var(--soft); font-size: 12px; }
.card.dark { background: var(--navy); color: #fff; border: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(var(--min, 260px), 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.kpi { gap: 4px; }
.kpi span { font-size: 13px; color: var(--soft); font-weight: 500; } .kpi b { font-size: 30px; font-weight: 700; display: block; line-height: 1.15; letter-spacing: -.02em; }
.kpi small { font-size: 12px; font-weight: 600; color: var(--soft); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; }
.delta.good { background: var(--ok-l); color: var(--ok); } .delta.bad { background: var(--bad-l); color: var(--bad); } .delta.flat { background: var(--line2); color: var(--muted); }
.delta .i { width: 14px; height: 14px; }

/* ---------- Boutons, pastilles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid #CDD7DC; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s; }
.btn:hover { border-color: #A9BAC1; color: var(--ink); background: #FBFCFC; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); } .btn.primary:hover { background: var(--brand-d); border-color: var(--brand-d); color: var(--brand-ink); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--bad-l); border-color: #E7B7B7; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.ok:hover { background: #0D5A3F; color: #fff; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--line2); color: var(--muted); }
.b-ok { background: var(--ok-l); color: var(--ok); } .b-warn { background: var(--warn-l); color: var(--warn); } .b-bad { background: var(--bad-l); color: var(--bad); }
.b-info { background: var(--info-l); color: var(--info); } .b-teal { background: var(--brand-l); color: var(--brand-d); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.chip:hover { color: var(--ink); border-color: #C3CFD5; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Tableaux et formulaires ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 600; color: var(--soft); text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
td { font-size: 14px; padding: 11px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
tbody tr:hover td { background: #FAFBFC; }
td small, .muted { color: var(--soft); font-size: 12px; } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
label, .label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=month], input[type=time], input[type=tel], select, textarea {
  width: 100%; min-height: 42px; border: 1px solid #CDD7DC; border-radius: var(--r-sm); padding: 0 12px; font: inherit; font-size: 14px; background: var(--surface); color: var(--ink); }
textarea { padding: 10px 12px; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, white); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 500; color: var(--ink); margin: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(var(--min, 200px), 1fr)); }
.alert { border-radius: 12px; padding: 12px 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert.ok { background: var(--ok-l); color: #0C4A35; } .alert.err { background: var(--bad-l); color: #6E1414; } .alert.info { background: var(--info-l); color: #23306A; } .alert.warn { background: var(--warn-l); color: #6B2F05; }
.bar { height: 10px; background: var(--line2); border-radius: 5px; position: relative; } .bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--brand); }
.cell { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 32px; border-radius: 8px; font-weight: 700; font-size: 13px; color: #fff; }
.cell select { min-height: 32px; padding: 0 4px; width: 56px; font-weight: 700; }
.dl { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line2); font-size: 14px; } .dl:last-child { border-bottom: 0; }
.dl span:first-child { color: var(--soft); } .dl span:last-child { font-weight: 600; text-align: right; }
.empty { text-align: center; color: var(--soft); padding: 28px 12px; font-size: 14px; }

/* ---------- Pilotage : graphiques en SVG ---------- */
.viz { width: 100%; height: auto; display: block; overflow: visible; }
.viz .grid-line { stroke: var(--line2); stroke-width: 1; }
.viz .axis { fill: var(--soft); font-size: 11px; font-family: Inter, sans-serif; }
.viz .series { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .area { fill: color-mix(in srgb, var(--brand) 10%, transparent); }
.viz .pt { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.viz .target { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.viz .hit { fill: transparent; cursor: crosshair; }
.viz .hit:hover + .pt, .viz .pt.on { r: 6; }
.hbar { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) 64px; align-items: center; gap: 12px; font-size: 14px; }
.hbar .track { height: 12px; background: var(--line2); border-radius: 0 4px 4px 0; position: relative; }
.hbar .fill { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .fill.over { background: #B45309; }
.hbar .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.heat { display: grid; grid-template-columns: 48px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 11px; color: var(--soft); }
.heat .h { height: 22px; border-radius: 3px; background: var(--line2); }
.heat .lbl { display: flex; align-items: center; }
.heat .hh { text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--soft); align-items: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.forecast { border-collapse: separate; border-spacing: 2px; }
.forecast th, .forecast td { padding: 4px; text-align: center; border: 0; font-size: 12px; }
.forecast td:first-child, .forecast th:first-child { text-align: left; white-space: nowrap; font-size: 13px; padding-right: 10px; }
.fc { display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 38px; height: 30px; border-radius: 6px; font-weight: 700; font-family: var(--num); }
.fc.none { background: var(--line2); color: var(--faint); font-weight: 500; }
.fc.ok { background: var(--ok-l); color: var(--ok); } .fc.warn { background: var(--warn-l); color: var(--warn); } .fc.bad { background: var(--bad); color: #fff; }
.fc .i { width: 12px; height: 12px; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.4; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 260px; display: none; }

/* ---------- Connexion, console, impression ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth .panel { flex: 1 1 420px; background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.auth .panel p { color: #CFE2E7; line-height: 1.6; max-width: 460px; }
.auth .form { flex: 1 1 480px; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth .box { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.auth .brand small { color: #B9D3DA; }
.code-input { font-family: var(--num); font-size: 22px; letter-spacing: .3em; text-align: center; }
.qr svg { width: 180px; height: 180px; } .qr-big svg { width: 100%; max-width: 360px; height: auto; }
.matrix td { text-align: center; } .matrix td:first-child { text-align: left; }
.matrix select { min-height: 32px; width: 104px; font-size: 12px; padding: 0 4px; }
.pagination { display: flex; gap: 8px; }
.topbar { background: var(--navy); color: #fff; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.topbar .brand small { color: #B9D3DA; }
.topbar a { color: #D7E6EA; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 9px; font-size: 14px; }
.topbar a:hover { background: var(--navy2); }
.topbar a.on { background: var(--teal-b); color: #fff; font-weight: 600; }
.wrap { max-width: 1320px; width: 100%; margin: 0 auto; padding: 28px 24px 48px; display: flex; flex-direction: column; gap: 18px; }
.tag-console { font-size: 11px; font-weight: 700; letter-spacing: .05em; background: var(--navy2); color: #CFE2E7; padding: 4px 8px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[dir=rtl] .hbar .fill, [dir=rtl] .bar > i { inset: 0 0 0 auto; }
@media print { .side, .topnav, .actions, .no-print { display: none !important; } .shell { display: block; } .main { padding: 0; max-width: none; } body { background: #fff; } .card { box-shadow: none; break-inside: avoid; } }

/* ---------- Carte des points de pointage ---------- */
.geo { display: flex; flex-direction: column; gap: 10px; }
.geo-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.geo-search { display: flex; gap: 6px; flex: 1; min-width: 240px; }
.geo-search input { flex: 1; }
.geo-map { height: 320px; border-radius: 14px; border: 1px solid var(--line); z-index: 0; background: #EEF2F1; }
.geo-map:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.geo-pin span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: grab; }
.geo-results { display: flex; flex-direction: column; gap: 4px; }
.geo-result { text-align: left; font: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.geo-result:hover { border-color: var(--teal); }
.geo-status { margin: 0; font-size: 13.5px; }
.geo-range { width: 100%; accent-color: var(--teal); }
.geo-warnings { display: flex; flex-direction: column; gap: 6px; }
.geo-msg { font-size: 13.5px; padding: 8px 12px; border-radius: 10px; }
.geo-msg.err { background: var(--bad-l); color: #6E1414; } .geo-msg.warn { background: var(--warn-l); color: #6B2F05; } .geo-msg.info { background: var(--info-l); color: #23306A; }
.refusals { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.refusals table { width: 100%; font-size: 13px; border-collapse: collapse; }
.refusals td, .refusals th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.point-card { display: flex; flex-direction: column; gap: 14px; }
.geo [hidden], .check[hidden] { display: none !important; }

/* ---------- Menu v3 : Nunito Sans, rubriques colorées, icônes en pastille ---------- */
input, select, textarea, button { font-family: inherit; }
.kpi b, .num { font-weight: 850; letter-spacing: -.01em; }
.shell { grid-template-columns: 276px minmax(0, 1fr); background: linear-gradient(to right, var(--surface) 275px, var(--line) 275px, var(--line) 276px, var(--bg) 276px); }
.side { padding: 18px 14px 28px; gap: 8px; }
.brand { padding: 2px 6px 10px; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; font-weight: 900; }
.brand b { font-size: 16.5px; font-weight: 900; letter-spacing: -.01em; }
.brand small { font-size: 12.5px; font-weight: 600; max-width: 180px; }
.nav-search { position: relative; margin: 0 2px 6px; }
.nav-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; }
.nav-search input { width: 100%; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--sunk); padding: 0 14px 0 38px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.nav-search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-l); }
.nav-group { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.nav-group > .nav-title { font-size: 12.5px; font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--soft); padding: 8px 10px 4px; }
.side .nav-link { display: flex; gap: 12px; align-items: center; min-height: 46px; padding: 0 10px 0 6px; border-radius: 14px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 700; transition: background .15s, color .15s; }
.side .nav-link .nav-label { flex: 1; min-width: 0; line-height: 1.2; }
.side .nav-ic { flex: none; width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--tone-l); color: var(--tone); transition: transform .2s, background .15s, color .15s; }
.side .nav-ic .i { width: 18px; height: 18px; }
.side .nav-link:hover:not(.on) { background: var(--sunk); color: var(--ink); }
.side .nav-link:hover .nav-ic { transform: scale(1.06); }
.side .nav-link.on { background: var(--brand-l); color: var(--brand-d); font-weight: 850; }
.side .nav-link.on .nav-ic { background: var(--brand); color: #fff; }
.side .nav-link:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.side .nav-link .count { font-size: 12px; font-weight: 800; padding: 2px 8px; background: #C2410C; }
.side .nav-link .i { color: inherit; }
.tone-teal { --tone: #0B6B67; --tone-l: #DDF1EE; }
.tone-indigo { --tone: #3A4AA8; --tone-l: #E3E7FA; }
.tone-amber { --tone: #9A5B0C; --tone-l: #FCEBCB; }
.tone-red { --tone: #A12A22; --tone-l: #FBE2DF; }
.tone-slate { --tone: #435561; --tone-l: #E8EEF0; }
.nav-empty { padding: 10px; font-size: 14px; margin: 0; }
.nav-group[hidden], .nav-link[hidden], .nav-empty[hidden] { display: none !important; }
/* Barre du haut : la page courante avec son icône et sa phrase d'aide */
.topnav .where { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.topnav .where b { font-weight: 850; font-size: 15.5px; display: block; line-height: 1.2; }
.topnav .where small { display: block; color: var(--soft); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.where-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--tone-l); color: var(--tone); }
.btn { font-weight: 750; border-radius: 999px; }
.badge { font-weight: 750; }
/* Accès rapides (accueil) */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.quick a { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 16px 10px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s, border-color .2s; }
.quick a:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; color: var(--ink); }
.quick .q-ic { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--tone-l); color: var(--tone); }
.quick .q-ic .i { width: 26px; height: 26px; }
.quick b { font-size: 15px; font-weight: 850; line-height: 1.2; }
.quick small { font-size: 12.5px; color: var(--soft); font-weight: 600; line-height: 1.3; }
.quick .count { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 800; padding: 2px 8px; }
/* Console éditeur : barre avec icônes */
.topbar a { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; }
.side .nav-link.on .nav-ic .i { color: #fff; }
.side .nav-group .nav-link > .nav-ic { flex: none; } .side .nav-group .nav-link > .nav-label { flex: 1; }
/* ---------- Assistant d'aide ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 320px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 86%; padding: 12px 16px; border-radius: 18px; font-size: 15px; line-height: 1.45; }
.bubble.bot { background: var(--sunk); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble.me { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; font-weight: 700; }
.bubble .btn { margin-top: 8px; }
.ask { display: flex; gap: 8px; } .ask input { flex: 1; border-radius: 999px; }
.faq-list { display: flex; flex-direction: column; gap: 6px; }
.faq-q, .chip-q { text-align: left; font: inherit; font-weight: 700; font-size: 14.5px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.faq-q:hover, .chip-q:hover { border-color: var(--brand); color: var(--brand-d); }
.chip-q { display: inline-block; margin: 4px 4px 0 0; padding: 6px 12px; border-radius: 999px; font-size: 13.5px; }

/* ======================================================================
   Audit v5 — téléphone, planning par jour, contrôles en français, mode sombre
   ====================================================================== */
/* Correctif : la grille à deux colonnes (déclarée plus haut) s'appliquait aussi sur téléphone,
   ce qui réduisait le contenu à 70 % de la largeur. */
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .main { max-width: 100%; }
}
@media (max-width: 560px) {
  .main { padding: 14px 12px 40px; gap: 14px; }
  h1 { font-size: 26px; }
  .head { align-items: stretch; }
  .head .actions { width: 100%; }
  .head .actions > * { flex: 1 1 auto; }
  .card { padding: 14px; border-radius: 16px; }
  /* tableau de bord : chiffres clés d'abord, raccourcis compacts en 2 colonnes */
  .dash-shell { display: flex; flex-direction: column; }
  .dash-shell .kpis-first { order: -1; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quick a { flex-direction: row; text-align: left; padding: 10px; gap: 10px; border-radius: 14px; }
  .quick .q-ic { width: 38px; height: 38px; flex: none; }
  .quick .q-ic .i { width: 20px; height: 20px; }
  .quick b { font-size: 13.5px; } .quick small { display: none; }
  .quick .count { top: 6px; right: 6px; }
  .kpi b { font-size: 24px; }
  .table-wrap table th:first-child, .table-wrap table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
}
/* Planning : grille sur ordinateur, un jour à la fois sur téléphone */
.plan-days { display: none; }
@media (max-width: 760px) {
  .plan-week { display: none; }
  .plan-days { display: flex; flex-direction: column; gap: 10px; }
}
.day-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; position: sticky; top: 60px; background: var(--surface); padding: 4px 0; z-index: 2; }
.day-tab { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: inherit; cursor: pointer; color: var(--ink); }
.day-tab small { font-size: 11px; color: var(--soft); text-transform: capitalize; } .day-tab b { font-size: 17px; }
.day-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; } .day-tab.on small { color: rgba(255, 255, 255, .8); }
.day-list { display: none; flex-direction: column; gap: 2px; } .day-list.on { display: flex; }
.day-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 2px 8px; } .day-title b { text-transform: capitalize; font-size: 16px; } .day-title small { width: 100%; }
.day-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line2); }
.day-row > div { min-width: 0; display: flex; flex-direction: column; } .day-row small { font-size: 12px; color: var(--soft); }
.day-row select { width: auto; max-width: 52%; min-height: 40px; font-weight: 700; }

/* Sélecteur de mois et dépôt de fichier en français (remplacent les contrôles du navigateur) */
.month-pick { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #CDD7DC; border-radius: var(--r-sm); background: var(--surface); padding: 0 4px; min-height: 42px; }
.month-pick button { border: 0; background: none; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 18px; }
.month-pick button:hover { background: var(--sunk); }
.month-pick span { min-width: 128px; text-align: center; font-weight: 700; text-transform: capitalize; }
.file-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-pick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pick .name { font-size: 13px; color: var(--soft); }

/* Menu repliable par groupe */
.side details.nav-group > summary { list-style: none; cursor: pointer; }
.side details.nav-group > summary::-webkit-details-marker { display: none; }
.side details.nav-group > summary::after { content: "▾"; float: right; color: var(--soft); transition: transform .15s; }
.side details.nav-group:not([open]) > summary::after { transform: rotate(-90deg); }

/* États vides illustrés */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 12px; color: var(--soft); }
.empty .empty-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-l); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.empty .empty-ic .i { width: 30px; height: 30px; }
.empty b { color: var(--ink); font-size: 16px; }

/* Barre de cases pour les validations groupées */
.bulk-bar { position: sticky; bottom: 12px; z-index: 4; display: none; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow-lg); }
.bulk-bar.on { display: flex; }
.bulk-check { width: 20px; height: 20px; accent-color: var(--brand); }

/* Mode sombre (réglage du compte : auto, clair ou sombre) */
@media (prefers-color-scheme: dark) { html[data-theme="auto"] { color-scheme: dark; } }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"], html[data-theme="auto"].sys-dark {
  --bg: #0B151C; --surface: #13212B; --sunk: #0F1B23; --line: #2A3A45; --line2: #22313B;
  --ink: #EAF1F4; --muted: #B5C3CB; --soft: #98A9B3; --navy: #0F2A38;
  --ok-l: #12372B; --bad-l: #401C1E; --warn-l: #3D2A14; --info-l: #1E2747;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 18px 40px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .topnav, html[data-theme="auto"].sys-dark .topnav { background: rgba(11, 21, 28, .9); }
html[data-theme="dark"] .btn, html[data-theme="auto"].sys-dark .btn { border-color: #3A4C58; }
html[data-theme="dark"] .btn:hover, html[data-theme="auto"].sys-dark .btn:hover { background: #182a35; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea,
html[data-theme="auto"].sys-dark input, html[data-theme="auto"].sys-dark select, html[data-theme="auto"].sys-dark textarea { background: #0F1B23; color: var(--ink); border-color: #3A4C58; }
html[data-theme="dark"] .shell, html[data-theme="auto"].sys-dark .shell { background: var(--bg); }
html[data-theme="dark"] img[src*="/qr"], html[data-theme="dark"] .qr { background: #fff; }
@media (max-width: 560px) { .main > .head { order: -2; } .main > .kpi-grid { order: -1; } }

/* Démarrage en 6 étapes */
.onboarding { gap: 12px; border: 1px solid var(--brand-l); }
.ob-bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.ob-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.ob-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ob-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; background: var(--bg); }
.ob-steps li.done { opacity: .7; }
.ob-n { flex: 0 0 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--card); border: 2px solid var(--brand); color: var(--brand); font-size: 13px; }
.ob-steps li.done .ob-n { background: var(--brand); color: #fff; }
.ob-n .i { width: 16px; height: 16px; }

/* 390 px : une colonne ne dépasse jamais l'écran, même avec un --min large */
.grid { grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 260px), 100%), 1fr)); }
.fields { grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 200px), 100%), 1fr)); }
.grid > *, .row > *, .fields > * { min-width: 0; }
.row > * { flex-basis: min(100%, var(--basis, auto)); }
@media (max-width: 560px) { .row > .card, .row > section { flex: 1 1 100% !important; } }
[hidden] { display: none !important; }

/* Mode sombre — corrections de contraste (audit du 21 novembre) */
html[data-theme="dark"], html[data-theme="auto"].sys-dark {
  --ok: #5BD69B; --warn: #F5B65A; --bad: #FF8A80; --info: #A9BCFF;
  --brand-l: color-mix(in srgb, var(--brand) 26%, #13212B);
  --brand-d: color-mix(in srgb, var(--brand) 45%, #FFFFFF);
  --teal-b: color-mix(in srgb, var(--brand) 80%, #FFFFFF);
}
html[data-theme="dark"] .chip.on, html[data-theme="auto"].sys-dark .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
html[data-theme="dark"] .side .nav-link.on, html[data-theme="auto"].sys-dark .side .nav-link.on { color: #fff; }
html[data-theme="dark"] .alert.ok, html[data-theme="auto"].sys-dark .alert.ok { color: var(--ok); }

/* Téléphone : chiffres du tableau de bord en 2 colonnes, titre de la barre masqué (il est déjà en grand dans la page) */
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .kpi-grid > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi-grid .kpi { padding: 14px; }
  .kpi-grid .kpi b { font-size: 26px; }
  .topnav .where > *:not(.where-ic) { display: none !important; }
  .topnav .where { flex: 1; }
}
.qr-box svg { width: 260px; height: 260px; background: #fff; padding: 12px; border-radius: 16px; }
.print-tips { text-align: left; max-width: 640px; margin: 18px auto; gap: 6px; }
.print-tips h2 { font-size: 17px; margin: 0; }
.print-tips ol { margin: 0; padding-left: 20px; line-height: 1.55; }
@media print { .no-print { display: none !important; } }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.error-card { max-width: 480px; text-align: center; align-items: center; gap: 10px; padding: 32px 24px; }
.error-card h1 { font-size: 24px; margin: 0; }
.error-code { font-size: 44px; font-weight: 900; color: var(--brand, #0B6B67); letter-spacing: -1px; }
