/* ============================================================
   IPN — Iprc Phone Notification. Système de design repris de la solution
   « Arrêté GAB » (interface Standard), thème IPRC uniquement.
   ============================================================ */
:root {
  --brand: #3e8748;
  --brand-d: #2f6b38;
  --bg: oklch(0.985 0.003 250);
  --surface: #ffffff;
  --ink: oklch(0.27 0.02 255);
  --muted: oklch(0.52 0.02 255);
  --line: oklch(0.92 0.004 255);
  --line-strong: oklch(0.86 0.006 255);
  --head-bg: oklch(0.25 0.04 150);
  --head-ink: oklch(0.95 0.01 255);

  --ok: oklch(0.40 0.12 150);     --ok-bg: oklch(0.95 0.04 150);
  --warn: oklch(0.45 0.10 80);    --warn-bg: oklch(0.96 0.05 85);
  --bad: oklch(0.45 0.17 25);     --bad-bg: oklch(0.96 0.04 25);
  --info: oklch(0.45 0.13 250);   --info-bg: oklch(0.96 0.04 250);

  /* surfaces secondaires (variabilisées pour le système de thèmes) */
  --thead-bg: oklch(0.975 0.003 255);
  --row-alt: oklch(0.99 0.002 255);
  --hover: oklch(0.975 0.004 255);
  --nav-active: oklch(0.95 0.05 145);
  --neutral-bg: oklch(0.95 0.003 255);

  /* palette catégorielle des graphiques (surchargée par thème) */
  --chart-1: #72b76e; --chart-2: #51bfea; --chart-3: #885ca3;

  --r: 8px; --r-sm: 6px;
  --sp1:4px; --sp2:8px; --sp3:12px; --sp4:16px; --sp6:24px; --sp8:32px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);

  --z-dropdown:100; --z-sticky:200; --z-backdrop:300; --z-modal:400; --z-toast:500;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
h1 { font-size: 21px; font-weight: 700; margin: 0; text-wrap: balance; }
h2 { font-size: 16px; font-weight: 600; margin: 0; text-wrap: balance; }
h3 { font-size: 14px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.brand .logo {
  width: 30px; height: 30px; border-radius: 7px; background: var(--brand);
  color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 13px;
  letter-spacing: .5px;
}
.brand .name { font-weight: 700; font-size: 14px; }
.brand .sub { font-size: 11px; color: var(--muted); }

.nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav .grp { font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--ink); font-weight: 500; font-size: 13.5px; position: relative;
  transition: background .12s ease-out;
}
.nav a .ic { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a .nav-badge { margin-left: auto; background: var(--warn); color: #fff; font-size: 11px;
  font-weight: 700; line-height: 1; padding: 2px 7px; border-radius: 999px; min-width: 18px;
  text-align: center; }
.nav a:hover { background: var(--hover); }
.nav a.active { background: var(--nav-active); color: var(--brand-d); font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--brand); border-radius: 0 3px 3px 0;
}
.nav a.active .ic { opacity: 1; }
.side .foot { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted); }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--head-bg); color: var(--head-ink);
  display: flex; align-items: center; gap: 16px; padding: 0 22px; height: 52px;
  position: sticky; top: 0; z-index: var(--z-sticky);
}
.topbar .ctx { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.topbar .ctx select {
  background: rgba(255,255,255,.10); color: var(--head-ink); border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r-sm); padding: 6px 10px; font-size: 13px;
}
.topbar .ctx select option { color: #111; }
.topbar .spacer { flex: 1; }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.topbar .who .av { width: 28px; height: 28px; border-radius: 50%; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.topbar .who a { color: rgba(255,255,255,.85); font-size: 12px; }
.topbar .who a:hover { color: #fff; }
.lang { display: inline-flex; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; overflow: hidden; }
.lang-btn { padding: 4px 11px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.7); }
.lang-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.lang-btn.active { background: var(--brand); color: #fff; }

.subnav { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 9px 13px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; flex: none; }
.subnav a:hover { color: var(--ink); }
.subnav a.active { color: var(--brand); border-bottom-color: var(--brand); }

.content { padding: 22px 26px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a:hover { color: var(--brand-d); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  transition: background .12s ease-out, border-color .12s ease-out; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--bad); border-color: oklch(0.85 0.06 25); }

/* ---------- Cards / panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); }
.card .hd { padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border-radius: var(--r) var(--r) 0 0; }
.card .hd h2 { color: var(--brand-d); }
.card .bd { padding: 16px; }
.card .bd.flush { padding: 0; }

.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 16px; box-shadow: var(--shadow); }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; margin-top: 4px; }
.kpi .v.accent { color: var(--brand-d); }

.cols { display: grid; gap: 16px; }
@media (min-width: 1000px) { .cols.c2 { grid-template-columns: 1fr 1fr; }
  .cols.c3 { grid-template-columns: 2fr 1fr; } }

/* ---------- Tables ---------- */
.tbl-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th { position: sticky; top: 0; background: var(--thead-bg);
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; z-index: 1; }
table.data tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tbody tr:hover { background: var(--hover); }
table.data tbody tr:nth-child(even) { background: var(--row-alt); }
table.data tbody tr:nth-child(even):hover { background: var(--hover); }
table.data a.lnk { color: var(--brand-d); font-weight: 600; }
table.data a.lnk:hover { text-decoration: underline; }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.7; }
.pill::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; opacity:.9; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.info { color: var(--info); background: var(--info-bg); }
.pill.neutral { color: var(--muted); background: var(--neutral-bg); }
.pill.plain::before { display:none; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input:not([type]), input[type=text], input[type=password], input[type=search], input[type=number], input[type=email],
input[type=tel], input[type=url], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 13.5px; background: var(--surface); color: var(--ink); font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid oklch(0.62 0.12 145 / .35); outline-offset: 0; border-color: var(--brand); }
.form-grid { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; min-width: 180px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink);
  transition: background .12s ease-out, border-color .12s ease-out; }
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .ct { margin-left: 6px; background: rgba(0,0,0,.07); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }
.chip.active .ct { background: rgba(255,255,255,.25); }

/* ---------- Misc ---------- */
.hr { height: 1px; background: var(--line); border: 0; margin: 16px 0; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; gap: 10px; }
.right { margin-left: auto; }
.tag-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; }
.ctl { font-size: 11px; font-weight: 600; margin-left: 6px; white-space: nowrap; }

