/*
 * admin.css : tout le style de l'interface admin Edwin.
 *
 * Contraintes (spec section 7) : la CSP interdit `style=""` et les <style> en ligne,
 * donc TOUT passe par ce fichier et par des classes ; les valeurs dynamiques
 * (largeur d'une barre, position d'une infobulle) sont posées par le CSSOM depuis le JS.
 * Aucune police externe : pile système, titres en graisse 800. Mode clair uniquement.
 *
 * Palette : fond #FCF9F4, encre #17213B, secondaire #55607A, corail #FF6F5B (décor, jamais
 * de texte dessus), corail profond pour les boutons, pêche #FEECE6, vert #0FA06A réservé
 * aux états « réglé / ok / positif ».
 */

:root {
  --bg: #fcf9f4;
  --surface: #ffffff;
  --ink: #17213b;
  --muted: #55607a;
  --faint: #67718b;
  --coral: #ff6f5b;
  --coral-deep: #dc4b32;
  --btn: #cf452c; /* corail profond ajusté : texte blanc à 4,6:1 (AA) */
  --btn-hover: #b93a23;
  --coral-text: #b93a23; /* corail pour du TEXTE sur fond clair ou pêche : 5,4:1 sur le fond, 5:1 sur la pêche (le --btn ne fait que 4,4:1) */
  --peach: #feece6;
  --peach-soft: #fff5f1;
  --peach-line: #f4d6cc;
  --green: #0fa06a;
  --green-deep: #0b7d52;
  --green-tint: #e3f5ec;
  --bad: #b5381f;
  --amber: #8a5a00;
  --amber-tint: #fff3d6;
  --line: #ebe4d8;
  --line-strong: #d9d0c0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 33, 59, 0.04), 0 6px 20px rgba(23, 33, 59, 0.045);
  --shadow-pop: 0 10px 40px rgba(23, 33, 59, 0.18);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.no-scroll { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration-color: var(--peach-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--coral); }
svg { flex-shrink: 0; }
svg [hidden] { display: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }

/* Focus : anneau encre net, visible sur crème, blanc et corail */
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
h1[tabindex="-1"]:focus, main[tabindex="-1"]:focus, .tabpanel:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- icônes */
.icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- démarrage */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.boot-error { padding: 24px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--peach-line); border-top-color: var(--coral); animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- coquille */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px 14px; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-name { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.brand-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; background: var(--peach); color: var(--ink); border: 1px solid var(--peach-line); border-radius: 999px; padding: 2px 8px; }
.nav ul { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  font-weight: 650; color: var(--muted); text-decoration: none; transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--peach-soft); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--peach); color: var(--ink); font-weight: 750; }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--coral); }
.nav-link[aria-current="page"] .icon { color: var(--btn); }
.sidebar-foot .btn { justify-content: flex-start; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--peach); border: 1px solid var(--peach-line); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.user-text { min-width: 0; }
.user-label { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.user-email { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 6px 10px; background: var(--bg); border-radius: 999px; border: 1px solid var(--line); width: fit-content; font-variant-numeric: tabular-nums; }
.session.is-low { color: var(--bad); border-color: var(--peach-line); background: var(--peach-soft); font-weight: 700; }
.version { font-size: 12px; color: var(--faint); padding-left: 2px; }
.shell-main { min-width: 0; }
.topbar { display: none; }
.main { padding: 36px 40px 72px; max-width: 1360px; margin: 0 auto; }
.nav-backdrop { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: auto;
    transform: translateX(-102%); visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s; box-shadow: var(--shadow-pop);
  }
  .shell.nav-open .sidebar { transform: none; visibility: visible; transition-delay: 0s; }
  .nav-link[aria-current="page"]::before { left: -14px; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(23, 33, 59, 0.45); }
  .nav-backdrop[hidden] { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40; height: 56px; padding: 0 12px 0 8px;
    background: rgba(252, 249, 244, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .menu-btn { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
  .menu-btn:hover { background: var(--peach-soft); }
  .topbar-title { font-weight: 800; font-size: 17px; }
  .main { padding: 20px 16px 56px; }
}

/* ---------------------------------------------------------------- page */
.page { display: flex; flex-direction: column; gap: 28px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-header-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral-text); }
.page-title { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -0.025em; }
.page-subtitle { color: var(--muted); max-width: 70ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 2px; min-height: 24px; color: var(--muted); font-size: 13.5px; font-weight: 650; text-decoration: none; margin-bottom: 4px; }
.back-link:hover { color: var(--ink); }
@media (max-width: 900px) { .page-title { font-size: 25px; } .page { gap: 22px; } }

.section { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 80px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.section-title { font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
.section-subtitle { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.minor-title { font-size: 14px; font-weight: 700; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid.gap-sm { gap: 8px; } .grid.gap-lg { gap: 24px; }
.grid > * { min-width: 0; }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cols-1 { grid-template-columns: minmax(0, 1fr); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); } .cols-auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.gap-sm { gap: 8px; } .stack.gap-lg { gap: 24px; } .stack.gap-xl { gap: 48px; } .stack > * { min-width: 0; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spaced { margin-top: 16px; }

/* ---------------------------------------------------------------- cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head-text { flex: 1 1 180px; min-width: 0; }
.card-flush > .card-head { padding: 20px 22px 0; }
.card-title { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.card-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { min-width: 0; }
.card-body > * + * { margin-top: 14px; }
@media (max-width: 900px) { .card { padding: 16px; border-radius: 14px; } }

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 14.5px; cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s; white-space: nowrap; position: relative;
}
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 13.5px; border-radius: 10px; }
.btn-icon-only { padding: 8px; width: 40px; }
.btn-sm.btn-icon-only { width: 34px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--btn); color: #fff; }
.btn-primary:hover { background: var(--btn-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--peach-soft); border-color: var(--peach-line); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: var(--peach-soft); }
.btn-danger { background: var(--btn); color: #fff; }
.btn-danger:hover { background: var(--btn-hover); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.is-busy { cursor: progress; }
.btn.is-busy .btn-label { opacity: 0.75; }
.btn.is-busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--ink); font-weight: 650; text-decoration: underline; text-decoration-color: var(--peach-line); text-underline-offset: 3px; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }
.link-btn:hover { text-decoration-color: var(--coral); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.chip:hover { background: var(--peach-soft); border-color: var(--peach-line); }

/* ---------------------------------------------------------------- badges, encadrés, onglets */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--green-tint); color: var(--green-deep); border-color: #bfe6d3; }
.badge-warn { background: var(--amber-tint); color: var(--amber); border-color: #f1dca4; }
.badge-bad { background: var(--peach); color: var(--bad); border-color: var(--peach-line); }
.badge-info { background: #e9ecf5; color: var(--ink); border-color: #d3d9ea; }
.badge-coral { background: var(--coral); color: var(--ink); border-color: var(--coral); }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.callout > .icon { margin-top: 2px; color: var(--muted); }
.callout-body { flex: 1; min-width: 0; font-size: 14px; }
.callout-title { font-weight: 800; }
.callout-actions { flex-shrink: 0; }
.callout-info { background: #f1f3f9; border-color: #dde2ee; }
.callout-ok { background: var(--green-tint); border-color: #bfe6d3; } .callout-ok > .icon { color: var(--green-deep); }
.callout-warn { background: var(--amber-tint); border-color: #f1dca4; } .callout-warn > .icon { color: var(--amber); }
.callout-bad { background: var(--peach); border-color: var(--peach-line); } .callout-bad > .icon { color: var(--bad); }

.tablist { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { background: none; border: 0; padding: 10px 10px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--coral); }
.tab-count { margin-left: 6px; background: var(--peach); border-radius: 999px; font-size: 12px; padding: 1px 7px; }

.kv { display: flex; flex-direction: column; }
.kv-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
@media (max-width: 860px) { .kv-2 { grid-template-columns: minmax(0, 1fr); } }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv-row dt { color: var(--muted); flex: 0 0 auto; max-width: 48%; }
.kv-row dd { font-weight: 650; text-align: right; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- formulaires */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-error { background: var(--peach); border: 1px solid var(--peach-line); color: var(--bad); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 700; font-size: 14px; }
.req { color: var(--bad); }
.field-hint { color: var(--muted); font-size: 13px; }
.field-error { color: var(--bad); font-size: 13px; font-weight: 650; }
.input {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:hover { border-color: #c4baa8; }
.input:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 1px; border-radius: 10px; }
.input::placeholder { color: #8b93a8; }
.input-sm { min-height: 36px; padding: 5px 10px; font-size: 14px; width: auto; }
textarea.input { resize: vertical; min-height: 84px; }
.has-error .input { border-color: var(--bad); }
.input-code { font-family: var(--mono); font-size: 26px; letter-spacing: 0.4em; text-align: center; padding-left: 0.4em; font-weight: 700; min-height: 54px; }
.select {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355607A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.input-reveal:hover { background: var(--peach-soft); color: var(--ink); }
.bool-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; }
.check-input { appearance: none; width: 24px; height: 24px; border: 1.5px solid #b9b0a0; border-radius: 6px; background: var(--surface); cursor: pointer; flex-shrink: 0; display: inline-grid; place-content: center; }
.check-input:checked { background: var(--ink); border-color: var(--ink); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); background-size: 16px; background-position: center; background-repeat: no-repeat; }
.switch-input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: #cfc7b8; position: relative; cursor: pointer; flex-shrink: 0; transition: background 0.15s; }
.switch-input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch-input:checked { background: var(--ink); }
.switch-input:checked::after { transform: translateX(18px); }
.search-wrap { position: relative; flex: 1 1 240px; max-width: 380px; min-width: 180px; }
.search-wrap > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-input { padding-left: 38px; min-height: 38px; }

.segmented { display: inline-flex; background: #f1ebe0; border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented-btn { border: 0; background: transparent; padding: 6px 14px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; min-height: 32px; }
.segmented-btn:hover { color: var(--ink); }
.segmented-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 33, 59, 0.15); }
.period { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.period-custom { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; }
.period-custom label { color: var(--muted); font-weight: 650; }
@media (max-width: 900px) { .period { align-items: stretch; width: 100%; } .period-custom { justify-content: flex-start; } .segmented { width: 100%; } .segmented-btn { flex: 1 1 auto; padding: 6px 8px; } }

/* ---------------------------------------------------------------- tableaux */
.table-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar-spacer { flex: 1 1 0; }
.menu-wrap { position: relative; }
.popover { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 8px; min-width: 210px; display: flex; flex-direction: column; }
.menu-item { padding: 8px 10px; border-radius: 8px; }
.menu-item:hover { background: var(--peach-soft); }
.table-scroll {
  overflow-x: auto;
  /* ombres de défilement : un liseré apparaît du côté où il reste du contenu caché (le fond blanc 'local' les masque quand on est au bord) */
  background:
    linear-gradient(90deg, var(--surface) 30%, rgba(255, 255, 255, 0)) 0 0 / 32px 100% no-repeat local,
    linear-gradient(270deg, var(--surface) 30%, rgba(255, 255, 255, 0)) 100% 0 / 32px 100% no-repeat local,
    linear-gradient(90deg, rgba(23, 33, 59, 0.16), rgba(23, 33, 59, 0)) 0 0 / 12px 100% no-repeat scroll,
    linear-gradient(270deg, rgba(23, 33, 59, 0.16), rgba(23, 33, 59, 0)) 100% 0 / 12px 100% no-repeat scroll;
}
.table-scroll:focus-visible { outline-offset: -3px; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table thead th { font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: #fbf7f0; white-space: nowrap; padding-top: 10px; padding-bottom: 10px; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table th[scope="row"] { font-weight: 700; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table.is-loading { opacity: 0.55; transition: opacity 0.15s; }
.data-table-compact th, .data-table-compact td { padding: 8px 12px; font-size: 13.5px; }
.is-clickable { cursor: pointer; }
.is-clickable:hover > * { background: var(--peach-soft); }
.is-clickable:focus-visible { outline-offset: -2px; }
.th-btn { background: none; border: 0; padding: 2px 0; min-height: 24px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.th-btn:hover, .th-btn.is-sorted { color: var(--ink); }
.sort-icon { opacity: 0.5; }
.th-btn.is-sorted .sort-icon { opacity: 1; color: var(--btn); }
.th-btn:hover .sort-icon { opacity: 1; }
.row-link { font-weight: 700; text-decoration: none; }
.row-link:hover { text-decoration: underline; text-decoration-color: var(--coral); }
.ext-link { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.unsafe-url { color: var(--muted); overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; text-decoration: line-through; text-decoration-color: var(--peach-line); }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.table-foot:empty { display: none; }
.pager { display: flex; gap: 4px; align-items: center; }
.page-btn { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid transparent; background: transparent; border-radius: 9px; font-weight: 700; cursor: pointer; display: inline-grid; place-items: center; color: var(--ink); }
.page-btn:hover:not(:disabled) { background: var(--peach-soft); border-color: var(--peach-line); }
.page-btn.is-current { background: var(--ink); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-dots { color: var(--faint); padding: 0 4px; }
.page-size { display: flex; align-items: center; gap: 8px; }
.data-table + .data-table { margin-top: 12px; }
@media (max-width: 700px) { .hide-sm { display: none; } .data-table th, .data-table td { padding: 11px 12px; } .table-foot { justify-content: center; } .data-table th[scope="row"] { overflow-wrap: anywhere; min-width: 7.5em; } .search-wrap { flex-basis: 100%; max-width: none; } }

/* ---------------------------------------------------------------- tuiles */
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 18px; min-height: 130px; text-decoration: none; color: inherit; overflow: hidden; }
.tile-link { transition: border-color 0.15s, transform 0.15s; }
.tile-link:hover { border-color: var(--peach-line); text-decoration: none; background: var(--peach-soft); }
.tile-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; } /* la hauteur de l'icône : les chiffres restent alignés d'une tuile à l'autre */
.tile-label { font-size: 13.5px; font-weight: 650; color: var(--muted); }
.tiles-long-labels .tile-top { min-height: 40px; align-items: flex-start; }
.tile-icon { color: var(--btn); background: var(--peach); border-radius: 10px; width: 30px; height: 30px; display: grid; place-items: center; flex-shrink: 0; }
.tile-value { font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-unit { font-size: 15px; font-weight: 700; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.tile-delta { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.tile-delta .delta-flat { width: 14px; text-align: center; font-weight: 800; }
.tile-delta strong { font-weight: 800; }
.tile-delta.is-good { color: var(--green-deep); }
.tile-delta.is-bad { color: var(--bad); }
.tile-delta .delta-label { color: var(--faint); font-weight: 500; }
.tile-delta.is-none .delta-text { color: var(--faint); }
.tile-hint { font-size: 12.5px; color: var(--muted); }
.tile-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px 10px; }
.tile-main .tile-value { min-width: 0; }
.tile-spark { opacity: 0.95; margin-bottom: 2px; }
.tile-warn { border-color: #efd699; background: linear-gradient(180deg, var(--amber-tint), var(--surface) 70%); }
.tile-bad { border-color: var(--peach-line); background: linear-gradient(180deg, var(--peach), var(--surface) 70%); }
.tile-ok { border-color: #bfe6d3; background: linear-gradient(180deg, var(--green-tint), var(--surface) 70%); }
.tile-skel { min-height: 130px; gap: 12px; }
.spark-row > * { margin-right: 20px; }
@media (max-width: 860px) { .tile { padding: 14px 14px 14px; min-height: 118px; } .tile-value { font-size: 26px; } .tile-main { flex-wrap: wrap; } .tile-spark svg { width: 64px; height: 26px; } }

/* ---------------------------------------------------------------- graphiques */
.col-coral, .col-1 { --c: #ff6f5b; } .col-ink, .col-2 { --c: #17213b; } .col-3 { --c: #e3a03a; } .col-4 { --c: #2f8f9d; }
.col-5 { --c: #8b5e83; } .col-6 { --c: #7d88a3; } .col-7 { --c: #f4b6a6; } .col-8 { --c: #a8b89a; }
.col-gray { --c: #8a93a8; } .col-green { --c: #0fa06a; } .col-bad { --c: #dc4b32; } .col-mist { --c: #d9d3c7; }
.f { fill: var(--c); } .st { stroke: var(--c); }
.stop-coral { stop-color: #ff6f5b; }
.chart-card { display: block; }
.chart-card .card-head { margin-bottom: 10px; }
.chart-legend { margin-bottom: 8px; }
.chart-body { position: relative; min-width: 0; }
.chart-svg { display: block; max-width: 100%; touch-action: pan-y; overflow: visible; border-radius: 8px; }
.chart-svg:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 4px; }
.axis-text { font-size: 11.5px; fill: var(--faint); font-family: var(--font); font-variant-numeric: tabular-nums; }
.axis-strong { fill: var(--muted); font-weight: 650; }
.grid-line { stroke: #eee7db; stroke-width: 1; }
.axis-line { stroke: #cfc6b6; stroke-width: 1; }
.line { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-dashed { stroke-width: 2; stroke-dasharray: 5 5; }
.guide { stroke: var(--ink); stroke-opacity: 0.3; stroke-dasharray: 3 3; stroke-width: 1; }
.dot { stroke: #fff; stroke-width: 2.5; }
.hover-band { fill: var(--ink); fill-opacity: 0.05; }
.bar-dim { fill-opacity: 0.5; }
.heat-scroll { overflow-x: auto; padding-bottom: 4px; }
.heat-scroll .chart-svg { max-width: none; } /* la matrice garde sa taille lisible et défile, au lieu de se réduire à 5 px sur mobile */
.heat-text { font-size: 11.5px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.heat-null { fill: none; stroke: #e3dccd; stroke-dasharray: 3 4; }
.focus-ring-svg { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.chart-tip { position: absolute; z-index: 6; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; min-width: 130px; box-shadow: 0 8px 24px rgba(23, 33, 59, 0.3); line-height: 1.35; }
.tip-head { font-size: 12px; opacity: 0.78; margin-bottom: 4px; font-weight: 600; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-name { flex: 1; opacity: 0.9; }
.tip-val { font-weight: 800; font-variant-numeric: tabular-nums; }
.tip-sub { font-size: 11.5px; opacity: 0.65; margin-left: 4px; }
.tip-total { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 12.5px; display: flex; justify-content: space-between; }
.chart-tip .swatch { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--c); flex-shrink: 0; }
.swatch-dashed { width: 18px; height: 3px; border-radius: 0; background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
.chart-data { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; max-height: 340px; overflow: auto; }
.chart-data .table-scroll { overflow: visible; }
.chart-data .data-table th[scope="row"] { font-weight: 600; color: var(--muted); }

.hbars, .funnel { display: flex; flex-direction: column; gap: 14px; }
.hbar-head, .funnel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 5px; font-size: 14px; }
.hbar-label { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.hbar-link { text-decoration: none; }
.hbar-link:hover { text-decoration: underline; text-decoration-color: var(--coral); }
.hbar-sub { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.hbar-value { display: inline-flex; gap: 8px; align-items: baseline; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar-value strong { font-weight: 800; }
.hbar-share { color: var(--muted); font-size: 12.5px; min-width: 40px; text-align: right; }
.hbar-track { display: block; width: 100%; }
.track-bg { fill: #f1ebe0; }
.hbar-others .hbar-label { color: var(--muted); font-weight: 500; }
.funnel-head { align-items: center; justify-content: flex-start; }
.funnel-num { width: 22px; height: 22px; border-radius: 50%; background: var(--peach); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.funnel-label { flex: 1; display: flex; flex-direction: column; font-weight: 650; min-width: 0; }
.funnel-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.funnel-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.funnel-conv { color: var(--ink); font-weight: 650; }
.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut { flex-shrink: 0; }
.seg { transition: opacity 0.15s; }
.seg-dim { opacity: 0.3; }
.donut-value { font-size: 24px; font-weight: 800; fill: var(--ink); font-variant-numeric: tabular-nums; }
.donut-label { font-size: 12px; fill: var(--muted); }
.donut-legend { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.donut-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 14px; }
.donut-row.is-active { background: var(--peach-soft); }
.donut-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.donut-val { font-variant-numeric: tabular-nums; font-weight: 800; }
.donut-share { color: var(--muted); font-size: 12.5px; min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.spark { display: block; overflow: visible; }
.spark-area { fill-opacity: 0.14; }
.spark-line { stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark.col-coral .spark-line, .spark .spark-line { stroke: var(--c); }
.spark circle { fill: var(--c); }
.spark-area { fill: var(--c); }

/* ---------------------------------------------------------------- états */
.skel { background: linear-gradient(90deg, #efe9de 25%, #f8f3ea 50%, #efe9de 75%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; border-radius: 8px; display: block; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 12px; } .skel-sm { width: 40%; height: 11px; } .skel-lg { width: 62%; height: 30px; border-radius: 10px; } .skel-sm.short { width: 28%; }
.skel-lines { display: flex; flex-direction: column; gap: 10px; }
.skel-block { width: 100%; border-radius: 12px; }
.skel-row { display: flex; gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.skel-row > * { flex: 1; }
.skel-table { min-width: 0; }
.page-loading { display: flex; flex-direction: column; gap: 22px; }
.loading-block { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 20px 4px; }
.empty, .error-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 20px; }
.empty-compact { padding: 22px 16px; }
.empty .illus { margin-bottom: 6px; }
.empty-chart { padding: 28px 16px; }
.empty-title { font-weight: 800; font-size: 16px; }
.empty-text { color: var(--muted); font-size: 14px; max-width: 46ch; margin-bottom: 8px; }
.error-state .empty-title { color: var(--ink); }
.error-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--peach); color: var(--bad); display: grid; place-items: center; margin-bottom: 4px; }
.card > .empty:only-child, .chart-body > .empty { border: 1.5px dashed var(--peach-line); border-radius: 14px; background: linear-gradient(180deg, #fffaf7, #fff); }

/* ---------------------------------------------------------------- couches */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(23, 33, 59, 0.45); display: flex; animation: fade 0.15s ease-out; }
.overlay-center { align-items: center; justify-content: center; padding: 16px; }
.overlay-right { justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(0.98); opacity: 0; } }
.modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-pop); padding: 26px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; animation: pop 0.18s ease-out; }
.modal-lg { width: min(720px, 100%); }
.modal-title { font-size: 20px; font-weight: 800; letter-spacing: -0.015em; margin-bottom: 10px; overflow-wrap: anywhere; }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
.modal-message { color: var(--muted); overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.drawer { background: var(--surface); width: min(480px, 100vw); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: slide-in 0.2s ease-out; }
.drawer-lg { width: min(720px, 100vw); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer-head-text { min-width: 0; }
.drawer-title { font-size: 20px; font-weight: 800; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.drawer-subtitle { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.drawer-close { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 10px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.drawer-close:hover { background: var(--peach-soft); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 900px) { .drawer-body, .drawer-head, .drawer-foot { padding-left: 16px; padding-right: 16px; } }

.toasts { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 12px 12px 14px; box-shadow: var(--shadow-pop); animation: pop 0.2s ease-out; border-left: 5px solid #8a93a8; font-size: 14px; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.18s, transform 0.18s; }
.toast-success { border-left-color: var(--green); } .toast-error { border-left-color: var(--coral); } .toast-warn { border-left-color: #e3a03a; }
.toast-icon { margin-top: 1px; display: grid; }
.toast-success .toast-icon { color: #5fd9a5; } .toast-error .toast-icon { color: #ff9b8c; } .toast-warn .toast-icon { color: #f5c46b; }
.toast-msg { flex: 1; overflow-wrap: anywhere; padding-top: 1px; }
.toast-action { background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; border-radius: 8px; padding: 3px 10px; font-weight: 700; cursor: pointer; font-size: 13px; }
.toast-action:hover { background: rgba(255, 255, 255, 0.12); }
.toast-close { background: transparent; border: 0; color: #fff; opacity: 0.7; cursor: pointer; display: grid; padding: 3px; border-radius: 6px; }
.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.toasts :focus-visible, .toast :focus-visible { outline-color: #fff; }
@media (max-width: 900px) { .toasts { right: 16px; left: 16px; bottom: 16px; width: auto; } }

/* ---------------------------------------------------------------- connexion */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 500px at 85% -10%, var(--peach) 0%, transparent 60%), radial-gradient(700px 420px at -10% 110%, #fff0e8 0%, transparent 60%), var(--bg); }
.login-main { width: min(440px, 100%); display: flex; flex-direction: column; gap: 22px; align-items: stretch; }
.login-brand { display: flex; align-items: center; gap: 10px; justify-content: center; }
.login-brand .brand-name { font-size: 28px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-pop); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.login-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.login-title:focus { outline: none; }
.login-sub { color: var(--muted); margin-top: -8px; }
.login-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.login-foot { text-align: center; color: var(--faint); font-size: 13px; }
@media (max-width: 480px) { .login-card { padding: 24px 20px; border-radius: 18px; } .input-code { font-size: 22px; } }

/* ---------------------------------------------------------------- catalogue */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.icon-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; font-size: 11.5px; color: var(--muted); text-align: center; }
.icon-cell .icon { color: var(--ink); }

/* ---------------------------------------------------------------- mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .skel { background: #efe9de; }
  .spinner { border-top-color: var(--peach-line); border-right-color: var(--coral); }
}

/* ---------------------------------------------------------------- impression */
@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .page-actions, .table-toolbar, .table-foot, .toasts, .btn, .chips, .nav-backdrop, .skip-link, .period { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .card, .tile { box-shadow: none; break-inside: avoid; }
  .page-title { font-size: 22px; }
  .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-data { display: block; }
  a { text-decoration: none; }
}

/* ================================================================ [statkit] pages Liste d'attente, Clients, Fiche client
   Ajout seul (js/ui/statkit.js). Rien ci-dessus n'est modifié. */
.block { min-width: 0; }
.section-nav { margin-top: -6px; }
.flagged { white-space: nowrap; }
.flag { font-size: 1.05em; margin-right: 2px; }
.filter { display: inline-flex; align-items: center; gap: 6px; }
.filter-text { font-size: 13px; color: var(--muted); font-weight: 650; }
.spaced-sm { margin-top: 8px; }
.minor-title + .row-wrap { margin-top: 8px; }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.meter-label { color: var(--muted); font-weight: 650; }
.meter-value { font-weight: 800; font-variant-numeric: tabular-nums; }
.meter-track { height: 10px; border-radius: 999px; background: #f1ebe0; overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.meter-warn .meter-fill { background: #e3a03a; }
.meter-bad .meter-fill { background: var(--coral-deep); }
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; display: flex; gap: 14px; padding: 0 0 18px 0; }
.timeline-item::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-strong); z-index: 1; }
.tl-ok .timeline-dot { border-color: var(--green); }
.tl-warn .timeline-dot { border-color: #e3a03a; }
.tl-bad .timeline-dot { border-color: var(--coral-deep); }
.tl-info .timeline-dot { border-color: var(--ink); }
.timeline-body { min-width: 0; flex: 1; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.timeline-title { font-weight: 750; }
.timeline-text { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.timeline-at { color: var(--faint); font-size: 12.5px; }
.block-note { color: var(--muted); font-size: 13.5px; }
.stat-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .stat-split { grid-template-columns: minmax(0, 1fr); } }
/* [/statkit] */

/* ================================================================ Vue d'ensemble, Finance, Système, Compte (agent r3 : home / finance / system / account) */
.small { font-size: 13px; }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-5 .tile { padding-left: 16px; padding-right: 16px; }
.cols-5 .tile-label { font-size: 13px; }
@media (max-width: 1250px) { .cols-5 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
.updated-at { font-size: 13px; align-self: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.cell-sub { font-size: 12px; font-weight: 500; }
.big-number { font-size: 38px; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bullets { display: flex; flex-direction: column; gap: 8px; padding-left: 20px; list-style: disc; color: var(--ink); }
.bullets li::marker { color: var(--coral); }
.tab-head { margin-bottom: 16px; }
.tab-head .section-subtitle { max-width: 90ch; }
.controls-bar { display: flex; flex-direction: column; gap: 10px; margin-top: -8px; }
.toolbar-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.toolbar-label { font-weight: 700; font-size: 13.5px; color: var(--muted); }
.toolbar-note { font-size: 13px; }
.toolbar-period .period { flex-direction: row; flex-wrap: wrap; align-items: center; }
.toolbar-period .period-custom { justify-content: flex-start; }
.table-title-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }

/* alertes de la vue d'ensemble */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 12px; background: var(--surface); }
.alert-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #f1f3f9; color: var(--muted); }
.alert-text { min-width: 0; }
.alert-title { font-weight: 800; overflow-wrap: anywhere; }
.alert-detail { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.alert-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.alert-critical { border-left-color: var(--bad); background: var(--peach-soft); } .alert-critical .alert-icon { background: var(--peach); color: var(--bad); }
.alert-warning { border-left-color: #e3a03a; background: #fffaf0; } .alert-warning .alert-icon { background: var(--amber-tint); color: var(--amber); }
.alert-info { border-left-color: #8a93a8; }
.all-clear { display: flex; align-items: center; gap: 14px; padding: 10px 4px; }
.all-clear-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--green-tint); color: var(--green-deep); display: grid; place-items: center; flex-shrink: 0; }
@media (max-width: 700px) { .alert-item { grid-template-columns: auto minmax(0, 1fr); } .alert-side { grid-column: 1 / -1; justify-content: space-between; } }

/* bandeau d'état du système */
.status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.status-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.status-label { font-size: 13px; font-weight: 650; color: var(--muted); }
.status-value { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-hint { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.tabpanel .data-table th, .tabpanel .data-table td { padding-left: 11px; padding-right: 11px; }

/* ======================================================================== CRÉATEURS (console du programme) ========
 * Section ajoutée par la page Créateurs (js/pages/creators.js, creator_detail.js, _creators_*.js).
 * Ne modifie aucune règle existante. Préfixes : .badges, .sub-line, .code-chip, .cell-actions, .money-lines, .tier-*,
 * .secret-*, .notes-box, .pick-*, .disclosure, .steps, .plain-list, .batch-total, .link-line.
 */
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.sub-line { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.data-table td .sub-line, .data-table th .sub-line { margin-top: 2px; }
.code-chip { font-family: var(--mono); font-size: 13px; background: var(--peach-soft); border: 1px solid var(--peach-line); border-radius: 8px; padding: 1px 8px; overflow-wrap: anywhere; }
.cell-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-lines { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.link-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px 4px 4px 12px; font-size: 13px; overflow-wrap: anywhere; }
.secret-row { display: flex; flex-direction: column; gap: 8px; }
.secret-box, .notes-box { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 260px; overflow: auto; }
.notes-box { font-family: var(--font); font-size: 14px; }
.disclosure { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.disclosure > summary { cursor: pointer; padding: 10px 14px; font-weight: 700; list-style-position: inside; border-radius: 12px; }
.disclosure > summary:hover { background: var(--peach-soft); }
.disclosure[open] > summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.disclosure-body { padding: 14px; }
.plain-list { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.steps { padding-left: 20px; list-style: decimal; display: flex; flex-direction: column; gap: 4px; }
.batch-total { font-weight: 800; font-variant-numeric: tabular-nums; }
.pick-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pick-item { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.pick-item:hover { background: var(--peach-soft); border-color: var(--peach-line); }
.pick-name { font-weight: 800; overflow-wrap: anywhere; }
.pick-sub { grid-column: 1; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.pick-item .badge { grid-column: 2; grid-row: 1 / span 2; }
.search-results { min-height: 0; }
.tier-editor { display: flex; flex-direction: column; gap: 12px; }
.tier-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 14px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tier-title { font-weight: 800; padding: 0 6px; }
.tier-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
@media (max-width: 700px) { .tier-fields { grid-template-columns: minmax(0, 1fr); } }
.data-table .row-link { overflow-wrap: anywhere; display: inline-block; padding: 4px 0; } /* cible tactile d'au moins 24 px */
.data-table td .ext-link, .data-table th .ext-link { word-break: break-all; }
.audit-action { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.audit-detail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.mono.wrap { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }
.codes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 14px 16px; background: var(--peach-soft); border: 1px dashed var(--peach-line); border-radius: 12px; list-style: none; }
.codes-grid li { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; }
.acct-tier-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
@media (max-width: 700px) { .acct-tier-row { grid-template-columns: minmax(0, 1fr); padding-bottom: 12px; border-bottom: 1px solid var(--line); } .acct-tier-row .btn { justify-self: start; } }
.session-ua { max-width: 28ch; overflow-wrap: anywhere; font-size: 13px; color: var(--muted); }
.data-table a[href^="mailto:"] { overflow-wrap: anywhere; }

.data-table.table-wide { min-width: 560px; }

/* ===== CRÉATEURS (ajout, suite) : texte réservé aux petits écrans (le créateur dans la colonne de date) ===== */
.only-sm { display: none; }
@media (max-width: 700px) { .sub-line.only-sm { display: block; } }
.data-table .col-name { min-width: 7.5em; }
.data-table .col-url { min-width: 11em; }

a[href^="mailto:"] { display: inline-block; padding: 4px 0; overflow-wrap: anywhere; } /* cible tactile d'au moins 24 px */

.data-table .code-chip { white-space: nowrap; }
@media (max-width: 420px) { .tile-value { font-size: 22px; } }

/* ================================================================ [assistant] bouton Edwin et panneau latéral
   Ajout seul (js/ui/assistant.js). Sur ordinateur large le panneau pousse la page ; en dessous il la recouvre ;
   sur mobile il prend tout l'écran. */
:root { --edwin-w: 420px; }
.edwin-launcher {
  position: fixed; z-index: 45; right: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 8px; height: 48px;
  padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--btn); color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: var(--shadow-pop); cursor: pointer; transition: background 0.15s;
}
.edwin-launcher:hover { background: var(--btn-hover); }
.edwin-launcher:focus-visible { outline-color: var(--ink); outline-offset: 3px; border-radius: 999px; }
html.edwin-open .edwin-launcher { display: none; }
.edwin-panel {
  position: fixed; z-index: 55; top: 0; right: 0; bottom: 0; width: var(--edwin-w); max-width: 100vw; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); animation: slide-in 0.2s ease-out;
}
.edwin-panel[hidden] { display: none; }
.edwin-panel:focus { outline: none; }
@media (min-width: 1251px) { html.edwin-open .shell-main { margin-right: var(--edwin-w); } }
@media (max-width: 900px) {
  .edwin-panel { z-index: 70; width: 100%; border-left: 0; }
  .edwin-launcher { right: 16px; bottom: 16px; }
}

.edwin-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.edwin-head-top { display: flex; align-items: center; gap: 10px; }
.edwin-title { font-size: 20px; font-weight: 800; letter-spacing: -0.015em; flex: 1; }
.edwin-close { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 10px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.edwin-close:hover { background: var(--peach-soft); }
.edwin-cap { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.4em; }
.edwin-cap.is-alert { color: var(--amber); font-weight: 700; }
.edwin-cap.is-blocked { color: var(--bad); font-weight: 700; }
.edwin-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-left: -8px; }
.edwin-tools .btn.is-active { background: var(--peach); }

.edwin-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; overscroll-behavior: contain; }
.edwin-loading { padding: 8px 0; }
.edwin-log { display: flex; flex-direction: column; gap: 14px; }
.edwin-msg { display: flex; flex-direction: column; gap: 4px; max-width: 92%; }
.edwin-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.edwin-who { font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.edwin-when { font-weight: 500; text-transform: none; letter-spacing: 0; }
.edwin-bubble { padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.edwin-msg.is-mine .edwin-bubble { background: var(--peach); border-color: var(--peach-line); border-bottom-right-radius: 4px; }
.edwin-msg.is-edwin .edwin-bubble { border-bottom-left-radius: 4px; }
.edwin-msg.is-thinking .edwin-bubble { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: normal; }
.edwin-msg.is-thinking .spinner { width: 16px; height: 16px; border-width: 2px; }
.edwin-opened { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.edwin-opened a { color: var(--coral-text); text-decoration: underline; text-underline-offset: 2px; }
.edwin-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

.edwin-empty { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.edwin-empty-title { font-size: 18px; font-weight: 800; }
.edwin-empty-text { color: var(--muted); font-size: 14px; }
.edwin-suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.edwin-chip { width: 100%; text-align: left; padding: 10px 14px; min-height: 44px; border: 1px solid var(--peach-line); border-radius: 12px; background: var(--peach-soft); font-size: 14px; font-weight: 600; cursor: pointer; }
.edwin-chip:hover { background: var(--peach); }

.edwin-history-note { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.edwin-history { display: flex; flex-direction: column; gap: 8px; }
.edwin-history-item { width: 100%; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.edwin-history-item:hover { background: var(--peach-soft); }
.edwin-history-item.is-current { border-color: var(--coral); background: var(--peach-soft); }
.edwin-history-title { font-weight: 700; overflow-wrap: anywhere; }
.edwin-history-meta { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

.edwin-notice { padding: 0 18px 10px; display: flex; flex-direction: column; gap: 8px; }
.edwin-notice[hidden] { display: none; }
.edwin-composer { padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.edwin-composer[hidden] { display: none; }
textarea.edwin-input { resize: none; min-height: 56px; max-height: 180px; line-height: 1.45; }
.edwin-composer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.edwin-composer-row .edwin-count { flex: 1; }
.edwin-mic { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink, inherit); display: grid; place-items: center; cursor: pointer; }
.edwin-mic:hover:not(:disabled) { background: var(--peach-soft); border-color: var(--peach-line); }
.edwin-mic:disabled { opacity: .5; cursor: not-allowed; }
.edwin-mic.is-listening, .edwin-mic.is-listening:hover:not(:disabled) { background: var(--btn); border-color: var(--btn); color: #fff; animation: edwin-listen 1.4s ease-in-out infinite; }
@keyframes edwin-listen { 0%, 100% { box-shadow: 0 0 0 0 rgba(207, 69, 44, .45); } 50% { box-shadow: 0 0 0 8px rgba(207, 69, 44, 0); } }
.edwin-dictate-status { margin: 0; font-size: 13px; color: var(--muted); }
.edwin-dictate-status[hidden] { display: none; }
.edwin-dictate-status.is-live { color: var(--coral-text); font-weight: 650; }
.edwin-dictate-status.is-error { color: var(--bad); font-weight: 650; }
.edwin-count { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.edwin-count.is-near { color: var(--amber); font-weight: 700; }
@media print { .edwin-launcher, .edwin-panel { display: none !important; } }

/* ---- [assistant] propositions à valider (lot D2, js/ui/assistant_proposals.js) */
.edwin-launcher-badge { position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--ink); color: #fff; border: 2px solid var(--bg); font-size: 12.5px; font-weight: 800; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.edwin-launcher-badge[hidden] { display: none; }
.edwin-tray { border-top: 1px solid var(--peach-line); background: var(--peach-soft); padding: 12px 18px; max-height: 44%; flex-shrink: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.edwin-tray[hidden], .edwin-panel.is-history .edwin-tray { display: none; }
.edwin-tray-title { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--coral-text); }
.edwin-props { display: flex; flex-direction: column; gap: 10px; }
.edwin-prop { background: var(--surface); border: 1px solid var(--peach-line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.edwin-prop.is-open { border-color: var(--ink); }
.edwin-prop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.edwin-prop-clock { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.edwin-prop-summary { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.edwin-prop-reason { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.edwin-prop-why { font-weight: 700; color: var(--ink); }
.edwin-prop-problem { font-size: 13px; color: var(--amber); background: var(--amber-tint); border-radius: 10px; padding: 8px 10px; }
.edwin-prop-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.edwin-prop-form { gap: 10px; }

.edwin-panel.is-deciding .edwin-body, .edwin-panel.is-deciding .edwin-composer, .edwin-panel.is-deciding .edwin-notice { display: none; }
.edwin-panel.is-deciding .edwin-tray { max-height: none; flex: 1; border-top: 0; }

/* ---- page Consommation (note 176) */
.stackbar { display: flex; height: 36px; border-radius: 10px; overflow: hidden; margin: 6px 0 14px; background: var(--line); }
.stackbar .seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2px; }
.seg-coral { background: var(--btn); } .seg-ink { background: var(--ink); } .seg-amber { background: var(--amber); } .seg-green { background: var(--green-deep); }
.stack-legend { display: flex; flex-direction: column; gap: 4px; font-size: 14px; margin-bottom: 8px; }
.stack-legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.section-title { font-size: 20px; font-weight: 800; margin-top: 8px; }

/* Fiche client : actions du super admin et journal (claude/228) */
.client-actions { display: flex; flex-direction: column; gap: 14px; }
.block-title { font-size: 15px; font-weight: 700; margin: 6px 0 0; }
.client-journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.client-journal-item { border-top: 1px solid var(--line); padding-top: 10px; }
.client-note { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Messagerie (claude/230) */
.nav-pill { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--coral); color: var(--ink); font-size: 12px; font-weight: 800; text-align: center; line-height: 1.5; }
.nav-pill[hidden] { display: none; }
.msg-threads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.msg-thread { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; background: var(--bg); }
.msg-thread:hover { background: var(--peach-soft); }
.msg-thread.is-unread { border-color: var(--coral); background: var(--peach-soft); }
.msg-thread-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.msg-thread-who { font-weight: 750; overflow-wrap: anywhere; }
.msg-thread-last { color: var(--muted); overflow-wrap: anywhere; }
.msg-conversation { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg-bubble { max-width: min(560px, 92%); padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.msg-bubble.msg-admin { align-self: flex-end; background: var(--peach); border-color: var(--peach-line); }
.msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { margin: 4px 0 0; }

/* Annonces (lot 9b) */
.ann-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ann-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.ann-item-top, .ann-item-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.ann-item-top { justify-content: flex-start; }
.ann-item-actions { display: inline-flex; gap: 8px; }
.ann-preview { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.ann-preview-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.ann-preview-cta { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--coral); background: var(--peach); font-weight: 700; font-size: 13.5px; }
.ann-promo { border-color: var(--coral); background: var(--peach-soft); }
.ann-alert { border-color: #e6c46a; background: #fff8e4; }
.ann-incident { border-color: #d9867c; background: #fdecea; }
.ann-translations { display: flex; flex-direction: column; gap: 8px; }
.ann-lang { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.ann-lang > summary { cursor: pointer; font-weight: 700; }
.ann-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ann-filter { display: flex; flex-direction: column; gap: 10px; }
.ann-count { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
