/* ===========================================================================
   Shippex Email Platform - design system
   Aucune étape de build : variables CSS natives, thème clair et sombre.
   Couleur unique : le violet Shippex des emails. Le reste est neutre.
   =========================================================================== */

:root {
  --brand-50:  #f2f0f9;
  --brand-100: #e2dcf1;
  --brand-200: #c7bce4;
  --brand-300: #a292d1;
  --brand-400: #7a63b8;
  --brand-500: #56409c;
  --brand-600: #352877;
  --brand-700: #2b2062;
  --brand-800: #221a4e;
  --brand-900: #1a143c;

  --gray-0:   #ffffff;
  --gray-25:  #fcfcfd;
  --gray-50:  #f7f8fa;
  --gray-100: #eff1f5;
  --gray-200: #e2e5ec;
  --gray-300: #cbd0da;
  --gray-400: #9aa2b1;
  --gray-500: #6b7382;
  --gray-600: #4e5563;
  --gray-700: #3a404c;
  --gray-800: #262b34;
  --gray-900: #171a20;
  --gray-950: #0e1014;

  --positive: #15803d;
  --positive-bg: #eefbf2;
  --warning: #a16207;
  --warning-bg: #fdf7e7;
  --danger: #b91c1c;
  --danger-bg: #fdf0f0;

  --surface: var(--gray-0);
  --surface-sunken: var(--gray-50);
  --surface-raised: var(--gray-0);
  --surface-hover: var(--gray-50);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --text-subtle: var(--gray-400);
  --accent: var(--brand-600);
  --accent-hover: var(--brand-700);
  --accent-soft: var(--brand-50);
  --accent-text: #ffffff;
  --focus-ring: 0 0 0 3px var(--brand-200);

  /* Courbes d'accélération. Les easings natifs manquent de nerf : une entrée en
     `ease-in` paraît plus lente qu'un `ease-out` de même durée, parce qu'elle
     retarde le mouvement au moment précis où l'œil regarde. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  /* Durées. Rien au-dessus de 300ms sur une interaction d'interface. */
  --t-press: 140ms;
  --t-hover: 150ms;
  --t-enter: 220ms;
  --t-exit: 160ms;

  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 20, 28, 0.05);
  --shadow: 0 2px 8px rgba(16, 20, 28, 0.07), 0 1px 2px rgba(16, 20, 28, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 20, 28, 0.12);

  --sidebar-width: 244px;
  --header-height: 60px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: var(--gray-900);
    --surface-sunken: var(--gray-950);
    --surface-raised: var(--gray-800);
    --surface-hover: var(--gray-800);
    --border: #2a2f3a;
    --border-strong: #3a414f;
    --text: var(--gray-50);
    --text-muted: var(--gray-400);
    --text-subtle: var(--gray-500);
    --accent: var(--brand-300);
    --accent-hover: var(--brand-200);
    --accent-soft: rgba(122, 99, 184, 0.14);
    --accent-text: var(--gray-950);
    --focus-ring: 0 0 0 3px rgba(122, 99, 184, 0.35);
    --positive: #4ade80;
    --positive-bg: rgba(21, 128, 61, 0.16);
    --warning: #fbbf24;
    --warning-bg: rgba(161, 98, 7, 0.18);
    --danger: #f87171;
    --danger-bg: rgba(185, 28, 28, 0.18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --surface: var(--gray-900);
  --surface-sunken: var(--gray-950);
  --surface-raised: var(--gray-800);
  --surface-hover: var(--gray-800);
  --border: #2a2f3a;
  --border-strong: #3a414f;
  --text: var(--gray-50);
  --text-muted: var(--gray-400);
  --text-subtle: var(--gray-500);
  --accent: var(--brand-300);
  --accent-hover: var(--brand-200);
  --accent-soft: rgba(122, 99, 184, 0.14);
  --accent-text: var(--gray-950);
  --focus-ring: 0 0 0 3px rgba(122, 99, 184, 0.35);
  --positive: #4ade80;
  --positive-bg: rgba(21, 128, 61, 0.16);
  --warning: #fbbf24;
  --warning-bg: rgba(161, 98, 7, 0.18);
  --danger: #f87171;
  --danger-bg: rgba(185, 28, 28, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* --- base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-sunken);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: var(--font-mono); font-size: 12.5px; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- ossature ------------------------------------------------------------ */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  height: var(--header-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  text-decoration: none;
}
.sidebar__brand:hover { text-decoration: none; }

.sidebar__logo {
  width: 104px;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.sidebar__tagline {
  font-size: 10.5px; color: var(--text-subtle);
  letter-spacing: 0.02em; line-height: 1;
}

/* Le logo Shippex est dessiné pour un fond clair : son bleu marine devient
   illisible sur fond sombre. Plutôt que d'en altérer les couleurs avec un
   filtre, on le pose sur une plaque blanche, comme sur un support imprimé. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar__logo,
  :root:not([data-theme="light"]) .auth__logo {
    background: #ffffff;
    border-radius: 5px;
    padding: 5px 8px;
  }
}
:root[data-theme="dark"] .sidebar__logo,
:root[data-theme="dark"] .auth__logo {
  background: #ffffff;
  border-radius: 5px;
  padding: 5px 8px;
}

.sidebar__mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--brand-600);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: -0.03em;
  flex: 0 0 auto;
}

.sidebar__nav { flex: 1 1 auto; overflow-y: auto; padding: 14px 10px; }

.nav-group { margin-bottom: 20px; }
.nav-group__label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-subtle);
  padding: 0 8px 6px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  /* Élément parcouru des dizaines de fois par jour : changement de couleur seul,
     aucun mouvement, sinon la navigation finit par paraître lourde. */
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
}
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: 0.8; }
.nav-link__count {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--text-subtle); font-variant-numeric: tabular-nums;
}