.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .ic { font-size: 30px; opacity: .4; }
.notice { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px; background: var(--info-bg); color: var(--info); }
.notice.demo { background: oklch(0.96 0.05 85); color: var(--warn); }

.def-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13px; }
.def-list dt { color: var(--muted); }
.def-list dd { margin: 0; font-weight: 600; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 264px; height: 100dvh; z-index: var(--z-modal);
    transform: translateX(-100%); transition: transform .22s cubic-bezier(.22,1,.36,1);
    box-shadow: 0 12px 40px rgba(16,24,40,.22);
  }
  body.nav-open .side { transform: translateX(0); }
  body.nav-open .nav-backdrop { display: block; }
}

.pager { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:12px 16px; }
.btn.disabled { opacity:.4; pointer-events:none; }
a.chip { text-decoration:none; display:inline-flex; align-items:center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Navigation repliable (off-canvas, petit écran) ---------- */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-sm); background: rgba(255,255,255,.10);
  color: var(--head-ink); cursor: pointer; flex: none; }
.nav-toggle:hover { background: rgba(255,255,255,.18); }
.nav-toggle svg { width: 19px; height: 19px; }
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.40); z-index: var(--z-backdrop); }

/* label de périmètre (topbar) */
.ctx-lbl { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.72); }

/* ---------- Focus visible (clavier) ---------- */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
[tabindex]:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px;
}
.nav a:focus-visible, .subnav a:focus-visible, a.kpi:focus-visible,
[data-href]:focus-visible { outline-offset: -2px; }
.topbar :focus-visible, .nav-toggle:focus-visible, .lang-btn:focus-visible { outline-color: #fff; }

/* ---------- Toasts (feedback global) ---------- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 9px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 11px 15px 11px 13px;
  font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px rgba(16,24,40,.16);
  transition: opacity .2s ease-out; animation: toast-in .2s ease-out; }
.toast .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.toast.err .dot { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Graphiques interactifs ---------- */
.ch-seg { cursor: pointer; transition: opacity .12s ease-out; }
svg:hover > .ch-seg:not(:hover) { opacity: .4; }
#chtip { position: fixed; z-index: 600; pointer-events: none; display: none;
  background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 600;
  padding: 5px 9px; border-radius: 6px; box-shadow: var(--shadow); white-space: nowrap; }

