/* ============================================================
   HangUp : système de design commun aux produits PowerUp d'IPRC.
   ============================================================ */
: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: 252px 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;
  /* One line per entry, even in bold when active ("Validation et construction"). */
  white-space: nowrap;
}
.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(--nav-active-ink, 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); }

/* Administration : sections regroupées, toutes visibles sans défilement (une ligne par section, un seul trait entre deux) */
.admin-nav { border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); padding: 4px 14px; margin: 0 0 20px; }
.admin-nav-group { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: center; column-gap: 12px; padding: 8px 0; }
.admin-nav-group + .admin-nav-group { border-top: 1px solid var(--line); }
.admin-nav-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.admin-nav-links { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-nav-links a { padding: 5px 11px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid transparent; border-radius: 999px; white-space: nowrap; line-height: 1.3; }
.admin-nav-links a:hover { color: var(--ink); background: var(--neutral-bg); }
.admin-nav-links a.active { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }
@media (max-width: 700px) {
  .admin-nav-group { grid-template-columns: 1fr; row-gap: 4px; }
}

.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: var(--hd-bg, color-mix(in srgb, var(--brand) 10%, var(--surface)));
  border-radius: var(--r) var(--r) 0 0; }
.card .hd h2 { color: var(--hd-ink, 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; }
/* une colonne de grille peut rétrécir sous la largeur de son tableau : le tableau défile dans sa carte au lieu d'élargir la page */
.cols > * { min-width: 0; }
@media (min-width: 1000px) { .cols.c2 { grid-template-columns: 1fr 1fr; }
  .cols.c3 { grid-template-columns: 2fr 1fr; } }
/* Fiche alerte sur petit écran : le résumé du traitement passe avant la chronologie. */
@media (max-width: 999px) { .cols > .carte-traitement { order: -1; } }

/* ---------- 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(--thead-ink, 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; white-space: nowrap; max-width: 100%; vertical-align: middle; }
.pill::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; opacity:.9; }
.pill.ok { color: var(--pill-ok, var(--ok)); background: var(--pill-ok-bg, var(--ok-bg)); }
.pill.warn { color: var(--pill-warn, var(--warn)); background: var(--pill-warn-bg, var(--warn-bg)); }
.pill.bad { color: var(--pill-bad, var(--bad)); background: var(--pill-bad-bg, var(--bad-bg)); }
.pill.info { color: var(--pill-info, var(--info)); background: var(--pill-info-bg, 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 .produit-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); }
dialog.modal { padding: 0; margin: 8vh auto auto; max-height: 84vh; overflow: auto; }
dialog.modal::backdrop { background: rgba(0,0,0,.45); }
dialog.modal p { margin: 0 0 12px; }
h1.titre-alerte { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
button.pastille { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
button.pastille:hover { filter: brightness(1.08); }

/* ============================================================
   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, .topbar .who .stack > a { 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[class*="u-minw-"] { 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 (écrans du socle)
   ============================================================ */

/* Page de connexion */
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 .produit-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(--surface); 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(--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; }
/* Fiche alerte : bloc « Problème » et paramètres reçus */
.probleme .bd { display: grid; gap: 8px; }
.probleme-titre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.probleme-message { font-size: 19px; font-weight: 600; line-height: 1.35; word-break: break-word; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.probleme-meta { color: var(--muted); font-size: 13px; }
.probleme-anomalie { font-size: 15px; font-weight: 600; line-height: 1.35; word-break: break-word; margin: 2px 0 4px; }
.probleme-evol { font-size: 13px; }
.probleme-action .pill { white-space: normal; font-size: 12.5px; line-height: 1.45; padding: 6px 12px; border-radius: 10px; display: inline-block; max-width: 100%; }
dl.params-recus { grid-template-columns: max-content 1fr; }
dl.params-recus dd { word-break: break-word; }
/* Renvois Centreon regroupés : liste dépliable des envois */
details.renvois summary { margin-top: 2px; }
ul.renvois-liste { list-style: none; margin: 6px 0 0; padding: 6px 10px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); max-height: 260px; overflow-y: auto; font-size: 12px; color: var(--muted); }
ul.renvois-liste li { display: block; padding: 2px 0; border: 0; font-size: 12px; }
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(--nav-active-ink, 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; }
.cond-row.no-key { grid-template-columns: 1fr 1fr 2.6fr; }   /* nom du champ libre masqué : la valeur prend sa place */
.cond-row [hidden] { display: none !important; }
@media (max-width: 1000px) {
  .level-row { grid-template-columns: 1fr 1fr; }
  .level-row .num-badge { grid-column: 1 / -1; margin-top: 0; }
  .cond-row, .cond-row.no-key { grid-template-columns: 1fr 1fr; }
  .cond-row.no-key [name$="[value]"] { grid-column: 1 / -1; }
}

/* --- 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; }

/* ---------- Manuel d'utilisation ---------- */
.manual { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.man-toc { position: sticky; top: 64px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 13px; max-height: calc(100vh - 80px); overflow: auto; }
.man-toc ul { margin: 0; padding-left: 0; list-style: none; } .man-toc li { margin: 3px 0; } .man-toc .l3 { margin-left: 12px; font-size: 12px; } .man-toc a { color: var(--muted); } .man-toc a:hover { color: var(--brand-d); }
.man-body { min-width: 0; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 32px; max-width: 980px; line-height: 1.6; font-size: 14.5px; }
.man-head { display: flex; align-items: center; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; } .man-head img { height: 40px; }
.man-intro { font-size: 15px; color: var(--muted); }
.man-sec { margin-top: 34px; } .man-sec h2 { font-size: 20px; margin: 0 0 12px; color: var(--brand-d); scroll-margin-top: 70px; } .man-sec h3 { font-size: 16px; margin: 24px 0 8px; scroll-margin-top: 70px; }
.man-sec p, .man-sec ul, .man-sec ol { margin: 8px 0; } .man-sec ul, .man-sec ol { padding-left: 22px; } .man-sec li { margin: 4px 0; }
.man-steps > li { margin: 8px 0; padding-left: 4px; } .man-steps > li::marker { font-weight: 700; color: var(--brand-d); }
.man-note, .man-warn { border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-size: 13.5px; }
.man-note { background: var(--info-bg); border-left: 4px solid var(--info); } .man-warn { background: var(--warn-bg); border-left: 4px solid var(--warn); }
.man-note ul, .man-warn ul { margin: 6px 0 0; }
.man-fig { margin: 14px 0 18px; } .man-fig img { display: block; width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); } .man-fig figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; text-align: center; }
table.data.man-table { margin: 10px 0; table-layout: auto; } table.data.man-table tbody td, table.data.man-table thead th { white-space: normal; vertical-align: top; position: static; } table.data.man-table td:first-child { white-space: nowrap; }
.man-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
code { background: var(--neutral-bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
@media (max-width: 1000px) { .manual { grid-template-columns: 1fr; } .man-toc { position: static; max-height: none; } .man-body { padding: 18px; } }
@media print {
  .side, .topbar, .no-print, .toast-wrap, .nav-backdrop { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; } .manual { display: block; } .man-body { border: 0; max-width: none; padding: 0; font-size: 12pt; }
  .man-sec { page-break-inside: auto; } .man-sec h2 { page-break-after: avoid; margin-top: 24pt; } .man-fig { page-break-inside: avoid; } .man-fig img { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}

/* ============================================================
   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; }

/* Ancres (#centreon, #dynatrace) : la cible reste visible sous la barre collante */
.card[id], [id].card { scroll-margin-top: 64px; }

/* ---------- Connexion biométrique : icône du capteur dans les boutons et la liste ---------- */
.bio-ic { display: inline-flex; flex: none; }
.bio-ic[hidden], [data-passkey-login][hidden], [data-passkey-start][hidden] { display: none !important; }
.bio-ic svg { width: 18px; height: 18px; }
.bio-row { display: inline-flex; align-items: center; gap: 7px; }
.bio-row .bio-ic svg { width: 15px; height: 15px; color: var(--muted); }

/* ---------- Indicateur de santé dans la barre du haut ---------- */
.health-ind { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--head-ink); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); white-space: nowrap; }
a.health-ind:hover { background: rgba(255,255,255,.14); color: #fff; }
.health-ind .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.health-ind.ok .dot { background: #4cc46a; box-shadow: 0 0 0 3px rgba(76,196,106,.25); }
.health-ind.bad { background: rgba(229,72,77,.22); border-color: rgba(229,72,77,.6); }
.health-ind.bad .dot { background: #ff5a5f; box-shadow: 0 0 0 3px rgba(255,90,95,.3); }
@media (prefers-reduced-motion: no-preference) {
  .health-ind.bad .dot { animation: health-pulse 1.4s ease-in-out infinite; }
  @keyframes health-pulse { 50% { box-shadow: 0 0 0 6px rgba(255,90,95,0); } }
}
@media (max-width: 760px) {
  .topbar .theme-switch { display: none; }             /* thème : réglable dans Mon compte, gain de place */
  .health-ind { padding: 4px 8px; }
  .health-ind .txt { display: none; }                  /* pastille seule sur téléphone */
}

/* ---------- Pastille « fuseau du profil différent de celui de l'appareil » ---------- */
.tz-ind { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: #ffe2a3; background: rgba(255,190,60,.16); border: 1px solid rgba(255,190,60,.5); }
.tz-ind[hidden] { display: none !important; }
a.tz-ind:hover { background: rgba(255,190,60,.26); color: #fff3d6; }
.tz-ind svg { width: 14px; height: 14px; flex: none; }
@media (max-width: 760px) { .tz-ind { padding: 4px 8px; } .tz-ind .txt { display: none; } }

/* ============================================================
   Palettes (Mon compte › Couleurs) : data-palette = standard | vivid | blue,
   combinées au thème clair / sombre / automatique. Standard = rendu d'origine.
   ============================================================ */
:root[data-palette="vivid"][data-theme="light"] {
  --brand: #2e7d32; --brand-d: #1b5e20; --head-bg: #0f3d17; --line-strong: #b9c7bb;
  --hd-bg: #cfe8d1; --hd-ink: #12461a; --thead-bg: #2e7d32; --thead-ink: #ffffff; --nav-active: #2e7d32; --nav-active-ink: #ffffff;
  --pill-ok: #fff; --pill-ok-bg: #2e7d32; --pill-warn: #fff; --pill-warn-bg: #a85c00; --pill-bad: #fff; --pill-bad-bg: #c62828; --pill-info: #fff; --pill-info-bg: #1565c0;
  --hover-brand: #1b5e20;
}
:root[data-palette="vivid"][data-theme="dark"] {
  --brand: #2e7d32; --brand-d: #8fdc98; --head-bg: #072a0f;
  --hd-bg: #173d1d; --hd-ink: #b8efbf; --thead-bg: #1f5d27; --thead-ink: #ffffff; --nav-active: #2e7d32; --nav-active-ink: #ffffff;
  --pill-ok: #fff; --pill-ok-bg: #2e7d32; --pill-warn: #fff; --pill-warn-bg: #a35a00; --pill-bad: #fff; --pill-bad-bg: #b3261e; --pill-info: #fff; --pill-info-bg: #1559b3;
  --hover-brand: #276b2b;
}
:root[data-palette="blue"][data-theme="light"] {
  --brand: #1d5fae; --brand-d: #154a88; --head-bg: #0c2747; --line-strong: #b8c4d4;
  --hd-bg: #d3e2f6; --hd-ink: #123f73; --thead-bg: #1d5fae; --thead-ink: #ffffff; --nav-active: #1d5fae; --nav-active-ink: #ffffff;
  --pill-ok: #fff; --pill-ok-bg: #2e7d32; --pill-warn: #fff; --pill-warn-bg: #a85c00; --pill-bad: #fff; --pill-bad-bg: #c62828; --pill-info: #fff; --pill-info-bg: #5b3fb0;
  --hover-brand: #154a88; --chart-1: #3b7dd8; --chart-2: #51bfea; --chart-3: #885ca3;
}
:root[data-palette="blue"][data-theme="dark"] {
  --brand: #1f66bd; --brand-d: #9cc7ff; --head-bg: #061a33;
  --hd-bg: #13325a; --hd-ink: #c2dcff; --thead-bg: #1a4f92; --thead-ink: #ffffff; --nav-active: #1f66bd; --nav-active-ink: #ffffff;
  --pill-ok: #fff; --pill-ok-bg: #2e7d32; --pill-warn: #fff; --pill-warn-bg: #a35a00; --pill-bad: #fff; --pill-bad-bg: #b3261e; --pill-info: #fff; --pill-info-bg: #5b3fb0;
  --hover-brand: #1a56a0; --chart-1: #5b9be8; --chart-2: #51bfea; --chart-3: #a07cc0;
}
/* Thème automatique : mêmes jetons, selon le réglage du système. */
@media not (prefers-color-scheme: dark) {
  :root[data-palette="vivid"][data-theme="auto"] {
    --brand: #2e7d32; --brand-d: #1b5e20; --head-bg: #0f3d17; --line-strong: #b9c7bb;
    --hd-bg: #cfe8d1; --hd-ink: #12461a; --thead-bg: #2e7d32; --thead-ink: #ffffff; --nav-active: #2e7d32; --nav-active-ink: #ffffff;
    --pill-ok: #fff; --pill-ok-bg: #2e7d32; --pill-warn: #fff; --pill-warn-bg: #a85c00; --pill-bad: #fff; --pill-bad-bg: #c62828; --pill-info: #fff; --pill-info-bg: #1565c0;
    --hover-brand: #1b5e20;
  }
  :root[data-palette="blue"][data-theme="auto"] {
    --brand: #1d5fae; --brand-d: #154a88; --head-bg: #0c2747; --line-strong: #b8c4d4;
    --hd-bg: #d3e2f6; --hd-ink: #123f73; --thead-bg: #1d5fae; --thead-ink: #ffffff; --nav-active: #1d5fae; --nav-active-ink: #ffffff;
    --pill-ok: #fff; --pill-ok-bg: #2e7d32; --pill-warn: #fff; --pill-warn-bg: #a85c00; --pill-bad: #fff; --pill-bad-bg: #c62828; --pill-info: #fff; --pill-info-bg: #5b3fb0;
    --hover-brand: #154a88; --chart-1: #3b7dd8; --chart-2: #51bfea; --chart-3: #885ca3;
  }
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="vivid"][data-theme="auto"] {
    --brand: #2e7d32; --brand-d: #8fdc98; --head-bg: #072a0f;
    --hd-bg: #173d1d; --hd-ink: #b8efbf; --thead-bg: #1f5d27; --thead-ink: #ffffff; --nav-active: #2e7d32; --nav-active-ink: #ffffff;
    --pill-ok: #fff; --pill-ok-bg: #2e7d32; --pill-warn: #fff; --pill-warn-bg: #a35a00; --pill-bad: #fff; --pill-bad-bg: #b3261e; --pill-info: #fff; --pill-info-bg: #1559b3;
    --hover-brand: #276b2b;
  }
  :root[data-palette="blue"][data-theme="auto"] {
    --brand: #1f66bd; --brand-d: #9cc7ff; --head-bg: #061a33;
    --hd-bg: #13325a; --hd-ink: #c2dcff; --thead-bg: #1a4f92; --thead-ink: #ffffff; --nav-active: #1f66bd; --nav-active-ink: #ffffff;
    --pill-ok: #fff; --pill-ok-bg: #2e7d32; --pill-warn: #fff; --pill-warn-bg: #a35a00; --pill-bad: #fff; --pill-bad-bg: #b3261e; --pill-info: #fff; --pill-info-bg: #5b3fb0;
    --hover-brand: #1a56a0; --chart-1: #5b9be8; --chart-2: #51bfea; --chart-3: #a07cc0;
  }
}
/* Survol du bouton principal : teinte de la palette (la règle sombre d'origine est verte). */
:root[data-palette="vivid"] .btn.primary:hover, :root[data-palette="blue"] .btn.primary:hover { background: var(--hover-brand); border-color: var(--hover-brand); }
/* En-tête de tableau plein : les liens de tri et les icônes suivent le texte blanc. */
:root[data-palette="vivid"] table.data thead th a, :root[data-palette="blue"] table.data thead th a { color: inherit; }

/* ============================================================
   Mon compte : sommaire, vignettes d'apparence, sections
   ============================================================ */
.acct-id { display: flex; align-items: center; gap: 14px; }
.acct-av { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 19px; flex: none; }
.acct-toc { position: sticky; top: calc(52px + env(safe-area-inset-top, 0px)); z-index: 5; display: flex; gap: 4px; flex-wrap: wrap;
  background: var(--bg); padding: 8px 0 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.acct-toc a { padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid transparent; }
.acct-toc a:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.acct-sec { margin-top: 16px; scroll-margin-top: 120px; }
.acct-prefs { display: block; }

.choice-set { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 10px; }
.choice-set legend { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 10px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 900px; }
.choice { position: relative; display: grid; gap: 10px; padding: 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer;
  transition: border-color .12s ease-out, box-shadow .12s ease-out; }
.choice:hover { border-color: var(--line-strong); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
.choice:has(input:checked)::after { content: "✓"; position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.thumb { display: block; position: relative; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; max-width: 100%; }
.thumb.split img { position: absolute; inset: 0; }
.thumb.split img[data-theme-img="dark"] { clip-path: polygon(62% 0, 100% 0, 100% 100%, 38% 100%); }
.choice-txt { display: grid; gap: 1px; padding: 0 4px 2px; }
.choice-txt strong { font-size: 13.5px; }
.choice-txt span { font-size: 12px; color: var(--muted); }

.seg-radio { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; justify-self: start; }
.seg-radio label { position: relative; cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span { display: block; padding: 7px 16px; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--surface); }
.seg-radio label + label span { border-left: 1px solid var(--line-strong); }
.seg-radio input:checked + span { background: var(--brand); color: #fff; }
.seg-radio input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -3px; }

.acct-save { position: sticky; bottom: env(safe-area-inset-bottom, 0px); z-index: 4; display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.acct-save.dirty { border-color: var(--brand); }
.acct-save [hidden] { display: none !important; }
.acct-sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.acct-tile { display: grid; gap: 10px; align-content: space-between; justify-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.acct-tile-h { display: grid; gap: 4px; justify-items: start; }
@media (max-width: 760px) {
  .acct-toc { top: calc(52px + env(safe-area-inset-top, 0px)); flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .acct-toc a { white-space: nowrap; }
  .choice-grid { gap: 8px; }
  .choice { padding: 5px; gap: 6px; border-radius: 10px; }
  .choice-txt span { display: none; }                    /* sur téléphone : vignette et nom seulement */
  .choice-txt strong { font-size: 12.5px; }
  .choice:has(input:checked)::after { top: 9px; right: 9px; width: 20px; height: 20px; font-size: 11px; }
  .acct-av { width: 38px; height: 38px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .choice { transition: none; } }

/* Filtre « Sans routage » : rouge tant qu'une alerte non routée est encore ouverte. */
.chip.chip-alarm { border-color: var(--bad); color: var(--bad); }
.chip.chip-alarm .ct { background: var(--bad); color: #fff; }
.chip.chip-alarm.active { background: var(--bad); border-color: var(--bad); color: #fff; }
.chip.chip-alarm.active .ct { background: rgba(255,255,255,.25); }

/* Politique : carte repliée listant les règles de routage qui imposent une autre relance. */
details.override-note { margin-top: 10px; border: 1px solid var(--line-strong); border-left: 3px solid var(--warn); border-radius: var(--r-sm); background: var(--surface); padding: 8px 10px; }
details.override-note summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details.override-note summary::-webkit-details-marker { display: none; }
details.override-note[open] summary .muted { display: none; }
details.override-note ul { margin: 8px 0 6px; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }

/* ---------- Formulaire de règle de routage ---------- */
.rule-card { margin-bottom: 16px; }
.rule-active { margin: 0; font-size: 13px; font-weight: 600; }
.rule-grid { display: grid; grid-template-columns: 110px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px 18px; align-items: start; }
.rule-grid .field { margin: 0; }
.rule-delays { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.delay-tile { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.delay-tile .delay-t { font-weight: 600; font-size: 13.5px; }
.delay-tile p { margin: 0; }
.delay-tile .seg-radio { flex-wrap: wrap; }
.reminder-custom { display: none !important; }
.delay-tile:has(input[name="resolve_reminder_mode"][value="custom"]:checked) .reminder-custom { display: flex !important; }
.flap-custom { display: none !important; }
.delay-tile:has(input[name="flap_mode"][value="custom"]:checked) .flap-custom { display: flex !important; }
.rule-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 1000px) { .rule-grid { grid-template-columns: 110px minmax(0, 1fr); } .rule-delays { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .rule-grid { grid-template-columns: 1fr; } }

/* ---------- Alertes en direct ---------- */
.live-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink); margin: -6px 0 6px; flex-wrap: wrap; }
.live-bar .muted { font-weight: 400; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fa84f; flex: none; }
.live-bar[data-mode="paused"] .live-dot, .live-bar[data-mode="idle"] .live-dot { background: var(--warn); }
.live-bar[data-mode="done"] .live-dot { background: var(--muted); }
.live-bar [hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .live-bar[data-mode="live"] .live-dot { animation: live-pulse 2s ease-in-out infinite; }
  @keyframes live-pulse { 50% { box-shadow: 0 0 0 5px rgba(47,168,79,0); } 0% { box-shadow: 0 0 0 0 rgba(47,168,79,.45); } }
  tr.live-new td { animation: live-flash 3s ease-out; }
  @keyframes live-flash { 0%, 30% { background: color-mix(in srgb, var(--brand) 18%, transparent); } 100% { background: transparent; } }
}

/* Arrêt d'urgence des notifications : bandeau visible sur toutes les pages. */
.engine-paused { margin-bottom: 16px; border-color: var(--bad); background: color-mix(in oklch, var(--bad) 8%, var(--surface, transparent)); }

/* Bandeau « notifications sur ce téléphone » (vérifié à chaque ouverture) */
.push-check { margin-bottom: 16px; border-color: var(--warn); background: color-mix(in oklch, var(--warn) 8%, var(--surface, transparent)); }
.push-check.ok { border-color: var(--ok); background: color-mix(in oklch, var(--ok) 8%, var(--surface, transparent)); }
.push-check .bd { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.push-check-actions { display: inline-flex; gap: 8px; margin-left: auto; }

/* Aide expressions régulières : testeur */
.regex-tester { display: grid; gap: 8px; max-width: 640px; }
.regex-tester input, .regex-tester textarea { font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; }
.regex-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; }
.regex-results li { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.regex-results .pill { flex: none; }

/* Première connexion : étapes mot de passe › double authentification › préférences */
.onboarding-steps { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0 0 18px; padding: 0; font-size: 13px; color: var(--muted); }
.onboarding-steps li { display: flex; align-items: center; gap: 8px; }
.onboarding-steps .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); font-weight: 700; font-size: 12px; background: var(--surface); }
.onboarding-steps li.current { color: var(--ink); font-weight: 600; }
.onboarding-steps li.current .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.onboarding-steps li.done .n { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }

/* Gabarit de la première connexion : même page que la connexion (grand logo, IPRC en bas), plus large */
.login.login-wide { width: 720px; }
.login .onboarding-bar { justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Pages de première connexion (fond clair) : le lien Déconnexion reprend la couleur du texte, souligné */
.login .onboarding-bar .linkish { color: inherit; font-size: inherit; text-decoration: underline; }
.login .onboarding-bar .linkish:hover { color: var(--fg, inherit); }
.login-wide .page-head { margin-bottom: 14px; }
.login-wide .onboarding-steps { justify-content: center; }
.login-wide > .card { margin-left: auto; margin-right: auto; }
/* Procédures : éditeur enrichi et page de lecture */
.rt { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--bg); border-radius: 8px 8px 0 0; }
.rt-toolbar button { border: 1px solid transparent; background: transparent; color: var(--ink); border-radius: 6px; min-width: 32px; height: 30px; padding: 0 8px; cursor: pointer; font-size: 13px; }
.rt-toolbar button:hover { background: var(--hover); border-color: var(--line); }
.rt-toolbar button:disabled { opacity: .4; cursor: not-allowed; }
.rt-toolbar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.rt-editor { min-height: 320px; padding: 14px 16px; outline: none; line-height: 1.55; overflow-wrap: anywhere; }
.rt-editor:focus { box-shadow: inset 0 0 0 2px var(--brand); }
.rt-status { padding: 4px 10px 6px; min-height: 18px; }
.rt-editor img, .procedure-body img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.rt-editor h2, .procedure-body h2 { font-size: 20px; margin: 18px 0 8px; }
.rt-editor h3, .procedure-body h3 { font-size: 16px; margin: 14px 0 6px; }
.rt-editor h4, .procedure-body h4 { font-size: 14px; margin: 12px 0 4px; }
.rt-editor p, .procedure-body p { margin: 0 0 10px; }
.rt-editor ul, .rt-editor ol, .procedure-body ul, .procedure-body ol { margin: 0 0 10px; padding-left: 24px; }
.rt-editor blockquote, .procedure-body blockquote { margin: 0 0 10px; padding: 6px 14px; border-left: 4px solid var(--brand); background: var(--neutral-bg); border-radius: 4px; }
.rt-editor pre, .procedure-body pre { margin: 0 0 10px; padding: 10px 12px; background: var(--neutral-bg); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: Consolas, Menlo, monospace; font-size: 13px; }
.rt-editor code, .procedure-body code { font-family: Consolas, Menlo, monospace; font-size: 13px; }
.rt-editor table, .procedure-body table { border-collapse: collapse; margin: 0 0 10px; max-width: 100%; }
.rt-editor th, .rt-editor td, .procedure-body th, .procedure-body td { border: 1px solid var(--line-strong); padding: 6px 10px; text-align: left; vertical-align: top; }
.rt-editor th, .procedure-body th { background: var(--bg); }
.procedure-body { font-size: 15px; line-height: 1.6; max-width: 820px; }
.procedure-body a { color: var(--brand); font-weight: 600; }
@media (max-width: 720px) { .procedure-body { font-size: 16px; } .rt-editor { min-height: 220px; } }

/* Manuel utilisateur intégré (resources/docs) */
.doc-wrap { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
.doc-nav { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); padding: 12px; }
.doc-search { position: relative; margin-bottom: 10px; }
.doc-search input { width: 100%; }
.doc-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 60vh; overflow: auto; }
.doc-result { display: block; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.doc-result strong { display: block; color: var(--brand-d); }
.doc-result span { color: var(--muted); font-size: 12px; }
.doc-result.none { color: var(--muted); }
.doc-tree { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.doc-tree-title { margin: 12px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.doc-tree a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--ink); }
.doc-tree .lvl2 a { padding-left: 20px; font-size: 12.5px; }
.doc-tree .lvl3 a { padding-left: 32px; font-size: 12px; color: var(--muted); }
.doc-tree a:hover { background: var(--neutral-bg); }
.doc-tree a.active { background: var(--surface); color: var(--ok); font-weight: 600; }
.doc-body { min-width: 0; max-width: 980px; }
.doc-content { line-height: 1.6; font-size: 14.5px; }
.doc-content h1 { font-size: 26px; margin: 4px 0 12px; }
.doc-content h2 { font-size: 19px; margin: 28px 0 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc-content h3 { font-size: 16px; margin: 20px 0 8px; }
.doc-content table { border-collapse: collapse; width: 100%; margin: 10px 0 16px; font-size: 13.5px; }
.doc-content th, .doc-content td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.doc-content th { background: var(--neutral-bg); }
.doc-content figure { margin: 14px 0 20px; }
.doc-content figure img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; }
.doc-content figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.doc-content .note, .doc-content .attention, .doc-content .a-verifier, .doc-content .non-active { border-left: 4px solid var(--info, #1d5fae); background: var(--info-bg, #eef4fb); padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.doc-content .attention { border-color: var(--warn); background: var(--warn-bg); }
.doc-content .a-verifier { border-color: var(--muted); background: var(--neutral-bg); }
.doc-content .non-active { border-color: var(--bad); background: var(--bad-bg); }
.doc-content ol.etapes > li { margin-bottom: 10px; }
.doc-content code { font-size: 12.5px; background: var(--neutral-bg); padding: 1px 4px; border-radius: 4px; }
.doc-reserve { color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: help; }
.doc-prevnext { display: flex; justify-content: space-between; gap: 12px; margin: 32px 0 8px; flex-wrap: wrap; }
.doc-version { margin-top: 10px; }
.doc-zoom { max-width: 96vw; max-height: 96vh; padding: 10px; border: 0; border-radius: 10px; }
.doc-zoom img { max-width: 92vw; max-height: 86vh; display: block; margin-top: 8px; }
.doc-zoom::backdrop { background: rgba(0,0,0,.7); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) {
  .doc-wrap { grid-template-columns: 1fr; }
  .doc-nav { position: static; max-height: none; }
}
@media print { .doc-nav, .doc-prevnext, .doc-search { display: none; } .doc-wrap { display: block; } }

/* Notice « Vos données personnelles » */
.privacy-notice h2 { font-size: 15px; margin: 0 0 6px; }
.privacy-notice p { margin: 0 0 6px; line-height: 1.5; }
.privacy-notice ul { margin: 0; padding-left: 20px; line-height: 1.5; }
.privacy-notice li + li { margin-top: 4px; }
.privacy-notice ul ul { margin-top: 4px; }

/* ============================================================
   Compléments HangUp
   ============================================================ */
pre.diff { background: oklch(0.2 0.02 255); color: oklch(0.9 0.01 255); padding: 12px 14px; border-radius: var(--r-sm); font-size: 12px; overflow: auto; max-height: 360px; margin: 8px 0 0; }
pre.diff .plus { color: #7ED3A8; }
pre.diff .moins { color: #F19C8C; }
pre.conf { background: var(--thead-bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; font-size: 12px; overflow: auto; max-height: 560px; margin: 0; }
.statut-agent { font-size: 22px; font-weight: 700; }
.appel-en-cours { border-left: 4px solid var(--brand); }
.pause-motifs { display: flex; flex-wrap: wrap; gap: 8px; }
table.data td.wrap { white-space: normal; }

/* Droits d'un jeton d'API : regroupés par thème, case alignée, code technique sous le libellé */
fieldset.droits { border: 0; margin: 0 0 12px; padding: 0; }
fieldset.droits legend { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 6px; }
.droit { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.droit + .droit { margin-top: 6px; }
.droit:hover { background: var(--hover); }
.droit:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.droit input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); }
.droit > span { flex: 1; min-width: 0; }
.droit .libelle { display: block; font-size: 13.5px; line-height: 1.35; }
.droit code { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); background: none; padding: 0; }

/* Saisie du numéro sous une liste de destinations (« Numéro externe… ») */
.destination-externe { display: block; margin-top: 6px; }
.destination-externe[hidden] { display: none; }

/* Listes en cartes sur petit écran : une carte par ligne, libellé de colonne devant chaque valeur */
table.data td.wrap .pill { margin: 2px 0; }
@media (max-width: 760px) {
  table.data.cartes-mobile thead { display: none; }
  table.data.cartes-mobile, table.data.cartes-mobile tbody, table.data.cartes-mobile tr, table.data.cartes-mobile td { display: block; width: 100%; }
  table.data.cartes-mobile tr { padding: 10px 14px; border-bottom: 1px solid var(--line, #e5e7eb); }
  table.data.cartes-mobile td { display: flex; gap: 10px; align-items: flex-start; padding: 3px 0; border: 0; white-space: normal; font-size: 13px; }
  table.data.cartes-mobile td::before { content: attr(data-label); flex: 0 0 34%; color: var(--muted); font-weight: 600; font-size: 12px; padding-top: 2px; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; text-transform: none; letter-spacing: normal; }
  table.data.cartes-mobile td.coupe { overflow-wrap: anywhere; }
  table.data.cartes-mobile .pills { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
  table.data.cartes-mobile .pill { white-space: normal; border-radius: 10px; line-height: 1.45; padding: 3px 10px; }
  table.data.cartes-mobile td { flex-wrap: wrap; text-align: left; justify-content: flex-start; min-width: 0; }
  table.data.cartes-mobile td.num, table.data.cartes-mobile td.tnum { text-align: left; }
  /* colonne sans titre (actions, case à cocher) : pas de libellé, contenu sur toute la largeur */
  table.data.cartes-mobile td[data-label=""]::before { display: none; }
  table.data.cartes-mobile td[data-label=""] { padding-top: 6px; }
  table.data.cartes-mobile td > form, table.data.cartes-mobile td .row { flex-wrap: wrap; }
  table.data.cartes-mobile td input:not([type=checkbox]):not([type=radio]), table.data.cartes-mobile td select { max-width: 100%; }
  table.data.cartes-mobile tr:nth-child(even) { background: var(--row-alt); }
}


/* Valeur affichée en lecture seule dans un formulaire (ex. numéro d'agent attribué automatiquement) */
.field .valeur-lecture { padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--neutral-bg); font-weight: 600; min-height: 38px; display: flex; align-items: center; }

/* --- Tour de contrôle --- */
.tour-alertes .notice.bad { background: var(--bad-bg); color: var(--bad); }
.tour-alertes .notice.warn { background: var(--warn-bg); color: var(--warn); }
.tour-mur { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tour-mur .tuile { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; min-height: 92px; }
.tour-mur .tuile .nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour-mur .tuile.etat-disponible { border-left-color: var(--ok); }
.tour-mur .tuile.etat-sonne { border-left-color: var(--info); background: var(--info-bg); }
.tour-mur .tuile.etat-en_appel { border-left-color: var(--bad); }
.tour-mur .tuile.etat-pause, .tour-mur .tuile.etat-qualification, .tour-mur .tuile.etat-post_appel { border-left-color: var(--warn); }
.tour-mur .tuile.etat-injoignable { border-left-color: var(--bad); background: var(--bad-bg); }
.tour-mur .tuile.etat-hors_ligne { opacity: .6; }
/* plein écran (écran mural) : sans menu ni barre du haut, textes agrandis */
body.mural .side, body.mural .topbar, body.mural .nav-backdrop { display: none !important; }
body.mural .app { grid-template-columns: 1fr; }
body.mural .tour { font-size: 15px; }
body.mural .tour .kpi .v { font-size: 34px; }
@media (max-width: 760px) { .tour-mur { grid-template-columns: 1fr 1fr; } }
/* Tour de contrôle : l'état d'un appel passe à la ligne plutôt que d'élargir le tableau */
.tour table.data td .pill { white-space: normal; line-height: 1.35; padding-top: 3px; padding-bottom: 3px; }

/* Profils d'un utilisateur : un bloc par profil, périmètre en cases à cocher */
.profil-bloc { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.profil-tete { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.profil-tete .field { margin: 0; flex: 1 1 140px; min-width: 0; }
.profil-tete .field select { width: 100%; }
.profil-tete .btn { margin-bottom: 2px; }
.profil-perimetre { margin-top: 10px; }
.profil-perimetre summary { cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--brand-d); }
.profil-resume { font-weight: 400; color: var(--muted); margin-left: 6px; }
.profil-groupes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; }
.profil-groupe { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px 8px; margin: 0; max-height: 180px; overflow: auto; }
.profil-groupe legend { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 4px; }
.profil-groupe .check { display: flex; margin: 3px 0; }
.profil-global { margin-top: 8px; }
.profil-bloc [hidden] { display: none !important; }

/* PowerCAST: wait indicator (D-064), built from the charter variables. */
.pc-spinner { position: fixed; inset: 0; display: none; place-items: center; background: color-mix(in srgb, var(--bg) 60%, transparent); z-index: var(--z-modal); }
.pc-spinner.on { display: grid; }
.pc-spinner span { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line-strong); border-top-color: var(--brand); animation: pc-spin .8s linear infinite; }
@keyframes pc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pc-spinner span { animation-duration: 3s; } }
.pc-grid-cell { text-align: center; }
.pc-two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.pc-meters { display: flex; flex-direction: column; gap: 16px; }
.pc-meter-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.pc-meter-line strong { font-variant-numeric: tabular-nums; }

/* PowerCAST logo: wide wordmark, sized by width to keep the visual weight of the charter logo. */
.brand .produit-logo { height: auto; width: 172px; max-width: 100%; margin-bottom: 0; }
.login .hero .produit-hero { height: auto; width: 320px; max-width: 100%; }
.foot-brand .iprc-mini { height: 20px; }
.login .iprc-foot .logo-img { height: 36px; }

.pc-guide { padding: 0; }
.pc-guide > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; color: var(--brand-d); list-style: none; display: flex; align-items: center; gap: 8px; }
.pc-guide > summary::-webkit-details-marker { display: none; }
.pc-guide > summary::before { content: '▸'; transition: transform .15s; }
.pc-guide[open] > summary::before { transform: rotate(90deg); }
.pc-guide > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--r); }
.pc-guide ol { margin: 0; padding: 0 16px 16px 40px; display: flex; flex-direction: column; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .pc-guide > summary::before { transition: none; } }

.pc-grid-group th { background: var(--neutral-bg); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 12px; }

.pc-audit-detail > summary { cursor: pointer; color: var(--brand-d); font-weight: 600; }
.pc-changes { margin-top: 8px; border-collapse: collapse; font-size: 12.5px; min-width: 360px; }
.pc-changes th, .pc-changes td { padding: 4px 10px 4px 0; text-align: left; vertical-align: top; white-space: normal; border: 0; }
.pc-changes th { color: var(--muted); font-weight: 600; }
.pc-changes td.old { color: var(--bad); text-decoration: line-through; }
.pc-changes td.new { color: var(--ok); font-weight: 600; }
.pc-num { text-align: right; font-variant-numeric: tabular-nums; }
.pc-header { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; margin: 0; }
.pc-header dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.pc-header dd { margin: 2px 0 0; }
.pc-summary-text { white-space: pre-line; line-height: 1.6; }
.pc-summary-text mark { background: var(--warn-bg); color: var(--warn); padding: 0 2px; border-radius: 3px; font-weight: 600; }
.pc-mono { width: 100%; font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px; }
textarea { width: 100%; }

/* ===== PowerCAST UX layer (05/11): built on the charter variables only ===== */
.pc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.pc-crumbs a { color: var(--brand-d); text-decoration: none; }
.pc-crumbs a:hover { text-decoration: underline; }
.pc-crumbs .sep { opacity: .6; }
.page-head { align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .row { flex-wrap: wrap; justify-content: flex-end; }
.page-head .sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn, a.btn, button.btn { line-height: 1.25; box-sizing: border-box; white-space: nowrap; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* D-159: headers of the report columns of figures aligned with the figures. */
table.data thead th.pc-num { text-align: right; }
table.data td.wrap { white-space: normal; }
table.data td .sub2 { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.pc-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-actions.end { justify-content: flex-end; }
.pc-actions form { display: inline-flex; margin: 0; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.pc-chips .grp { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.pc-chips .gap { width: 12px; }
.chip { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: var(--ink); }
.pc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
tr.pc-editor > td { background: var(--neutral-bg); white-space: normal; padding: 14px 16px; }
tr.pc-editor[hidden] { display: none; }
.pc-split { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.pc-split .line { display: grid; grid-template-columns: 1fr 84px 18px; gap: 6px; align-items: center; margin-bottom: 6px; }
.pc-split .line input { text-align: right; }
.pc-split .line select { min-width: 0; width: 100%; } /* RG-1142: full category names */
.pc-split h3 { font-size: 12px; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.pc-total { font-size: 12.5px; font-weight: 600; }
.pc-total.ok { color: var(--ok); } .pc-total.bad { color: var(--bad); }
.pc-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.pc-empty strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.pc-empty .btn { margin-top: 12px; }
.pc-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 0 0 16px; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pc-steps li { padding: 12px 14px; border-right: 1px solid var(--line); display: flex; gap: 10px; align-items: center; min-width: 0; }
.pc-steps li:last-child { border-right: 0; }
.pc-steps .n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--neutral-bg); color: var(--muted); }
.pc-steps .t { font-size: 13px; font-weight: 600; } .pc-steps .s { font-size: 11.5px; color: var(--muted); }
.pc-steps li.done .n { background: var(--surface); color: var(--ok); }
.pc-steps li.current { background: var(--nav-active); } .pc-steps li.current .n { background: var(--brand); color: #fff; }
input[type="file"] { font: inherit; font-size: 13px; padding: 6px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%; box-sizing: border-box; }
input[type="file"]::file-selector-button { font: inherit; font-size: 12.5px; margin-right: 10px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
dialog.pc-confirm { border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; max-width: 440px; width: calc(100vw - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog.pc-confirm::backdrop { background: rgba(0,0,0,.45); }
dialog.pc-confirm h2 { margin: 0 0 8px; } dialog.pc-confirm p { margin: 0 0 18px; color: var(--muted); }
.pc-checks { display: grid; gap: 6px 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); max-height: 220px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.pc-checks label { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 400; color: var(--ink); margin: 0; }
table.data.sticky thead th { position: sticky; top: 52px; z-index: 2; }
/* A scrolling wrapper would hold the sticky header 52px below its own top, over the first rows: on wide screens the
   wrapper does not scroll, so the header sticks under the top bar of the page. */
@media (min-width: 761px) { .tbl-wrap:has(> table.data.sticky) { overflow: visible; } }
.kpi .v.bad { color: var(--bad); } .kpi .v.warn { color: var(--warn); }
.pc-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 20px; }
.pc-kv dt { font-size: 12px; color: var(--muted); font-weight: 600; } .pc-kv dd { margin: 2px 0 0; }
.pc-report-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: inherit; box-shadow: var(--shadow); min-height: 104px; }
.pc-report-card:hover { border-color: var(--brand); }
.pc-report-card .c { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.pc-report-card .t { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.pc-report-card .pill { align-self: flex-start; margin-top: auto; white-space: nowrap; }
.pc-grid-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-bottom: 16px; }
@media (max-width: 720px) { .pc-steps { grid-template-columns: 1fr; } .pc-steps li { border-right: 0; border-bottom: 1px solid var(--line); } }

table.data td.wrap > input:not([type=checkbox]):not([type=hidden]) { min-width: 130px; width: 100%; box-sizing: border-box; }
table.data td.wrap > select { min-width: 140px; }
table.data td.wrap > textarea { width: 100%; box-sizing: border-box; min-width: 240px; }
tr.pc-editor > td { vertical-align: top; }

.card .hd.pc-hd-inner { border-radius: 0; border-top: 1px solid var(--line); }
table.data td .pc-actions { flex-wrap: nowrap; }
table.data.compact { font-size: 12.5px; }
table.data.compact thead th, table.data.compact tbody td { padding: 8px 8px; }
table.data.compact td:first-child, table.data.compact th:first-child { padding-left: 14px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.pc-accordion { display: flex; flex-direction: column; gap: 8px; }
.pc-accordion > details.pc-guide { border: 1px solid var(--line); border-radius: var(--r-sm); }
.pc-accordion > details.pc-guide > summary { padding: 10px 14px; }

.pc-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; }
.pc-pager-info { color: var(--muted); font-size: 12.5px; }
.pc-pager ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.pc-pager .pg { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 13px; text-decoration: none; box-sizing: border-box; }
.pc-pager a.pg:hover { border-color: var(--brand); color: var(--brand-d); }
.pc-pager .pg.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pc-pager .pg.disabled { opacity: .45; cursor: default; }
.pc-pager .pg.dots { border-color: transparent; background: none; min-width: 20px; padding: 0; }
.pc-pager a.pg:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

tr.pc-row { scroll-margin-top: 120px; }
tr.pc-row:target > td { background: var(--nav-active); transition: background 1.5s ease; }
@media (prefers-reduced-motion: reduce) { tr.pc-row:target > td { transition: none; } }

.pc-toast { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast, 500); padding: 10px 16px; border-radius: var(--r); font-size: 13px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.18); background: var(--surface); color: var(--ok); border: 1px solid currentColor; transition: opacity .6s; }
.pc-toast.bad { color: var(--bad); }
.pc-toast.out { opacity: 0; }

/* Bulk actions and search of the validation grid (D-075) */
.pc-bulk { margin-bottom: 12px; padding: 10px 14px; position: sticky; top: 60px; z-index: 5; }
.pc-bulk-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; }
.pc-bulk-bar .gap { flex: 1; }
.pc-radio { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.pc-bulk-fix { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
th.pc-check, td.pc-check { width: 1%; text-align: center; padding-right: 0; }
td.pc-check input, th.pc-check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.pc-search { min-width: 240px; }
/* Report figure linked to its lines (D-075) */
a.pc-drill { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
a.pc-drill:hover, a.pc-drill:focus-visible { color: var(--brand-d); text-decoration-style: solid; }

/* Validation grid on a phone: one card per line, bulk bar in the flow (not sticky) */
.pc-mobile-only { display: none; }
@media (max-width: 760px) {
  .pc-mobile-only { display: inline-flex; }
  .pc-bulk { position: static; padding: 12px; }
  .pc-bulk-bar { gap: 10px 14px; }
  .pc-bulk-bar > strong { width: 100%; }
  .pc-bulk-bar .gap { display: none; }
  .pc-bulk-bar .btn { flex: 1 1 140px; justify-content: center; }
  .pc-chips form { margin-left: 0 !important; width: 100%; flex-wrap: wrap; }
  .pc-search { min-width: 0; flex: 1 1 100%; }
  .pc-chips form .grp { display: none; }
  .pc-chips form select { flex: 1 1 0; min-width: 0; width: auto; }
  .page-head .row { width: 100%; }
  .page-head .row > form, .page-head .row > a { flex: 1 1 100%; }
  .page-head .row .btn { width: 100%; justify-content: center; }
  table.pc-vgrid tr.pc-row { align-items: start; }
  table.pc-vgrid thead { display: none; }
  table.pc-vgrid, table.pc-vgrid tbody { display: block; }
  table.pc-vgrid tr.pc-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "chk type amt" "chk line line" "chk note note" "chk prop prop" "chk stat stat" "chk act act"; column-gap: 12px; row-gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.pc-vgrid tr.pc-row > td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0 !important; }
  table.pc-vgrid td.pc-check { grid-area: chk; padding-top: 2px; }
  table.pc-vgrid td.c-type { grid-area: type; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
  table.pc-vgrid td.c-amt { grid-area: amt; font-weight: 600; text-align: right; }
  table.pc-vgrid td.c-line { grid-area: line; font-size: 14px; overflow-wrap: anywhere; }
  table.pc-vgrid td.c-prop { grid-area: prop; font-size: 12.5px; }
  table.pc-vgrid td.c-note { grid-area: note; }
  table.pc-vgrid td.c-note:empty { display: none; }
  table.pc-vgrid td.c-stat { grid-area: stat; padding-top: 2px; }
  table.pc-vgrid td.c-act { grid-area: act; padding-top: 4px; }
  table.pc-vgrid td.c-act .pc-actions { flex-wrap: wrap; }
  table.pc-vgrid tr.pc-editor, table.pc-vgrid tr.pc-editor > td { display: block; }
  table.pc-vgrid tr.pc-editor[hidden] { display: none; }
  table.pc-vgrid tr.pc-editor > td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.pc-vgrid .pc-split { grid-template-columns: 1fr; }
  table.pc-vgrid tr:not(.pc-row):not(.pc-editor) > td { display: block; }
}

/* Line page on a phone: months as rows, projects as cards, empty fields hidden */
.pc-months-phone { display: none; }
@media (max-width: 760px) {
  table.pc-months { display: none; }
  .pc-months-phone { display: block; }
  .pc-months-phone table.data td, .pc-months-phone table.data th { padding: 7px 12px; }
  table.pc-projects td.pc-proj-name { font-weight: 600; font-size: 14px; padding-bottom: 6px; }
  table.pc-projects td:empty { display: none; }
  .page-head { flex-wrap: wrap; }
}

/* Other pages on a phone: lists as cards, report tables as statements, settings as stacked forms, roles matrix with a fixed first column */
@media (max-width: 760px) {
  table.data.cartes-mobile td:empty { display: none; }
  table.data.cartes-mobile td.pc-card-title { display: block; font-size: 14px; font-weight: 600; padding-bottom: 4px; overflow-wrap: anywhere; }
  table.data.cartes-mobile td.pc-card-title .sub2 { font-weight: 400; }
  /* a labelled value stays beside its label and wraps inside its own column */
  table.data.cartes-mobile td:not([data-label=""]) { flex-wrap: nowrap; }
  table.data.cartes-mobile td:not([data-label=""]) > * { min-width: 0; overflow-wrap: anywhere; }
  table.data.cartes-mobile td > .row, table.data.cartes-mobile td > a.lnk, table.data.cartes-mobile td > select, table.data.cartes-mobile td > div:not(.pc-actions) { flex: 1 1 0; min-width: 0; }
  table.data.cartes-mobile td .pc-actions { flex-wrap: wrap; }
  table.data.cartes-mobile td > a.btn { margin-top: 2px; }
  /* the field-by-field changes of the audit log stay a small table inside the card */
  .pc-changes { min-width: 0; width: 100%; }
  table.data.cartes-mobile table.pc-changes { display: table; }
  table.data.cartes-mobile table.pc-changes thead { display: table-header-group; }
  table.data.cartes-mobile table.pc-changes tbody { display: table-row-group; }
  table.data.cartes-mobile table.pc-changes tr { display: table-row; padding: 0; border: 0; background: none; }
  table.data.cartes-mobile table.pc-changes th, table.data.cartes-mobile table.pc-changes td { display: table-cell; width: auto; padding: 3px 8px 3px 0; font-size: 12px; overflow-wrap: anywhere; }
  table.data.cartes-mobile table.pc-changes td::before { content: none; }
  table.data.pc-unit-status tbody td { white-space: normal; }
  table.data.pc-unit-status .pill { white-space: nowrap; }
  .pc-kv, .pc-header { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* report tables of four columns or more: the row label as a title, then one line per figure, value on the right */
  table.pc-report-cards tr > td:first-child { display: block; font-weight: 600; font-size: 14px; padding-bottom: 4px; }
  table.pc-report-cards td:not(:first-child) { flex-wrap: nowrap; justify-content: space-between; align-items: baseline; }
  table.pc-report-cards td:not(:first-child)::before { flex: 1 1 auto; text-align: left; }
  table.data.pc-report-cards td.pc-num { text-align: right; justify-content: space-between; }
  /* settings: one card per entry, each field labelled above its input, full width */
  table.pc-params td:not([data-label=""]) { flex-direction: column; align-items: stretch; gap: 3px; padding: 5px 0; }
  table.pc-params td:not([data-label=""])::before { flex: none; padding: 0; }
  table.pc-params td > div[class*="u-"], table.pc-params td > .wrap { min-width: 0 !important; }
  table.pc-params td input[type=checkbox] { align-self: flex-start; width: 18px; height: 18px; }
  table.pc-params td textarea { width: 100%; }
  table.pc-params tr.pc-editor > td { background: none; padding: 5px 0; }
  table.pc-params tr.pc-editor { background: var(--neutral-bg); }
  /* roles matrix: permission column fixed while the role columns scroll */
  table.data.sticky.pc-roles thead th { top: 0; white-space: normal; min-width: 92px; vertical-align: bottom; }
  table.pc-roles tbody td:first-child, table.pc-roles thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 150px; max-width: 160px; box-shadow: 1px 0 0 var(--line); }
  table.pc-roles thead th:first-child { z-index: 3; background: var(--thead-bg); }
  table.pc-roles tr.pc-grid-group th > span { position: sticky; left: 12px; }
}

/* UX-076 user manual (resources/manual, App\Support\Manual) */
.doc-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
.doc-nav { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px; }
.doc-brand { display: block; font-weight: 700; font-size: 15px; color: var(--brand-d); margin: 0 2px 10px; }
.doc-search { position: relative; margin-bottom: 10px; }
.doc-search input { width: 100%; }
.doc-results { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); max-height: 60vh; overflow: auto; }
.doc-result { display: block; padding: 9px 11px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.doc-result:hover { background: var(--neutral-bg); }
.doc-result strong { display: block; color: var(--brand-d); margin-bottom: 2px; }
.doc-result span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.doc-result.none { color: var(--muted); }
.doc-nav-toggle { display: none; width: 100%; }
.doc-tree-group { border-top: 1px solid var(--line); padding: 6px 0; }
.doc-tree-group summary { cursor: pointer; list-style: none; padding: 6px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.doc-tree-group summary::-webkit-details-marker { display: none; }
.doc-tree-group summary::before { content: '▸'; display: inline-block; width: 14px; transition: transform .15s; }
.doc-tree-group[open] summary::before { transform: rotate(90deg); }
.doc-tree ul { list-style: none; margin: 0; padding: 0 0 4px; font-size: 13px; }
.doc-tree a { display: block; padding: 5px 8px 5px 18px; border-radius: 7px; color: var(--ink); line-height: 1.35; }
.doc-tree a:hover { background: var(--neutral-bg); }
.doc-tree a.active { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.doc-back-app { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.doc-body { min-width: 0; max-width: 1000px; }
.doc-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.doc-crumbs a { color: var(--brand-d); }
.doc-content { line-height: 1.65; font-size: 14.5px; }
.doc-content h1 { font-size: 27px; line-height: 1.25; margin: 2px 0 10px; }
.doc-content h1 + p { font-size: 15.5px; color: var(--muted); }
.doc-content h2 { font-size: 19px; margin: 34px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.doc-content h3 { font-size: 16px; margin: 22px 0 8px; scroll-margin-top: 12px; }
.doc-content h4 { font-size: 14.5px; margin: 16px 0 6px; }
.doc-content table { border-collapse: collapse; width: 100%; margin: 10px 0 18px; font-size: 13.5px; background: var(--surface); }
.doc-content th, .doc-content td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.doc-content thead th { background: var(--neutral-bg); font-weight: 600; }
.doc-content tbody th { background: var(--neutral-bg); font-weight: 600; width: 28%; }
.doc-content figure { margin: 16px 0 22px; }
.doc-content figure img { max-width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: 10px; cursor: zoom-in; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.doc-content figure.phone img { max-width: 320px; }
.doc-content figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.doc-content figcaption b { color: var(--ink); }
.doc-content .legend { counter-reset: legend; list-style: none; padding: 0; margin: 8px 0 18px; }
.doc-content .legend > li { counter-increment: legend; position: relative; padding-left: 34px; margin-bottom: 8px; }
.doc-content .legend > li::before { content: counter(legend); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: #d9480f; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.doc-content ol.etapes { counter-reset: step; list-style: none; padding: 0; }
.doc-content ol.etapes > li { counter-increment: step; position: relative; padding: 2px 0 10px 42px; border-left: 2px solid var(--line); margin-left: 14px; }
.doc-content ol.etapes > li::before { content: counter(step); position: absolute; left: -15px; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.doc-content ol.etapes > li:last-child { border-left-color: transparent; }
.doc-content .note, .doc-content .attention, .doc-content .bloquant, .doc-content .astuce, .doc-content .limite, .doc-content .erreur, .doc-content .a-clarifier { border-left: 4px solid var(--info); background: var(--info-bg); padding: 10px 14px 10px 14px; border-radius: 8px; margin: 14px 0; }
.doc-content .note::before, .doc-content .attention::before, .doc-content .bloquant::before, .doc-content .astuce::before, .doc-content .limite::before, .doc-content .erreur::before, .doc-content .a-clarifier::before { display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 3px; }
.doc-content .note::before { content: 'À savoir'; color: var(--info); }
.doc-content .attention { border-color: var(--warn); background: var(--warn-bg); }
.doc-content .attention::before { content: 'Attention'; color: var(--warn); }
.doc-content .bloquant { border-color: var(--bad); background: var(--bad-bg); }
.doc-content .bloquant::before { content: 'Contrôle bloquant'; color: var(--bad); }
.doc-content .astuce { border-color: var(--ok); background: var(--ok-bg); }
.doc-content .astuce::before { content: 'Bonne pratique'; color: var(--ok); }
.doc-content .limite { border-color: var(--muted); background: var(--neutral-bg); }
.doc-content .limite::before { content: 'Limitation connue'; color: var(--muted); }
.doc-content .erreur { border-color: var(--bad); background: var(--surface); border-style: solid; border-width: 1px 1px 1px 4px; }
.doc-content .erreur::before { content: 'Message d’erreur'; color: var(--bad); }
.doc-content .a-clarifier { border-color: var(--muted); background: var(--surface); border-style: dashed; border-width: 1px 1px 1px 4px; }
.doc-content .a-clarifier::before { content: 'Comportement à confirmer'; color: var(--muted); }
.doc-content .ui { font-weight: 600; background: var(--neutral-bg); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; white-space: nowrap; }
.doc-content .msg { font-style: italic; }
.doc-content details { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin: 12px 0; background: var(--surface); }
.doc-content details > summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.doc-content details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.doc-content code { font-size: 12.5px; background: var(--neutral-bg); padding: 1px 5px; border-radius: 4px; }
.doc-content .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 14px 0 20px; }
.doc-content .cards a, .doc-content .cards .card-item { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); color: var(--ink); }
.doc-content .cards a:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.doc-content .cards strong { display: block; color: var(--brand-d); margin-bottom: 4px; }
.doc-content .cards span { font-size: 13px; color: var(--muted); }
.doc-content .badge-ok, .doc-content .badge-no { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 0 8px; }
.doc-content .badge-ok { background: var(--ok-bg); color: var(--ok); }
.doc-content .badge-no { background: var(--neutral-bg); color: var(--muted); }
.doc-toc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0 18px; background: var(--surface); }
.doc-toc-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.doc-toc ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 28px; font-size: 13.5px; }
.doc-reserve { color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: help; }
.doc-prevnext { display: flex; justify-content: space-between; gap: 12px; margin: 36px 0 8px; flex-wrap: wrap; }
.doc-pn { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 220px; background: var(--surface); color: var(--ink); }
.doc-pn:hover { border-color: var(--brand); }
.doc-pn small { color: var(--muted); font-size: 12px; }
.doc-pn.next { text-align: right; margin-left: auto; }
.doc-version { margin: 14px 0 6px; font-size: 12px; color: var(--muted); }
.doc-top { position: fixed; right: 20px; bottom: 20px; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 4px 14px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transition: opacity .2s; }
.doc-top.show { opacity: 1; pointer-events: auto; }
.doc-zoom { max-width: 96vw; max-height: 96vh; padding: 10px; border: 0; border-radius: 12px; background: var(--surface); }
.doc-zoom-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.doc-zoom img { max-width: 92vw; max-height: 84vh; display: block; margin-top: 8px; cursor: zoom-out; }
.doc-zoom::backdrop { background: rgba(0,0,0,.72); }
.help-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: inherit; }
@media (max-width: 900px) {
  .doc-wrap { grid-template-columns: 1fr; gap: 14px; }
  .doc-nav { position: static; max-height: none; }
  .doc-nav-toggle { display: block; }
  .doc-tree { display: none; margin-top: 8px; }
  .doc-tree.open { display: block; }
  .doc-toc ul { columns: 1; }
}
@media (max-width: 640px) {
  .doc-content table { display: block; overflow-x: auto; }
  .doc-content tbody th { width: auto; }
  .doc-content h1 { font-size: 22px; }
  .doc-pn { min-width: 0; flex: 1 1 100%; }
}
@media print { .side, .topbar, .doc-nav, .doc-prevnext, .doc-top, .doc-toc { display: none !important; } .doc-wrap { display: block; } }
.doc-profile { border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px 10px; background: var(--surface); margin-top: 24px; }
.doc-profile h2 { border-top: 0; margin-top: 10px; }
.doc-rights { columns: 2; column-gap: 28px; padding-left: 18px; font-size: 13.5px; }
@media (max-width: 640px) { .doc-rights { columns: 1; } }
.topbar .help-link { background: transparent; color: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.28); }
.topbar .help-link:hover { color: #fff; border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.08); }
.topbar .help-link svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .topbar .help-link span { display: none; } }
.doc-content td .ui, .doc-content th .ui { white-space: normal; }
.doc-content td, .doc-content th { overflow-wrap: break-word; }
.doc-body { overflow-x: hidden; }
html[lang="en"] .doc-content .note::before { content: 'Good to know'; }
html[lang="en"] .doc-content .attention::before { content: 'Caution'; }
html[lang="en"] .doc-content .bloquant::before { content: 'Blocking check'; }
html[lang="en"] .doc-content .astuce::before { content: 'Good practice'; }
html[lang="en"] .doc-content .limite::before { content: 'Known limitation'; }
html[lang="en"] .doc-content .erreur::before { content: 'Error message'; }
html[lang="en"] .doc-content .a-clarifier::before { content: 'Behaviour to be confirmed'; }

/* RG-1141: count of reassignment requests in the menu */
.nav .nav-count { margin-left: auto; padding: 0 7px; font-size: 11px; line-height: 18px; }

/* D-097: time zone of the user */
.topbar .tz-pick { position: relative; }
.topbar .tz-pick summary { list-style: none; cursor: pointer; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .tz-form { position: absolute; right: 0; top: 110%; z-index: 30; background: var(--card, #fff); border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 10px; display: grid; gap: 6px; min-width: 240px; }

/* UX-079: next steps of a direction, revenue groups. */
.pc-next .pc-next-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.pc-next .pc-next-steps > li.done { color: var(--muted); }
.pc-next .pc-next-steps > li.done::marker { content: "✓  "; }
.pc-next .pc-next-anomalies { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.pc-next form.inline, .pc-next-anomalies form.inline { display: inline-flex; margin-left: 6px; vertical-align: middle; }
.pc-group-row td { background: var(--thead-bg); padding: 0; }
.pc-group-toggle { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 12px; }
.pc-group-toggle:focus-visible { outline: 2px solid var(--brand, #3e8748); outline-offset: -2px; }
.pc-group-toggle[aria-expanded="false"] .pc-fold-icon { transform: rotate(-90deg); }
.pc-fold-icon { display: inline-block; transition: transform .15s; }

/* UX-080: detail of a line beside the list; a bottom sheet on a phone. */
.pc-panel { position: fixed; top: 52px; right: 0; bottom: 0; width: min(760px, 50vw); z-index: 60; /* below the 52px top bar */
  background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -8px 0 24px rgba(16,24,40,.12); display: flex; flex-direction: column; }
.pc-panel[hidden] { display: none; }
.pc-panel-inner { overflow-y: auto; flex: 1; padding: 0 16px 24px; outline: none; }
.pc-panel-head { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; gap: 12px; justify-content: space-between; align-items: center;
  padding: 12px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.pc-panel-head > div:first-child { min-width: 0; flex: 1; }
.pc-panel-head h2 { margin: 0 0 4px; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.pc-panel-head .pc-actions { flex: none; flex-wrap: nowrap; align-self: center; }
.pc-panel-close { min-width: 32px; justify-content: center; }
.pc-panel table.pc-projects td.pc-proj-name, .pc-projects td.pc-proj-name { min-width: 240px; }
.pc-projects td.pc-proj-name .pill { margin: 0 6px 4px 0; }
.pc-panel-body .card { box-shadow: none; }
.pc-panel-wait { padding: 16px 0; }
@media (min-width: 1001px) { body.pc-panel-open .content { margin-right: min(760px, 50vw); } }
@media (max-width: 1000px) {
  .pc-panel { top: auto; left: 0; width: auto; height: min(85vh, calc(100vh - 52px)); height: min(85dvh, calc(100dvh - 52px)); border-left: 0; border-top: 1px solid var(--line-strong);
    border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(16,24,40,.18); }
}
tr.pc-row-active > td { background: var(--ok-bg); }
tr.pc-row-done > td { transition: background .6s; }
.pc-form-error { margin: 0 0 8px; }

/* UX-082: collapsible sidebar on a computer (icon rail); the phone drawer is unchanged. */
.brand { justify-content: space-between; }
.side-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); cursor: pointer; }
.side-toggle:hover { background: var(--hover); color: var(--ink); }
.side-toggle svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .side-toggle { display: none; } }
@media (min-width: 761px) {
  .app { transition: grid-template-columns .18s ease-out; }
  html.side-collapsed .app { grid-template-columns: 64px 1fr; }
  /* Folded: an icon rail. Hovering it (or moving into it with the keyboard) unfolds the whole menu over the page
     while the pointer stays in it; it folds back when the pointer leaves. */
  html.side-collapsed .side { width: 64px; overflow: hidden; z-index: 60; transition: width .15s ease-out, box-shadow .15s; }
  html.side-collapsed .side:is(:hover, :has(:focus-visible)) { width: 252px; overflow-y: auto; transition-delay: .12s;
    z-index: calc(var(--z-sticky) + 1); /* above the dark top bar while unfolded */
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
  html.side-collapsed .side:not(:hover):not(:has(:focus-visible)) .brand { padding: 12px 0; justify-content: center; }
  html.side-collapsed .side:not(:hover):not(:has(:focus-visible)) :is(.brand-logo, .nav .grp, .foot) { display: none; }
  html.side-collapsed .side:not(:hover):not(:has(:focus-visible)) .nav { padding: 8px; align-items: center; }
  html.side-collapsed .side:not(:hover):not(:has(:focus-visible)) .nav a { justify-content: center; padding: 10px; width: 44px; }
  html.side-collapsed .side:not(:hover):not(:has(:focus-visible)) .nav a .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html.side-collapsed .side:not(:hover):not(:has(:focus-visible)) .nav a .nav-count { position: absolute; top: 2px; right: 0; padding: 0 5px; font-size: 10px; }
  html.side-collapsed .side .nav a { position: relative; }
  /* The freed width goes to the content. */
  html.side-collapsed .content { max-width: calc(1320px + 188px); }
}
}

/* UX-083: the panel shows its tables as grids and cards, without horizontal scrolling. */
.pc-panel .pc-mgrid-block + .pc-mgrid-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pc-mgrid-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pc-mgrid-total strong { font-size: 15px; }
.pc-mgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.pc-mgrid > div { background: var(--thead-bg); border-radius: var(--r-sm); padding: 6px 8px; min-width: 0; }
.pc-mgrid dt { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pc-mgrid dd { margin: 2px 0 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pc-mgrid dd.neg { color: var(--bad); }
.pc-mgrid-edit { border: 0; padding: 0; margin: 10px 0; min-width: 0; }
.pc-mgrid-edit legend { padding: 0; width: 100%; }
.pc-mgrid-edit legend h3 { margin: 0; font-size: 13.5px; }
.pc-mgrid-edit label { display: flex; flex-direction: column; gap: 3px; background: var(--thead-bg); border-radius: var(--r-sm); padding: 6px 8px; min-width: 0; }
.pc-mgrid-edit label span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pc-mgrid-edit input { width: 100%; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .pc-mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 380px) { .pc-mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pc-cards { display: grid; gap: 10px; }
.pc-kcard { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; }
.pc-kcard-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 8px; overflow-wrap: anywhere; }
.pc-kcard .pc-kv { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; }
.pc-kcard .pc-kv dd { overflow-wrap: anywhere; }
.pc-kcard .pc-kv dd.num { text-align: left; }

/* UX-084: parameters page — grouped side menu, readable numbers with their unit, one save bar, table search. */
.pc-param-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.pc-subnav { position: sticky; top: 68px; display: flex; flex-direction: column; gap: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 10px; max-height: calc(100vh - 88px); overflow-y: auto; }
.pc-subnav-title { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 8px 4px; }
.pc-subnav a, .pc-subnav-phone a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 8px;
  border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: 13.5px; }
.pc-subnav a:hover, .pc-subnav-phone a:hover { background: var(--hover); }
.pc-subnav a.active, .pc-subnav-phone a.active { background: var(--nav-active); color: var(--nav-active-ink, var(--brand-d)); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.pc-subnav .ct, .pc-subnav-phone .ct { flex: none; font-size: 11.5px; color: var(--muted); background: var(--thead-bg); border-radius: 999px; padding: 0 7px; font-weight: 600; }
.pc-subnav-phone { display: none; }
.pc-param-main { min-width: 0; }
.pc-num-field { display: inline-flex; align-items: center; gap: 6px; }
.pc-num-field input { text-align: right; max-width: 160px; font-variant-numeric: tabular-nums; }
.pc-unit { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.pc-table-search { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pc-table-search input { max-width: 360px; width: 100%; }
table.pc-params tr.pc-changed > td { background: var(--warn-bg); }
table.pc-params tr.pc-changed > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.pc-save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 14px;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); }
.pc-save-bar.has-changes { border-color: var(--warn); }
.pc-save-bar.has-changes [data-change-count] { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) {
  .pc-param-layout { grid-template-columns: 1fr; }
  .pc-subnav { display: none; }
  .pc-subnav-phone { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 10px; }
  .pc-subnav-phone summary { cursor: pointer; padding: 8px 0; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
  .pc-subnav-phone .pc-subnav-title { padding-top: 10px; }
}

/* D-106: arbitration of a reconciliation gap, two choices as stacked cards. */
.pc-choice-cards { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.pc-choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.pc-choice:hover { background: var(--hover); }
.pc-choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.pc-choice input { margin-top: 3px; flex: none; }
.pc-choice > span { display: flex; flex-direction: column; gap: 3px; }
.pc-arbitrage .hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* D-112, UX-086: « i » button next to a business rule and its popover. */
.pc-ri { position: relative; display: inline-block; vertical-align: middle; }
.pc-ri-btn { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 4px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--muted);
  font: italic 700 11px/1 Georgia, 'Times New Roman', serif; cursor: pointer; }
.pc-ri-btn:hover, .pc-ri-btn[aria-expanded="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.pc-ri-pop { position: absolute; z-index: var(--z-dropdown); top: calc(100% + 6px); left: 0; width: min(360px, 80vw);
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; text-align: left; white-space: normal;
  font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: 0 10px 28px rgba(0, 0, 0, .16); }
.pc-ri-pop[hidden] { display: none; }
.pc-ri-pop:focus { outline: none; }
.pc-ri-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pc-ri-close { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.pc-ri-case { padding-top: 8px; border-top: 1px solid var(--line); }
.pc-ri-case em { font-style: normal; font-weight: 600; }
/* On a phone: a sheet at the bottom of the screen. */
@media (max-width: 640px) {
  .pc-ri-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 70vh; overflow-y: auto;
    border-radius: var(--r) var(--r) 0 0; z-index: var(--z-modal); padding: 16px; }
}
/* D-113, UX-087: progress of an import while it is read or written. */
.pc-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pc-progress-bar { height: 10px; border-radius: 999px; background: var(--thead-bg); overflow: hidden; }
.pc-progress-bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s ease-out; }
@media (prefers-reduced-motion: reduce) { .pc-progress-bar > span { transition: none; } }

/* RG-1151 : connexion biométrique (clés d'accès) / Biometric sign-in (passkeys). */
.bio-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--muted); font-size: 12px; }
.bio-or::before, .bio-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.bio-btn { width: 100%; justify-content: center; gap: 8px; }
.bio-ic { display: inline-flex; width: 20px; height: 20px; flex: none; }
.bio-ic svg { width: 100%; height: 100%; }
.bio-ic[hidden] { display: none; }
.bio-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
[data-passkey-register] .bio-btn { width: auto; }
/* SEC-033 (D-123) : classes utilitaires qui remplacent les anciens styles en ligne (CSP sans unsafe-inline).
   EN: utility classes replacing the former inline styles (CSP without unsafe-inline). */
.u-ai-center { align-items: center !important; }
.u-ai-flex-end { align-items: flex-end !important; }
.u-b-0 { border: 0 !important; }
.u-bt-line { border-top: 1px solid var(--line) !important; }
.u-c-muted { color: var(--muted) !important; }
.u-cur-pointer { cursor: pointer !important; }
.u-d-flex { display: flex !important; }
.u-ff-mono { font-family: ui-monospace,Consolas,monospace !important; }
.u-flex-1 { flex: 1 !important; }
.u-fs-11-5 { font-size: 11.5px !important; }
.u-fs-12 { font-size: 12px !important; }
.u-fs-12-5 { font-size: 12.5px !important; }
.u-fs-13 { font-size: 13px !important; }
.u-fs-44 { font-size: 44px !important; }
.u-fwt-600 { font-weight: 600 !important; }
.u-fwt-800 { font-weight: 800 !important; }
.u-fxw-wrap { flex-wrap: wrap !important; }
.u-gap-0 { gap: 0 !important; }
.u-gap-10 { gap: 10px !important; }
.u-gap-12 { gap: 12px !important; }
.u-gap-6 { gap: 6px !important; }
.u-gap-8 { gap: 8px !important; }
.u-gc-full { grid-column: 1/-1 !important; }
.u-gtc-fit280 { grid-template-columns: repeat(auto-fit,minmax(280px,1fr)) !important; }
.u-jc-center { justify-content: center !important; }
.u-jc-space-between { justify-content: space-between !important; }
.u-lh-1 { line-height: 1 !important; }
.u-m-0 { margin: 0 !important; }
.u-m-0-0-12 { margin: 0 0 12px !important; }
.u-m-0-0-16 { margin: 0 0 16px !important; }
.u-m-0-0-4 { margin: 0 0 4px !important; }
.u-m-0-0-6 { margin: 0 0 6px !important; }
.u-m-0-0-8 { margin: 0 0 8px !important; }
.u-m-10-0-0 { margin: 10px 0 0 !important; }
.u-m-10-0-6 { margin: 10px 0 6px !important; }
.u-m-12-0-0 { margin: 12px 0 0 !important; }
.u-m-6-0 { margin: 6px 0 !important; }
.u-m-6-0-0 { margin: 6px 0 0 !important; }
.u-m-8-0-0 { margin: 8px 0 0 !important; }
.u-maxw-180 { max-width: 180px !important; }
.u-maxw-260 { max-width: 260px !important; }
.u-maxw-640 { max-width: 640px !important; }
.u-mb-10 { margin-bottom: 10px !important; }
.u-mb-12 { margin-bottom: 12px !important; }
.u-mb-14 { margin-bottom: 14px !important; }
.u-mb-16 { margin-bottom: 16px !important; }
.u-mb-4 { margin-bottom: 4px !important; }
.u-mb-6 { margin-bottom: 6px !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-minw-170 { min-width: 170px !important; }
.u-minw-180 { min-width: 180px !important; }
/* D-155: comment of the imported file in the lines grid, three lines at most (full text on hover). */
td.c-note { max-width: 260px; font-size: 12.5px; color: var(--muted); }
td.c-note > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; overflow-wrap: anywhere; }
.u-minw-200 { min-width: 200px !important; }
.u-minw-230 { min-width: 230px !important; }
.u-minw-250 { min-width: 250px !important; }
.u-minw-48 { min-width: 48px !important; }
.u-ml-auto { margin-left: auto !important; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-10 { margin-top: 10px !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-mt-14 { margin-top: 14px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-mt-4 { margin-top: 4px !important; }
.u-mt-6 { margin-top: 6px !important; }
.u-mt-8 { margin-top: 8px !important; }
.u-p-0 { padding: 0 !important; }
.u-p-0-12-12 { padding: 0 12px 12px !important; }
.u-p-0-16-16 { padding: 0 16px 16px !important; }
.u-p-14 { padding: 14px !important; }
.u-p-18 { padding: 18px !important; }
.u-p-22 { padding: 22px !important; }
.u-p-26-22 { padding: 26px 22px !important; }
.u-p-6-0 { padding: 6px 0 !important; }
.u-pl-18 { padding-left: 18px !important; }
.u-ta-center { text-align: center !important; }
.u-ta-right { text-align: right !important; }
.u-w-100p { width: 100% !important; }
.u-w-1p { width: 1% !important; }
.u-ws-normal { white-space: normal !important; }

/* D-124 à D-128 : réglages de sécurité, notice, anonymisation. / Security settings, notice, anonymization. */
.pc-form-grid { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pc-ack-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-top: 4px; }
.pc-ack-check input { margin-top: 3px; flex: none; }
.pc-secret { display: inline-block; margin-top: 6px; padding: 4px 8px; font: 600 15px/1.4 ui-monospace, Consolas, monospace; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); user-select: all; }
.login.login-wide { width: 880px; max-width: calc(100vw - 32px); }
.pc-privacy .hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-privacy .hd h1 { margin: 0; font-size: 20px; }
.pc-notice h2 { font-size: 15px; margin: 18px 0 6px; }
.pc-notice h2:first-child { margin-top: 0; }
.pc-notice p, .pc-notice li { font-size: 14px; line-height: 1.55; }
.pc-notice ul { margin: 0 0 6px; padding-left: 20px; }
.pc-notice-text { white-space: pre-line; }
.pc-privacy-ack { margin-top: 18px; }
.pc-danger { border-color: oklch(0.85 0.06 25); }
.u-jc-between { justify-content: space-between !important; }
.pc-privacy-h2 { font-size: 15px; margin: 18px 0 6px; }
.u-m-14-0-0 { margin: 14px 0 0 !important; }
/* D-141 (Nasr, 11/11) : pas de zoom sur mobile (pincement et double appui), défilement gardé.
   EN: no zoom on mobile (pinch and double tap), scrolling kept. */
html, body { touch-action: pan-x pan-y; }

/* UX-090 : menu du compte derrière la pastille, sur téléphone seulement. / Account menu behind the avatar, phones only. */
.topbar .who-menu { display: none; position: relative; }
.topbar .who-menu > summary { list-style: none; cursor: pointer; }
.topbar .who-menu > summary::-webkit-details-marker { display: none; }
.topbar .who-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 200px; display: grid; gap: 2px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.topbar .who-pop .who-name { font-weight: 600; font-size: 13px; padding: 6px 10px; overflow-wrap: anywhere; }
.topbar .who-pop a, .topbar .who-pop .who-out { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 8px;
  color: inherit; font-size: 14px; text-decoration: none; width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.topbar .who-pop a svg { width: 16px; height: 16px; }
.topbar .who-pop a:hover, .topbar .who-pop .who-out:hover { background: var(--bg, #f3f3f3); }
.topbar .who-pop hr { border: 0; border-top: 1px solid var(--line, #ddd); margin: 6px 0; }
.topbar .who-pop .who-out { color: var(--bad, #b42318); }
@media (max-width: 760px) {
  .topbar .who .av-desk, .topbar .who .stack { display: none; }
  .topbar .who-menu { display: block; }
}

/* Sub-headings of the charges: filters by business unit then direction, and choice list with typing (Nasr, 12/11) */
.pc-ch-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; padding: 12px 14px; margin-bottom: 14px; }
.pc-ch-filters .field { margin-bottom: 0; min-width: 180px; }
.pc-ch-filters .pc-ch-q { flex: 1 1 240px; }
.pc-ch-filters .pc-ch-q input { width: 100%; }
.pc-ch-todo { font-size: 13px; padding-bottom: 8px; }
.pc-ch-todo input { width: 16px; height: 16px; accent-color: var(--brand); }
.pc-ch-counts { padding-bottom: 9px; margin-left: auto; }
.pc-combo { position: relative; display: inline-block; min-width: 240px; width: 100%; max-width: 340px; }
.pc-combo input { width: 100%; padding-right: 28px; }
.pc-combo::after { content: ""; position: absolute; right: 11px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.pc-combo-list { position: fixed; z-index: 600; max-height: 300px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: 0 8px 24px rgba(0,0,0,.16); font-size: 13px; }
.pc-combo-list .grp { padding: 6px 12px 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pc-combo-list [role=option] { padding: 6px 12px 6px 20px; cursor: pointer; color: var(--ink); }
.pc-combo-list [role=option] .cd { display: inline-block; min-width: 34px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-combo-list [role=option][aria-selected=true] { font-weight: 700; }
.pc-combo-list [role=option].on { background: var(--brand); color: #fff; }
.pc-combo-list [role=option].on .cd { color: #fff; }
.pc-combo-list .none { padding: 8px 12px; color: var(--muted); }
@media (max-width: 760px) {
  .pc-ch-filters .field { min-width: 0; flex: 1 1 100%; }
  .pc-ch-counts { margin-left: 0; }
  .pc-combo { max-width: none; }
}
/* D-174: sub-heading list and its own save button on one line */
.pc-ch-cell { display: flex; gap: 6px; align-items: center; }
.pc-ch-cell .btn { flex: none; }

/* D-176: where the budget stands against the targets (targets page) */
.pc-tp-figure { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.pc-tp-figure > .muted { font-size: 12px; min-width: 58px; }
.pc-tp-figure .v { margin-top: 0; font-size: 22px; }
.pc-tp-forecast { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.meter > span.pc-tp-ok { background: var(--ok); }
.meter > span.pc-tp-warn { background: var(--warn); }
.meter > span.pc-tp-bad { background: var(--bad); }
.meter > span.pc-tp-na { background: var(--line-strong); }
.pc-tp-row { display: flex; flex-direction: column; gap: 6px; }
.pc-tp-values { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; color: var(--muted); }
.pc-tp-values strong { color: var(--ink); }
.meter.pc-tp-track { position: relative; overflow: visible; height: 10px; margin: 8px 0; }
.meter.pc-tp-track > span { border-radius: 5px; }
/* The target mark: thick, dark, ringed in white so that it stays visible over the bar (Nasr, 12/11). */
.pc-tp-mark { position: absolute; top: -8px; bottom: -8px; width: 4px; margin-left: -2px; border-radius: 2px; background: #111418; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, .35); z-index: 1; }
.pc-tp-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.pc-tp-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.pc-tp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 5px; }
.pc-tp-dot.pc-tp-ok { background: var(--ok); } .pc-tp-dot.pc-tp-warn { background: var(--warn); } .pc-tp-dot.pc-tp-bad { background: var(--bad); }
.pc-tp-mark-legend { display: inline-block; width: 4px; height: 16px; border-radius: 2px; background: #111418; }
:root[data-theme="dark"] .pc-tp-mark, :root[data-theme="dark"] .pc-tp-mark-legend { background: #f2f4f7; box-shadow: 0 0 0 2px #111418; }