.sidebar__foot { border-top: 1px solid var(--border); padding: 12px 14px; }

.account { display: flex; align-items: center; gap: 10px; }
.account__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  flex: 0 0 auto;
}
.account__body { min-width: 0; flex: 1 1 auto; }
.account__name {
  font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account__role { font-size: 11px; color: var(--text-subtle); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-height);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar__title { flex: 1 1 auto; min-width: 0; }
.topbar__title h1 { font-size: 16px; }
.topbar__title p { margin: 1px 0 0; font-size: 12.5px; color: var(--text-muted); }
.topbar__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.content { padding: 24px 26px 56px; flex: 1 1 auto; }
.content--narrow { max-width: 760px; }

/* --- composants ---------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card__head h2 { flex: 1 1 auto; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: var(--surface-sunken);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex; gap: 8px; align-items: center;
}

.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
}

.stat { padding: 16px 18px; }
.stat__label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat__value {
  font-size: 26px; font-weight: 650; letter-spacing: -0.03em;
  margin-top: 4px; font-variant-numeric: tabular-nums;
}
.stat__hint { font-size: 12px; color: var(--text-subtle); margin-top: 2px; }

/* boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 13px;
  font: inherit; font-size: 13px; font-weight: 550;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--t-hover) ease,
    border-color var(--t-hover) ease,
    opacity var(--t-hover) ease,
    transform var(--t-press) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--surface-hover); text-decoration: none; }
}
/* Retour immédiat à l'appui : l'interface confirme qu'elle a entendu le clic. */
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn--primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--danger { color: var(--danger); border-color: var(--border-strong); }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); }

.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--surface-hover); }

.btn--sm { padding: 4px 9px; font-size: 12px; }
.btn--icon { padding: 6px; }
.btn--block { width: 100%; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn[aria-pressed="true"] {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent); z-index: 1;
}

/* formulaires */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field__label {
  display: block; font-size: 12.5px; font-weight: 600;
  margin-bottom: 5px; color: var(--text);
}
.field__hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.field__error { font-size: 12px; color: var(--danger); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%;
  padding: 7px 10px;
  font: inherit; font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
.input, .select, .textarea {
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.textarea--code { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236b7382' stroke-width='1.6'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 15px;
  padding-right: 30px;
}

.checkbox { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.checkbox input { margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--brand-600); }
.checkbox__text { font-size: 13px; }
.checkbox__text small { display: block; color: var(--text-muted); font-size: 12px; }

.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1 1 0; min-width: 0; }
@media (max-width: 720px) { .form-row { flex-direction: column; } }

/* tableaux */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-subtle);
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-sunken);
  white-space: nowrap;
}
.table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-hover); }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }

.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* pastilles */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  font-size: 11.5px; font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge--on { color: var(--positive); background: var(--positive-bg); border-color: transparent; }
.badge--warn { color: var(--warning); background: var(--warning-bg); border-color: transparent; }
.badge--off { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.badge--accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* Indicateur du mode d'envoi. Présent sur toutes les pages, il doit être lisible
   d'un coup d'œil : c'est lui qui dit si un clic va toucher de vrais clients. */
.send-mode {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: default;
  white-space: nowrap;
  transition:
    background-color var(--t-hover) ease,
    border-color var(--t-hover) ease,
    transform var(--t-press) var(--ease-out);
}
button.send-mode { cursor: pointer; }
button.send-mode:active { transform: scale(0.97); }

.send-mode__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.send-mode--sim { color: var(--warning); background: var(--warning-bg); }
.send-mode--live { color: var(--danger); background: var(--danger-bg); }

@media (hover: hover) and (pointer: fine) {
  button.send-mode--sim:hover { border-color: var(--warning); }
  button.send-mode--live:hover { border-color: var(--danger); }
}

/* En envoi réel, le point pulse doucement : un état dangereux ne doit pas se
   fondre dans le décor. L'animation reste lente pour ne pas devenir agaçante. */
.send-mode--live .send-mode__dot { animation: send-mode-pulse 2.4s ease-in-out infinite; }

@keyframes send-mode-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .send-mode--live .send-mode__dot { animation: none; }
}

