/* SaaS — design system (aucun build requis).
   Utiliser les classes ci-dessous plutot que du CSS ad hoc. Compatible RTL (proprietes logiques). */
:root {
  --c-primary: #0e7c86;
  --c-primary-600: #0b6770;
  --c-primary-50: #e6f4f5;
  --c-accent: #f59e0b;
  --c-ink: #0f172a;
  --c-text: #334155;
  --c-muted: #64748b;
  --c-line: #e2e8f0;
  --c-bg: #f5f7fa;
  --c-card: #ffffff;
  --c-side: #0b1f2a;
  --c-side-text: #b6c6d0;
  --c-ok: #15803d; --c-ok-bg: #dcfce7;
  --c-warn: #b45309; --c-warn-bg: #fef3c7;
  --c-bad: #b91c1c; --c-bad-bg: #fee2e2;
  --c-info: #1d4ed8; --c-info-bg: #dbeafe;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--c-text); background: var(--c-bg); line-height: 1.55; font-size: 15px; -webkit-font-smoothing: antialiased; }
[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", Arial, sans-serif; }
h1, h2, h3, h4 { color: var(--c-ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
a { color: var(--c-primary); text-decoration: none; } a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: #eef2f6; padding: .1em .4em; border-radius: 5px; word-break: break-all; }
.muted { color: var(--c-muted); } .small { font-size: .85rem; } .right { text-align: end; } .center { text-align: center; }
.nowrap { white-space: nowrap; } .w-full { width: 100%; }
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; } .gap-1{gap:.5rem}.gap-2{gap:1rem}.gap-3{gap:1.5rem} .wrap { flex-wrap: wrap; }
.container { width: min(1160px, 92%); margin-inline: auto; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--c-line); background: var(--c-card); color: var(--c-ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: #f1f5f9; text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; } .btn-primary:hover { background: var(--c-primary-600); }
.btn-accent { background: var(--c-accent); border-color: var(--c-accent); color: #1f1300; } .btn-accent:hover { background: #d98a06; }
.btn-danger { background: var(--c-card); border-color: #fca5a5; color: var(--c-bad); } .btn-danger:hover { background: var(--c-bad-bg); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-primary); } .btn-ghost:hover { background: var(--c-primary-50); }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; } .btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* Cartes, grilles, stats */
.card { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; } .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > * { min-width: 0; }
.content .card, .content [style*="grid-template-columns"] > * { min-width: 0; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat .label { color: var(--c-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .value { font-size: 1.8rem; font-weight: 700; color: var(--c-ink); }
.stat .hint { font-size: .8rem; color: var(--c-muted); }

/* Formulaires */
.form-group { margin-bottom: 1rem; }
label, .label { display: block; font-weight: 600; font-size: .85rem; color: var(--c-ink); margin-bottom: .3rem; }
.input, input:not([type]), input[type=time], input[type=month], input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=tel], input[type=search], select, textarea { width: 100%; padding: .55rem .75rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; color: var(--c-ink); background: var(--c-card); }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--c-primary); outline-offset: 0; border-color: var(--c-primary); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--c-primary); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.help { font-size: .8rem; color: var(--c-muted); margin-top: .25rem; }
.error-text { color: var(--c-bad); font-size: .82rem; margin-top: .25rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); } @media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--c-line); }

/* Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-card); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; background: color-mix(in srgb, var(--c-ink) 4%, var(--c-card)); color: var(--c-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding: .7rem 1rem; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tbody tr:hover { background: #fafcfd; }
.table .actions { text-align: end; white-space: nowrap; }

/* Badges, alertes */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #e2e8f0; color: #334155; }
.badge-ok { background: var(--c-ok-bg); color: var(--c-ok); } .badge-warn { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-bad { background: var(--c-bad-bg); color: var(--c-bad); } .badge-info { background: var(--c-info-bg); color: var(--c-info); }
.alert { padding: .8rem 1rem; border-radius: 8px; border: 1px solid; margin-bottom: 1rem; font-size: .92rem; }
.alert-ok { background: var(--c-ok-bg); border-color: #86efac; color: #14532d; } .alert-warn { background: var(--c-warn-bg); border-color: #fcd34d; color: #78350f; }
.alert-bad { background: var(--c-bad-bg); border-color: #fca5a5; color: #7f1d1d; } .alert-info { background: var(--c-info-bg); border-color: #93c5fd; color: #1e3a8a; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--c-muted); } .empty h3 { color: var(--c-ink); }
.pagination { display: flex; gap: .25rem; margin-top: 1rem; justify-content: center; } .pagination a, .pagination span { padding: .3rem .7rem; border: 1px solid var(--c-line); border-radius: 6px; background: var(--c-card); font-size: .85rem; }
.pagination .active span, .pagination span[aria-current] { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
nav[role=navigation] svg { width: 1rem; height: 1rem; }

/* Onglets */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--c-line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem 1rem; color: var(--c-muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active, .tabs a:hover { color: var(--c-primary); border-bottom-color: var(--c-primary); text-decoration: none; }

/* Gabarit back-office (agence + console) */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--c-side); color: var(--c-side-text); padding: 1.1rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 800; font-size: 1.05rem; padding: .3rem .6rem 1.1rem; }
.sidebar .brand .logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--c-primary), #14b8a6); display: grid; place-items: center; color: #fff; font-weight: 800; }
.sidebar .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #6b8394; padding: 1rem .7rem .35rem; }
.sidebar a.nav { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 8px; color: var(--c-side-text); font-weight: 500; font-size: .92rem; }
.sidebar a.nav:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar a.nav.active { background: var(--c-primary); color: #fff; }
.sidebar a.nav.locked { opacity: .5; } .sidebar .ico { width: 18px; height: 18px; flex: none; }
svg.ico { width: 1.1rem; height: 1.1rem; flex: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--c-line); padding: .7rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 5; }
.topbar .who { display: flex; align-items: center; gap: .75rem; font-size: .88rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--c-primary-50); color: var(--c-primary); display: grid; place-items: center; font-weight: 700; }
.content { padding: 1.5rem; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; } .page-head .sub { color: var(--c-muted); margin: .2rem 0 0; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 20; transform: translateX(-105%); transition: transform .2s; }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 15; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 1rem; }
  .topbar { flex-wrap: wrap; padding: .6rem 1rem; row-gap: .5rem; }
  .topbar > * { min-width: 0; max-width: 100%; }
  .topbar .who { flex-wrap: wrap; }
  .topbar .branch-switcher { max-width: 100%; } .topbar .branch-switcher label { white-space: nowrap; } .topbar .branch-switcher select { max-width: calc(100vw - 10rem); }
  .topbar .flex.items-center.gap-2 > .small { display: none; }
}

/* Pages publiques (marketing, auth) */
.pub-header { background: #fff; border-bottom: 1px solid var(--c-line); position: sticky; top: 0; z-index: 10; }
.pub-header .container { display: flex; align-items: center; justify-content: space-between; padding: .85rem 0; gap: 1rem; }
.pub-header nav { display: flex; gap: 1.4rem; align-items: center; } .pub-header nav a { color: var(--c-text); font-weight: 600; font-size: .92rem; }
@media (max-width: 700px) { .pub-header .container { flex-wrap: wrap; row-gap: .5rem; } .pub-header nav { flex-wrap: wrap; gap: .5rem 1rem; } }
.brand-mark { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--c-ink); font-size: 1.1rem; }
.brand-mark:hover { text-decoration: none; } .brand-mark .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--c-primary), #14b8a6); color: #fff; display: grid; place-items: center; font-weight: 800; }
.pub-footer { background: var(--c-side); color: var(--c-side-text); padding: 2.5rem 0; margin-top: 4rem; font-size: .9rem; } .pub-footer a { color: #fff; }
.hero { padding: 5rem 0 4rem; background: radial-gradient(1200px 400px at 80% -10%, #c9eef0 0, transparent 60%), linear-gradient(180deg, #fff, var(--c-bg)); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 18ch; } .hero p.lead { font-size: 1.15rem; max-width: 56ch; color: var(--c-text); }
.section { padding: 3.5rem 0; } .section-title { text-align: center; max-width: 60ch; margin: 0 auto 2.5rem; }
.price-card { display: flex; flex-direction: column; gap: .75rem; position: relative; } .price-card.featured { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary), var(--shadow); }
.price-card .price { font-size: 2.2rem; font-weight: 800; color: var(--c-ink); } .price-card .price small { font-size: .9rem; color: var(--c-muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; } .price-card li::before { content: "✓"; color: var(--c-ok); font-weight: 800; margin-inline-end: .5rem; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: linear-gradient(160deg, #e6f4f5, var(--c-bg) 60%); }
.auth-card { width: min(440px, 100%); } .auth-card .brand-mark { justify-content: center; width: 100%; margin-bottom: 1.25rem; }
.lang-switch { display: flex; gap: .35rem; font-size: .8rem; } .lang-switch a { padding: .15rem .45rem; border-radius: 5px; color: var(--c-muted); } .lang-switch a.active { background: var(--c-primary-50); color: var(--c-primary); font-weight: 700; }
.banner { padding: .65rem 1.5rem; font-size: .9rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.banner-warn { background: var(--c-warn-bg); color: #78350f; } .banner-bad { background: var(--c-bad-bg); color: #7f1d1d; } .banner-info { background: var(--c-info-bg); color: #1e3a8a; }

/* Accessibilité : lien d'évitement (clavier) et focus visible sur fond sombre */
.skip-link { position: absolute; inset-inline-start: .5rem; top: -3rem; z-index: 100; background: #fff; color: var(--c-ink); padding: .5rem .9rem; border-radius: 8px; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.skip-link:focus { top: .5rem; }
.sidebar a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.content:focus { outline: none; }

/* ---- Poste de pilotage : navigation par métier, tableau de bord, états vides ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.card { min-width: 0; }
.stat { min-width: 0; }
.stat .value, .rp-kpi .value { font-size: clamp(.95rem, .6rem + .7vw, 1.5rem); line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.rp-kpi .value { font-size: clamp(.95rem, .6rem + .5vw, 1.3rem); }

/* Menu */
.sidebar { overscroll-behavior: contain; }
.sidebar .brand { overflow: hidden; } .sidebar .brand span:last-child { min-width: 0; overflow-wrap: anywhere; }
.nav-section { margin: 0; }
.nav-section > summary.group { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; border-radius: 6px; user-select: none; color: #8ea4b3; }
.nav-section > summary.group::-webkit-details-marker { display: none; }
.nav-section > summary.group:hover { color: #fff; }
.nav-section .chev { width: .5rem; height: .5rem; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; margin-inline-end: .2rem; }
.nav-section:not([open]) .chev { transform: rotate(-45deg); } [dir="rtl"] .nav-section:not([open]) .chev { transform: rotate(135deg); }
.sidebar a.nav { position: relative; } .sidebar a.nav .nav-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sidebar a.nav.active { box-shadow: inset 3px 0 0 var(--c-accent); font-weight: 700; } [dir="rtl"] .sidebar a.nav.active { box-shadow: inset -3px 0 0 var(--c-accent); }
.nav-count { margin-inline-start: auto; min-width: 1.35rem; padding: 0 .4rem; border-radius: 999px; background: var(--c-accent); color: #1f1300; font-size: .72rem; font-weight: 800; line-height: 1.35rem; text-align: center; }
.nav-locked a.nav.locked { opacity: .75; font-size: .86rem; } .nav-locked summary.group { color: #7c92a1; }
.sidebar summary:focus-visible, .sidebar a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
:where(.btn, a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.btn:focus-visible { box-shadow: 0 0 0 4px var(--c-primary-50); }

/* Recherche globale */
.topsearch { position: relative; flex: 1 1 auto; max-width: 380px; margin: 0 auto; }
.topsearch input { width: 100%; padding: .45rem 2.2rem .45rem .9rem; border: 1px solid var(--c-line); border-radius: 999px; font-size: .88rem; background: #f8fafc; }
[dir="rtl"] .topsearch input { padding: .45rem .9rem .45rem 2.2rem; }
.topsearch-key { position: absolute; inset-inline-end: .7rem; top: 50%; transform: translateY(-50%); border: 1px solid var(--c-line); border-radius: 5px; padding: 0 .35rem; font: inherit; font-size: .72rem; color: var(--c-muted); background: #fff; pointer-events: none; }
.topsearch input:focus + .topsearch-key { display: none; }
.who-name { line-height: 1.25; }
@media (max-width: 900px) {
  .topsearch { max-width: none; flex: 1 1 100%; order: 5; } .topsearch-key { display: none; }
  .who-name { display: none; }
  .sidebar { width: min(300px, 86vw); } .sidebar a.nav { padding: .75rem .8rem; } .nav-section > summary.group { padding-block: .8rem; }
  .menu-toggle { min-width: 2.5rem; min-height: 2.5rem; }
}

/* Tableau de bord */
.dash-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.dash-actions .btn { min-height: 2.5rem; }
.dash-periods { display: flex; flex-wrap: wrap; gap: .25rem; padding: .2rem; background: var(--c-card); border: 1px solid var(--c-line); border-radius: 999px; }
.dash-periods a { padding: .3rem .8rem; border-radius: 999px; font-size: .83rem; font-weight: 600; color: var(--c-text); }
.dash-periods a:hover { background: var(--c-primary-50); text-decoration: none; } .dash-periods a.active { background: var(--c-primary); color: #fff; }
.dash-link-card { position: relative; } .dash-link-card:hover { border-color: var(--c-primary); }
.dash-cover { position: absolute; inset: 0; border-radius: var(--radius); z-index: 1; }
.dash-cover:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.dash-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; } a.badge:hover { text-decoration: none; filter: brightness(.95); }
.dash-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .4rem; border-top: 1px solid #eef2f6; color: inherit; border-radius: 6px; }
.dash-row:hover { background: var(--c-primary-50); text-decoration: none; }
.dash-row-main { display: flex; flex-direction: column; min-width: 0; } .dash-row-main strong { overflow-wrap: anywhere; }
.dash-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: none; max-width: 55%; text-align: end; }
.dash-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-bar { display: block; width: 110px; max-width: 100%; height: 6px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.dash-bar > span { display: block; height: 100%; background: var(--c-primary); border-radius: 99px; }
.dash-pipeline { list-style: none; margin: 0; padding: 0; }
.dash-pipe-row { display: grid; grid-template-columns: minmax(5.5rem, 8rem) 1fr auto; align-items: center; gap: .75rem; padding: .5rem .4rem; border-radius: 6px; color: var(--c-text); }
.dash-pipe-row:hover { background: var(--c-primary-50); text-decoration: none; } .dash-pipe-row .dash-bar { width: 100%; }
.dash-log { padding: .5rem 0; border-bottom: 1px solid #eef2f6; gap: 1rem; } .dash-log > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.dash-facts { margin: 0; display: grid; gap: .6rem; } .dash-facts > div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #eef2f6; padding-bottom: .5rem; }
.dash-facts dt { color: var(--c-muted); } .dash-facts dd { margin: 0; text-align: end; overflow-wrap: anywhere; }
.dash-progress { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin: .25rem 0 1rem; } .dash-progress > span { display: block; height: 100%; background: var(--c-ok); }
.dash-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.dash-steps li { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--c-line); border-radius: 8px; }
.dash-steps li.done { background: color-mix(in srgb, var(--c-ok-bg) 45%, var(--c-card)); }
.dash-check { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; background: var(--c-primary-50); color: var(--c-primary); }
.done .dash-check { background: var(--c-ok); color: #fff; }
.dash-step-text { display: flex; flex-direction: column; min-width: 0; } .dash-step-text a { font-weight: 700; }
@media (max-width: 600px) { .dash-pipe-row { grid-template-columns: minmax(4.5rem, 6rem) 1fr auto; } .dash-row-side { max-width: 48%; } .dash-actions .btn { flex: 1 1 calc(50% - .6rem); } }

/* États vides et pages d'erreur */
.empty { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.empty h3 { margin: .25rem 0 0; } .empty p { margin: 0 0 .5rem; max-width: 42ch; }
.error-page { max-width: 560px; margin: 3rem auto; text-align: center; }
.error-page .code { font-size: 3.5rem; font-weight: 800; color: var(--c-primary); line-height: 1; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }

/* ---- Sous-navigation de module (composant x-subnav) : groupes + menus déroulants, sans défilement horizontal ---- */
.subnav { border-bottom: 1px solid var(--c-line); margin-bottom: 1.25rem; }
.subnav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem .25rem; }
.subnav-item { position: relative; }
.subnav-link { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .7rem; margin: 0; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-weight: 600; color: var(--c-muted); cursor: pointer; white-space: nowrap; text-decoration: none; }
.subnav-link:hover, .subnav-link.active, .subnav-link[aria-expanded="true"] { color: var(--c-primary); text-decoration: none; }
.subnav-link.active, .subnav-link[aria-expanded="true"] { border-bottom-color: var(--c-primary); }
.subnav-link:focus-visible, .subnav-menu a:focus-visible { outline: 2px solid var(--c-primary); outline-offset: -2px; border-radius: 6px; }
.subnav-chev { width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-block-start: -3px; transition: transform .15s; }
.subnav-link[aria-expanded="true"] .subnav-chev { transform: rotate(-135deg); margin-block-start: 3px; }
.subnav-badge { min-width: 1.3rem; padding: 0 .4rem; border-radius: 999px; background: var(--c-bad); color: #fff; font-size: .72rem; font-weight: 800; line-height: 1.3rem; text-align: center; }
.subnav-menu { position: absolute; inset-inline-start: 0; top: 100%; z-index: 12; min-width: 14.5rem; max-width: min(22rem, 92vw); margin: 0; padding: .35rem; list-style: none; background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(15,23,42,.14); }
.subnav-menu[hidden] { display: none; }
.subnav-menu a { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .75rem; border-radius: 7px; color: var(--c-text); font-weight: 500; font-size: .9rem; }
.subnav-menu a:hover { background: var(--c-primary-50); color: var(--c-primary); text-decoration: none; }
.subnav-menu a.active { background: var(--c-primary-50); color: var(--c-primary); font-weight: 700; box-shadow: inset 3px 0 0 var(--c-primary); }
[dir="rtl"] .subnav-menu a.active { box-shadow: inset -3px 0 0 var(--c-primary); }
@media (max-width: 700px) {
  .subnav-list { gap: 0; } .subnav-item.has-menu { flex: 1 1 100%; } .subnav-item:not(.has-menu) { flex: 0 0 auto; }
  .subnav-link { padding: .7rem .7rem; min-height: 2.75rem; } .subnav-item.has-menu > .subnav-link { width: 100%; justify-content: space-between; }
  .subnav-menu { position: static; box-shadow: none; max-width: none; border-width: 0; border-inline-start: 3px solid var(--c-primary-50); border-radius: 0; margin-bottom: .35rem; }
}

/* ---- Mobile : tableaux lisibles (défilement horizontal propre au lieu d'écraser les colonnes), champs contenus ---- */
input, select, textarea { min-width: 0; max-width: 100%; }
.table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
.table td, .table th { overflow-wrap: normal; word-break: normal; }
.table td { max-width: 26rem; }
@media (max-width: 900px) {
  .table-wrap table.table { width: max-content; min-width: 100%; }
  .table td { max-width: 20rem; }
  .form-actions { flex-wrap: wrap; } .form-actions .btn { flex: 1 1 auto; }
  .card-head { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .fin-filters .f, .fin-filters .f.grow { flex: 1 1 100%; min-width: 0; }
  .inline-form .grow { flex-basis: 100%; }
}

/* Journal des actions, filtres, badge neutre partagé */
.journal-filters .form-group { margin-bottom: 0; flex: 1 1 150px; min-width: 0; }
.journal-action code { word-break: normal; white-space: nowrap; }
.badge-mute { background: #e2e8f0; color: #475569; }
@media (max-width: 600px) { .journal-filters .form-group { flex-basis: 100%; } .journal-filters .btn { width: 100%; } }
@media (max-width: 700px) {
  .subnav-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subnav-item, .subnav-item.has-menu { flex: none; min-width: 0; } .subnav-link { width: 100%; white-space: normal; }
  .subnav-item:has(> .subnav-link[aria-expanded="true"]) { grid-column: 1 / -1; }
}
@media (max-width: 600px) { .table td { max-width: 14rem; } }
