/* =========================================================
   Portail LSPD · BCSO · EMS — thème sombre
   ========================================================= */
:root {
  --bg: #0b0f17;
  --bg-2: #111725;
  --surface: #151c2c;
  --surface-2: #1b2336;
  --border: #263049;
  --text: #e7ebf3;
  --muted: #8d97ad;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, .14);
  --danger: #ef4d56;
  --success: #34c38f;
  --warning: #f2b84b;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --lspd: #3d7bff;
  --bcso: #c89b4e;
  --ems: #ef4b55;
}
.theme-lspd { --accent: var(--lspd); --accent-soft: rgba(61, 123, 255, .14); }
.theme-bcso { --accent: var(--bcso); --accent-soft: rgba(200, 155, 78, .15); }
.theme-ems  { --accent: var(--ems);  --accent-soft: rgba(239, 75, 85, .14); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font: 15px/1.55 var(--font);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pre { white-space: pre-wrap; word-wrap: break-word; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 15, 23, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-dots { display: flex; gap: 4px; }
.brand-dots span { width: 8px; height: 22px; border-radius: 3px; }
.brand-dots span:nth-child(1) { background: var(--lspd); }
.brand-dots span:nth-child(2) { background: var(--bcso); }
.brand-dots span:nth-child(3) { background: var(--ems); }
.topnav { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.topnav a { color: var(--muted); padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.topnav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.topnav form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }

/* ---------- Boutons & formulaires ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font: 600 .92rem var(--font); cursor: pointer;
  transition: filter .15s, background .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; border-color: rgba(239, 77, 86, .5); color: var(--danger); }
.btn-danger:hover { background: rgba(239, 77, 86, .12); }
.btn-sm { padding: 6px 10px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 8px 10px; border-radius: 8px; }
.btn-link:hover { color: var(--text); background: var(--surface); }

.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: grid; gap: 6px; font-weight: 600; font-size: .88rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font: 400 .95rem var(--font);
}
textarea { min-height: 140px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #5d6780; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; margin: 0; }

.alert { padding: 12px 14px; border-radius: 10px; border: 1px solid; font-size: .92rem; }
.alert-error { border-color: rgba(239, 77, 86, .45); background: rgba(239, 77, 86, .1); color: #ffb3b8; }
.alert-success { border-color: rgba(52, 195, 143, .45); background: rgba(52, 195, 143, .1); color: #a6f0d3; }
.alert-warning { border-color: rgba(242, 184, 75, .45); background: rgba(242, 184, 75, .1); color: #ffe0a3; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .value { font-size: 1.9rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat.accent { border-color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-danger { background: rgba(239, 77, 86, .14); color: var(--danger); border-color: transparent; }
.badge-success { background: rgba(52, 195, 143, .14); color: var(--success); border-color: transparent; }
.badge-lspd { background: rgba(61, 123, 255, .15); color: var(--lspd); border-color: transparent; }
.badge-bcso { background: rgba(200, 155, 78, .15); color: var(--bcso); border-color: transparent; }
.badge-ems  { background: rgba(239, 75, 85, .15); color: var(--ems); border-color: transparent; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
tr.inactive td { opacity: .5; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar form { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 240px; }
.toolbar input[type=search] { flex: 1; min-width: 180px; }
.toolbar select { width: auto; }
.pagination { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 16px; }

/* ---------- Pages publiques ---------- */
.hero { padding: 72px 0 48px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 520px; z-index: -1;
  background: radial-gradient(closest-side, rgba(61, 123, 255, .22), transparent 70%) 15% 50% / 50% 100% no-repeat,
              radial-gradient(closest-side, rgba(200, 155, 78, .16), transparent 70%) 50% 40% / 50% 100% no-repeat,
              radial-gradient(closest-side, rgba(239, 75, 85, .18), transparent 70%) 85% 50% / 50% 100% no-repeat;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 760px; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 620px; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 12px; }

.service-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px;
  color: var(--text); transition: transform .15s, border-color .15s; overflow: hidden;
}
.service-card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent); }
.service-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.service-card .emblem { width: 52px; height: 52px; }
.service-card .more { margin-top: auto; color: var(--accent); font-weight: 600; }

