/* =========================================================
   General Store — design system
   Principes : une seule couleur d'accent, contrastes WCAG 2.2 AA,
   cibles tactiles ≥ 40px, focus toujours visible, chiffres alignés.
   ========================================================= */

:root {
  color-scheme: light;
  --font: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --surface-3: #e9e9e6;
  --border: #e4e4e0;
  --border-strong: #d1d1cc;
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #71717a;

  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fff1e8;
  --accent-text: #9a3412;
  --on-accent: #ffffff;

  --success: #15803d;  --success-soft: #e8f6ec;
  --warning: #a16207;  --warning-soft: #fdf6dc;
  --danger: #b91c1c;   --danger-soft: #fdecec;
  --info: #1d4ed8;     --info-soft: #e8efff;

  --sidebar: #18181b;
  --sidebar-text: #a1a1aa;
  --sidebar-text-strong: #fafafa;
  --sidebar-hover: #27272a;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .05);
  --shadow: 0 1px 3px rgba(24, 24, 27, .06), 0 4px 12px rgba(24, 24, 27, .04);
  --shadow-lg: 0 12px 40px rgba(24, 24, 27, .18);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
  :root:not([data-theme="light"]) {
    --bg: #0f0f11; --surface: #18181b; --surface-2: #1f1f23; --surface-3: #2a2a2f;
    --border: #2a2a2f; --border-strong: #3a3a40; --text: #f4f4f5; --text-2: #c4c4cc; --text-3: #9b9ba5;
    --accent: #f97316; --accent-hover: #fb923c; --accent-soft: #2c1a10; --accent-text: #fdba74; --on-accent: #1a0d05;
    --success: #4ade80; --success-soft: #11291a; --warning: #facc15; --warning-soft: #2a240c;
    --danger: #f87171; --danger-soft: #2e1414; --info: #93b4ff; --info-soft: #141d33;
    --sidebar: #0b0b0d; --sidebar-hover: #1f1f23;
    --shadow-sm: none; --shadow: none; --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f11; --surface: #18181b; --surface-2: #1f1f23; --surface-3: #2a2a2f;
  --border: #2a2a2f; --border-strong: #3a3a40; --text: #f4f4f5; --text-2: #c4c4cc; --text-3: #9b9ba5;
  --accent: #f97316; --accent-hover: #fb923c; --accent-soft: #2c1a10; --accent-text: #fdba74; --on-accent: #1a0d05;
  --success: #4ade80; --success-soft: #11291a; --warning: #facc15; --warning-soft: #2a240c;
  --danger: #f87171; --danger-soft: #2e1414; --info: #93b4ff; --info-soft: #141d33;
  --sidebar: #0b0b0d; --sidebar-hover: #1f1f23;
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 24px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 22px; height: 22px; }

.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pos-text { color: var(--success); }
.neg-text { color: var(--danger); }
.accent-text { color: var(--accent-text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: var(--sidebar-text-strong); font-weight: 700; font-size: 16px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.nav-section { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #71717a; padding: 14px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 500; font-size: 14px; text-decoration: none !important;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.nav-link.active { background: var(--sidebar-hover); color: var(--sidebar-text-strong); box-shadow: inset 3px 0 0 var(--accent); }
.nav-link .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid #27272a; display: flex; flex-direction: column; gap: 4px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sidebar .avatar { background: #3f3f46; color: #fafafa; }
.user-chip .name { color: var(--sidebar-text-strong); font-size: 14px; font-weight: 600; line-height: 1.2; }
.user-chip .role { font-size: 12px; }

.main { flex: 1; min-width: 0; }
.page { max-width: 1280px; margin: 0 auto; padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 24px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--text-3); margin-top: 4px; font-size: 14px; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mobile-bar { display: none; }
.scrim { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 40; left: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 8px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; font-weight: 700; }
  .shell { flex-direction: column; }
  .page { padding: 20px 16px 48px; gap: 18px; }
  h1 { font-size: 21px; }
}

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header .hint { font-size: 13px; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.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)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1200px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 22px; }
  .stat-meta { font-size: 12px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .product { min-height: 100px !important; padding: 12px !important; }
  .page-header .actions .btn { flex: 1; }
  .page-header .actions { width: 100%; }
}
/* Barre panier mobile */
.cart-bar { display: none; }
@media (max-width: 1180px) {
  .cart-bar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 25; height: 56px; padding: 0 18px;
    align-items: center; justify-content: space-between; gap: 12px; border-radius: var(--radius); border: 0;
    background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 15px; box-shadow: var(--shadow-lg); cursor: pointer;
  }
  .page.has-cart-bar { padding-bottom: 96px; }
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--border); }

/* Statistiques */
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.stat-label .icon { color: var(--text-3); }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-value.accent { color: var(--accent-text); }
.stat-meta { font-size: 13px; color: var(--text-3); }

