/* Intranet Gendarmerie HM96 - feuille de style unique. Direction : service public, sobre, lisible. */
:root {
  --navy: #0b1f45; --navy-2: #13306b; --navy-3: #1d3f87; --ink: #17202e; --muted: #5d6778; --line: #dde2ea;
  --bg: #f3f5f8; --card: #fff; --soft: #eef1f6; --red: #b3202c; --red-bg: #fbe9ea; --green: #1f7a4d; --green-bg: #e6f4ec;
  --title: #0b1f45; --surface-2: #fafbfd; --amber: #9a6200; --amber-bg: #fdf3dd; --blue-bg: #e7eefb; --radius: 6px;
  --f-title: 'Oswald', 'Arial Narrow', sans-serif; --f-body: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--f-body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--navy-3); }
h1, h2, h3 { font-family: var(--f-title); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--title); margin: 0 0 .6em; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.tricolore { height: 4px; background: linear-gradient(90deg, #1d3f87 33.3%, #fff 33.3% 66.6%, #b3202c 66.6%); }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Boutons & formulaires */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--radius); font: 600 14px var(--f-body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #b9c2d0; background: var(--surface-2); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; } .btn.primary:hover { background: var(--navy-2); }
.btn.danger { color: var(--red); } .btn.danger:hover { background: var(--red-bg); border-color: #e7b9bd; }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--navy-3); outline-offset: 1px; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 4px; }
input, select, textarea { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #cbd2dd; border-radius: var(--radius); font: 15px var(--f-body);
  color: var(--ink); background: var(--card); }
textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--navy); }
.grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 460px; }
.search input { padding-left: 36px; }
.search svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; }

