/* ═══════════════════════════════════════════════════════════════════════════
   MDT — Sarasota Police Department · feuille de style
   Palette : nuit de cabine + laiton de l'insigne. Rouge/bleu réservés aux
   alertes (rampe lumineuse). Big Shoulders pour les titres et indicatifs,
   IBM Plex Sans pour le texte, Plex Mono pour les plaques et références.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --night: #0E1522; --deck: #0B111C; --panel: #151F30; --panel-2: #1A2638; --sunk: #101826;
  --line: #24324A; --line-2: #31425F;
  --ink: #E8ECF3; --mute: #8C9AB3; --faint: #5E6D87;
  --brass: #C9A227; --brass-2: #E3C051; --brass-ink: #1B1506;
  --red: #E5484D; --blue: #4C8DFF; --green: #3DD68C; --amber: #F2A93B;
  --r-dev: 26px; --r-panel: 12px; --r-ctl: 8px;
  --f-disp: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --f-text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -20%, #1B2A45 0%, transparent 60%), #070B12;
  color: var(--ink); font: 15px/1.5 var(--f-text); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brass-2); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(201,162,39,.35); }
.mono { font-family: var(--f-mono); font-size: .92em; letter-spacing: .01em; }
.muted { color: var(--mute); }
.faint { color: var(--faint); }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Appareil ── */
.device {
  position: relative; height: 100vh; display: grid; grid-template-rows: 5px 1fr;
  background: var(--night); overflow: hidden;
}
@media (min-width: 1280px) {
  body { padding: 18px; }
  .device {
    height: calc(100vh - 36px); max-width: 1680px; margin: 0 auto; border-radius: var(--r-dev);
    border: 10px solid #05080E;
    box-shadow: 0 0 0 1px #1E2A3E, 0 30px 90px rgba(0,0,0,.65), inset 0 0 0 1px rgba(255,255,255,.03);
  }
}

/* Dans la tablette de l'application PalmCrest : l'appli dessine déjà le cadre, pas de double bordure. */
html.in-tablet body { padding: 0; }
html.in-tablet .device { height: 100vh; max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }

/* ── Rampe lumineuse : éteinte au repos, s'allume sur un événement urgent ── */
.lightbar { display: grid; grid-template-columns: 1fr 1fr; background: #080C14; }
.lightbar i { display: block; opacity: .16; transition: opacity .3s; }
.lightbar i:first-child { background: linear-gradient(90deg, transparent, var(--red)); }
.lightbar i:last-child  { background: linear-gradient(90deg, var(--blue), transparent); }
.lightbar.on i { animation: strobe .5s steps(1) infinite; }
.lightbar.on i:last-child { animation-delay: .25s; }
.lightbar.soft i { opacity: .55; }
@keyframes strobe { 0% { opacity: 1; box-shadow: 0 0 18px currentColor; } 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .lightbar.on i { animation: none; opacity: 1; } }

.app { display: grid; grid-template-columns: 236px 1fr; min-height: 0; }

/* ── Rail de navigation ── */
.rail {
  background: var(--deck); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.badge-block { display: flex; gap: 12px; align-items: center; padding: 18px 16px 14px; }
.badge-block img { mix-blend-mode: lighten; width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(201,162,39,.25)); }
.badge-block b { display: block; font: 700 1.25rem/1 var(--f-disp); letter-spacing: .02em; }
.badge-block small { display: block; color: var(--mute); font-size: .74rem; margin-top: 3px; }
.nav-group { padding: 10px 10px 4px; }
.nav-group > span { display: block; padding: 0 8px 6px; color: var(--faint); font-size: .72rem; font-weight: 600; }
.nav {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-ctl);
  color: var(--mute); background: none; border: 0; cursor: pointer; font-weight: 500; font-size: .9rem; text-align: left;
}
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.nav.active { background: linear-gradient(90deg, rgba(201,162,39,.16), rgba(201,162,39,.02)); color: var(--ink); box-shadow: inset 2px 0 0 var(--brass); }
.nav .count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-2);
  color: var(--ink); font-size: .72rem; font-weight: 600; text-align: center; line-height: 20px;
}
.nav .count.hot { background: var(--red); color: #fff; }
.rail-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.me-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-ctl); }
.me-card .avatar { width: 36px; height: 36px; }
.me-card b { display: block; font-size: .86rem; line-height: 1.2; }
.me-card small { color: var(--mute); font-size: .76rem; }
.rail-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.avatar {
  display: grid; place-items: center; border-radius: 50%; flex: none; overflow: hidden;
  background: linear-gradient(145deg, #2A3B58, #1A2638); border: 1px solid var(--line-2);
  font: 700 .95rem var(--f-disp); color: var(--brass-2);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Zone principale ── */
.main { display: grid; grid-template-rows: auto 1fr; min-width: 0; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 22px; border-bottom: 1px solid var(--line);
  background: rgba(14,21,34,.9); backdrop-filter: blur(8px);
}
.menu-btn { display: none; }
.omni {
  flex: 0 1 560px; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-ctl); color: var(--faint); cursor: text;
}
.omni:hover { border-color: var(--line-2); }
.omni span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.omni kbd { margin-left: auto; font: 500 .72rem var(--f-mono); padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; }
.status-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-size: .84rem; white-space: nowrap; cursor: pointer;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(61,214,140,.15); }
.dot.warn { background: var(--amber); } .dot.bad { background: var(--red); } .dot.info { background: var(--blue); }
.clock { font: 600 1.35rem/1 var(--f-disp); letter-spacing: .03em; min-width: 64px; text-align: right; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-ctl);
  background: none; border: 1px solid transparent; color: var(--mute); cursor: pointer;
}
.icon-btn:hover { background: var(--panel); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .pip { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: .66rem; font-weight: 700; line-height: 16px; }

.view { overflow-y: auto; padding: 26px 30px 60px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.view > * { max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font: 700 2.15rem/1 var(--f-disp); letter-spacing: .01em; }
.page-head p { color: var(--mute); margin-top: 6px; max-width: 70ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Panneaux & mise en page ── */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel > header h2 { font: 600 1.2rem/1.1 var(--f-disp); letter-spacing: .02em; }
.panel > header .spacer { flex: 1; }
.panel > .body { padding: 16px 18px; }
.panel.flush > .body { padding: 0; }
.stack { display: grid; gap: 16px; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.cols.side { grid-template-columns: minmax(0, 1fr) 340px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }

/* Bandeau de chiffres (une seule ligne, pas une grille de cartes) */
.ticker { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--sunk); margin-bottom: 16px; }
.ticker > * { flex: 1 1 150px; padding: 12px 18px; border-right: 1px solid var(--line); background: none; border-top: 0; border-bottom: 0; border-left: 0; text-align: left; cursor: pointer; color: inherit; }
.ticker > *:last-child { border-right: 0; }
.ticker > *:hover { background: var(--panel); }
.ticker b { display: block; font: 700 1.9rem/1 var(--f-disp); }
.ticker span { color: var(--mute); font-size: .82rem; }
.ticker .hot b { color: var(--red); }
.ticker .gold b { color: var(--brass-2); }

/* ── Service ── */
.duty { display: grid; gap: 18px; }
.duty-clock { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.duty-clock b { font: 800 3.6rem/1 var(--f-disp); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.duty-clock.off b { color: var(--faint); }
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.code {
  display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-ctl); cursor: pointer; text-align: left;
  background: var(--sunk); border: 1px solid var(--line); color: var(--mute);
}
.code b { font: 700 1.05rem/1 var(--f-disp); color: var(--ink); letter-spacing: .02em; }
.code:hover { border-color: var(--line-2); }
.code[aria-pressed="true"] { border-color: currentColor; background: rgba(255,255,255,.03); }
.code.c-ok[aria-pressed="true"] { color: var(--green); }
.code.c-info[aria-pressed="true"] { color: var(--blue); }
.code.c-bad[aria-pressed="true"] { color: var(--red); }
.code.c-warn[aria-pressed="true"] { color: var(--amber); }
.code.c-mute[aria-pressed="true"] { color: var(--mute); }
.mission { border-left: 3px solid var(--amber); padding: 12px 14px; background: rgba(242,169,59,.07); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.mission.urgente { border-color: var(--red); background: rgba(229,72,77,.09); }
.mission h3 { font: 700 1.3rem/1.1 var(--f-disp); }

/* ── Listes & tableaux ── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-weight: 600; font-size: .78rem; color: var(--mute); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--panel-2); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .sub { color: var(--mute); font-size: .8rem; }
.list { display: grid; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item.click { cursor: pointer; }
.item.click:hover { background: var(--panel-2); }
.item .grow { overflow-wrap: anywhere; }
.item h3 { font-size: .96rem; font-weight: 600; line-height: 1.3; }
.item p { color: var(--mute); font-size: .86rem; margin-top: 2px; white-space: pre-line; }
.item .meta { color: var(--faint); font-size: .78rem; margin-top: 4px; }
.item .end { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.item p.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.item p.clamp.open { display: block; }
.empty { padding: 28px 18px; color: var(--mute); text-align: center; }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* ── Pastilles ── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; line-height: 1.5; }
.p-ok { color: var(--green); background: rgba(61,214,140,.1); }
.p-warn { color: var(--amber); background: rgba(242,169,59,.12); }
.p-bad { color: #FF7B7F; background: rgba(229,72,77,.14); }
.p-info { color: #86B2FF; background: rgba(76,141,255,.13); }
.p-mute { color: var(--mute); background: rgba(140,154,179,.1); }
.p-brass { color: var(--brass-2); background: rgba(201,162,39,.13); }
.p-line { color: var(--mute); border-color: var(--line-2); }

/* Plaque de Floride */
.plate {
  display: inline-block; padding: 3px 10px 2px; border-radius: 5px; background: #F2F0E6; color: #1C2A44;
  font: 600 .95rem/1.2 var(--f-mono); letter-spacing: .08em; border: 1px solid #C9C4AE; white-space: nowrap;
  box-shadow: inset 0 -3px 0 rgba(24,120,70,.25);
}
.plate.big { font-size: 1.6rem; padding: 6px 16px 5px; }

/* ── Boutons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); cursor: pointer; font-weight: 600; font-size: .88rem;
  transition: background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: #22314A; border-color: #3E5173; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn.primary:hover { background: var(--brass-2); border-color: var(--brass-2); }
.btn.danger { background: rgba(229,72,77,.12); border-color: rgba(229,72,77,.45); color: #FF8A8D; }
.btn.danger:hover { background: rgba(229,72,77,.22); }
.btn.ghost { background: none; border-color: transparent; color: var(--mute); }
.btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn.sm { padding: 5px 10px; font-size: .8rem; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.busy { pointer-events: none; opacity: .7; }

/* ── Onglets ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--mute); cursor: pointer; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brass); }
.tab .count { margin-left: 6px; font-size: .74rem; color: var(--faint); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; }
.seg button { padding: 6px 12px; background: none; border: 0; color: var(--mute); cursor: pointer; font-size: .84rem; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--panel-2); color: var(--ink); }

/* ── Formulaires ── */
.form { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span { font-size: .8rem; color: var(--mute); font-weight: 500; }
.field > small { color: var(--faint); font-size: .76rem; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 11px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink); outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--brass); }
.input::placeholder { color: var(--faint); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
select.input option { background: var(--panel); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); cursor: pointer; background: var(--sunk); }
.check input { margin-top: 3px; accent-color: var(--brass); width: 16px; height: 16px; }
.check b { display: block; font-size: .9rem; }
.check small { color: var(--mute); font-size: .8rem; }
.check:has(input:checked) { border-color: rgba(201,162,39,.6); background: rgba(201,162,39,.06); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--sunk); cursor: pointer; font-size: .82rem; user-select: none; }
.chip input { display: none; }
.chip:has(input:checked) { border-color: var(--brass); background: rgba(201,162,39,.12); color: var(--brass-2); }
.chip small { color: var(--faint); }
.summary { padding: 10px 12px; border-radius: var(--r-ctl); background: var(--sunk); border: 1px dashed var(--line-2); font-size: .88rem; }

/* ── Définitions ── */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; }
.kv div { min-width: 0; }
.kv dt { color: var(--faint); font-size: .76rem; }
.kv dd { font-weight: 500; overflow-wrap: anywhere; }

/* ── Fiche individu ── */
.dossier-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 18px; }
.dossier-head .avatar { width: 76px; height: 76px; font-size: 1.6rem; border-radius: 16px; }
.dossier-head h2 { font: 800 2.3rem/1 var(--f-disp); letter-spacing: .01em; }
.flags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 16px; }
.flag { display: flex; gap: 8px; align-items: center; padding: 7px 12px; border-radius: var(--r-ctl); font-size: .86rem; font-weight: 600; }
.flag.bad { background: rgba(229,72,77,.14); color: #FF8A8D; border: 1px solid rgba(229,72,77,.35); }
.flag.warn { background: rgba(242,169,59,.12); color: var(--amber); border: 1px solid rgba(242,169,59,.3); }
.flag.ok { background: rgba(61,214,140,.08); color: var(--green); border: 1px solid rgba(61,214,140,.25); }
.points { display: flex; gap: 3px; }
.points i { width: 12px; height: 18px; border-radius: 3px; background: var(--line); }
.points i.on { background: var(--green); }
.points.low i.on { background: var(--amber); }
.points.zero i { background: rgba(229,72,77,.3); }
.doc { padding: 12px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--sunk); }
.doc.missing { opacity: .55; border-style: dashed; }
.doc h4 { font-size: .9rem; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.doc p { color: var(--mute); font-size: .82rem; }
.docs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ── Radio ── */
.radio { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 330px); min-height: 380px; }
.radio-log { overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; }
.msg .who { font-size: .76rem; color: var(--mute); margin-bottom: 2px; display: flex; gap: 6px; align-items: center; }
.msg .bubble { padding: 8px 12px; border-radius: 12px 12px 12px 4px; background: var(--panel-2); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; }
.msg.mine .who { justify-content: flex-end; }
.msg.mine .bubble { border-radius: 12px 12px 4px 12px; background: #1F3150; border-color: #2E4670; }
.msg.urgent .bubble { border-color: var(--red); background: rgba(229,72,77,.14); }
.msg.deleted .bubble { color: var(--faint); font-style: italic; }
.inst { padding: 0 6px; border-radius: 4px; font-size: .68rem; font-weight: 700; color: #fff; background: var(--faint); }
.inst.sheriff { background: #6B7B45; } .inst.pompiers { background: #B42525; } .inst.hopital { background: #0B79B8; } .inst.spd { background: #8A6E12; } .inst.doj { background: #A0520A; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 140px; }

/* ── Appels 911 ── */
.call { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--panel); overflow: hidden; }
.call.urgente { border-color: rgba(229,72,77,.55); }
.call > header { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.call .num { font: 800 1.5rem/1 var(--f-disp); }
.call .log { border-top: 1px solid var(--line); padding: 10px 16px; font-size: .82rem; color: var(--mute); max-height: 160px; overflow-y: auto; background: var(--sunk); }
.call .log div + div { margin-top: 3px; }
.call .log b { color: var(--ink); font-weight: 500; }
.call footer { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); }

/* ── Unités spécialisées ── */
.units { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.unit { border-top: 3px solid var(--u, var(--brass)); }
.unit h2 { color: var(--u, var(--ink)); }
.members { display: flex; flex-wrap: wrap; gap: 6px; }
.member { display: inline-flex; gap: 6px; align-items: center; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); font-size: .8rem; }
.member.chef { border-color: var(--u, var(--brass)); }
.member button { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0 5px; font-size: 1rem; line-height: 1; }
.member button:hover { color: var(--red); }

/* ── Graphe simple ── */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bars div { flex: 1; display: grid; gap: 2px; align-content: end; height: 100%; position: relative; }
.bars i { display: block; border-radius: 3px 3px 0 0; background: var(--brass); min-height: 2px; }
.bars i.alt { background: var(--blue); opacity: .75; }
.bars span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: .66rem; color: var(--faint); }
.legend { display: flex; gap: 14px; font-size: .78rem; color: var(--mute); margin-top: 26px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ── Fenêtres ── */
.scrim { position: fixed; inset: 0; background: rgba(3,6,11,.66); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .15s; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: rise .2s var(--ease); }
.modal.wide { width: min(920px, 100%); }
.modal > header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal > header h2 { font: 700 1.45rem/1.1 var(--f-disp); flex: 1; }
.modal > .body { padding: 18px 20px; overflow-y: auto; }
.modal > footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* Palette de recherche */
.palette { width: min(680px, 100%); align-self: start; margin-top: 8vh; }
.palette .input { font-size: 1.1rem; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0; background: transparent; }
.palette .results { max-height: 60vh; overflow-y: auto; }
.palette .sect { padding: 10px 18px 4px; color: var(--faint); font-size: .76rem; font-weight: 600; }
.palette .item.sel { background: var(--panel-2); }

/* Notifications (tiroir) */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--panel); border-left: 1px solid var(--line-2); z-index: 60; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0,0,0,.5); animation: slide .2s var(--ease); }
.drawer > header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer > header h2 { font: 700 1.4rem var(--f-disp); flex: 1; }
.drawer .list { overflow-y: auto; }
.item.unread { box-shadow: inset 3px 0 0 var(--brass); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* Messages flottants */
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 80; max-width: min(420px, calc(100% - 40px)); }
.toast { padding: 11px 14px; border-radius: 10px; background: #1D2B42; border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: .9rem; animation: rise .2s var(--ease); display: flex; gap: 10px; }
.toast::before { content: ""; width: 4px; border-radius: 2px; background: var(--green); flex: none; }
.toast.err::before { background: var(--red); }
.toast.warn::before { background: var(--amber); }
.toast.info::before { background: var(--blue); }

.loading { padding: 40px; text-align: center; color: var(--faint); }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--brass); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.offline-note { padding: 10px 14px; border-radius: var(--r-ctl); background: rgba(242,169,59,.08); border: 1px solid rgba(242,169,59,.25); color: var(--amber); font-size: .86rem; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .cols, .cols.side, .cols.even { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 5px auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s var(--ease); }
  .rail.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .menu-btn { display: grid; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .omni kbd, .clock { display: none; }
  .view { padding: 18px 14px 50px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.8rem; }
  .duty-clock b { font-size: 2.8rem; }
  .msg { max-width: 92%; }
  .units { grid-template-columns: 1fr; }
  .status-chip .lbl { display: none; }
  .item { flex-wrap: wrap; }
  .item .end { margin-left: 0; width: 100%; justify-content: flex-start; }
  .radio { height: calc(100vh - 250px); }
  .dossier-head h2 { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── Radio vocale ── */
.inst.mairie { background: #5B4B8A; }
.vc-card.on { border-color: rgba(201,162,39,.45); }
.vc-card > .body { display: grid; gap: 14px; }
.vc-lcd {
  display: grid; gap: 2px; padding: 14px 16px; border-radius: 10px;
  background: linear-gradient(180deg, #0A1410, #0C1A14); border: 1px solid #1E3A2C;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.55);
}
.vc-lcd small { color: #5F8C74; font-size: .76rem; font-weight: 600; }
.vc-lcd b { font: 800 3.1rem/1 var(--f-disp); color: #4F7A64; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.vc-lcd b span { font-size: 1rem; margin-left: 6px; color: #5F8C74; }
.vc-lcd em { font-style: normal; font-size: .86rem; color: #6E9A82; min-height: 1.3em; }
.vc-lcd.on b { color: #7CF2B0; text-shadow: 0 0 14px rgba(124,242,176,.35); }
.vc-lcd em.live { color: #7CF2B0; font-weight: 600; }
.vc-ptt-wrap { display: flex; align-items: center; gap: 16px; }
.vc-ptt-wrap kbd { font: 500 .78rem var(--f-mono); padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--ink); }
.vc-ptt {
  width: 86px; height: 86px; border-radius: 50%; flex: none; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #2A3B58, #141E2F); border: 2px solid var(--line-2); color: var(--mute);
  touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .08s, border-color .15s, color .15s;
}
.vc-ptt svg { width: 34px; height: 34px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.vc-ptt:hover { border-color: var(--brass); color: var(--brass-2); }
.vc-ptt.on { transform: scale(.96); border-color: var(--red); color: #fff; background: radial-gradient(circle at 35% 30%, #F0666A, #A3262A); box-shadow: 0 0 0 6px rgba(229,72,77,.18), 0 0 28px rgba(229,72,77,.45); }
.vc-tune { display: grid; gap: 8px; }
.vc-lbl { font-size: .8rem; color: var(--mute); font-weight: 500; }
.vc-in { position: relative; display: block; width: 116px; }
.vc-in .input { font: 700 1.25rem var(--f-disp); letter-spacing: .04em; padding-right: 44px; text-align: center; }
.vc-in span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: .74rem; pointer-events: none; }
.vc-sec { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--mute); }
.vc-sec em { font-style: normal; color: var(--faint); }
.vc-roster { display: grid; gap: 6px; }
.vc-peer { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: var(--r-ctl); background: var(--sunk); border: 1px solid var(--line); }
.vc-peer b { display: block; font-size: .88rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.vc-peer small { color: var(--faint); font-size: .76rem; }
.vc-peer.talk { border-color: rgba(124,242,176,.55); background: rgba(61,214,140,.08); }
.vc-peer.talk small { color: var(--green); font-weight: 600; }
.vc-freqs, .vc-chs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.vc-fq, .vc-ch {
  display: grid; gap: 1px; padding: 8px 10px; text-align: left; cursor: pointer; border-radius: var(--r-ctl);
  background: var(--sunk); border: 1px solid var(--line); color: var(--mute); font-size: .76rem; width: 100%;
}
.vc-fq b { font: 700 1.25rem/1 var(--f-disp); color: var(--ink); }
.vc-ch b { display: flex; gap: 5px; align-items: center; color: var(--ink); font-size: .86rem; }
.vc-ch b svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; flex: none; }
.vc-ch em { font-style: normal; color: var(--faint); }
.vc-fq small { color: var(--faint); }
.vc-fq:hover:not(:disabled), .vc-ch:hover:not(:disabled) { border-color: var(--line-2); background: var(--panel-2); }
.vc-fq.on, .vc-ch.on { border-color: var(--brass); background: rgba(201,162,39,.08); cursor: default; }
.vc-ch.used em { color: var(--green); }
.vc-ch.add { border-style: dashed; }
.vc-chw { position: relative; }
.vc-chx { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--faint); cursor: pointer; }
.vc-chx:hover { color: var(--red); background: rgba(229,72,77,.12); }
.vc-chx svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.vc-sets { display: grid; gap: 4px; }
.vc-set { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vc-set:last-child { border-bottom: 0; }
.vc-set b { display: block; font-size: .9rem; font-weight: 600; }
.vc-set small { color: var(--faint); font-size: .78rem; }
.vc-key { min-width: 120px; font-family: var(--f-mono); }
.vc-key.wait { border-color: var(--brass); color: var(--brass-2); animation: vcblink 1s steps(2) infinite; }
@keyframes vcblink { 50% { border-color: var(--line-2); } }
.vc-vol { display: flex; align-items: center; gap: 10px; }
.vc-vol em { font-style: normal; font-size: .8rem; color: var(--mute); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.vc-vol input[type=range] {
  -webkit-appearance: none; appearance: none; width: 180px; height: 6px; border-radius: 3px; cursor: pointer;
  background: linear-gradient(90deg, var(--brass) var(--v, 90%), var(--line) var(--v, 90%));
}
.vc-vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 2px solid var(--brass); }
.vc-vol input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid var(--brass); }
.vc-sw { position: relative; width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--sunk); cursor: pointer; flex: none; }
.vc-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--faint); transition: transform .15s, background .15s; }
.vc-sw[aria-checked="true"] { background: rgba(201,162,39,.2); border-color: var(--brass); }
.vc-sw[aria-checked="true"]::after { transform: translateX(20px); background: var(--brass-2); }

/* Poste flottant (visible sur tous les écrans quand un poste est allumé) */
.vcdock {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 45; display: grid; gap: 6px;
  width: min(460px, calc(100% - 24px));
}
.vcdock-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 14px;
  background: rgba(21,31,48,.96); border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0,0,0,.5); backdrop-filter: blur(8px);
}
.vcdock-row.live { border-color: rgba(124,242,176,.5); }
.vc-led { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px rgba(61,214,140,.15); }
.vcdock-row.live .vc-led { background: #7CF2B0; box-shadow: 0 0 10px #7CF2B0; }
.vcdock-t { flex: 1; min-width: 0; text-align: left; background: none; border: 0; cursor: pointer; padding: 2px 0; }
.vcdock-t b { display: block; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcdock-t small { display: block; font-size: .76rem; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcdock-row.live .vcdock-t small { color: #7CF2B0; }
.vcdock-b { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.vcdock-b svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vcdock-b.on { background: var(--red); border-color: var(--red); color: #fff; }
.vcdock-b.x { width: 32px; background: none; border-color: transparent; color: var(--faint); }
.vcdock-b.x:hover { color: var(--red); }
@media (max-width: 860px) {
  .vc-lcd b { font-size: 2.5rem; }
  .vc-ptt { width: 76px; height: 76px; }
  .vc-set { flex-wrap: wrap; }
  .vc-vol input[type=range] { width: 140px; }
  .vcdock { bottom: 10px; }
}
@media (min-width: 861px) { .vcdock { left: calc(50% + 118px); } }

/* ── Carte d'appel 911 (dans la tablette) ── */
.callpop {
  position: fixed; top: 74px; right: 20px; z-index: 70; width: min(380px, calc(100% - 24px));
  display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px;
  background: rgba(21,31,48,.98); border: 1px solid var(--line-2); border-left: 4px solid var(--amber);
  box-shadow: 0 20px 50px rgba(0,0,0,.55); animation: rise .2s var(--ease);
}
.callpop.urgent { border-left-color: var(--red); box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(229,72,77,.35); }
.callpop-h { display: flex; align-items: center; gap: 8px; }
.callpop-h b { font: 800 1.35rem/1 var(--f-disp); letter-spacing: .02em; }
.callpop-h .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.callpop h3 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.callpop p { color: var(--mute); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.callpop small { color: var(--faint); font-size: .78rem; }
.callpop .row { margin-top: 4px; }
.callpop-msg { padding: 8px 10px; border-radius: var(--r-ctl); font-size: .86rem; font-weight: 600; }
.callpop-msg.ok { background: rgba(61,214,140,.1); color: var(--green); }
.callpop-msg.err { background: rgba(229,72,77,.14); color: #FF8A8D; }
@media (max-width: 860px) { .callpop { top: 64px; right: 12px; } }
.callpop .row { flex-wrap: nowrap; gap: 6px; }
.callpop .row .btn { padding-left: 12px; padding-right: 12px; white-space: nowrap; }
.callpop .row .btn.primary { flex: 1; }
/* Textes sans espaces (lieu, description) : retour à la ligne forcé, rien ne déborde. */
.callpop { overflow: hidden; }
.callpop h3, .callpop p, .callpop small, .callpop-msg, .call h3, .call p, .call .log { overflow-wrap: anywhere; word-break: break-word; }
.callpop h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.callpop { grid-template-columns: minmax(0, 1fr); }
.callpop-h > * { min-width: 0; }
.callpop-h .pill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callpop-h b, .callpop-h .icon-btn { flex: none; }

/* ── Code 99 ── */
.c99-btn {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(229,72,77,.6); background: rgba(229,72,77,.12);
  color: #FF8A8D; font: 800 .95rem var(--f-disp); letter-spacing: .08em; cursor: pointer; white-space: nowrap;
}
.c99-btn:hover { background: rgba(229,72,77,.25); color: #fff; }
.c99-btn.live { background: var(--red); color: #fff; border-color: var(--red); animation: c99blink 1s steps(2) infinite; }
@keyframes c99blink { 50% { background: #8F2023; } }
.panic { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; width: min(560px, calc(100% - 24px)); display: grid; gap: 10px; }
.pn { padding: 14px 18px; border-radius: 14px; background: linear-gradient(180deg, #4A1214, #2A0C0E); border: 2px solid var(--red);
  box-shadow: 0 0 0 6px rgba(229,72,77,.18), 0 24px 60px rgba(0,0,0,.6); display: grid; gap: 6px; animation: pnpulse 1.2s ease-in-out infinite; }
.pn.mine { background: linear-gradient(180deg, #3A1A10, #22100A); border-color: var(--amber); animation: none; box-shadow: 0 0 0 6px rgba(242,169,59,.15), 0 24px 60px rgba(0,0,0,.6); }
@keyframes pnpulse { 50% { box-shadow: 0 0 0 14px rgba(229,72,77,.08), 0 24px 60px rgba(0,0,0,.6); } }
.pn-h { display: flex; align-items: center; gap: 10px; }
.pn-h b { font: 800 1.15rem var(--f-disp); letter-spacing: .06em; color: #FFB3B5; }
.pn.mine .pn-h b { color: #FFD08A; }
.pn-h span { margin-left: auto; color: #E6A9AB; font-size: .8rem; }
.pn h3 { font: 800 1.6rem/1.1 var(--f-disp); overflow-wrap: anywhere; }
.pn p { color: #F1D2D3; font-size: .92rem; overflow-wrap: anywhere; }
.pn small { color: #E6A9AB; font-size: .8rem; }
.pn .row { margin-top: 4px; flex-wrap: wrap; }
@media (max-width: 860px) { .c99-btn { padding: 0 10px; font-size: .85rem; } }