.lang-chips { display: inline-flex; gap: 4px; }
.lang-chip {
  min-width: 26px; padding: 2px 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  border-radius: var(--radius-sm); text-align: center;
  background: var(--accent-soft); color: var(--accent);
}
.lang-chip--missing {
  background: transparent; color: var(--text-subtle);
  border: 1px dashed var(--border-strong);
}

/* messages */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert--success { color: var(--positive); background: var(--positive-bg); border-color: transparent; }
.alert--warning { color: var(--warning); background: var(--warning-bg); border-color: transparent; }
.alert--error { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.alert strong { font-weight: 650; }

.flash-stack {
  position: fixed; top: 14px; right: 18px; z-index: 200;
  width: 340px; max-width: calc(100vw - 36px);

  opacity: 1;
  transform: translateY(0) scale(1);
  /* L'entrée est plus lente que la sortie : on prend le temps d'attirer l'œil,
     on libère l'espace sans faire attendre. */
  transition:
    opacity var(--t-enter) var(--ease-out),
    transform var(--t-enter) var(--ease-out);
}
/* Jamais depuis scale(0) : rien n'apparaît de nulle part dans le monde réel. */
@starting-style {
  .flash-stack { opacity: 0; transform: translateY(-8px) scale(0.97); }
}
.flash-stack[data-leaving="true"] {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition:
    opacity var(--t-exit) var(--ease-out),
    transform var(--t-exit) var(--ease-out);
}
.flash-stack .alert { box-shadow: var(--shadow-lg); background: var(--surface); }
.flash-stack .alert--success { background: var(--positive-bg); }
.flash-stack .alert--warning { background: var(--warning-bg); }
.flash-stack .alert--error { background: var(--danger-bg); }

.empty {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 16px; }

/* onglets */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 8px 14px;
  font-size: 13px; font-weight: 550;
  color: var(--text-muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: -1px;
  text-decoration: none;
  transition: color var(--t-hover) ease, border-bottom-color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .tab:hover { color: var(--text); text-decoration: none; }
}
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border-strong);
  transition: background-color var(--t-hover) ease;
}
.tab__dot--filled { background: var(--positive); }

.tab-panel[hidden] { display: none; }

/* barre de filtres */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .input, .toolbar .select { width: auto; min-width: 170px; }
.toolbar__spacer { flex: 1 1 auto; }

/* aperçu email */
/* Un email Shippex fait 600px de large : la colonne d'aperçu doit pouvoir
   l'afficher sans le comprimer, sinon la mise en page est illisible. */
.preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 34%);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1400px) { .preview { grid-template-columns: minmax(0, 1fr); } }

.preview__frame {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  place-items: start center;
  min-height: 460px;
}
.preview__frame iframe {
  width: 100%; max-width: 640px; height: 640px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: max-width 0.2s ease;
}
.preview__frame[data-viewport="mobile"] iframe { max-width: 390px; height: 700px; }

.var-list { display: flex; flex-direction: column; gap: 3px; }
.var-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: none; background: none; width: 100%;
  text-align: left; cursor: pointer; font: inherit;
  color: var(--text);
}
.var-item { transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .var-item:hover { background: var(--surface-hover); }
}
.var-item:active { transform: scale(0.98); }
.var-item code { color: var(--accent); font-weight: 600; }
.var-item span { font-size: 11.5px; color: var(--text-subtle); margin-left: auto; }

.scope-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-subtle);
  margin: 14px 0 5px;
}
.scope-title:first-child { margin-top: 0; }

/* page de connexion */
.auth {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background: var(--surface-sunken);
}
.auth__card { width: 100%; max-width: 380px; }
.auth__brand {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin-bottom: 24px;
}
.auth__logo { width: 160px; height: auto; display: block; object-fit: contain; }
.auth__brand span { font-size: 12px; color: var(--text-subtle); }
.auth__foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-subtle); }

/* pages d'erreur */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-page__code {
  font-size: 56px; font-weight: 700; letter-spacing: -0.04em;
  color: var(--text-subtle); line-height: 1;
}

/* utilitaires */
.stack { display: flex; flex-direction: column; }
.stack--sm { gap: 8px; }
.stack--md { gap: 16px; }
.stack--lg { gap: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.inline-form { display: inline; }

@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 60; transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar[data-open="true"] { transform: none; box-shadow: var(--shadow-lg); }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

@media print {
  .sidebar, .topbar__actions, .btn { display: none; }
}

/* Mouvement réduit ne veut pas dire aucune animation : on garde les fondus et les
   changements de couleur, qui aident à comprendre ce qui change, et on supprime
   tout déplacement ou changement d'échelle. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-property: opacity, background-color, border-color, color, box-shadow !important;
    transition-duration: 150ms !important;
  }
  .btn:active:not(:disabled),
  .var-item:active { transform: none; }
  .flash-stack,
  .flash-stack[data-leaving="true"] { transform: none; }
}
