:root {
  --bg: #070a1c; --bg2: #0d1433; --panel: rgba(255,255,255,.06); --panel-b: rgba(255,214,130,.28);
  --text: #eef1fb; --muted: #aeb9e3; --gold: #e8c15a; --gold2: #f2cf6b; --coral: #ff7a45;
  --blue: #0055a4; --red: #ef4135; --ok: #4ade80; --danger: #ff5c50; --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1100px 600px at 85% -10%, rgba(244,162,89,.16), transparent 60%), radial-gradient(900px 500px at -10% 10%, rgba(90,130,255,.18), transparent 60%), linear-gradient(180deg, var(--bg2), var(--bg) 70%);
  background-attachment: fixed;
}
a { color: var(--gold2); text-decoration: none; } a:hover { text-decoration: underline; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* En-tete */
header.top { position: sticky; top: 0; z-index: 20; background: linear-gradient(90deg, #070b22, #17235a); border-bottom: 0; }
header.top::after { content: ""; display: block; height: 5px; background: linear-gradient(90deg, var(--blue) 33.3%, #fff 33.3% 66.6%, var(--red) 66.6%); }
.bar { max-width: none; margin: 0; padding: 10px 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 800; letter-spacing: .5px; }
.brand:hover { text-decoration: none; }
.brand img { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--gold); object-fit: cover; }
.brand span { font-size: 1.25rem; background: linear-gradient(90deg, #ffe0a8, var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav.main { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav.main a { white-space: nowrap; color: var(--text); padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: .95rem; }
nav.main a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
nav.main a.active { background: rgba(232,193,90,.18); color: var(--gold2); }
nav.main a.dev { color: #111; background: linear-gradient(135deg, var(--gold2), #c99a2e); }
.userbox { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.userbox img { width: 34px; height: 34px; border-radius: 50%; }
.userbox .name { font-weight: 600; font-size: .9rem; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 12px; color: #111; background: linear-gradient(135deg, var(--gold2), #c99a2e); }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.alt { color: var(--text); background: rgba(255,255,255,.1); }
.btn.danger { color: #fff; background: linear-gradient(135deg, #ff6b5e, #c62828); }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 9px; }
.btn[disabled] { opacity: .55; cursor: wait; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
/* Pied de page toujours en bas de la fenêtre, même quand la page est courte */
body { display: flex; flex-direction: column; }
main { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
h1, h2, h3 { line-height: 1.25; }
h1.page { margin: 0 0 6px; font-size: 2rem; }
.sub { color: var(--muted); margin: 0 0 22px; }
.card { background: var(--panel); border: 1px solid var(--panel-b); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(4px); }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.1); }
.badge.open { background: rgba(74,222,128,.18); color: var(--ok); } .badge.closed { background: rgba(255,92,80,.16); color: var(--danger); }
.muted { color: var(--muted); } .small { font-size: .85rem; }

/* Accueil */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 54px 32px; text-align: center; border: 1px solid var(--panel-b);
  background: linear-gradient(180deg, rgba(23,35,90,.85), rgba(7,10,28,.9)); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .12; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 200'><path fill='white' d='M50 0l1.5 25 2 40 8 25c3 12 10 40 26 110h-14c-6-10-10-14-23-14s-17 4-23 14H13c16-70 23-98 26-110l8-25 2-40z'/></svg>") no-repeat 85% 100% / auto 120%; }
.hero > * { position: relative; }
.hero img.logo { width: 150px; height: 150px; border-radius: 50%; border: 5px solid var(--gold); box-shadow: 0 8px 40px rgba(244,162,89,.35); object-fit: cover; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 18px 0 6px; background: linear-gradient(90deg, #ffe0a8, var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: 1px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 22px; font-size: 1.1rem; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; } .stat b { display: block; font-size: 2.1rem; color: var(--gold2); } .stat span { color: var(--muted); }
.doc-card { display: block; color: var(--text); } .doc-card:hover { text-decoration: none; border-color: var(--gold); transform: translateY(-2px); transition: .15s; }
.doc-card h3 { margin: 0 0 4px; color: var(--gold2); }
.session-guild { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; } .session-guild img { width: 38px; height: 38px; border-radius: 50%; }
.session-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(255,214,130,.15); }

/* Documentation */
.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: start; }
@media (max-width: 800px) { .doc-layout { grid-template-columns: 1fr; } }
.doc-nav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 4px; }
.doc-nav a { padding: 9px 14px; border-radius: 10px; color: var(--text); font-weight: 600; } .doc-nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.doc-nav a.active { background: rgba(232,193,90,.18); color: var(--gold2); }
.md h1 { margin-top: 0; font-size: 1.9rem; color: var(--gold2); } .md h2 { margin-top: 1.8em; font-size: 1.35rem; border-bottom: 1px solid rgba(255,214,130,.25); padding-bottom: 6px; } .md h3 { margin-top: 1.4em; }
.md ul, .md ol { padding-left: 1.4em; } .md li { margin: 4px 0; }
.md blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--gold); background: rgba(255,255,255,.05); border-radius: 0 10px 10px 0; color: var(--muted); }
.md code { background: rgba(255,255,255,.1); padding: 1px 6px; border-radius: 6px; } .md hr { border: 0; border-top: 1px solid rgba(255,214,130,.25); margin: 1.6em 0; }

/* Recherche / listes */
.searchbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
input[type=text], input[type=search], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: rgba(5,8,25,.7); border: 1px solid rgba(255,214,130,.3); border-radius: 10px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.searchbar input { flex: 1; min-width: 220px; }
select[multiple] { min-height: 160px; } textarea { min-height: 120px; resize: vertical; }
select option { background: #0d1433; color: var(--text); }
.results { display: grid; gap: 12px; }
.row-card { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.row-card h3 { margin: 0 0 4px; } .kv { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .92rem; } .kv b { color: var(--text); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.modal-back { position: fixed; inset: 0; background: rgba(2,4,14,.8); display: grid; place-items: center; z-index: 50; padding: 20px; overflow: auto; }
.modal { max-width: 920px; width: 100%; } .modal img { border-radius: 14px; display: block; width: 100%; background: #0d1433; }
.modal .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* Espace Developpement */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.tabs button { cursor: pointer; font: inherit; font-weight: 700; color: var(--text); background: rgba(255,255,255,.07); border: 1px solid transparent; border-radius: 10px; padding: 8px 16px; }
.tabs button.active { background: rgba(232,193,90,.2); border-color: var(--gold); color: var(--gold2); }
.form { display: grid; gap: 12px; } .field label { display: block; font-weight: 700; font-size: .88rem; color: var(--gold); margin-bottom: 4px; } .field .hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.cfg-table { width: 100%; border-collapse: collapse; } .cfg-table td { padding: 8px 6px; border-top: 1px solid rgba(255,214,130,.15); vertical-align: top; } .cfg-table td:first-child { color: var(--muted); width: 45%; }
.result { white-space: pre-wrap; border-radius: 10px; padding: 10px 14px; margin-top: 12px; } .result.ok { background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.4); } .result.err { background: rgba(255,92,80,.12); border: 1px solid rgba(255,92,80,.4); }
.toast { position: fixed; bottom: 22px; right: 22px; z-index: 60; background: #17235a; border: 1px solid var(--gold); padding: 12px 18px; border-radius: 12px; max-width: 360px; }
.notice { padding: 12px 16px; border-radius: 12px; background: rgba(255,92,80,.12); border: 1px solid rgba(255,92,80,.4); margin-bottom: 16px; }
footer.foot { text-align: center; color: var(--muted); padding: 30px 20px 40px; font-size: .88rem; } footer.foot a { color: var(--muted); text-decoration: underline; }

/* Icones personnalisees (remplacent les emojis unicode) : :book: :arrow: :trident: :diamond: */
.ico { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -0.32em; margin-right: .35em; background: center / contain no-repeat; filter: drop-shadow(0 0 5px rgba(139,107,255,.55)); }
.ico-book { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 32%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%231a1650%22/%3E%3Cstop offset=%221%22 stop-color=%22%23090c26%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%221.5%22 y=%221.5%22 width=%2229%22 height=%2229%22 rx=%228%22 fill=%22url(%23g)%22 stroke=%22%238b6bff%22 stroke-width=%221.6%22/%3E%3Crect x=%223.2%22 y=%223.2%22 width=%2225.6%22 height=%2225.6%22 rx=%226.5%22 fill=%22none%22 stroke=%22%23b9a6ff%22 stroke-opacity=%22.25%22 stroke-width=%221%22/%3E%3Crect x=%2210%22 y=%227.5%22 width=%2212%22 height=%2217%22 rx=%222.6%22 fill=%22none%22 stroke=%22%23fff%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M13.6 7.5v17%22 fill=%22none%22 stroke=%22%23fff%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E"); }
.ico-arrow { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 32%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%231a1650%22/%3E%3Cstop offset=%221%22 stop-color=%22%23090c26%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%221.5%22 y=%221.5%22 width=%2229%22 height=%2229%22 rx=%228%22 fill=%22url(%23g)%22 stroke=%22%238b6bff%22 stroke-width=%221.6%22/%3E%3Crect x=%223.2%22 y=%223.2%22 width=%2225.6%22 height=%2225.6%22 rx=%226.5%22 fill=%22none%22 stroke=%22%23b9a6ff%22 stroke-opacity=%22.25%22 stroke-width=%221%22/%3E%3Cpath d=%22M8.5 16h14M17 10.5 22.5 16 17 21.5%22 fill=%22none%22 stroke=%22%23fff%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E"); }
.ico-trident { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 32%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%231a1650%22/%3E%3Cstop offset=%221%22 stop-color=%22%23090c26%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%221.5%22 y=%221.5%22 width=%2229%22 height=%2229%22 rx=%228%22 fill=%22url(%23g)%22 stroke=%22%238b6bff%22 stroke-width=%221.6%22/%3E%3Crect x=%223.2%22 y=%223.2%22 width=%2225.6%22 height=%2225.6%22 rx=%226.5%22 fill=%22none%22 stroke=%22%23b9a6ff%22 stroke-opacity=%22.25%22 stroke-width=%221%22/%3E%3Cpath d=%22M16 7.5v17M9.5 10v4.5a6.5 6.5 0 0 0 13 0V10M12.8 24.5h6.4%22 fill=%22none%22 stroke=%22%23fff%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E"); }
.ico-diamond { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 32%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%231a1650%22/%3E%3Cstop offset=%221%22 stop-color=%22%23090c26%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%221.5%22 y=%221.5%22 width=%2229%22 height=%2229%22 rx=%228%22 fill=%22url(%23g)%22 stroke=%22%238b6bff%22 stroke-width=%221.6%22/%3E%3Crect x=%223.2%22 y=%223.2%22 width=%2225.6%22 height=%2225.6%22 rx=%226.5%22 fill=%22none%22 stroke=%22%23b9a6ff%22 stroke-opacity=%22.25%22 stroke-width=%221%22/%3E%3Cpath d=%22M16 7.5 23.5 16 16 24.5 8.5 16Z%22 fill=%22none%22 stroke=%22%23f2cf6b%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E"); }
.md li.arw { list-style: none; margin-left: -1.1em; }
.md li.arw::before { content: ''; display: inline-block; width: 1.15em; height: 1.15em; margin-right: .5em; vertical-align: -0.25em; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 32%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%231a1650%22/%3E%3Cstop offset=%221%22 stop-color=%22%23090c26%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%221.5%22 y=%221.5%22 width=%2229%22 height=%2229%22 rx=%228%22 fill=%22url(%23g)%22 stroke=%22%238b6bff%22 stroke-width=%221.6%22/%3E%3Crect x=%223.2%22 y=%223.2%22 width=%2225.6%22 height=%2225.6%22 rx=%226.5%22 fill=%22none%22 stroke=%22%23b9a6ff%22 stroke-opacity=%22.25%22 stroke-width=%221%22/%3E%3Cpath d=%22M8.5 16h14M17 10.5 22.5 16 17 21.5%22 fill=%22none%22 stroke=%22%23fff%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E"); filter: drop-shadow(0 0 4px rgba(139,107,255,.5)); }
.md h1 .ico, .md h2 .ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }

/* Icones supplementaires : :check: :cross: :warn: */
.ico-check { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 32%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%231a1650%22/%3E%3Cstop offset=%221%22 stop-color=%22%23090c26%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%221.5%22 y=%221.5%22 width=%2229%22 height=%2229%22 rx=%228%22 fill=%22url(%23g)%22 stroke=%22%238b6bff%22 stroke-width=%221.6%22/%3E%3Crect x=%223.2%22 y=%223.2%22 width=%2225.6%22 height=%2225.6%22 rx=%226.5%22 fill=%22none%22 stroke=%22%23b9a6ff%22 stroke-opacity=%22.25%22 stroke-width=%221%22/%3E%3Cpath d=%22M9.5 16.5 14 21l8.5-9.5%22 fill=%22none%22 stroke=%22%234ade80%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E"); }
.ico-cross { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 32%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%231a1650%22/%3E%3Cstop offset=%221%22 stop-color=%22%23090c26%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%221.5%22 y=%221.5%22 width=%2229%22 height=%2229%22 rx=%228%22 fill=%22url(%23g)%22 stroke=%22%238b6bff%22 stroke-width=%221.6%22/%3E%3Crect x=%223.2%22 y=%223.2%22 width=%2225.6%22 height=%2225.6%22 rx=%226.5%22 fill=%22none%22 stroke=%22%23b9a6ff%22 stroke-opacity=%22.25%22 stroke-width=%221%22/%3E%3Cpath d=%22M10.5 10.5l11 11M21.5 10.5l-11 11%22 fill=%22none%22 stroke=%22%23ff6b5e%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E"); }
.ico-warn { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 32%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%231a1650%22/%3E%3Cstop offset=%221%22 stop-color=%22%23090c26%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%221.5%22 y=%221.5%22 width=%2229%22 height=%2229%22 rx=%228%22 fill=%22url(%23g)%22 stroke=%22%238b6bff%22 stroke-width=%221.6%22/%3E%3Crect x=%223.2%22 y=%223.2%22 width=%2225.6%22 height=%2225.6%22 rx=%226.5%22 fill=%22none%22 stroke=%22%23b9a6ff%22 stroke-opacity=%22.25%22 stroke-width=%221%22/%3E%3Cpath d=%22M16 8.5 24.5 23h-17Z%22 fill=%22none%22 stroke=%22%23ffa94d%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M16 14v4.2%22 fill=%22none%22 stroke=%22%23ffa94d%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M16 20.6h.01%22 fill=%22none%22 stroke=%22%23ffa94d%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E"); }
.md li.nb { list-style: none; margin-left: -1.1em; }
.md h3 .ico { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.md p .ico { width: 1.15em; height: 1.15em; vertical-align: -0.25em; }

/* Page Lexique : titres des termes en dore */
.md.doc-lexique h3 { color: var(--gold2); }

/* Page Recrutement staff : titres en dore */
.md.doc-recrutement-staff h2 { color: var(--gold2); }

/* Pages reglements de metiers : titres en dore */
.md.doc-reglement-police h2,
.md.doc-reglement-pompiers h2,
.md.doc-reglement-medic h2,
.md.doc-reglement-hars h2 { color: var(--gold2); }

/* Selecteur de roles (pastilles) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; font-size: .85rem; background: rgba(232,193,90,.14); border: 1px solid rgba(232,193,90,.4); color: var(--text); }
.chip button { cursor: pointer; border: 0; width: 20px; height: 20px; border-radius: 50%; line-height: 1; font-size: 1rem; color: var(--text); background: rgba(255,255,255,.12); }
.chip button:hover { background: var(--danger); color: #fff; }
select:disabled { opacity: .6; cursor: not-allowed; }

/* Onglets en liens (Espace staff : Casiers / Aide) */
.tabs a { cursor: pointer; font: inherit; font-weight: 700; color: var(--text); background: rgba(255,255,255,.07); border: 1px solid transparent; border-radius: 10px; padding: 8px 16px; text-decoration: none; }
.tabs a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.tabs a.active { background: rgba(232,193,90,.2); border-color: var(--gold); color: var(--gold2); }
/* Aide du staff : sous-titres en dore */
.md.doc-aide h2 { color: var(--gold2); }

/* Journal : visuel des logs (titre, sections Details / Avant / Apres / Chronologie, pied de page) */
.logcard { padding: 18px 20px; }
.log-title { margin: 0 0 6px; font-size: 1.2rem; }
.log-sec { border-top: 1px solid rgba(255,255,255,.1); padding: 10px 0 4px; margin-top: 10px; }
.log-sec h4 { margin: 0 0 6px; font-size: 1rem; color: var(--text); }
.log-items { list-style: none; margin: 0; padding: 0; }
.log-items li { margin: 3px 0; padding-left: 14px; position: relative; color: var(--muted); }
.log-items li::before { content: '\2022'; position: absolute; left: 2px; color: var(--muted); }
.log-items li b { color: var(--text); font-weight: 700; }
.log-chip { font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace; font-size: .86rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 1px 7px; color: var(--text); word-break: break-word; }
.log-chip-channel { font-family: inherit; background: rgba(88,101,242,.28); border-color: rgba(88,101,242,.5); color: #c9d1ff; font-weight: 600; }
.log-code { margin: 0; padding: 10px 12px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace; font-size: .9rem; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.log-foot { margin-top: 12px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; color: var(--muted); }

/* Espace Police */
.pol-who { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pol-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.pol-suspect { margin-top: 8px; display: grid; gap: 4px; }
.danger-low { color: #4ade80; } .danger-mid { color: #fbbf24; } .danger-high { color: #fb923c; } .danger-max { color: #ff5c50; }
@media (max-width: 700px) { .row-card { grid-template-columns: 1fr; } .pol-actions { flex-direction: row; flex-wrap: wrap; } }
.pol-entry { border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }

/* Catalogue d'infractions */
.inf-list { margin-top: 8px; max-height: 250px; overflow: auto; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: rgba(0,0,0,.18); }
.inf-cat { position: sticky; top: 0; padding: 6px 12px; font-size: .74rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--gold2); background: #0d1433; border-bottom: 1px solid rgba(255,255,255,.08); }
.inf-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; text-align: left; cursor: pointer; font: inherit; color: var(--text); background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.inf-row:hover { background: rgba(232,193,90,.12); }
.inf-row.on { background: rgba(74,222,128,.12); color: var(--ok); }
.inf-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.inf-admin-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.sev { display: inline-block; font-size: .7rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }
.sev-contravention { background: rgba(74,222,128,.16); color: var(--ok); }
.sev-delit { background: rgba(251,191,36,.18); color: #fbbf24; }
.sev-crime { background: rgba(255,92,80,.2); color: var(--danger); }

/* ============================================================
   Police Nationale : thème institutionnel (bleu France / rouge Marianne), aplats, filets fins.
   Uniquement actif sur l'espace Police (body.pn) : le reste du site garde son apparence.
   ============================================================ */
body.pn {
  --bg: #0b1d44; --bg2: #07122e; --panel: #102a5e; --panel-b: #2a4a8f; --text: #ffffff; --muted: #b7c4e8;
  --gold: #ffffff; --gold2: #ffffff; --radius: 0; --ok: #6ee7a0; --danger: #ff7a70;
  background: #0b1d44; background-attachment: scroll;
  font-family: Arial, "Liberation Sans", Helvetica, sans-serif;
}
body.pn header.top, body.pn footer.foot { display: none; }
body.pn { min-height: 100vh; display: flex; flex-direction: column; }
body.pn a { color: #ffffff; }

/* Fond : guilloché discret + gyrophares bleus flous */
#pn-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#pn-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pn-gyro {
  position: absolute; width: 64vmax; height: 64vmax; border-radius: 50%; opacity: .12;
  background: radial-gradient(circle, rgba(0, 90, 255, 1) 0%, rgba(0, 80, 255, .6) 26%, rgba(0, 80, 255, 0) 62%);
  filter: blur(30px); will-change: opacity;
  animation: pn-flash 1.3s ease-in-out infinite;
}
/* Faisceau qui tourne, comme un vrai gyrophare */
.pn-gyro::after {
  content: ""; position: absolute; inset: 6%; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0, 85, 255, 0) 0deg, rgba(0, 85, 255, .95) 22deg, rgba(0, 85, 255, 0) 58deg, rgba(0, 85, 255, 0) 180deg, rgba(0, 85, 255, .95) 202deg, rgba(0, 85, 255, 0) 238deg);
  animation: pn-spin .85s linear infinite; will-change: transform;
}
.pn-gyro.l { left: -26vmax; top: -30vmax; }
.pn-gyro.r { right: -26vmax; top: -30vmax; animation-delay: .65s; }
.pn-gyro.r::after { animation-direction: reverse; }
.pn-gyro.bl { left: -26vmax; bottom: -30vmax; }
.pn-gyro.br { right: -26vmax; bottom: -30vmax; animation-delay: .65s; }
.pn-gyro.br::after { animation-direction: reverse; }
/* Double flash rapide puis courte pause, en alternance gauche / droite */
@keyframes pn-flash { 0% { opacity: .1; } 7% { opacity: .85; } 15% { opacity: .1; } 23% { opacity: .85; } 31% { opacity: .1; } 100% { opacity: .1; } }
@keyframes pn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pn-gyro, .pn-gyro::after { animation: none; } .pn-gyro { opacity: .4; } }

/* En-tête propre à la Police Nationale */
#pn-head { position: relative; z-index: 2; flex: none; background: rgba(7, 18, 46, .8); border-bottom: 1px solid #2a4a8f; }
#pn-head::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, #000091 33.3%, #ffffff 33.3% 66.6%, #e1000f 66.6%); }
.pn-head-in { max-width: none; margin: 0; padding: 22px 40px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pn-rf { display: flex; flex-direction: column; line-height: 1.15; }
.pn-rf b { font-size: 1.02rem; letter-spacing: .3px; }
.pn-rf em { font-size: .76rem; color: #b7c4e8; }
.pn-rf em:first-of-type { margin-top: 8px; }
.pn-flag { display: flex; width: 42px; height: 12px; margin-bottom: 8px; }
.pn-flag i { flex: 1; background: #000091; } .pn-flag i:nth-child(2) { background: #ffffff; } .pn-flag i:nth-child(3) { background: #e1000f; }
.pn-sep { width: 1px; align-self: stretch; background: #2a4a8f; }
.pn-logo { width: 76px; height: 76px; border-radius: 50%; border: 2px solid #ffffff; object-fit: cover; }
.pn-title h2 { margin: 0; font-size: 1.9rem; line-height: 1.1; }
.pn-title span { color: #b7c4e8; font-size: .95rem; }
.pn-bar { display: flex; margin-top: 8px; } .pn-bar i { height: 3px; width: 46px; background: #e1000f; } .pn-bar i + i { background: #ffffff; }
.pn-user { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 4px; font-size: .92rem; }
.pn-user span { color: #b7c4e8; } .pn-user a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
#pn-foot { position: relative; z-index: 1; flex: none; margin-top: auto; background: rgba(7, 18, 46, .72); color: #b7c4e8; font-size: .82rem; padding: 22px 40px; }
#pn-foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #000091 33.3%, #ffffff 33.3% 66.6%, #e1000f 66.6%); }

body.pn main { position: relative; z-index: 1; flex: 1 0 auto; width: 100%; max-width: 1480px; margin: 0 auto; padding: 22px 40px 40px; box-sizing: border-box; }
/* Écran d'identification : titre et panneau centrés dans la page */
body.pn main.pn-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
body.pn main.pn-center .card { width: min(520px, 100%); text-align: left; }
body.pn h1.page { font-size: 2.3rem; font-weight: 700; }
body.pn .sub { font-size: 1.02rem; }

/* Cartes, boutons, onglets, champs : aplats, angles droits */
body.pn .card { background: #102a5e; border: 1px solid #2a4a8f; border-left: 5px solid #ffffff; border-radius: 0; backdrop-filter: none; box-shadow: none; }
body.pn .btn { color: #0b1d44; background: #ffffff; border-radius: 0; box-shadow: none; }
body.pn .btn:hover { filter: none; background: #dfe7ff; }
body.pn .btn.alt { color: #ffffff; background: transparent; box-shadow: inset 0 0 0 1.5px #ffffff; }
body.pn .btn.alt:hover { background: rgba(255, 255, 255, .12); }
body.pn .btn.danger { color: #ffb3ab; background: transparent; box-shadow: inset 0 0 0 1.5px #ff7a70; }
body.pn .btn.danger:hover { background: rgba(255, 122, 112, .15); }
body.pn .btn.sm { border-radius: 0; }
body.pn .tabs { gap: 0; margin: 18px 0 22px; border-bottom: 1px solid #2a4a8f; background: #07122e; flex-wrap: wrap; }
body.pn .tabs a { color: #ffffff; font-weight: 400; background: transparent; border: 0; border-top: 3px solid transparent; border-radius: 0; padding: 14px 20px; }
body.pn .tabs a:hover { background: #12306a; }
body.pn .tabs a.active { background: #173373; border-top-color: #ffffff; font-weight: 700; color: #ffffff; }
body.pn input[type=text], body.pn input[type=search], body.pn input[type=number], body.pn input[type=datetime-local], body.pn select, body.pn textarea {
  background: rgba(255, 255, 255, .08); color: #ffffff; border: 0; border-bottom: 2px solid #ffffff; border-radius: 0;
}
body.pn input:focus, body.pn select:focus, body.pn textarea:focus { outline: 2px solid #ffffff; outline-offset: 1px; }
body.pn select option { background: #0b1d44; color: #ffffff; }
body.pn ::placeholder { color: #8fa0cf; }
body.pn .chip { border-radius: 0; background: #1d3f86; border: 0; color: #dfe7ff; }
body.pn .chip button { border-radius: 0; background: rgba(255, 255, 255, .14); }
body.pn .badge { border-radius: 0; }
body.pn .sev { border-radius: 0; }
body.pn .modal-back { background: rgba(3, 8, 24, .86); }
body.pn .modal { background: #0f2757; }
body.pn .modal img { border-radius: 0; }
body.pn .inf-list { border-radius: 0; border-color: #2a4a8f; background: rgba(0, 0, 0, .22); }
body.pn .inf-cat { background: #0b1d44; color: #ffffff; border-bottom-color: #2a4a8f; }
body.pn .inf-row:hover { background: rgba(255, 255, 255, .1); }
body.pn .inf-row.on { background: rgba(110, 231, 160, .14); color: #6ee7a0; }
body.pn .pol-entry { border-radius: 0; border-color: #2a4a8f; }
body.pn .result { border-radius: 0; }
body.pn .md blockquote, body.pn article blockquote { border-left: 4px solid #e1000f; background: rgba(255, 255, 255, .06); border-radius: 0; padding: 10px 16px; margin: 14px 0; }
body.pn .md h2, body.pn article h2 { margin-top: 30px; padding-bottom: 6px; border-bottom: 2px solid #e1000f; }
body.pn .md h3, body.pn article h3 { margin-top: 22px; color: #ffffff; }
body.pn .empty, body.pn .notice { border-radius: 0; }
@media (max-width: 700px) { .pn-user { margin-left: 0; text-align: left; } .pn-sep { display: none; } }

/* Tableaux dans les pages de documentation (markdown) */
.md .tbl, article .tbl { overflow-x: auto; margin: 14px 0; }
.md table, article table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.md th, .md td, article th, article td { text-align: left; padding: 9px 12px; border: 1px solid rgba(255, 255, 255, .16); vertical-align: top; }
.md th, article th { background: rgba(255, 255, 255, .08); font-weight: 700; }
.md tr:nth-child(even) td, article tr:nth-child(even) td { background: rgba(255, 255, 255, .03); }
/* Sélecteur de document (Police Nationale > Documentation) */
.pol-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.pol-pills a { padding: 9px 16px; text-decoration: none; border: 1px solid rgba(255, 255, 255, .35); font-weight: 600; font-size: .92rem; }
.pol-pills a:hover { background: rgba(255, 255, 255, .1); }
.pol-pills a.active { background: #ffffff; color: #0b1d44; border-color: #ffffff; }
.pol-actions select.sm { font-size: .85rem; padding: 7px 8px; }

/* Miniatures des véhicules (sélecteur) */
.veh-thumb { width: 72px; height: 42px; object-fit: contain; margin-right: 10px; flex: none; background: rgba(255, 255, 255, .06); }
.veh-thumb.big { width: 96px; height: 56px; margin: 0 8px 0 0; }
.veh-chip { display: inline-flex; align-items: center; }

/* Fenêtre de confirmation animée (suppressions, retraits...) */
.cfm-back { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(2, 4, 14, 0); backdrop-filter: blur(0); transition: background .2s ease, backdrop-filter .2s ease; }
.cfm-back.in { background: rgba(2, 4, 14, .72); backdrop-filter: blur(4px); }
.cfm-back.out { background: rgba(2, 4, 14, 0); backdrop-filter: blur(0); }
.cfm { width: 100%; max-width: 420px; text-align: center; padding: 28px 24px 22px; opacity: 0; transform: translateY(18px) scale(.92); transition: transform .3s cubic-bezier(.2, .9, .3, 1.25), opacity .2s ease; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.cfm-back.in .cfm { opacity: 1; transform: none; }
.cfm-back.out .cfm { opacity: 0; transform: translateY(10px) scale(.96); }
.cfm h3 { margin: 14px 0 6px; font-size: 20px; }
.cfm p { margin: 0 0 20px; color: var(--muted); line-height: 1.45; }
.cfm-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; position: relative; color: #8fb4ff; background: rgba(143, 180, 255, .14); }
.cfm-icon.danger { color: var(--danger); background: rgba(239, 65, 53, .16); }
.cfm-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.cfm-icon::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
.cfm-back.in .cfm-icon::after { animation: cfm-ring 1.1s ease-out .15s 2; }
.cfm-lid { transform-box: fill-box; transform-origin: 100% 100%; }
.cfm-back.in .cfm-lid { animation: cfm-lid .55s ease .25s both; }
.cfm-actions { display: flex; gap: 10px; justify-content: center; }
.cfm-actions .btn { min-width: 120px; }
@keyframes cfm-ring { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes cfm-lid { 0% { transform: rotate(0); } 45% { transform: rotate(-24deg) translateY(-1px); } 100% { transform: rotate(-14deg); } }
@media (prefers-reduced-motion: reduce) { .cfm-back, .cfm, .cfm-lid, .cfm-icon::after { transition: none !important; animation: none !important; } }

/* Menu de gauche (groupes pliables). Masqué dans l'Espace Police, qui a sa propre mise en page. */
:root { --hdr: 72px; --side-w: 250px; }
.menu-btn { display: none; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--text); cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
aside.side { position: fixed; left: 0; top: var(--hdr); bottom: 0; width: var(--side-w); overflow-y: auto; padding: 14px 12px 30px; background: rgba(7, 10, 28, .94); border-right: 1px solid rgba(255, 255, 255, .08); z-index: 15; }
body:not(.has-side) aside.side, body:not(.has-side) .menu-btn, body.pn:not(.pn-unlocked) aside.side, body.pn:not(.pn-unlocked) .side-back, body.pn .menu-btn { display: none !important; }
body.has-side:not(.pn) main { margin: 0 auto 0 var(--side-w); width: calc(100% - var(--side-w)); max-width: 1180px; }
body.has-side:not(.pn) footer.foot { margin-left: var(--side-w); }
.side-back { display: none; }
.sg { padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sg:last-child { border-bottom: 0; }
.sg-head { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border: 0; background: none; color: #6ea2ff; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; border-radius: 8px; text-align: left; }
.sg-head:hover { background: rgba(255, 255, 255, .05); }
.chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s ease; }
.sg.closed .chev { transform: rotate(-45deg); }
.sg-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease; }
.sg-items > div { overflow: hidden; min-height: 0; }
.sg.closed .sg-items { grid-template-rows: 0fr; }
.si { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 1px 0; border-radius: 8px; color: #c4ccec; font-size: .93rem; font-weight: 500; }
.si:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.si.active { background: #17224f; color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.si .ico { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px; }
.si .ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 900px) {
  body.has-side:not(.pn) .menu-btn { display: inline-grid; }
  aside.side { width: min(82vw, 290px); transform: translateX(-102%); transition: transform .25s ease; box-shadow: 8px 0 30px rgba(0, 0, 0, .45); }
  body.side-open aside.side { transform: none; }
  .side-back { display: block; position: fixed; inset: 0; z-index: 14; background: rgba(2, 4, 14, .6); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.side-open .side-back { opacity: 1; pointer-events: auto; }
  body.has-side:not(.pn) main { margin: 0 auto; width: 100%; }
  body.has-side:not(.pn) footer.foot { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { aside.side, .side-back, .sg-items, .chev { transition: none !important; } }

/* ============================================================
   Espace Police : même menu de gauche que le site (couleurs institutionnelles), en-tête compact, texte plus lisible
   ============================================================ */
#pn-head { position: sticky; top: 0; z-index: 20; }
body.pn-unlocked .pn-head-in { padding: 12px 28px; gap: 16px; }
body.pn-unlocked .pn-logo { width: 54px; height: 54px; }
body.pn-unlocked .pn-title h2 { font-size: 1.45rem; }
body.pn-unlocked .pn-title span { font-size: .88rem; }
body.pn-unlocked .pn-bar { margin-top: 5px; }
.pn-menu-btn { display: none; width: 40px; height: 40px; place-items: center; border: 1px solid #2a4a8f; background: #102a5e; color: #fff; cursor: pointer; }
.pn-menu-btn .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pn-menu-btn .ico { display: grid; place-items: center; }
body.pn aside.side { background: #07122e; border-right: 1px solid #2a4a8f; box-shadow: none; }
body.pn .sg { border-color: #2a4a8f; }
body.pn .sg-head { color: #9fc0ff; border-radius: 0; }
body.pn .sg-head:hover { background: rgba(255, 255, 255, .06); }
body.pn .si { color: #c9d4f0; border-radius: 0; }
body.pn .si:hover { background: rgba(255, 255, 255, .08); color: #fff; }
body.pn .si.active { background: #1a3a7a; color: #fff; box-shadow: inset 3px 0 0 #e1000f; }
body.pn .sg-back { margin-top: 10px; padding-top: 10px; border-top: 1px solid #2a4a8f; border-bottom: 0; }
body.pn-unlocked .pol-tabs { display: none; }
body.pn.pn-unlocked main { margin: 0 auto 0 var(--side-w); width: calc(100% - var(--side-w)); max-width: 1230px; padding: 26px 36px 44px; }
body.pn-unlocked #pn-foot { padding-left: calc(var(--side-w) + 40px); }
/* Lisibilité */
body.pn { font-size: 17px; line-height: 1.65; }
body.pn .btn.sm { padding: 9px 16px; font-size: .95rem; }
body.pn .row-card { padding: 20px 22px; gap: 18px; }
body.pn .row-card h3 { font-size: 1.15rem; margin: 0 0 8px; }
body.pn .kv b { color: #ffffff; }
@media (max-width: 900px) {
  body.pn-unlocked .pn-menu-btn { display: inline-grid; }
  body.pn.pn-unlocked main { margin: 0 auto; width: 100%; padding: 20px 16px 36px; }
  body.pn-unlocked #pn-foot { padding-left: 24px; }
  body.pn-unlocked .pn-head-in { padding: 10px 16px; }
}

/* ============================================================
   Barres de défilement personnalisées (toute la page, menus, fenêtres, tableaux)
   Couleurs pilotées par des variables : thème doré sur le site, bleu dans l'Espace Police.
   ============================================================ */
:root { --sb-a: #f2cf6b; --sb-b: #ff7a45; --sb-hover-a: #ffe39a; --sb-hover-b: #ff9468; --sb-track: rgba(7, 10, 28, .72); --sb-edge: rgba(255, 255, 255, .06); }
html.pn-root { --sb-a: #8fb4ff; --sb-b: #2a4fd0; --sb-hover-a: #c2d6ff; --sb-hover-b: #e1000f; --sb-track: #07122e; --sb-edge: rgba(143, 180, 255, .14); }
@supports selector(::-webkit-scrollbar) {
  *::-webkit-scrollbar { width: 14px; height: 14px; }
  *::-webkit-scrollbar-track { background: var(--sb-track); box-shadow: inset 0 0 0 1px var(--sb-edge); border-radius: 12px; }
  *::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--sb-a), var(--sb-b)); border: 3px solid transparent; background-clip: padding-box; border-radius: 12px; min-height: 44px; min-width: 44px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
  *::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--sb-hover-a), var(--sb-hover-b)); background-clip: padding-box; }
  *::-webkit-scrollbar-thumb:active { background: var(--sb-hover-b); background-clip: padding-box; }
  *::-webkit-scrollbar-corner { background: transparent; }
  aside.side::-webkit-scrollbar { width: 10px; }
}
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--sb-a) var(--sb-track); }
}

/* Filtres des rapports, compteurs de caractères, suggestions Roblox, statistiques de la Police Nationale */
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin: -6px 0 18px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.filters label.chk { flex-direction: row; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); padding-bottom: 8px; }
.filters select, .filters input[type=date] { padding: 8px 10px; min-width: 150px; border-radius: 10px; border: 1px solid var(--panel-b); background: rgba(255,255,255,.06); color: var(--text); font: inherit; color-scheme: dark; }
.cnt { text-align: right; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.cnt.warn { color: var(--gold2); } .cnt.full { color: var(--danger); font-weight: 700; }
.suggest { margin-top: 6px; } .suggest .chips { margin: 4px 0 0; }
.chip.sug { cursor: pointer; padding: 4px 12px; font: inherit; font-size: .85rem; color: var(--text); }
.chip.sug:hover { background: rgba(232,193,90,.3); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-b); }
.kpi .v { font-size: 1.9rem; font-weight: 800; color: var(--gold2); line-height: 1.1; } .kpi .l { color: var(--muted); font-size: .85rem; }
.stat-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
.brow { display: grid; grid-template-columns: minmax(110px, 240px) 1fr 40px auto; align-items: center; gap: 10px; padding: 4px 0; font-size: .92rem; }
.brow .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .bar { height: 12px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.brow .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--coral)); }
.brow b { text-align: right; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; }
.spark i { display: block; width: 5px; background: var(--gold); border-radius: 2px 2px 0 0; }
.chip.sev-contravention { background: rgba(74,222,128,.14); border-color: rgba(74,222,128,.5); padding: 2px 10px; }
.chip.sev-delit { background: rgba(255,170,60,.16); border-color: rgba(255,170,60,.55); padding: 2px 10px; }
.chip.sev-crime { background: rgba(255,92,80,.18); border-color: rgba(255,92,80,.6); padding: 2px 10px; }

/* ============================================================
   Accessibilité : focus clavier visible, texte secondaire, placeholders
   ============================================================ */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible, .chip:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold2); outline-offset: 3px; border-radius: 8px; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline-offset: 2px; }
body.pn a:focus-visible, body.pn button:focus-visible, body.pn summary:focus-visible, body.pn [tabindex]:focus-visible, body.pn .chip:focus-visible, body.pn select:focus-visible, body.pn input:focus-visible, body.pn textarea:focus-visible { outline-color: #ffffff; }
::placeholder { color: #96a3d2; opacity: 1; }
body.pn ::placeholder { color: #a9b8e0; }

/* ============================================================
   Mobile : fenêtres, formulaires, filtres, statistiques, notifications
   ============================================================ */
body { overflow-wrap: break-word; -webkit-text-size-adjust: 100%; }
.row-card > * { min-width: 0; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
/* Fenêtre plus haute que l'écran : le haut reste accessible (avant, il était coupé car centré) */
.modal-back { display: flex; align-items: flex-start; justify-content: center; }
.modal { margin: auto; }
.modal .head { flex-wrap: wrap; gap: 8px 12px; }
@media (max-width: 700px) {
  .bar { padding: 10px 14px; gap: 12px; }
  .modal-back { padding: 10px; }
  .card { padding: 14px; }
  body.pn .row-card { padding: 14px; gap: 12px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .filters { gap: 10px; }
  .filters label, .filters label.chk { flex: 1 1 100%; }
  .filters select, .filters input[type=date] { width: 100%; min-width: 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 12px; } .kpi .v { font-size: 1.5rem; }
  .brow, .brow.agent { grid-template-columns: 1fr 38px; row-gap: 4px; }
  .brow .lab { grid-column: 1 / -1; white-space: normal; overflow: visible; }
  .brow .bar { grid-column: 1; }
  .brow b { grid-column: 2; }
  .brow .spark, .brow .chip { grid-column: 1 / -1; justify-self: start; }
  .pol-actions .btn, .pol-actions button { flex: 1 1 auto; justify-content: center; }
  .suggest .chips { flex-wrap: wrap; }
}
/* Écrans tactiles : cibles plus grandes, et 16 px minimum dans les champs (sinon iOS zoome à la saisie) */
@media (pointer: coarse) {
  .btn, button.btn, a.btn { min-height: 44px; }
  .btn.sm { min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
  .chip.sug { min-height: 38px; }
  select, select.sm, input[type=text], input[type=search], input[type=number], input[type=date], textarea, .pol-actions select.sm { font-size: 16px; }
}

/* Agents concernés d'un rapport (formulaire) */
.agent-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.agent-row input { min-width: 0; }
@media (max-width: 700px) { .agent-row { grid-template-columns: 1fr 1fr; } .agent-row button { grid-column: 1 / -1; } }

/* ============================================================
   Espace IGPN
   ============================================================ */
.chip.st { font-weight: 700; }
.chip.st-nouvelle { background: rgba(0,85,164,.28); border-color: rgba(120,170,255,.7); }
.chip.st-examen { background: rgba(255,170,60,.18); border-color: rgba(255,170,60,.6); }
.chip.st-enquete { background: rgba(160,100,255,.22); border-color: rgba(190,140,255,.7); }
.chip.st-attente { background: rgba(255,215,90,.16); border-color: rgba(255,215,90,.6); }
.chip.st-classee { background: rgba(160,170,190,.18); border-color: rgba(160,170,190,.55); }
.chip.st-cloturee { background: rgba(74,222,128,.14); border-color: rgba(74,222,128,.5); }
.chip.prio-haute { background: rgba(255,170,60,.2); border-color: rgba(255,170,60,.65); }
.chip.prio-urgente { background: rgba(255,92,80,.25); border-color: rgba(255,92,80,.75); }
.chip.rst-brouillon { background: rgba(160,170,190,.18); border-color: rgba(160,170,190,.55); }
.chip.rst-transmis { background: rgba(0,85,164,.28); border-color: rgba(120,170,255,.7); }
.chip.rst-complement { background: rgba(255,170,60,.18); border-color: rgba(255,170,60,.6); }
.chip.rst-valide { background: rgba(74,222,128,.16); border-color: rgba(74,222,128,.55); }
.chip.rst-refuse { background: rgba(255,92,80,.2); border-color: rgba(255,92,80,.65); }
.chip.vr-todo { background: rgba(255,215,90,.16); border-color: rgba(255,215,90,.6); }
.chip.vr-verifie { background: rgba(74,222,128,.16); border-color: rgba(74,222,128,.55); }
.chip.vr-infirme { background: rgba(255,92,80,.2); border-color: rgba(255,92,80,.65); }
.kpi-link { text-align: left; cursor: pointer; color: inherit; font: inherit; width: 100%; }
.kpi-link:hover { border-color: var(--gold2); transform: translateY(-1px); }
.igpn-hit { text-decoration: none; color: inherit; display: block; }
.igpn-hit:hover { border-color: var(--gold2); }
.igpn-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.igpn-sec { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.igpn-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.igpn-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--panel-b); }
.igpn-item > div:first-child { flex: 1 1 320px; min-width: 0; }
.igpn-group { margin-top: 16px; }
.igpn-group h4 { margin: 0 0 2px; }
.igpn-k-fait h4 { color: #6ee7a0; } .igpn-k-declaration h4 { color: #9ec5ff; } .igpn-k-a_verifier h4 { color: #ffd75a; } .igpn-k-constatation h4 { color: #c9b0ff; }
.igpn-hist { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--panel-b); }
.igpn-decision { margin: 12px 0; }
.igpn-decide { padding: 12px; border: 1px solid var(--panel-b); border-radius: 12px; margin: 12px 0; }
.igpn-tabs { margin-top: 14px; }
.wk { display: flex; align-items: flex-end; gap: 8px; height: 90px; margin-top: 6px; }
.wk-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; font-size: .75rem; color: var(--muted); }
.wk-col i { display: block; width: 100%; background: linear-gradient(180deg, var(--gold2), var(--gold)); border-radius: 4px 4px 0 0; }
/* Éditeur de permissions (Accès au site) */
.igpn-entry { border: 1px solid var(--panel-b); border-radius: 14px; padding: 12px; margin-bottom: 12px; background: rgba(255,255,255,.03); }
.igpn-entry-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.igpn-perms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.igpn-pgroup h4 { margin: 0 0 6px; color: var(--gold2); font-size: .9rem; }
.igpn-perm { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; cursor: pointer; }
.igpn-perm input { margin-top: 4px; }
.igpn-perm small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
@media (max-width: 700px) { .igpn-hist { grid-template-columns: 1fr; gap: 2px; } }

/* ============================================================
   Chat IGPN
   ============================================================ */
.chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.chat-wrap { position: relative; }
.chat-msgs { height: clamp(320px, calc(100vh - 380px), 720px); overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: auto; outline: none; }
.chat-day { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; color: var(--muted); font-size: .78rem; text-transform: capitalize; }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--panel-b); }
.chat-msg { display: flex; gap: 12px; padding: 4px 6px; border-radius: 10px; position: relative; }
.chat-msg:hover { background: rgba(255,255,255,.04); }
.chat-msg.mine { background: rgba(232,193,90,.05); }
.chat-msg.cont { padding-top: 1px; padding-bottom: 1px; }
.chat-avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; position: relative; display: grid; place-items: center; color: #10132b; font-weight: 800; }
.chat-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-gap { flex: 0 0 40px; text-align: center; font-size: .68rem; color: transparent; padding-top: 4px; user-select: none; }
.chat-msg:hover .chat-gap { color: var(--muted); }
.chat-body { min-width: 0; flex: 1; }
.chat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.chat-name { color: var(--gold2); }
.chat-user { color: var(--muted); font-size: .82rem; }
.chat-time { color: var(--muted); font-size: .75rem; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.chat-deleted { color: var(--muted); font-style: italic; }
.chat-edited { color: var(--muted); font-size: .72rem; }
.chat-actions { position: absolute; right: 8px; top: -10px; display: none; gap: 4px; background: var(--bg2); border: 1px solid var(--panel-b); border-radius: 8px; padding: 2px; }
.chat-msg:hover .chat-actions, .chat-msg:focus-within .chat-actions { display: flex; }
.chat-act { background: none; border: 0; color: var(--text); font: inherit; font-size: .8rem; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.chat-act:hover { background: rgba(255,255,255,.1); }
.chat-act-del:hover { background: rgba(255,92,80,.3); }
.chat-edit textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.chat-edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.chat-more { align-self: center; margin-bottom: 6px; }
.chat-jump { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.chat-banner { background: rgba(255,170,60,.18); border-bottom: 1px solid rgba(255,170,60,.5); padding: 8px 14px; font-size: .88rem; }
.chat-compose { display: flex; gap: 10px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--panel-b); }
.chat-compose textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; box-sizing: border-box; }
.chat-out { padding: 0 16px 10px; }
.chat-out:empty { display: none; }
@media (max-width: 700px) {
  .chat-msgs { padding: 10px; height: clamp(300px, calc(100vh - 340px), 640px); }
  .chat-avatar, .chat-gap { flex-basis: 34px; width: 34px; height: 34px; }
  .chat-gap { height: auto; }
  .chat-actions { display: flex; position: static; background: none; border: 0; padding: 0; margin-top: 2px; }
  .chat-act { padding: 4px 8px 4px 0; color: var(--muted); }
  .chat-compose { padding: 10px; }
}

/* Chat IGPN : pièces jointes */
.chat.drag { outline: 2px dashed var(--gold2); outline-offset: -6px; }
.chat-pending { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 0; border-top: 1px solid var(--panel-b); }
.chat-pending:empty { display: none; }
.chat-pend { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 190px; max-width: 280px; padding: 8px 10px; border: 1px solid var(--panel-b); border-radius: 10px; background: rgba(255,255,255,.05); }
.chat-pend-name { font-weight: 600; overflow-wrap: anywhere; }
.chat-pend-error { border-color: rgba(255,92,80,.7); background: rgba(255,92,80,.12); }
.chat-pend-ready { border-color: rgba(74,222,128,.5); }
.chat-pend-bar { height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.chat-pend-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--coral)); }
.chat-pend .chat-act { align-self: flex-start; padding-left: 0; color: var(--muted); }
.chat-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chat-img { position: relative; padding: 0; border: 1px solid var(--panel-b); border-radius: 10px; background: rgba(255,255,255,.06); cursor: zoom-in; overflow: hidden; min-width: 120px; min-height: 80px; }
.chat-img-el { display: block; max-width: min(320px, 100%); max-height: 240px; width: auto; height: auto; }
.chat-img-el:not(.loaded) { width: 160px; height: 100px; }
.chat-img-el.failed { width: 160px; height: 60px; color: var(--muted); font-size: .8rem; }
.chat-img-pct { position: absolute; inset: auto 6px 6px auto; background: rgba(0,0,0,.65); color: #fff; font-size: .75rem; padding: 1px 6px; border-radius: 6px; }
.chat-img-pct:empty { display: none; }
.chat-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--panel-b); border-radius: 10px; background: rgba(255,255,255,.05); max-width: min(380px, 100%); }
.chat-file-ico { flex: 0 0 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), var(--coral)); color: #10132b; font-weight: 800; font-size: .72rem; }
.chat-file-info { min-width: 0; flex: 1; }
.chat-file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .chat-pending { padding: 8px 10px 0; } .chat-pend { min-width: 0; flex: 1 1 100%; max-width: none; } }

/* Espace Immobilier */
.immo { position: relative; min-height: 80vh; padding-bottom: 280px; }
.immo > *:not(.immo-bg) { position: relative; z-index: 1; }
.immo-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; border-radius: var(--radius); background: radial-gradient(900px 480px at 88% 0%, rgba(232,193,90,.14), transparent 62%), linear-gradient(180deg, rgba(7,10,28,0) 0%, rgba(17,26,71,.6) 100%); }
.immo-bg .sky { position: absolute; left: 0; bottom: 0; width: 100%; height: 300px; }
.immo-stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 12px; }
.immo-stat { flex: 1; min-width: 160px; background: var(--panel); border: 1px solid var(--panel-b); border-radius: var(--radius); padding: 14px 18px; }
.immo-stat b { display: block; font-size: 1.8rem; } .immo-stat b.ok, .immo-st.ok { color: #7ff0a8; } .immo-stat b.gd, .immo-st.gd { color: var(--gold2); }
.immo-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 4px 0 8px; }
.immo-bar .searchbar { flex: 1; min-width: 220px; margin: 0; }
.immo-bar select { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--panel-b); background: var(--bg2); color: var(--text); font: inherit; }
.immo-sec-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--panel-b); padding-bottom: 8px; margin: 26px 0 14px; }
.immo-sec-head h2 { margin: 0; font-size: 1.4rem; color: var(--gold2); }
.immo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.immo-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; background: rgba(13,20,51,.9); }
.immo-ph { height: 110px; position: relative; background: linear-gradient(135deg, #17235a, #0d1433 60%, #2a2f66); border-bottom: 1px solid rgba(255,214,130,.18); }
.immo-tag, .immo-st { position: absolute; top: 12px; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.immo-tag { left: 12px; background: rgba(7,10,28,.75); color: var(--text); }
.immo-st { right: 12px; background: rgba(255,255,255,.08); }
.immo-cb { padding: 16px; display: flex; flex-direction: column; gap: 8px; } .immo-cb h3, .immo-cb p { margin: 0; }
.immo-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.immo-ph.has { cursor: pointer; }
.immo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.immo-cnt { position: absolute; left: 12px; bottom: 10px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(7,10,28,.75); color: var(--text); }
.immo-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.immo-thumb { position: relative; width: 84px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--bg2); border: 1px solid var(--panel-b); }
.immo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.immo-thumb button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border: 0; border-radius: 50%; cursor: pointer; font-weight: 700; line-height: 1; color: #fff; background: rgba(198,40,40,.9); }
