/* SIRIUS — interface de centre opérationnel (thème sombre unique, volontaire) */
:root {
  color-scheme: dark;
  --bg: #080b10;
  --bg2: #0b1016;
  --panel: #10161e;
  --panel2: #151d27;
  --raise: #1a2430;
  --line: #1f2a37;
  --line2: #2b3949;
  --text: #e3e9f0;
  --text2: #b1bcc8;
  --muted: #7d8a9a;
  --dim: #56626f;
  --accent: #e0b44c;
  --accent-ink: #1a1405;
  --ok: #3ec47a;
  --warn: #f0a53a;
  --crit: #ff4d5e;
  --info: #5aa9e6;
  --st-available: #3ec47a;
  --st-busy: #e0b44c;
  --st-unavailable: #5e6a78;
  --st-enroute: #f0a53a;
  --st-onscene: #ff7a59;
  --st-alerted: #5aa9e6;
  --f-ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-d: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --f-m: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;
  --r: 4px;
  --side: 212px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--f-ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.mono { font-family: var(--f-m); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- démarrage ---------- */
.boot { height: 100vh; display: grid; place-content: center; gap: 12px; justify-items: center; color: var(--muted); font: 700 18px var(--f-d); letter-spacing: .3em; }
.boot-mark { width: 38px; height: 38px; border: 2px solid var(--accent); border-radius: 50%; border-top-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- connexion ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 460px); }
.login-side { position: relative; overflow: hidden; border-right: 1px solid var(--line); background:
  radial-gradient(1200px 600px at 20% 110%, #13202c 0%, transparent 60%), var(--bg2); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.login-side > * { position: relative; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand b { font: 700 34px/1 var(--f-d); letter-spacing: .22em; }
.login-brand small { display: block; color: var(--muted); letter-spacing: .08em; font-size: 12px; margin-top: 4px; }
.login-side h1 { font: 600 44px/1.05 var(--f-d); letter-spacing: .02em; max-width: 14ch; margin: 0 0 14px; text-wrap: balance; }
.login-side p { color: var(--text2); max-width: 52ch; margin: 0; }
.login-legal { color: var(--dim); font-size: 12px; max-width: 60ch; }
.login-form { display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 48px 40px; background: var(--panel); }
.login-form h2 { font: 600 24px var(--f-d); letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.demo-accounts { border: 1px dashed var(--line2); border-radius: var(--r); padding: 10px 12px; font-size: 12.5px; color: var(--text2); }
.demo-accounts table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.demo-accounts td { padding: 3px 4px; }
.demo-accounts button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-family: var(--f-m); }

/* ---------- structure ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr); height: 100vh; }
.side { grid-row: 1 / 3; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-brand { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.side-brand .mark { width: 26px; height: 26px; flex: none; }
.side-brand b { font: 700 20px/1 var(--f-d); letter-spacing: .24em; }
.side-brand small { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .06em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; overflow: auto; }
.nav-sec { font: 600 11px var(--f-d); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--text2); text-decoration: none; font-weight: 500; position: relative; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a[aria-current="page"] { background: var(--panel2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav a .cnt { margin-left: auto; }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.conn { display: flex; align-items: center; gap: 8px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); }
.conn.on i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }

.top { display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg2); min-width: 0; }
.top h1 { font: 600 19px var(--f-d); letter-spacing: .1em; text-transform: uppercase; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .clock { font: 600 17px var(--f-m); letter-spacing: .04em; }
.top .date { color: var(--muted); font-size: 12px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); border: 1px solid transparent; background: none; color: var(--text2); cursor: pointer; }
.iconbtn:hover { background: var(--panel); color: var(--text); border-color: var(--line); }
.iconbtn .badge { position: absolute; top: 2px; right: 2px; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.userchip .av { width: 28px; height: 28px; border-radius: 3px; display: grid; place-items: center; font: 700 13px var(--f-d); letter-spacing: .04em; color: var(--bg); background: var(--accent); }
.userchip .nm { line-height: 1.15; }
.userchip .nm b { display: block; font-size: 13px; }
.userchip .nm small { color: var(--muted); font-size: 11px; }
.main { overflow: auto; min-height: 0; padding: 16px; }
.main.fill { overflow: hidden; display: flex; flex-direction: column; }

/* ---------- éléments ---------- */
.pn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pn-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); min-height: 40px; flex: none; }
.pn-h h2, .pn-h h3 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; font: 600 14px var(--f-d); letter-spacing: .12em; text-transform: uppercase; color: var(--text2); display: flex; align-items: center; gap: 8px; }
.pn-h .spacer { flex: 1; }
.pn-b { padding: 12px; overflow: auto; min-height: 0; }
.pn-b.flush { padding: 0; }
.lbl { font: 600 11px var(--f-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 12px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel2); color: var(--text); cursor: pointer; font-weight: 600; font-size: 12.5px; letter-spacing: .02em; white-space: nowrap; min-height: 34px; }
.btn:hover:not(:disabled) { border-color: var(--muted); background: var(--raise); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: #ecc463; border-color: #ecc463; }
.btn.ok { background: color-mix(in srgb, var(--ok) 18%, var(--panel2)); border-color: color-mix(in srgb, var(--ok) 55%, transparent); color: #bff0d3; }
.btn.danger { color: #ffb3bb; border-color: color-mix(in srgb, var(--crit) 45%, transparent); background: color-mix(in srgb, var(--crit) 8%, var(--panel2)); }
.btn.ghost { background: none; border-color: transparent; color: var(--text2); }
.btn.ghost:hover:not(:disabled) { background: var(--panel2); border-color: var(--line); }
.btn.sm { padding: 4px 9px; min-height: 28px; font-size: 12px; }
.btn.xl { padding: 14px 18px; font-size: 15px; min-height: 54px; font-family: var(--f-d); letter-spacing: .08em; text-transform: uppercase; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--text2); font-weight: 500; }
.field small { color: var(--muted); font-size: 11.5px; }
.inp, select.inp, textarea.inp { width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); padding: 8px 10px; min-height: 36px; }
.inp:focus { border-color: var(--accent); outline: none; }
textarea.inp { resize: vertical; min-height: 70px; }
.inp.sm { padding: 5px 8px; min-height: 30px; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.err { color: #ffb3bb; background: color-mix(in srgb, var(--crit) 10%, transparent); border: 1px solid color-mix(in srgb, var(--crit) 35%, transparent); padding: 8px 10px; border-radius: var(--r); font-size: 13px; }
.note { color: var(--text2); background: var(--panel2); border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--r); font-size: 13px; }
.empty { color: var(--dim); padding: 18px 8px; text-align: center; font-size: 13px; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--crit); color: #fff; font: 600 11px var(--f-m); }
.badge.soft { background: var(--raise); color: var(--text2); }

/* pastilles */
.svc { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 5px; border-radius: 3px; font: 600 11px var(--f-ui); letter-spacing: .04em; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 60%, #fff); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); white-space: nowrap; }
.svc::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.svc.solid { background: var(--c); color: #0a0d12; border-color: var(--c); }
.svc.solid::before { background: #0a0d12; opacity: .5; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.prio { display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 5px; border-radius: 3px; font: 700 11.5px var(--f-m); color: var(--c); border: 1.5px solid var(--c); }
.prio.solid { background: var(--c); color: #0a0d12; }
.st { display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--f-ui); text-transform: uppercase; letter-spacing: .05em; color: var(--c, var(--muted)); white-space: nowrap; }
.st::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.st.available { --c: var(--st-available); } .st.busy, .st.accepted { --c: var(--st-busy); } .st.unavailable, .st.released, .st.refused { --c: var(--st-unavailable); }
.st.enroute, .st.engaged { --c: var(--st-enroute); } .st.onscene { --c: var(--st-onscene); } .st.alerted { --c: var(--st-alerted); }
.st.pending { --c: var(--crit); } .st.closed { --c: var(--dim); } .st.cancelled { --c: var(--dim); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 10px; font: 600 11px var(--f-ui); letter-spacing: .05em; text-transform: uppercase; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 70%, #fff); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); white-space: nowrap; }
.pill.pending { --c: var(--crit); } .pill.alerted { --c: var(--st-alerted); } .pill.engaged { --c: var(--st-enroute); } .pill.onscene { --c: var(--st-onscene); } .pill.closed, .pill.cancelled { --c: var(--dim); }
.pill.pulse::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.2s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.ticon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); background: color-mix(in srgb, var(--c, var(--muted)) 16%, var(--panel2)); color: color-mix(in srgb, var(--c, var(--muted)) 75%, #fff); flex: none; }
.ticon.lg { width: 44px; height: 44px; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font: 600 11px var(--f-ui); text-transform: uppercase; letter-spacing: .07em; color: var(--dim); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--panel2) 70%, transparent); }
.tbl tr.click { cursor: pointer; }
.tbl td.act { text-align: right; white-space: nowrap; }

/* ---------- listes d'interventions / appels ---------- */
.ilist { display: flex; flex-direction: column; }
.irow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 3px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; position: relative; }
.irow:hover { background: var(--panel2); }
.irow[aria-current="true"] { background: var(--raise); box-shadow: inset 3px 0 0 var(--accent); }
.irow .ti { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.irow .tm { font: 12px var(--f-m); color: var(--muted); text-align: right; }
.irow .sub { grid-column: 2 / 4; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.irow .sub .loc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.irow .ic { grid-row: 1 / 3; }
.irow.fresh { animation: fresh 1.4s ease-out 3; }
@keyframes fresh { 0% { background: color-mix(in srgb, var(--crit) 22%, transparent); } 100% { background: transparent; } }
.irow.pending-row::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--crit); }
.callrow .msg { grid-column: 2 / 4; font-size: 12.5px; color: var(--text2); font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 12px; border: 1px solid var(--line2); background: none; cursor: pointer; font-size: 12px; color: var(--text2); }
.chip[aria-pressed="true"] { background: var(--raise); color: var(--text); border-color: var(--muted); }

/* ---------- dispatch ---------- */
.dispatch { display: grid; grid-template-columns: minmax(290px, 360px) minmax(0, 1fr) minmax(250px, 300px); gap: 12px; flex: 1; min-height: 0; }
.dcol { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.dcol > .pn { flex: 1; }
.dcol > .pn.calls { flex: 0 1 auto; max-height: 42%; }

/* détail d'intervention */
.inc-head { display: flex; gap: 14px; align-items: flex-start; }
.inc-head h2 { font: 700 28px/1.08 var(--f-d); letter-spacing: .02em; margin: 2px 0 6px; text-wrap: balance; }
.inc-head .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inc-head .num { font: 600 13px var(--f-m); color: var(--accent); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 14px 0; }
.kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv b { font-weight: 500; overflow-wrap: anywhere; }
.quote { border-left: 2px solid var(--line2); background: var(--bg2); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; font-style: italic; color: var(--text); }
.sec { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.sec > h3 { margin: 0; font: 600 14px var(--f-d); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sec > h3 .spacer { flex: 1; }
.svc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.svc-card > div:first-child { flex-wrap: wrap; row-gap: 4px; }
.svc-card { border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--r); background: var(--panel2); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.svc-card .rl { color: var(--text2); font-size: 12.5px; }
.svc-card .req { color: #ffb3bb; font-size: 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.reqbox { border: 1px solid color-mix(in srgb, var(--crit) 45%, transparent); background: color-mix(in srgb, var(--crit) 7%, var(--panel)); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.reqbox .t { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.timeline { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); max-height: 340px; overflow: auto; }
.tl { display: grid; grid-template-columns: 64px 110px minmax(0, 1fr); gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tl:last-child { border-bottom: 0; }
.tl .w { font-weight: 600; font-size: 12px; color: var(--c, var(--text2)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl.note .x { color: var(--text); }
.tl.system .x, .tl.status .x { color: var(--text2); }
.tl.request { background: color-mix(in srgb, var(--crit) 6%, transparent); }
.tl.response { background: color-mix(in srgb, var(--ok) 6%, transparent); }
.tl.call .x { font-style: italic; }
.composer { display: flex; gap: 8px; }
.composer .inp { flex: 1; }
.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--bg2); position: sticky; bottom: -12px; margin: 16px -12px -12px; }

/* unités */
.ugroup { margin-bottom: 14px; }
.ugroup h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font: 600 13px var(--f-d); letter-spacing: .12em; text-transform: uppercase; }
.ugroup h4 small { margin-left: auto; font: 12px var(--f-m); color: var(--muted); letter-spacing: 0; }
.urow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 6px 8px; border-radius: 3px; background: var(--panel2); margin-bottom: 3px; border: 1px solid transparent; }
.urow .cs { font: 600 13px var(--f-m); }
.urow .sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow .inc { font: 11px var(--f-m); color: var(--accent); text-align: right; }
.urow.mine { border-color: var(--accent); }

/* ---------- terminal ---------- */
.term { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.ident { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, var(--panel)) 0%, var(--panel) 45%); }
.ident .cs { font: 700 34px/1 var(--f-d); letter-spacing: .06em; }
.ident .who { color: var(--text2); font-size: 13px; }
.statusbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sbtn { padding: 14px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel); cursor: pointer; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.sbtn .k { font: 600 11px var(--f-m); color: var(--dim); }
.sbtn .v { font: 700 20px/1.1 var(--f-d); letter-spacing: .06em; text-transform: uppercase; }
.sbtn:hover:not(:disabled) { border-color: var(--muted); }
.sbtn[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #0a0d12; }
.sbtn[aria-pressed="true"] .k { color: #0a0d12; opacity: .7; }
.sbtn:disabled { opacity: .4; cursor: not-allowed; }
.term-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.mission { border: 1px solid var(--line2); }
.mission-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.offer { border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel2); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.offer.hot { border-color: color-mix(in srgb, var(--crit) 60%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--crit) 25%, transparent); }
.offer .t { display: flex; align-items: center; gap: 10px; }
.offer .t b { font-size: 15px; }
.duty-form { max-width: 760px; margin: 0 auto; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .v { font: 600 32px/1 var(--f-m); letter-spacing: -.02em; }
.kpi .v small { font-size: 14px; color: var(--muted); letter-spacing: 0; }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi.alert .v { color: var(--crit); }
.dash { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 12px; margin-top: 12px; }
.dash-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.svcbar { display: grid; grid-template-columns: 80px minmax(0, 1fr) 96px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.svcbar .track { height: 10px; border-radius: 3px; background: var(--bg2); display: flex; gap: 2px; overflow: hidden; }
.svcbar .track span { height: 100%; }
.alerts { display: flex; flex-direction: column; }
.al { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.al .ic { grid-row: 1 / 3; margin-top: 2px; }
.al .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al .b { grid-column: 2 / 4; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al .tm { font: 11.5px var(--f-m); color: var(--dim); }
.lv-critical { color: var(--crit); } .lv-warning { color: var(--warn); } .lv-info { color: var(--info); }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 11px var(--f-m); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--info); }
.chart .bar:hover, .chart .hit:hover + .bar { fill: #8cc6f0; }
.chart-tip { position: fixed; pointer-events: none; background: var(--raise); border: 1px solid var(--line2); border-radius: var(--r); padding: 6px 9px; font-size: 12px; z-index: 60; box-shadow: 0 8px 24px rgb(0 0 0 / .4); }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 4px 10px; font-size: 13px; }
.hbar .tr { grid-column: 1 / 3; height: 8px; background: var(--bg2); border-radius: 3px; overflow: hidden; }
.hbar .tr span { display: block; height: 100%; background: var(--info); border-radius: 0 4px 4px 0; }
.hbar .n { text-align: right; font-family: var(--f-m); color: var(--text2); }

/* ---------- carte ---------- */
.map { position: relative; width: 100%; height: 100%; min-height: 320px; background: #0a1017; border-radius: var(--r); overflow: hidden; user-select: none; touch-action: none; }
.map svg.world { width: 100%; height: 100%; display: block; cursor: grab; }
.map svg.world.drag { cursor: grabbing; }
.map svg.world.pick { cursor: crosshair; }
.map .ctrls { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.map .ctrls button { width: 32px; height: 32px; display: grid; place-items: center; background: rgb(16 22 30 / .92); border: 1px solid var(--line2); border-radius: var(--r); color: var(--text2); cursor: pointer; }
.map .ctrls button:hover { color: var(--text); border-color: var(--muted); }
.map .legend { position: absolute; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 6px 10px; background: rgb(10 14 20 / .88); border: 1px solid var(--line); border-radius: var(--r); font-size: 11.5px; color: var(--text2); max-width: calc(100% - 20px); }
.map .legend span { display: inline-flex; align-items: center; gap: 5px; }
.map .coords { position: absolute; right: 10px; bottom: 10px; font: 11px var(--f-m); color: var(--muted); background: rgb(10 14 20 / .88); padding: 3px 7px; border-radius: 3px; border: 1px solid var(--line); }
.mk-inc { cursor: pointer; }
.mk-inc .halo { animation: halo 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { 0% { opacity: .7; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.2); } }
@media (prefers-reduced-motion: reduce) { .mk-inc .halo, .irow.fresh, .pill.pulse::before { animation: none; } }
.mk-unit { cursor: pointer; }
.mk-label { font: 600 10px var(--f-m); fill: #dfe6ee; paint-order: stroke; stroke: #0a1017; stroke-width: 3px; }
.mk-sel { stroke: var(--accent); stroke-width: 2.5; fill: none; }

/* ---------- notifications ---------- */
#toast-root { position: fixed; top: 60px; right: 14px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 11px 12px; background: var(--raise); border: 1px solid var(--line2); border-left: 3px solid var(--c, var(--info)); border-radius: var(--r); box-shadow: 0 10px 30px rgb(0 0 0 / .45); animation: tin .22s ease-out; cursor: pointer; }
.toast.out { animation: tout .2s ease-in forwards; }
.toast .ic { grid-row: 1 / 3; color: var(--c); margin-top: 1px; }
.toast .t { font-weight: 600; font-size: 13.5px; }
.toast .b { grid-column: 2 / 4; color: var(--text2); font-size: 12.5px; }
.toast .x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.toast.critical { --c: var(--crit); } .toast.warning { --c: var(--warn); } .toast.info { --c: var(--info); } .toast.success { --c: var(--ok); }
@keyframes tin { from { transform: translateX(16px); opacity: 0; } }
@keyframes tout { to { transform: translateX(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.out { animation: none; } }

/* ---------- fenêtres ---------- */
.overlay { position: fixed; inset: 0; background: rgb(3 5 8 / .72); z-index: 70; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; box-shadow: 0 30px 80px rgb(0 0 0 / .6); }
.modal.wide { width: min(980px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0; font: 600 18px var(--f-d); letter-spacing: .1em; text-transform: uppercase; }
.modal-b { padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal.alarm { border-color: var(--crit); box-shadow: 0 0 0 1px var(--crit), 0 30px 80px rgb(0 0 0 / .6); }
.modal.alarm .modal-h { background: color-mix(in srgb, var(--crit) 14%, var(--panel)); }
.svc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.svc-pick span { min-width: 0; overflow-wrap: anywhere; }
.svc-pick label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: var(--r); cursor: pointer; background: var(--panel2); }
.svc-pick label:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--panel2)); }
.svc-pick input { accent-color: var(--c); width: 16px; height: 16px; }
.menu { position: absolute; z-index: 75; min-width: 220px; background: var(--raise); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 16px 40px rgb(0 0 0 / .5); padding: 6px; }
.menu button, .menu a { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 3px; cursor: pointer; text-align: left; color: var(--text); text-decoration: none; font-size: 13px; }
.menu button:hover, .menu a:hover { background: var(--panel2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .hd { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.drop { position: absolute; right: 0; top: 42px; width: min(400px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; z-index: 75; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 16px 40px rgb(0 0 0 / .5); }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text2); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.page-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.page-h h2 { margin: 0; font: 600 20px var(--f-d); letter-spacing: .08em; text-transform: uppercase; }
.page-h p { margin: 0; color: var(--muted); font-size: 13px; flex-basis: 100%; }
.swatch { width: 18px; height: 18px; border-radius: 3px; background: var(--c); display: inline-block; vertical-align: middle; border: 1px solid rgb(255 255 255 / .15); }
.keybox { font-family: var(--f-m); background: var(--bg2); border: 1px dashed var(--accent); padding: 10px 12px; border-radius: var(--r); word-break: break-all; }
pre.code { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; overflow: auto; font: 12px/1.55 var(--f-m); color: var(--text2); margin: 0; }
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .dispatch { grid-template-columns: minmax(270px, 330px) minmax(0, 1fr); }
  .dispatch .units-col { display: none; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .dash, .term-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-side { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 52px minmax(0, 1fr) 60px; }
  .side { grid-row: 3; grid-column: 1; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .side-brand, .side-foot, .nav-sec { display: none; }
  .nav { flex-direction: row; padding: 4px; gap: 0; overflow-x: auto; width: 100%; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; flex: 1; min-width: 64px; justify-content: center; }
  .nav a[aria-current="page"] { box-shadow: inset 0 2px 0 var(--accent); }
  .nav a .cnt { position: absolute; top: 2px; right: 8px; }
  .main.fill { overflow: auto; }
  .dispatch { grid-template-columns: 1fr; }
  .dcol > .pn, .dcol > .pn.calls { max-height: none; flex: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .top .date, .userchip .nm { display: none; }
  .tl { grid-template-columns: 54px minmax(0, 1fr); }
  .tl .w { grid-column: 2; }
  .tl .x { grid-column: 1 / 3; }
  .main { padding: 12px; }
  .term-grid > #t-side { order: -1; }
  .sbtn { padding: 10px; } .sbtn .v { font-size: 15px; }
  .ident .cs { font-size: 28px; }
}
.legend-inline { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 8px; font-size: 12px; color: var(--text2); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.reqcount { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 9px; background: var(--crit); color: #fff; font: 600 11px var(--f-m); }
.reqcount svg.i { width: 12px; height: 12px; }

.tbl td.mono { white-space: nowrap; }
.reqlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); }
.rq { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rq:last-child { border-bottom: 0; }
.rq .flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rq .msg, .rq .resp { grid-column: 2 / 4; }
.rq .resp { color: var(--muted); font-size: 12.5px; }