/* Logo IPRC (image horizontale, remplace l'ancienne pastille « GAB ») */
.brand .logo-img { height: 30px; width: auto; }
.login .logo-img { height: 44px; width: auto; }
.foot-brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.foot-brand > div { white-space: nowrap; min-width: 0; }
.foot-brand .iprc-mini { height: 18px; width: auto; flex: none; }
.brand .nextup-logo { display: block; height: 26px; width: auto; margin-bottom: 3px; }

/* KPI cliquables */
a.kpi { text-decoration: none; color: inherit; display: block;
  transition: box-shadow .12s ease-out, transform .12s ease-out, border-color .12s ease-out; }
a.kpi:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); border-color: var(--brand); transform: translateY(-1px); }
a.leg { text-decoration: none; color: inherit; border-radius: 6px; padding: 2px 4px; transition: background .12s; }
a.leg:hover { background: var(--hover); }

/* ---------- Modale (explication d'écart) ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: var(--z-backdrop);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto; }
.modal { background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; max-width: 640px; width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.3);
  z-index: var(--z-modal); }
.modal .modal-hd { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface)); border-radius: 10px 10px 0 0; }
.modal .modal-hd strong { color: var(--brand-d); }
.modal .modal-bd { padding: 16px; }
.modal-x { cursor: pointer; border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); }
.modal-x:hover { color: var(--ink); }

/* ============================================================
   Correctifs MOBILE (placés en fin de fichier = priorité d'ordre)
   ============================================================ */
@media (max-width: 760px) {
  /* Burger : la règle de base .nav-toggle{display:none} étant définie plus bas
     dans le fichier, elle écrasait l'ancienne media-query. On ré-affirme ici. */
  .nav-toggle { display: inline-flex !important; }

  /* Topbar : éviter le débordement horizontal sur petit écran */
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar .ctx { min-width: 0; gap: 6px; }
  .topbar .ctx-lbl { display: none; }                 /* libellé « Périmètre » masqué */
  .topbar .ctx select { max-width: 34vw; padding: 6px 8px; }
  .topbar .pill.warn.plain { display: none; }         /* pastille DÉMO masquée */
  .topbar .who .stack span { display: none; }         /* nom complet masqué (avatar gardé) */

  /* Tables : toujours scrollables horizontalement, jamais hors du cadre */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .card, .bd { min-width: 0; }
  table.data { font-size: 12px; }

  /* Onglets Administration : passent à la ligne au lieu de déborder */
  .subnav { flex-wrap: wrap; row-gap: 2px; }
  /* Lignes label/valeur : autoriser le retour à la ligne, libellés non figés */
  .row { flex-wrap: wrap; }
  .row .muted.small[style*="min-width"] { min-width: 0 !important; }
  /* Formulaires : champs pleine largeur sur mobile */
  .form-grid { grid-template-columns: 1fr; }
  /* Tuiles KPI sur deux colonnes, chiffres un peu plus petits */
  .grid-kpi { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi .v { font-size: 22px; }
  .kpi .v.txt { font-size: 17px; }
  /* Fil d'activité : date sur sa ligne, texte qui passe à la ligne */
  .feed li { flex-wrap: wrap; gap: 6px 10px; }
  .feed .when { width: 100%; }
  .content { padding: 16px; }
  form .field input, form .field select { max-width: 100% !important; }
}

/* ============================================================
   Compléments IPN (écrans du socle)
   ============================================================ */

/* Page de connexion (reprise de l'écran de connexion d'Arrêté GAB) */
body.auth { display: grid; place-items: center; min-height: 100vh;
  background: radial-gradient(1200px 600px at 70% -10%, oklch(0.94 0.04 145), transparent), var(--bg); }
.login { width: 380px; max-width: calc(100vw - 32px); padding: 24px 0; }
.login .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; }
.login .brand-row { display: flex; align-items: center; gap: 12px; }
.login .brand-row .name { font-weight: 700; font-size: 17px; }
.login .lang { border-color: var(--line-strong); }
.login .lang-btn { color: var(--muted); }
.login .lang-btn.active { background: var(--brand); color: #fff; }
.login .lang-row { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.login .hero { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 26px; text-align: center; }
.login .hero .nextup-hero { display: block; height: 72px; width: auto; max-width: 100%; }
.login .iprc-foot { display: flex; justify-content: center; margin-top: 26px; }
.login .iprc-foot img { display: block; height: 46px; width: auto; }
.login .foot-note { text-align: center; margin-top: 12px; }
.code-input { font-size: 22px !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }

/* Notices de retour */
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice + .notice, .notice + form, .notice + .card { margin-top: 12px; }
.errors { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--bad-bg); color: var(--bad); font-size: 13px; }
.errors ul { margin: 0; padding-left: 18px; }
.field .err { color: var(--bad); font-size: 12px; margin-top: 4px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Mot de passe provisoire, affiché une seule fois */
.secret-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px;
  border: 1px dashed var(--warn); border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn); }