/* ---------- Formulaires ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
.input, input:not([type=checkbox]):not([type=radio]), select, textarea {
  height: 40px; width: 100%; padding: 0 12px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 15px; color: var(--text); transition: border-color .15s, box-shadow .15s; min-width: 0;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; cursor: pointer; flex-shrink: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > span.help { font-size: 12px; color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .form-grid.two { grid-template-columns: minmax(0, 1fr); } }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 14px; font-weight: 500; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search > input { padding-left: 40px !important; }
.input-sm { height: 34px !important; font-size: 14px !important; }
.w-qty { width: 96px !important; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
:root[data-theme="dark"] .btn.success { color: #05210f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.success { color: #05210f; } }
.btn.success:hover:not(:disabled) { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.lg { height: 48px; padding: 0 20px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 40px; padding: 0; }
.btn.icon-only.sm { width: 32px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
th.num { text-align: right; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.expanded td { background: var(--surface-2); }
tr.detail > td { background: var(--surface-2); padding: 16px 20px 20px; }
td .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
table.compact td { padding: 8px 16px; }
table.plain th { background: transparent; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2);
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }

.meter { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; min-width: 80px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--success); }
.meter.warning > span { background: var(--warning); }
.meter.danger > span { background: var(--danger); min-width: 6px; }

/* ---------- Onglets ---------- */
.segmented { display: inline-flex; gap: 2px; background: var(--surface-3); padding: 3px; border-radius: 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented button { flex-shrink: 0; }
.segmented button {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; background: transparent;
  border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer;
}
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented .count { background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.segmented button.on .count { background: var(--accent-soft); color: var(--accent-text); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer;
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--surface); }

/* ---------- Alertes ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.45; }
.alert .icon { margin-top: 1px; }
.alert.success { background: var(--success-soft); color: var(--success); }
.alert.warning { background: var(--warning-soft); color: var(--warning); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert b { font-weight: 600; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 36px 20px; color: var(--text-3); font-size: 14px; }
.empty .icon { width: 28px; height: 28px; color: var(--border-strong); }
.empty .title { color: var(--text-2); font-weight: 600; }

/* Listes */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); min-height: 56px; color: inherit; text-decoration: none !important; }
.list-item:last-child { border-bottom: none; }
a.list-item:hover { background: var(--surface-2); }
.list-item .grow .title { font-weight: 600; font-size: 14px; color: var(--text); }
.list-item .grow .meta { font-size: 13px; color: var(--text-3); }
.icon-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); }
.icon-tile.accent { background: var(--accent-soft); color: var(--accent-text); }
.icon-tile.warning { background: var(--warning-soft); color: var(--warning); }
.icon-tile.danger { background: var(--danger-soft); color: var(--danger); }
.icon-tile.success { background: var(--success-soft); color: var(--success); }
.icon-tile.info { background: var(--info-soft); color: var(--info); }

/* ---------- Point de vente ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
@media (max-width: 1180px) { .pos { grid-template-columns: minmax(0, 1fr); } }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.product {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; min-height: 112px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.product:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.product:active { transform: scale(.98); }
.product.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.product .name { font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--text); padding-right: 28px; }
.product .price { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); margin-top: auto; }
.product .stock { font-size: 12px; font-weight: 500; }
.product .qty-pill { position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.cart { position: sticky; top: 24px; }
@media (max-width: 1180px) { .cart { position: static; } }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); align-items: center; }
.cart-line .title { font-weight: 600; font-size: 14px; }
.cart-line .meta { font-size: 13px; color: var(--text-3); }
.cart-line .line-total { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; height: 36px; }
.stepper button { width: 36px; height: 100%; border: 0; background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.stepper button:hover { background: var(--surface-2); color: var(--text); }
.stepper input { width: 52px !important; height: 100% !important; border: 0 !important; border-left: 1px solid var(--border) !important; border-right: 1px solid var(--border) !important; border-radius: 0 !important; text-align: center; padding: 0 !important; font-weight: 600; box-shadow: none !important; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; }
.total-row .amount { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 14px; counter-increment: step; }
.steps li::before { content: counter(step); width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.steps .ing { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.tree { list-style: none; margin: 0; padding-left: 18px; border-left: 2px solid var(--border); }
.tree.root { padding-left: 0; border-left: 0; }
.tree li { padding: 4px 0; font-size: 14px; }
.tree .qty { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Dialogues & notifications ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(9, 9, 11, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s ease; }
.dialog { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .15s ease; }
.dialog.wide { max-width: 880px; }
.dialog.narrow { max-width: 440px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 0; }
.dialog-header h2 { font-size: 18px; }
.dialog-body { padding: 20px 24px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.dialog-footer .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(400px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--text); color: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: pop .2s ease; }
.toast .icon { color: #4ade80; margin-top: 1px; }
.toast.error .icon { color: #f87171; }
.toast ul { margin: 6px 0 0; padding-left: 16px; font-weight: 400; opacity: .8; font-size: 13px; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.login .brand-mark { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto; }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--text-3); }