/* ---------- Cartes, tableaux, badges */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card > h2:first-child, .card > .row:first-child h2 { margin-bottom: 14px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 500 12px var(--f-title); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--navy); padding: 10px 12px; white-space: nowrap; }
td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7f9fc; }
tr.wanted td { background: #fdf4f4; } tr.wanted td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.sect td { background: var(--soft); font: 500 12px var(--f-title); letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--navy-2); white-space: nowrap; }
.badge.red { background: var(--red); color: #fff; letter-spacing: .05em; } .badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); } .badge.blue { background: var(--blue-bg); color: var(--navy-3); }
.badge.navy { background: var(--navy); color: #fff; font-family: var(--f-title); font-weight: 500; letter-spacing: .08em; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font: 500 26px var(--f-title); color: var(--title); }
.stat span { font-size: 13px; color: var(--muted); }
.stat.red { border-left: 3px solid var(--red); } .stat.sel { outline: 2px solid var(--navy-3); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }

/* ---------- Structure intranet (menu en haut) */
.shell { min-height: 100vh; }
.topnav { background: var(--navy); color: #d4dcec; position: sticky; top: 0; z-index: 30; }
.topnav .in { display: flex; align-items: center; gap: 14px; height: 62px; padding: 0 24px; max-width: 1500px; margin: auto; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; flex: none; }
.brand .logo { width: 40px; height: 40px; object-fit: contain; }
.brand b { font: 500 15px var(--f-title); letter-spacing: .1em; display: block; } .brand small { font-size: 12px; color: #9fb0cf; }
.mainnav { display: flex; align-items: center; gap: 2px; flex: 1; margin-left: 12px; }
.top-link { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border: 0; border-radius: 5px; background: none; color: #d4dcec;
  font: 600 14px var(--f-body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.top-link:hover, .dd.open > .top-link { background: rgba(255,255,255,.08); color: #fff; }
.top-link.on { background: #fff; color: var(--navy); }
.top-link .chev { width: 14px; height: 14px; margin-left: -2px; }
.dd { position: relative; }
.dd .menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 6px; z-index: 40; }
.dd.open .menu { display: block; }
.dd .menu a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 5px; color: var(--ink); text-decoration: none; font-size: 14px; }
.dd .menu a:hover { background: var(--soft); } .dd .menu a.on { background: var(--soft); color: var(--title); font-weight: 700; }
.dd .menu a svg { color: var(--navy-3); }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: none; color: #fff; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.who { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 8px; border-radius: 6px; }
.who:hover { background: rgba(255,255,255,.08); }
.who-t b { display: block; font-size: 14px; white-space: nowrap; } .who-t small { display: block; font-size: 12px; color: #9fb0cf; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; font: 500 13px var(--f-title); letter-spacing: .05em; flex: none; }
.content { padding: 26px 24px 90px; max-width: 1500px; margin: auto; }
.burger { display: none; }
/* Barre de bas de page, toujours visible */
.site-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px; text-align: center; font-size: 13px; color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; } .page-head p { margin: 4px 0 0; color: var(--muted); }
.burger { display: none; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: 600 14px var(--f-body); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--title); border-bottom-color: var(--title); }

/* ---------- Accueil intranet */
.hero { position: relative; min-height: 430px; border-radius: var(--radius); overflow: hidden; background: var(--navy) center/cover no-repeat; display: flex; align-items: flex-end; margin-bottom: 18px; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,20,46,.9) 0%, rgba(8,20,46,.25) 60%, rgba(8,20,46,.1)); }
.hero .in { position: relative; z-index: 1; padding: 30px 34px; color: #fff; width: 100%; }
.hero .motto { font: 400 clamp(22px, 3.2vw, 40px)/1.15 var(--f-title); letter-spacing: .16em; text-transform: uppercase; }
.hero .motto span { color: #aebbd6; margin: 0 .35em; }
.hero .sub { margin-top: 10px; color: #cdd6e8; font-size: 15px; }
.hero .edit { position: absolute; top: 14px; right: 14px; z-index: 2; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.quick a { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 600; }
.quick a:hover { border-color: var(--navy-3); }
.quick a svg { color: var(--navy-3); width: 22px; height: 22px; }

/* ---------- Site public */
.pub-top { background: var(--navy); color: #fff; }
.pub-top .in { max-width: 1180px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; flex-wrap: wrap; }
.pub-top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.pub-top nav a { color: #d4dcec; text-decoration: none; padding: 7px 12px; border-radius: 5px; font-size: 14px; font-weight: 600; }
.pub-top nav a:hover, .pub-top nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.pub-top nav a.login { background: #fff; color: var(--navy); }
.pub-main { max-width: 1180px; margin: auto; padding: 30px 20px 90px; }
.pub-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; padding: 20px 0 34px; }
.pub-hero h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; }
.pub-hero p { font-size: 17px; color: var(--muted); max-width: 540px; }
.pub-hero .emblem { justify-self: center; width: min(320px, 75%); } .pub-hero .emblem .logo { width: 100%; height: auto; display: block; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cards3 a.card { text-decoration: none; color: var(--ink); display: block; }
.cards3 a.card:hover { border-color: var(--navy-3); }
.cards3 .card svg { width: 26px; height: 26px; color: var(--navy-3); margin-bottom: 8px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 48px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 500 15px var(--f-title); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--soft); }
.gallery figcaption { padding: 10px 12px; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }

/* ---------- Accueil public */
body { overflow-x: clip; }
.bleed { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.pub-main:has(.ph-hero) { padding-top: 0; }
.ph-hero { position: relative; color: #fff; background:
  radial-gradient(900px 420px at 85% 30%, rgba(90,130,210,.28), transparent 70%),
  repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px),
  linear-gradient(160deg, #0b1f45 0%, #10295c 55%, #0b1f45 100%); padding: 56px 20px 0; }
.ph-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #1d3f87 33.3%, #fff 33.3% 66.6%, #b3202c 66.6%); }
.ph-in { max-width: 1180px; margin: auto; display: grid; grid-template-columns: 1.25fr .75fr; gap: 40px; align-items: center; }
.kicker { font: 500 13px var(--f-title); letter-spacing: .2em; text-transform: uppercase; color: #9fb4de; margin-bottom: 14px; }
.ph-txt h1 { color: #fff; font-size: clamp(32px, 4.6vw, 54px); line-height: 1.05; margin-bottom: 14px; }
.motto-l { font: 400 14px var(--f-title); letter-spacing: .24em; text-transform: uppercase; color: #d9e2f5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.motto-l i { width: 5px; height: 5px; background: #b3202c; transform: rotate(45deg); }
.ph-txt p { color: #c9d4ea; font-size: 17px; max-width: 560px; margin: 0 0 24px; }
.ph-logo { justify-self: center; position: relative; width: min(340px, 80%); }
.ph-logo::before { content: ''; position: absolute; inset: -18px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 0 0 18px rgba(255,255,255,.04), 0 30px 80px rgba(0,0,0,.35); }
.ph-logo .logo { width: 100%; height: auto; display: block; position: relative; }
.btn.light { background: #fff; color: var(--navy); border-color: #fff; height: 42px; } .btn.light:hover { background: #e9eefb; }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); height: 42px; } .btn.outline-light:hover { background: rgba(255,255,255,.1); }
.ph-links { max-width: 1180px; margin: 48px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: 10px 10px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.15); position: relative; top: 1px; }
.ph-links a { display: flex; gap: 12px; align-items: center; padding: 20px 22px; color: var(--ink); text-decoration: none; border-left: 1px solid var(--line); }
.ph-links a:first-child { border-left: 0; } .ph-links a:hover { background: var(--soft); }
.ph-links svg { width: 26px; height: 26px; color: var(--navy-3); } .ph-links b { display: block; font-size: 15px; } .ph-links small { color: var(--muted); font-size: 13px; }
.ph-hero + .ph-sec { margin-top: 44px; }
.ph-slides { position: absolute; inset: 0; overflow: hidden; }
.ph-slides .sl { position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transform: scale(1.06); transition: opacity 1.4s ease, transform 7s ease-out; }
.ph-slides .sl.ok.on { opacity: 1; transform: scale(1); }
.ph-slides.ready::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,20,46,.92) 0%, rgba(8,20,46,.7) 45%, rgba(8,20,46,.45) 100%), linear-gradient(0deg, rgba(8,20,46,.6), transparent 40%); }
.ph-in, .ph-links { position: relative; z-index: 1; }
details.regs { margin-top: 10px; } details.regs summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--navy-3); display: inline-flex; align-items: center; gap: 6px; list-style: none; }
details.regs summary::-webkit-details-marker { display: none; } details.regs .reg-list { margin-top: 8px; }
.ph-sec { margin-bottom: 48px; }
.sec-t { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.sec-t span { font: 500 14px var(--f-title); color: var(--red); letter-spacing: .1em; } .sec-t h2 { margin: 0; font-size: 22px; flex: 1; }
.missions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mission { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px 20px; border-top: 3px solid var(--navy); }
.mission svg { width: 30px; height: 30px; color: var(--navy-3); margin-bottom: 10px; } .mission h3 { margin-bottom: 6px; } .mission p { margin: 0; color: var(--muted); font-size: 14px; }
.units { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.unit { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.unit:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(11,31,69,.12); }
.unit-img { aspect-ratio: 16/8; background: linear-gradient(150deg, #0b1f45, #1d3f87) center/cover no-repeat; display: grid; place-items: center; }
.unit-img b { color: #fff; font: 500 34px var(--f-title); letter-spacing: .14em; }
.unit-b { padding: 14px 16px 18px; } .unit-b h3 { margin: 8px 0 6px; font-size: 14px; } .unit-b p { margin: 0; font-size: 14px; color: var(--muted); }
.join-band { background: linear-gradient(120deg, #0b1f45, #1d3f87); color: #fff; padding: 40px max(20px, calc(50vw - 570px)); display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: -60px; }
.join-band h2 { color: #fff; margin-bottom: 6px; } .join-band p { margin: 0; color: #c9d4ea; max-width: 620px; }

/* ---------- Connexion */
.login-wrap { min-height: calc(100vh - 40px); display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side .motto { font: 400 28px/1.3 var(--f-title); letter-spacing: .14em; text-transform: uppercase; }
.login-form { display: grid; place-items: center; padding: 30px; }
.login-form form { width: min(380px, 100%); }
.alert { padding: 10px 12px; border-radius: var(--radius); font-size: 14px; margin-bottom: 12px; background: var(--red-bg); color: var(--red); }
.alert.info { background: var(--blue-bg); color: var(--navy-2); } .alert.ok { background: var(--green-bg); color: var(--green); }

/* ---------- Modale & notifications */
.modal-bg { position: fixed; inset: 0; background: rgba(10,20,40,.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: var(--card); border-radius: 8px; width: min(720px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { width: min(1080px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0; }
.modal-b { padding: 18px 20px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 8px 8px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 56px; right: 18px; z-index: 80; display: grid; gap: 8px; }
.toast { background: #17202e; color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 380px; }
.toast.err { background: var(--red); }

/* ---------- Sélecteur d'infractions / calcul */
.picker { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.picker .list { max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.picker .it { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.picker .it:first-child { border-top: 0; } .picker .it:hover { background: #f5f7fb; }
.picker .it.on { background: var(--blue-bg); }
.calc { background: var(--soft); border-radius: var(--radius); padding: 14px; }
.calc .sel { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed #cfd6e1; }
.calc .sel input { width: 56px; height: 30px; }
.calc .tot { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 12px; font-size: 14px; }
.calc .tot b { text-align: right; } .calc .big { font: 500 22px var(--f-title); color: var(--title); }

/* ---------- Notation MIP */
.crit { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 14px; background: var(--soft); border-radius: var(--radius); margin-bottom: 8px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; flex: none; }
.seg button { border: 0; background: var(--card); padding: 5px 10px; font: 600 12px var(--f-body); color: var(--muted); cursor: pointer; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button { display: inline-flex; align-items: center; gap: 6px; } .seg button.on:not([data-v]) { background: var(--navy); color: #fff; }
.page-head .seg button { padding: 8px 12px; font-size: 13px; }
.seg button.on[data-v=acquis] { background: var(--green); color: #fff; } .seg button.on[data-v=non_acquis] { background: var(--red); color: #fff; }
.seg button.on[data-v=en_cours] { background: #c98a12; color: #fff; } .seg button.on[data-v=non_evalue] { background: #7b8494; color: #fff; }

/* ---------- Fiche / historique / camembert */
.content .avatar { background: var(--navy); color: #fff; }
.scroll-box { max-height: 380px; overflow-y: auto; padding: 4px 10px 0 6px; margin-right: -6px; }
.scroll-box::-webkit-scrollbar { width: 8px; } .scroll-box::-webkit-scrollbar-thumb { background-color: #9fb0cf; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 14px; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--navy-3); }
.timeline time { display: block; font-size: 12px; color: var(--muted); }
.pie { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.legend { display: grid; gap: 6px; font-size: 14px; } .legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }

/* ---------- PV (modèle du groupement, format A4) */
.fact-list .xs-items { max-height: 320px; } .fact-list { width: min(620px, 92vw); }
.xs-it.fact { display: flex; justify-content: space-between; gap: 12px; align-items: center; } .xs-it.fact small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; } .xs-it.fact b { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pv-scroll { overflow-x: auto; background: #e9ecf1; padding: 16px; border-radius: 6px; }
.pv2 { width: 794px; min-height: 1123px; margin: auto; background: #fff; color: #000; padding: 34px 40px 40px; font: 12.5px/1.35 Arial, Helvetica, sans-serif; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.pv2 * { color: #000; }
.pv-top { display: grid; grid-template-columns: 290px 1fr 72px; gap: 12px; align-items: center; }
.pv-org { border: 1px solid #000; }
.pv-org-h { background: #e6e6e6; text-align: center; font-weight: 700; padding: 14px 6px; border-bottom: 1px solid #000; }
.pv-org-b { padding: 12px 6px 6px; display: grid; gap: 12px; }
.pv-mid { display: grid; gap: 14px; font-size: 12.5px; padding-top: 32px; }
.pv-seal { width: 72px; height: 72px; align-self: start; }
.pv-ids-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -1px; }
table.pv-ids { border-collapse: collapse; width: auto; font-size: 11.5px; }
table.pv-ids th { background: none; color: #000; font: italic 9px Arial, sans-serif; letter-spacing: 0; text-transform: none; padding: 2px 8px 0; border: 1px solid #000; border-bottom: 0; text-align: center; }
table.pv-ids td { border: 1px solid #000; border-top: 0; padding: 0 8px 2px; text-align: center; font-weight: 700; min-width: 44px; }
table.pv-ids th.wide { min-width: 70px; }
.pv-ids-row > table:first-child { width: 290px; } .pv-ids-row > table:first-child td:last-child { min-width: 70px; }
.pv-intro { margin: 2px 0 12px; }
table.pv-box { border-collapse: collapse; width: 100%; font-size: 12.5px; margin-bottom: 20px; }
table.pv-box th { background: #e6e6e6; color: #000; font: 12px Arial, sans-serif; text-transform: none; letter-spacing: 0; text-align: center; border: 1px solid #000; padding: 6px; }
table.pv-box th.nat { width: 82px; text-align: left; }
table.pv-box td { border: 1px solid #000; padding: 8px 6px; height: 64px; vertical-align: top; }
.pv-sec { border-top: 1px solid #999; border-bottom: 1px solid #999; text-align: center; font-weight: 700; padding: 6px; margin: 10px 0 8px; }
.pv-g { display: grid; gap: 8px; margin-bottom: 4px; }
.pv-g.g3 { grid-template-columns: 90px 1fr 1fr; } .pv-g.g3b { grid-template-columns: 1fr 1.3fr 1fr; } .pv-g.g2 { grid-template-columns: 1fr 1fr; } .pv-g.g4 { grid-template-columns: 2fr .8fr 1.2fr; }
.pv-g.parents { grid-template-columns: 1fr; gap: 0; margin-top: -2px; } .pv-g.parents > div { display: grid; grid-template-columns: 34px 1fr; }
.pv-g.sep { border-top: 1px solid #999; padding-top: 4px; margin-top: 6px; }
.pv-g .lb { display: block; font: italic 9px Arial, sans-serif; }
.pv-g.parents .lb { display: inline; }
.pv-txt { margin: 6px 0; }
.pv-hear { border-top: 1px solid #999; padding-top: 10px; margin-top: 12px; }
.pv-decl { white-space: pre-wrap; min-height: 90px; padding: 6px 0 16px; }
.pv-sig { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; font-weight: 700; }
.pv-sig .hand { display: block; font: 600 26px 'Caveat', cursive; margin-top: 18px; }
.pv-end { margin-top: 28px; } .pv-end i { display: block; margin: 0 0 2px 12px; font-size: 11px; }

/* ---------- PV imprimable */
.pv { font: 14px/1.45 'Times New Roman', serif; color: #000; background: #fff; padding: 28px 34px; border: 1px solid var(--line); }
.pv h4 { text-align: center; font: bold 15px 'Times New Roman', serif; margin: 14px 0 6px; text-transform: uppercase; }
.pv table { font-size: 13px; } .pv th { background: #eee; color: #000; font: bold 11px Arial, sans-serif; letter-spacing: 0; }
.pv td { border: 1px solid #999; }
.pv .hd { display: flex; justify-content: space-between; font-weight: bold; }
.pv .decl { min-height: 120px; white-space: pre-wrap; border: 1px solid #999; padding: 10px; }
.pv .sig { display: flex; justify-content: space-between; margin-top: 26px; }

/* ---------- Composants maison */
.x-native { position: absolute !important; opacity: 0 !important; pointer-events: none !important; width: 1px !important; height: 1px !important; }
.xs-btn, .xd-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 10px; border: 1px solid #cbd2dd; border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: 15px var(--f-body); text-align: left; cursor: pointer; }
.xs-btn span, .xd-btn span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-btn .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.xs-btn.open .chev { transform: rotate(180deg); }
.xs-btn:hover, .xd-btn:hover { border-color: #9aa6b8; } .xs-btn.open, .xd-btn.open { border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(29,63,135,.15); }
.xd-btn svg { color: var(--navy-3); } .xd-btn .ph { color: var(--muted); }
.pop { position: fixed; z-index: 90; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 34px rgba(10,20,40,.22);
  opacity: 0; transform: translateY(-4px); transition: opacity .12s, transform .12s; max-width: calc(100vw - 12px); }
.pop.in { opacity: 1; transform: none; }
.xs-list { padding: 6px; } .xs-items { max-height: 260px; overflow-y: auto; }
.xs-q { position: relative; margin-bottom: 6px; } .xs-q svg { position: absolute; left: 9px; top: 9px; color: var(--muted); width: 16px; } .xs-q input { height: 34px; padding-left: 32px; font-size: 14px; }
.xs-it { padding: 7px 10px; border-radius: 5px; cursor: pointer; font-size: 14px; } .xs-it:hover { background: var(--soft); }
.xs-it.on { background: var(--blue-bg); color: var(--title); font-weight: 700; } .xs-empty { padding: 10px; color: var(--muted); font-size: 14px; }
.cal { padding: 10px; width: 290px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-h button { border: 0; background: none; color: var(--ink); width: 32px; height: 32px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.cal-h button:hover { background: var(--soft); }
.cal-h .cal-t { width: auto; padding: 0 10px; font: 500 15px var(--f-title); letter-spacing: .06em; text-transform: uppercase; color: var(--title); }
.flip { transform: rotate(180deg); }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-g span { font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.cal-g button { position: relative; height: 34px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 14px var(--f-body); cursor: pointer; }
.cal-g button:hover { background: var(--soft); } .cal-g button.out { color: var(--muted); opacity: .55; }
.cal-g button.today { box-shadow: inset 0 0 0 1px var(--navy-3); font-weight: 700; }
.cal-g button.sel { background: var(--navy); color: #fff; font-weight: 700; }
.cal-g button i { position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--red); }
.cal-f { display: flex; justify-content: space-between; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.cal-f button { border: 0; background: none; color: var(--navy-3); font: 600 13px var(--f-body); cursor: pointer; padding: 4px 6px; border-radius: 4px; } .cal-f button:hover { background: var(--soft); }
.cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cal-months button { height: 40px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); cursor: pointer; font: 600 14px var(--f-body); }
.cal-months button:hover { background: var(--soft); } .cal-months button.sel { background: var(--navy); color: #fff; border-color: var(--navy); }
.tp { display: flex; gap: 8px; padding: 10px; }
.tp-c b { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 4px; }
.tp-c > div { height: 224px; overflow-y: auto; display: grid; gap: 2px; padding-right: 4px; }
.tp-c button { width: 56px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 14px var(--f-body); cursor: pointer; }
.tp-c button:hover { background: var(--soft); } .tp-c button.sel { background: var(--navy); color: #fff; font-weight: 700; }
.dtp { display: grid; grid-template-columns: auto auto; } .dtp .tp { border-left: 1px solid var(--line); }
.dtp-f { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }
.xf { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px dashed #b6c0cf; border-radius: var(--radius); background: var(--surface-2); flex-wrap: wrap; }
.xf.drag { border-color: var(--navy-3); background: var(--blue-bg); }
.xf-n { font-size: 13px; color: var(--muted); flex: 1; min-width: 160px; overflow-wrap: anywhere; }
input[type=checkbox], input[type=radio] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid #9aa6b8; background: var(--card);
  display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: background .12s, border-color .12s; }
input[type=checkbox] { border-radius: 4px; } input[type=radio] { border-radius: 50%; }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--navy); border-color: var(--navy); }
input[type=checkbox]:checked::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
input[type=radio]:checked::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } input[type=number] { -moz-appearance: textfield; }
* { scrollbar-width: thin; scrollbar-color: #aab4c4 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #b3bccb; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-thumb:hover { background-color: #8e99ab; }

/* ---------- Signature */
.sigpad { position: relative; border: 1px dashed #9aa6b8; border-radius: var(--radius); background: #fff; max-width: 560px; touch-action: none; }
.sigpad canvas { display: block; width: 100%; height: auto; aspect-ratio: 560/180; cursor: crosshair; }
.sigpad .sig-ph { position: absolute; left: 14px; bottom: 10px; font-size: 13px; color: #9aa6b8; pointer-events: none; }
.sigpad::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 34px; border-bottom: 1px solid #d5dbe5; pointer-events: none; }
.sig-prev { max-height: 90px; max-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.sig-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } @media (max-width: 900px) { .sig-blocks { grid-template-columns: 1fr; } }
img.avatar { object-fit: cover; background: #0a0a0a; padding: 0; border-radius: 8px; }
.pv-sig .sig-blank { display: block; height: 70px; }
.pv-sig img.sig-img { display: block; max-height: 70px; max-width: 240px; margin-top: 10px; }

/* ---------- Planning */
.planning { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.planning .ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.planning .ph h2 { margin: 0; }
.pg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pg .dh { padding: 8px; font: 500 12px var(--f-title); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--navy); text-align: center; }
.pg .dc { min-height: 108px; border-right: 1px solid var(--line); border-top: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.pg .dc:nth-child(7n+7) { border-right: 0; } .pg .dc:hover { background: var(--surface-2); }
.pg .dc.out { background: var(--soft); } .pg .dc.out .dn { opacity: .5; }
.pg .dn { font-size: 13px; font-weight: 700; color: var(--muted); align-self: flex-end; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.pg .dc.today .dn { background: var(--navy); color: #fff; }
.pg .ev { font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 4px; background: var(--blue-bg); color: var(--title); border-left: 3px solid var(--navy-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.pg .ev.cont { opacity: .8; border-left-style: dashed; }
.pg .ev.mine { border-left-color: var(--green); background: var(--green-bg); }
.pg .ev:hover { filter: brightness(.96); }
.reg-list { display: flex; flex-wrap: wrap; gap: 6px; }
.meter { height: 6px; border-radius: 6px; background: var(--soft); overflow: hidden; margin-top: 6px; } .meter i { display: block; height: 100%; background: var(--navy-3); }

/* ---------- Notifications */
.bell { position: relative; }
.bell .cnt { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/18px var(--f-body); text-align: center; }
.notif { position: absolute; top: calc(100% + 8px); right: 0; width: min(380px, calc(100vw - 20px)); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0,0,0,.22); z-index: 60; overflow: hidden; }
.notif-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-h h3 { margin: 0; }
.notif-l { max-height: 420px; overflow-y: auto; }
.notif-i { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif-i:hover { background: var(--surface-2); } .notif-i.unread { background: var(--blue-bg); }
.notif-i .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--navy-3); margin-top: 6px; flex: none; visibility: hidden; } .notif-i.unread .dot { visibility: visible; }
.notif-i .tx { flex: 1; min-width: 0; font-size: 14px; } .notif-i .tx b { display: block; } .notif-i .tx span { color: var(--muted); font-size: 13px; } .notif-i .tx time { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-i .del { border: 0; background: none; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: 5px; flex: none; } .notif-i .del:hover { background: var(--red-bg); color: var(--red); }

/* ---------- Dispatch intégré */
.sheet-wrap { position: relative; height: calc(100vh - 62px - 40px - 150px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.sheet-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.sheet-wrap.full { position: fixed; inset: 0; height: auto; z-index: 100; border-radius: 0; border: 0; }
.sheet-exit { display: none; position: absolute; top: 10px; right: 10px; z-index: 2; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.sheet-wrap.full .sheet-exit, .sheet-wrap:fullscreen .sheet-exit { display: inline-flex; }
.sheet-wrap:fullscreen { border: 0; border-radius: 0; }
/* Page Dispatch : la page ne défile pas, seul le tableau défile */
html[data-route=dispatch], html[data-route=dispatch] body, html.sheet-full, html.sheet-full body { overflow: hidden; overscroll-behavior: none; }
html[data-route=dispatch] #page { height: calc(100vh - 62px - 40px); display: flex; flex-direction: column; padding-bottom: 10px; }
html[data-route=dispatch] #page .sheet-wrap { flex: 1; height: auto; min-height: 0; overscroll-behavior: contain; }

/* ---------- Mode sombre (intranet) */
[data-theme=dark] { --ink: #e4e9f2; --muted: #9ba7ba; --line: #2a3446; --bg: #0e131b; --card: #161d29; --soft: #1e2736; --surface-2: #1a2230;
  --title: #d9e3f5; --red-bg: #3a1c21; --green-bg: #173326; --amber-bg: #3a2c12; --blue-bg: #1c2a44; color-scheme: dark; }
[data-theme=dark] body { background: var(--bg); }
[data-theme=dark] .content a:not(.btn):not(.stat), [data-theme=dark] .site-foot a { color: #8fb0ee; }
[data-theme=dark] input, [data-theme=dark] select, [data-theme=dark] textarea, [data-theme=dark] .xs-btn, [data-theme=dark] .xd-btn { border-color: #3a4558; }
[data-theme=dark] .xf { border-color: #3a4558; } [data-theme=dark] .pg .dh { background: #0b1630; }
[data-theme=dark] * { scrollbar-color: #3b475c transparent; } [data-theme=dark] ::-webkit-scrollbar-thumb { background-color: #3b475c; }
[data-theme=dark] .btn:hover { border-color: #4a5670; }
[data-theme=dark] .btn.primary { background: #2c4f99; border-color: #2c4f99; } [data-theme=dark] .btn.primary:hover { background: #3560b5; }
[data-theme=dark] th { background: #0b1630; }
[data-theme=dark] tr.click:hover td { background: #1c2533; }
[data-theme=dark] tr.wanted td { background: #2a1519; }
[data-theme=dark] .badge { color: #bccbe8; } [data-theme=dark] .badge.navy { background: #2c4f99; color: #fff; }
[data-theme=dark] .badge.green { color: #7fd1a6; } [data-theme=dark] .badge.amber { color: #f0c46b; } [data-theme=dark] .badge.blue { color: #9dbcf5; }
[data-theme=dark] .alert { color: #f2a7ae; } [data-theme=dark] .alert.info { color: #a9c2f0; } [data-theme=dark] .alert.ok { color: #86d6ab; }
[data-theme=dark] .sect td { color: var(--title); }
[data-theme=dark] .seg button { color: var(--muted); }
[data-theme=dark] .timeline li::before { background: var(--card); }
[data-theme=dark] .picker .it:hover { background: var(--soft); }
[data-theme=dark] .calc .sel { border-color: #34405a; }
[data-theme=dark] .modal { box-shadow: 0 20px 50px rgba(0,0,0,.6); }
[data-theme=dark] .pv, [data-theme=dark] .pv * { color: #000; }

@media print {
  body { background: #fff; }
  .topnav, .site-foot, .modal-h, .modal-f, .no-print, .toasts { display: none !important; }
  .modal-bg { position: static; background: none; padding: 0; } .modal { box-shadow: none; width: 100%; }
  .pv { border: 0; padding: 0; }
}
@media (max-width: 1100px) { .missions, .units { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1480px) { .who-t { display: none; } .top-link { padding: 0 10px; } }
@media (max-width: 900px) {
  .topnav .in { padding: 0 16px; flex-wrap: wrap; height: auto; min-height: 62px; }
  .burger { display: inline-grid; order: 2; margin-left: auto; }
  .tools { order: 3; margin-left: 0; } .who-t { display: none; }
  .mainnav { display: none; order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; margin: 0 0 10px; }
  .mainnav.open { display: flex; }
  .dd .menu { position: static; box-shadow: none; margin: 4px 0 6px 18px; }
  .content { padding-left: 16px; padding-right: 16px; }
  .pg .dc { min-height: 64px; padding: 3px; } .pg .ev { font-size: 10px; padding: 2px 3px; } .pg .dh { font-size: 10px; padding: 6px 2px; }
  .sheet-wrap { height: 70vh; }
  .picker, .grid.two, .pub-hero, .login-wrap, .ph-in { grid-template-columns: 1fr; }
  .ph-logo { width: 200px; order: -1; } .ph-links { grid-template-columns: 1fr 1fr; } .ph-links a:nth-child(3) { border-left: 0; } .ph-links a { border-top: 1px solid var(--line); }
  .missions, .units { grid-template-columns: 1fr; } .ph-hero { padding-top: 32px; }
  article.card[style*="grid-template-columns"] { grid-template-columns: 1fr !important; } article.card[style*="grid-template-columns"] > img { max-height: 200px; }
  .login-side { padding: 28px; }
  .kv { grid-template-columns: 1fr; }
}