.emblem { color: var(--accent); flex-shrink: 0; }
.section { padding: 40px 0; }
.page-head { padding: 40px 0 24px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.page-head .emblem { width: 72px; height: 72px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before {
  content: counter(s); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem;
}

/* ---------- Authentification ---------- */
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 28px; }
.secure-note { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; margin-top: 14px; }

/* ---------- Espace de service ---------- */
.app { flex: 1; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: 20px 14px; }
.sidebar .dept-title { display: flex; gap: 10px; align-items: center; padding: 6px 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.sidebar .dept-title .emblem { width: 38px; height: 38px; }
.sidebar .dept-title strong { display: block; font-size: 1.05rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500; margin-bottom: 2px;
}
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar .me { margin-top: 18px; padding: 14px 12px; border-top: 1px solid var(--border); font-size: .85rem; }
.sidebar .switch { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.main { padding: 28px; min-width: 0; }
.main-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.main-head h1 { margin: 0; font-size: 1.6rem; }
.crumb { color: var(--muted); font-size: .85rem; margin-bottom: 4px; }

.announcement { border-left: 3px solid var(--border); padding: 4px 0 4px 14px; }
.announcement.pinned { border-left-color: var(--accent); }
.announcement + .announcement { margin-top: 18px; }
.announcement .meta { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; }

.secret {
  font: 600 1.4rem ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .06em;
  padding: 14px; border-radius: 10px; background: var(--bg-2); border: 1px dashed var(--accent); text-align: center;
  user-select: all;
}

/* ---------- Pied de page ---------- */
.footer { border-top: 1px solid var(--border); padding: 22px 0; color: var(--muted); font-size: .85rem; margin-top: auto; }
.footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); padding: 14px; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; margin: 0; }
  .sidebar .me { display: none; }
  .main { padding: 20px 16px; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  .topnav .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Utilitaires ---------- */
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.topnav a.btn { color: #fff; }
.topnav a.btn:hover { background: var(--accent); }
.grid > .card + .card { margin-top: 0; }
.grid + .card, .grid + .grid, .card + .grid { margin-top: 16px; }
.app > * { min-width: 0; }
@media (max-width: 860px) {
  .topbar .container { height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
  .topnav { gap: 2px; flex-wrap: nowrap; }
  .topnav a, .btn-link { padding: 6px 8px; font-size: .88rem; }
  .brand-text { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* =========================================================
   v2 — Terminal de service
   ========================================================= */
:root { --mono: ui-monospace, "Cascadia Code", "Consolas", "SF Mono", monospace; --p1: #ef4d56; --p2: #f2b84b; --p3: #5fa8ff; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .01em; }
.mono-area { font-family: var(--mono); font-size: .9rem; line-height: 1.6; }
.stack { display: grid; gap: 16px; align-content: start; }
.stack > .card + .card { margin-top: 0; }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.narrow { max-width: 860px; }
a.stat { color: var(--text); text-decoration: none; transition: border-color .15s; }
a.stat:hover { border-color: var(--accent); }
.stat .u { font-size: .9rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.stat-hot { border-color: rgba(239, 77, 86, .6); background: linear-gradient(135deg, rgba(239, 77, 86, .14), transparent 70%), var(--surface); }
.alert-info { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.badge-warning { background: rgba(242, 184, 75, .15); color: var(--warning); border-color: transparent; }
.btn-success { background: var(--success); color: #062a1c; }
.btn-success svg, .btn svg { flex-shrink: 0; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 0 10px; }
.danger-title { color: var(--danger); }

/* Navigation latérale */
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #5d6780; margin: 16px 12px 6px; font-weight: 700; }
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-align: center; background: var(--surface-2); color: var(--text); }
.nav-count.hot { background: var(--danger); color: #fff; }
.nav-count.warn { background: var(--warning); color: #2a1d00; }
.nav-count.live { background: rgba(52, 195, 143, .18); color: var(--success); }
.me-name { color: var(--text); }

/* Widget de service */
.duty { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 8px; background: var(--surface); display: grid; gap: 8px; }
.duty.on { border-color: rgba(52, 195, 143, .5); background: linear-gradient(135deg, rgba(52, 195, 143, .12), transparent 70%), var(--surface); }
.duty-head { display: flex; gap: 10px; align-items: center; }
.duty-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.duty input, .duty select { padding: 7px 9px; font-size: .82rem; }
.form-tight { display: grid; gap: 8px; margin: 0; }
.pulse, .live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(52, 195, 143, .6); animation: pulse 2s infinite; flex-shrink: 0; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 195, 143, .55); } 70% { box-shadow: 0 0 0 8px rgba(52, 195, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 195, 143, 0); } }

/* Barre MDT */
.mdt-bar { display: flex; gap: 16px; align-items: center; margin: -8px 0 22px; flex-wrap: wrap; }
.mdt-search { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; color: var(--muted); }
.mdt-search:focus-within { border-color: var(--accent); }
.mdt-search input { border: 0; background: transparent; padding: 11px 0; }
.mdt-search input:focus-visible { outline: none; }
.mdt-meta { display: flex; align-items: center; gap: 8px; }
.clock { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; padding: 6px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); margin-left: 6px; }

/* Onglets */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; width: fit-content; max-width: 100%; }
.tabs a { padding: 7px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: .88rem; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { background: var(--surface-2); color: var(--text); }

/* Unités et codes radio */
.units { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.unit { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); }
.unit-main { flex: 1; min-width: 0; }
.unit-side { text-align: right; display: grid; font-size: .85rem; }
.radio-code { font-family: var(--mono); font-weight: 600; }
.radio { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--success); flex-shrink: 0; }
.radio-97 { background: var(--p3); } .radio-23 { background: var(--warning); } .radio-6 { background: var(--danger); }
.radio-15 { background: #b07cff; } .radio-7 { background: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .8rem; font-family: var(--mono); margin: 2px 4px 2px 0; }

/* Appels 911 */
.prio { display: inline-block; font: 700 .72rem var(--mono); padding: 2px 7px; border-radius: 6px; color: #fff; }
.prio-1 { background: var(--p1); } .prio-2 { background: var(--p2); color: #2a1d00; } .prio-3 { background: var(--p3); color: #04172f; }
.calls-board { display: grid; gap: 12px; align-content: start; }
.call { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--p2); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }
.call-p1 { border-left-color: var(--p1); } .call-p3 { border-left-color: var(--p3); }
.call-p1.call-waiting { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 3px rgba(239, 77, 86, .25); } }
.call-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.call-nature { font-size: 1.02rem; }
.call-time { margin-left: auto; font-family: var(--mono); }
.call-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dropdown { position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-panel { position: absolute; z-index: 5; right: 0; top: calc(100% + 6px); width: 280px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; }
.segmented { display: flex; gap: 6px; }
.segmented label { flex: 1; display: block; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 9px; border-radius: 10px; opacity: .45; font-size: .85rem; }
.segmented input:checked + span { opacity: 1; box-shadow: 0 0 0 2px var(--text); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.empty-state { display: flex; gap: 14px; align-items: center; color: var(--success); }
.empty-state svg { width: 28px; height: 28px; }
.empty-state .muted, .empty-state strong { color: inherit; }
.empty-state strong { color: var(--text); }

/* Rapports */
.summary-btn { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; }
.summary-btn::-webkit-details-marker { display: none; }
.status-strip { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 16px; }
.status-valide { border-color: rgba(52, 195, 143, .4); }
.status-rejete { border-color: rgba(239, 77, 86, .4); }
.status-soumis { border-color: rgba(242, 184, 75, .4); }
.review-box { border-color: var(--warning); }
.report-text { font-size: .98rem; line-height: 1.7; }
.charge-picker select { width: 100%; }
.charges { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.charges li { display: grid; grid-template-columns: auto 1fr 64px auto; gap: 8px; align-items: center; padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; }
.charges li input[type=number] { padding: 5px 6px; text-align: center; }
.ch-label { font-size: .88rem; }
.totals { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 10px; }
.totals div { display: flex; justify-content: space-between; }
.totals strong { font-family: var(--mono); font-size: 1.05rem; }
.checklist { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.sticky-actions { position: sticky; top: 84px; }
.btn-link.btn-block { display: block; text-align: center; }
.dl-tight { grid-template-columns: 120px 1fr; }

/* Autocomplétion */
.autocomplete { position: relative; }
.ac-list { position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.ac-list button { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; font-weight: 500; }
.ac-list button:hover, .ac-list button.active { background: var(--accent-soft); }
.ac-list .muted { font-weight: 400; }
.ac-empty { padding: 10px 12px; color: var(--muted); font-weight: 400; font-size: .88rem; }

/* Dossiers */
.id-card { display: grid; grid-template-columns: 110px 1fr; gap: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.id-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent); }
.id-photo { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; aspect-ratio: 5/6; display: grid; place-items: end center; color: #2c3650; overflow: hidden; }
.id-photo svg { width: 90%; }
.alert-wanted { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 12px; margin-bottom: 12px; color: #fff; text-decoration: none;
  background: repeating-linear-gradient(135deg, rgba(239, 77, 86, .95) 0 14px, rgba(200, 50, 60, .95) 14px 28px); }
.alert-wanted:hover { text-decoration: none; filter: brightness(1.08); }
.alert-wanted svg { width: 26px; height: 26px; }
.plate-sm { display: inline-block; font: 700 .85rem var(--mono); letter-spacing: .08em; padding: 2px 8px; border-radius: 5px; background: #f4f1e6; color: #0d1a5c; border: 2px solid #0d1a5c; }
.plate-sm.big { font-size: 1.4rem; padding: 8px 14px; }

/* Avis de recherche */
.wanted-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.wanted-card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--warning); border-radius: 12px; padding: 14px; color: var(--text); }
a.wanted-card:hover { text-decoration: none; border-color: var(--accent); }
.wanted-card.danger-lvl-3 { border-top-color: var(--danger); }
.wanted-card.danger-lvl-1 { border-top-color: var(--p3); }
.wanted-card.closed { opacity: .55; }
.wanted-top { display: flex; justify-content: space-between; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.wanted-photo { height: 130px; border-radius: 8px; background: var(--bg-2); display: grid; place-items: center; color: #2c3650; overflow: hidden; }
.wanted-photo svg { height: 120px; margin-top: 18px; }
.wanted-name { font-weight: 700; font-size: 1.08rem; }
.wanted-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.danger { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; }
.danger-1 { background: rgba(95, 168, 255, .15); color: var(--p3); }
.danger-2 { background: rgba(242, 184, 75, .15); color: var(--warning); }
.danger-3 { background: var(--danger); color: #fff; }
.wanted-detail { border-top: 4px solid var(--warning); }
.wanted-detail.danger-lvl-3 { border-top-color: var(--danger); }
.sev { font-size: .78rem; font-weight: 600; }
.sev-1 { color: var(--p3); } .sev-2 { color: var(--warning); } .sev-3 { color: var(--danger); }

/* Fiche agent */
.badge-card { display: flex; gap: 20px; align-items: center; padding: 22px; border-radius: 16px; border: 1px solid var(--accent);
  background: radial-gradient(circle at 0 0, var(--accent-soft), transparent 60%), var(--surface); }
.badge-card .emblem { width: 84px; height: 84px; }
.badge-card-name { font-size: 1.5rem; font-weight: 700; }
.badge-card-ids { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; }
.badge-card-ids span { display: grid; }

/* Notes de service */
.memo { border-left: 4px solid var(--border); }
.memo-pinned { border-left-color: var(--accent); }
.memo-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; flex-wrap: wrap; }
.memo-sign { text-align: right; font-style: italic; }

/* Candidatures */
.application summary { cursor: pointer; list-style: none; }
.application summary::-webkit-details-marker { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Accueil */
.hero-live { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 28px; color: var(--muted); font-size: .92rem; }
.hero-live > span { display: inline-flex; gap: 8px; align-items: center; }
.hero-live strong { color: var(--text); }
.hero-live .live-dot { background: var(--accent); animation: none; }

/* Graphiques SVG */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .hit:hover .bar { filter: brightness(1.25); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .baseline { stroke: #3a4560; stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 11px var(--font); }
.chart .label { fill: var(--text); font: 13px var(--font); }
.chart .value { fill: var(--muted); font: 600 12px var(--mono); }

@media (max-width: 1100px) { .grid-main { grid-template-columns: 1fr; } .sticky-actions { position: static; } }
@media (max-width: 860px) {
  .mdt-meta { display: none; }
  .id-card { grid-template-columns: 1fr; }
  .id-photo { max-width: 120px; }
  .dl-tight { grid-template-columns: 1fr; }
  .dropdown-panel { right: auto; left: 0; }
  .sidebar .duty { margin-bottom: 10px; }
  .nav-group { display: none; }
}
@media print {
  .topbar, .sidebar, .mdt-bar, .actions, .footer { display: none !important; }
  body, .card, .stat, table { background: #fff !important; color: #000 !important; }
  .app { display: block; }
}
.grid-charts { grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); }
@media (max-width: 600px) { .grid-charts { grid-template-columns: 1fr; } }
.main { max-width: 1560px; width: 100%; }
.chart { max-height: 300px; }

/* =========================================================
   v3 — Carte en direct, plaintes, FiveM
   ========================================================= */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.map-wrap { position: relative; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: #0a1220; height: calc(100vh - 220px); min-height: 480px; }
.map { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.map:active { cursor: grabbing; }
.map-water-a { stop-color: #0f1d33; } .map-water-b { stop-color: #08101d; }
.map-land { fill: #1a2433; stroke: #2a3a52; stroke-width: 14; }
.map-city { fill: #222f44; stroke: #2e3f5b; stroke-width: 6; }
.map-zone { fill: rgba(239, 77, 86, .08); stroke: rgba(239, 77, 86, .35); stroke-width: 8; stroke-dasharray: 40 30; }
.map-lake { fill: #0f1d33; stroke: #2a3a52; stroke-width: 10; }
.map-road { fill: none; stroke: #3a4a64; stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.map-grid { stroke: rgba(141, 151, 173, .07); stroke-width: 4; }
.map-label { fill: #6f7c96; font-family: var(--font); font-weight: 600; text-transform: uppercase; pointer-events: none; }
.map-label.big { fill: #9aa6bf; }
.map-label.water { fill: #36507a; font-style: italic; }
.map-label.region { fill: #4a5874; }
.m-unit-dot { stroke: #0a1220; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.m-unit.d-lspd .m-unit-dot, .m-unit.d-lspd .m-unit-dir { fill: var(--lspd); }
.m-unit.d-bcso .m-unit-dot, .m-unit.d-bcso .m-unit-dir { fill: var(--bcso); }
.m-unit.d-ems .m-unit-dot, .m-unit.d-ems .m-unit-dir { fill: var(--ems); }
.m-unit.r-6 .m-unit-dot { stroke: #fff; animation: blink-stroke 1s infinite; }
@keyframes blink-stroke { 50% { stroke: var(--danger); } }
.m-unit-label { fill: #fff; font-family: var(--mono); font-weight: 700; paint-order: stroke; stroke: #0a1220; stroke-width: 4px; vector-effect: non-scaling-stroke; }
.m-call-dot { fill: var(--p2); }
.m-call-ring { fill: none; stroke: var(--p2); stroke-width: 2px; vector-effect: non-scaling-stroke; animation: ring 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.m-call.p1 .m-call-dot { fill: var(--p1); } .m-call.p1 .m-call-ring { stroke: var(--p1); }
.m-call.p3 .m-call-dot { fill: var(--p3); } .m-call.p3 .m-call-ring { stroke: var(--p3); }
@keyframes ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.map-controls { position: absolute; right: 12px; top: 12px; display: grid; gap: 6px; }
.map-controls .btn { background: rgba(11, 15, 23, .85); backdrop-filter: blur(6px); min-width: 38px; }
.map-legend { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 14px; padding: 8px 12px; border-radius: 10px; background: rgba(11, 15, 23, .85); color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot-lspd { background: var(--lspd); } .dot-bcso { background: var(--bcso); } .dot-ems { background: var(--ems); } .dot-call { background: var(--p1); }
.map-side { max-height: calc(100vh - 220px); overflow: auto; }
.map-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.map-list button { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font: inherit; cursor: pointer; }
.map-list button:hover { border-color: var(--accent); }
.map-list button > .muted { grid-column: 2; }
.map-list button > .prio { grid-row: span 2; }
.map-list button > .dot { grid-row: span 2; }
.map-status { display: flex; align-items: center; gap: 8px; }
.live-dot.off { background: var(--muted); animation: none; box-shadow: none; }
.link-card .secret { font-size: 1.8rem; }
.badge-fivem { background: rgba(242, 133, 0, .15); color: #f5a524; border-color: transparent; }

/* Plaintes */
.track { display: flex; gap: 0; margin: 16px 0; }
.track li { flex: 1; list-style: none; text-align: center; position: relative; color: var(--muted); font-size: .82rem; padding-top: 26px; }
.track li::before { content: ""; position: absolute; top: 6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); z-index: 1; }
.track li::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.track li:first-child::after { display: none; }
.track li.done { color: var(--text); }
.track li.done::before { background: var(--accent); border-color: var(--accent); }
.track li.done::after { background: var(--accent); }
.track-wrap { padding: 0; margin: 0; display: flex; }
@media (max-width: 1100px) { .map-layout { grid-template-columns: 1fr; } .map-wrap { height: 60vh; } .map-side { max-height: none; } }
.stat .small-value { font-size: 1.05rem; line-height: 1.9; }

/* Calage de la carte */
.lm-dot { fill: #5fa8ff; stroke: #fff; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.lm-ring { fill: none; stroke: #5fa8ff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.lm-label { fill: #fff; font: 700 150px var(--font); paint-order: stroke; stroke: #000; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.calib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calib-grid label { font-size: .78rem; }
.calib-grid input { padding: 7px 9px; }