.secret-box code { font-size: 16px; font-weight: 700; color: var(--ink); background: var(--surface);
  padding: 4px 10px; border-radius: var(--r-sm); user-select: all; }

/* Cases à cocher alignées (rôles, équipes, matrice) */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check-list { display: flex; flex-wrap: wrap; gap: 10px 22px; }
table.matrix td.c, table.matrix th.c { text-align: center; }
table.matrix tbody td { white-space: normal; }
table.matrix .grp-row td { background: var(--thead-bg); font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; }

/* Détail avant / après du journal d'audit */
details.diff summary { cursor: pointer; color: var(--brand-d); font-weight: 600; font-size: 12px; list-style: none; }
details.diff summary::-webkit-details-marker { display: none; }
details.diff pre { margin: 8px 0 0; font-size: 11.5px; background: var(--thead-bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 8px 10px; white-space: pre-wrap; max-width: 460px; }
table.data td.wrap { white-space: normal; }

/* Santé de la plateforme */
.checks { display: grid; gap: 10px; }
.check-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.check-row:last-child { border-bottom: 0; }
.check-row .ms { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* QR code d'enrôlement MFA */
.qr { background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); display: inline-block; line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.mfa-grid { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }

/* Liste d'activité récente */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; align-items: baseline; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; width: 128px; }

/* Boutons-formulaires en ligne (POST) */
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .mfa-grid { grid-template-columns: 1fr; }
  .check-row { grid-template-columns: 1fr auto; }
  .check-row .detail { grid-column: 1 / -1; }
}

/* Barre supérieure : avatar cliquable et déconnexion en bouton (POST, protégé CSRF) */
.topbar .who a.av { color: #fff; }
.linkish { border: 0; background: none; padding: 0; cursor: pointer; font: inherit;
  color: rgba(255,255,255,.85); font-size: 12px; text-align: left; }
.linkish:hover { color: #fff; text-decoration: underline; }
.kpi .v.txt { font-size: 20px; line-height: 1.6; }
.tnum { font-variant-numeric: tabular-nums; }

/* Blocs de code (page d'intégration Centreon) */
pre.code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55;
  background: oklch(0.21 0.02 260); color: oklch(0.93 0.02 150); padding: 12px 14px; border-radius: var(--r-sm);
  overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; margin: 8px 0 0; }
.steps-lg { margin: 0; padding-left: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.steps-lg > li > strong { display: block; margin-bottom: 4px; }
ul.feed.timeline li { align-items: flex-start; }
a.lnk { color: var(--brand-d); font-weight: 600; } a.lnk:hover { text-decoration: underline; }

/* Choix d'un contact par autocomplétion (liste détachée, affichée hors des cadres défilants) */
.ac { position: relative; }
.ac .ac-input { padding-right: 26px; }
.ac::after { content: ""; position: absolute; right: 11px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.ac.missing .ac-input { border-color: var(--bad); background: var(--bad-bg); }
.ac-panel { position: fixed; z-index: var(--z-backdrop); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); box-shadow: 0 8px 24px rgba(16,24,40,.16); max-height: 270px; overflow-y: auto;
  max-width: min(440px, calc(100vw - 24px)); }
.ac-item { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item.on, .ac-item:hover { background: var(--hover); }
.ac-name { font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.ac-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.ac-empty { padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
table.planning .ac-input { padding: 5px 24px 5px 6px; font-size: 12.5px; min-width: 130px; }

/* Aide repliable (carte <details>) */
details.help > summary { cursor: pointer; list-style: none; border-bottom: 0; border-radius: var(--r); }
details.help > summary::-webkit-details-marker { display: none; }
details.help > summary h2::before { content: "?"; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px;
  border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; vertical-align: 1px; }
details.help[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
details.help[open] > summary .muted { display: none; }
details.help .bd { font-size: 13.5px; max-width: 900px; }
details.help .bd p { margin: 0 0 10px; }
details.help .bd h3 { margin: 16px 0 6px; }
details.help .bd ul { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 4px; }
details.help table.data { margin: 4px 0 10px; max-width: 640px; }
details.help table.data td { white-space: normal; }

/* Planning de la semaine */
table.planning td { padding: 6px 8px; }
table.planning td.wrap { white-space: nowrap; }
table.planning select { padding: 5px 6px; font-size: 12.5px; min-width: 110px; width: 100%; }
table.planning select.missing { border-color: var(--bad); background: var(--bad-bg); }
table.planning th.holiday { color: var(--warn); }

/* Ligne de modèle de shift */
.shift-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shift-row > input[name=name] { width: 170px; }
.shift-row > input[type=time] { width: 110px; }
.shift-row > select { width: auto; }
.shift-row .days { display: inline-flex; gap: 3px; }
.day { position: relative; cursor: pointer; }
.day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: inline-grid; place-items: center; width: 30px; height: 28px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface); }
.day input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.day input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Niveaux d'une politique d'escalade */
.level-row { display: grid; grid-template-columns: 34px 1.5fr 1.1fr 1fr .7fr .8fr .9fr; gap: 8px 10px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.level-row:last-child { border-bottom: 0; }
.level-row .num-badge { width: 28px; height: 28px; border-radius: 50%; background: var(--nav-active); color: var(--brand-d);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-top: 22px; }
.level-row label { font-size: 11.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
.level-row select + select { margin-top: 6px; }
.cond-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.6fr; gap: 8px; margin-bottom: 8px; }
@media (max-width: 1000px) {
  .level-row { grid-template-columns: 1fr 1fr; }
  .level-row .num-badge { grid-column: 1 / -1; margin-top: 0; }
  .cond-row { grid-template-columns: 1fr 1fr; }
}

/* --- Lot 7 : indicateurs et graphiques --- */
.chart { width: 100%; height: 190px; display: block; }
.chart-stack { width: 100%; height: 14px; display: block; border-radius: 4px; overflow: hidden; }
.dot-sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: baseline; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; animation: live 2s infinite; }
@keyframes live { 50% { opacity: .35; } }
.oncall-list { list-style: none; margin: 0; padding: 0; }
.oncall-list li { display: flex; gap: 10px; justify-content: space-between; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.oncall-list li:first-child { border-top: 0; }
.meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--brand); }

pre.msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; background: var(--neutral-bg); border-radius: 8px; padding: 10px 12px; }

/* Notification APP : aperçu des notifications (Administration) */
.push-previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.push-ex { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px; }
.push-ex.active { border: 1px solid var(--brand); }
.push-note { display: flex; gap: 10px; align-items: flex-start; background: var(--neutral-bg); border-radius: 14px; padding: 10px 12px; font-size: 13px; }
.push-note img { width: 30px; height: 30px; flex: none; background: #fff; border-radius: 7px; padding: 2px; }
.push-note .push-app { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.push-note .push-app span { text-transform: none; letter-spacing: 0; }
.push-note strong { display: block; font-weight: 700; }
.push-note .push-body { color: var(--ink); white-space: normal; }
fieldset:disabled { opacity: .5; }

/* ============================================================
   Thème sombre : préférence de l'utilisateur (Mon compte, barre du haut).
   data-theme = light | dark | auto (auto suit le réglage du système).
   ============================================================ */
:root[data-theme="light"] .logo-dark { display: none; }
@media not (prefers-color-scheme: dark) { :root[data-theme="auto"] .logo-dark { display: none; } }
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #3e8748; --brand-d: #86cf91;
  --bg: oklch(0.17 0.012 255); --surface: oklch(0.215 0.014 255);
  --ink: oklch(0.93 0.008 255); --muted: oklch(0.71 0.015 255);
  --line: oklch(0.31 0.014 255); --line-strong: oklch(0.39 0.016 255);
  --head-bg: oklch(0.20 0.035 150); --head-ink: oklch(0.95 0.01 255);
  --ok: oklch(0.80 0.12 150);   --ok-bg: oklch(0.31 0.06 150);
  --warn: oklch(0.84 0.11 85);  --warn-bg: oklch(0.33 0.06 80);
  --bad: oklch(0.77 0.13 25);   --bad-bg: oklch(0.32 0.08 25);
  --info: oklch(0.80 0.10 250); --info-bg: oklch(0.31 0.06 250);
  --thead-bg: oklch(0.245 0.014 255); --row-alt: oklch(0.225 0.013 255); --hover: oklch(0.265 0.015 255);
  --nav-active: oklch(0.31 0.06 145); --neutral-bg: oklch(0.28 0.012 255);
  --shadow: 0 1px 2px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
}
:root[data-theme="dark"] .btn.primary:hover { background: #357540; border-color: #357540; }
:root[data-theme="dark"] .nav a .nav-badge { background: oklch(0.64 0.13 75); color: #1b1400; }
:root[data-theme="dark"] .chip .ct { background: rgba(255,255,255,.1); }
:root[data-theme="dark"] body.auth { background: radial-gradient(1200px 600px at 70% -10%, oklch(0.27 0.05 145), transparent), var(--bg); }
:root[data-theme="dark"] a.kpi:hover { box-shadow: 0 4px 14px rgba(0,0,0,.5); }
:root[data-theme="dark"] .logo-light { display: none; }
@media (prefers-color-scheme: dark) {
:root[data-theme="auto"] {
  color-scheme: dark;
  --brand: #3e8748; --brand-d: #86cf91;
  --bg: oklch(0.17 0.012 255); --surface: oklch(0.215 0.014 255);
  --ink: oklch(0.93 0.008 255); --muted: oklch(0.71 0.015 255);
  --line: oklch(0.31 0.014 255); --line-strong: oklch(0.39 0.016 255);
  --head-bg: oklch(0.20 0.035 150); --head-ink: oklch(0.95 0.01 255);
  --ok: oklch(0.80 0.12 150);   --ok-bg: oklch(0.31 0.06 150);
  --warn: oklch(0.84 0.11 85);  --warn-bg: oklch(0.33 0.06 80);
  --bad: oklch(0.77 0.13 25);   --bad-bg: oklch(0.32 0.08 25);
  --info: oklch(0.80 0.10 250); --info-bg: oklch(0.31 0.06 250);
  --thead-bg: oklch(0.245 0.014 255); --row-alt: oklch(0.225 0.013 255); --hover: oklch(0.265 0.015 255);
  --nav-active: oklch(0.31 0.06 145); --neutral-bg: oklch(0.28 0.012 255);
  --shadow: 0 1px 2px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
}
:root[data-theme="auto"] .btn.primary:hover { background: #357540; border-color: #357540; }
:root[data-theme="auto"] .nav a .nav-badge { background: oklch(0.64 0.13 75); color: #1b1400; }
:root[data-theme="auto"] .chip .ct { background: rgba(255,255,255,.1); }
:root[data-theme="auto"] body.auth { background: radial-gradient(1200px 600px at 70% -10%, oklch(0.27 0.05 145), transparent), var(--bg); }
:root[data-theme="auto"] a.kpi:hover { box-shadow: 0 4px 14px rgba(0,0,0,.5); }
:root[data-theme="auto"] .logo-light { display: none; }
}
.theme-btn { display: grid; place-items: center; padding: 4px 9px; }
.theme-btn svg { width: 14px; height: 14px; }
