/* Edesy UI — the shadcn new-york "neutral" look, black and white, shared by
 * every Edesy app. Tokens are copied verbatim from edesy-tables and taskflow
 * (frontend/src/index.css) so the back office, the operator console and the
 * marketing site match them exactly. Component sizes mirror shadcn's cva
 * classes (button h-9 px-4 rounded-md, input h-9 shadow-xs, card rounded-xl
 * shadow-sm, …).
 *
 * The second half aliases the back office's own vocabulary (panel, btn,
 * button, pill, flash, field, grid, …) onto those components, so the page
 * templates did not have to be rewritten. Not for storefronts: a store's look
 * is its theme's, and these base rules would leak into it.
 */

/* ---------- tokens (verbatim) ---------- */

:root {
  --radius: 0.625rem;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.205 0 0);
  --chart-2: oklch(0.439 0 0);
  --chart-3: oklch(0.556 0 0);
  --chart-4: oklch(0.708 0 0);
  --chart-5: oklch(0.87 0 0);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.985 0 0);
  --chart-2: oklch(0.85 0 0);
  --chart-3: oklch(0.708 0 0);
  --chart-4: oklch(0.556 0 0);
  --chart-5: oklch(0.439 0 0);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.985 0 0);
  --sidebar-primary-foreground: oklch(0.205 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

/* Derived, as Tailwind's @theme inline derives them in the other apps. */
:root {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --focus-ring: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
  /* Status hues, kept quiet so the page still reads black and white. */
  --ok: oklch(0.527 0.154 150.069);
  --warn: oklch(0.555 0.163 48.998);
  --bad: var(--destructive);
  color-scheme: light;
}
.dark {
  --ok: oklch(0.792 0.209 151.711);
  --warn: oklch(0.828 0.189 84.429);
  color-scheme: dark;
}

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

*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { color: var(--foreground); letter-spacing: -0.015em; }
a { color: var(--foreground); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }
hr, .separator { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
::selection { background: var(--primary); color: var(--primary-foreground); }
img { max-width: 100%; }

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

.visually-hidden, .sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- button ---------- */

.btn, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.25rem; padding: 0 1rem;
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: var(--primary); color: var(--primary-foreground);
  font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.btn:hover, .button:hover { background: color-mix(in oklch, var(--primary) 90%, transparent); text-decoration: none; }
.btn:focus-visible, .button:focus-visible { border-color: var(--ring); box-shadow: var(--focus-ring); }
.btn:disabled, .button:disabled, .button[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn svg, .button svg { width: 1rem; height: 1rem; flex-shrink: 0; }

/* outline (the back office's "quiet" button) */
.btn--outline, .btn--quiet, .button--quiet {
  background: var(--background); color: var(--foreground);
  border-color: var(--border); box-shadow: var(--shadow-xs);
}
.btn--outline:hover, .btn--quiet:hover, .button--quiet:hover { background: var(--accent); color: var(--accent-foreground); }
.dark .btn--outline, .dark .btn--quiet, .dark .button--quiet { background: color-mix(in oklch, var(--input) 30%, transparent); border-color: var(--input); }
.dark .btn--outline:hover, .dark .btn--quiet:hover, .dark .button--quiet:hover { background: color-mix(in oklch, var(--input) 50%, transparent); }

.btn--secondary, .button--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn--secondary:hover, .button--secondary:hover { background: color-mix(in oklch, var(--secondary) 80%, transparent); }

.btn--ghost, .button--ghost { background: transparent; color: var(--foreground); }
.btn--ghost:hover, .button--ghost:hover { background: var(--accent); color: var(--accent-foreground); }

.btn--destructive, .btn--danger, .button--danger { background: var(--destructive); color: #fff; }
.btn--destructive:hover, .btn--danger:hover, .button--danger:hover { background: color-mix(in oklch, var(--destructive) 90%, transparent); }
.dark .btn--destructive, .dark .btn--danger, .dark .button--danger { background: color-mix(in oklch, var(--destructive) 60%, transparent); }

.btn--link { background: transparent; color: var(--primary); padding: 0; height: auto; }
.btn--link:hover { background: transparent; text-decoration: underline; }

.btn--sm, .button--sm { height: 2rem; padding: 0 0.75rem; gap: 0.375rem; }
.btn--lg, .button--lg { height: 2.5rem; padding: 0 1.5rem; }
.btn--icon { width: 2.25rem; padding: 0; }
.btn--icon.btn--sm { width: 2rem; }

/* A button inside running text, for an action offered in a sentence. */
.linkish, .linkbutton {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.linkbutton { font-size: 0.8125rem; color: var(--foreground); }
.linkbutton--bad { color: var(--destructive); }

/* ---------- inputs ---------- */

input:not([type]), input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="tel"], input[type="url"],
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"],
select, textarea, .input {
  display: block; width: 100%; min-width: 0;
  height: 2.25rem; padding: 0.25rem 0.75rem;
  font: inherit; font-size: 0.875rem; color: var(--foreground);
  background: transparent;
  border: 1px solid var(--input); border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: color 0.15s, box-shadow 0.15s, border-color 0.15s;
  outline: none;
}
textarea { height: auto; min-height: 4rem; padding: 0.5rem 0.75rem; line-height: 1.5; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2rem;
  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='%23737373' 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 0.6rem center; background-size: 1rem;
}
select[multiple] { height: auto; background-image: none; padding: 0.25rem; }
.dark :is(input:not([type]), input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="tel"], input[type="url"],
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"],
select, textarea, .input) { background-color: color-mix(in oklch, var(--input) 30%, transparent); }
.dark select option { background: var(--popover); color: var(--popover-foreground); }
::placeholder { color: var(--muted-foreground); opacity: 1; }
:is(input, select, textarea):focus-visible { border-color: var(--ring); box-shadow: var(--focus-ring); }
:is(input, select, textarea):disabled { opacity: 0.5; cursor: not-allowed; }
:is(input, select, textarea)[aria-invalid="true"] { border-color: var(--destructive); }
input[type="file"] { font: inherit; font-size: 0.875rem; color: var(--muted-foreground); }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 500; color: var(--foreground);
  height: 2rem; padding: 0 0.75rem; margin-right: 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--background); box-shadow: var(--shadow-xs); cursor: pointer;
}
input[type="color"] {
  width: 3rem; height: 2.25rem; padding: 0.2rem;
  border: 1px solid var(--input); border-radius: var(--radius-md); background: transparent; cursor: pointer;
}
input[type="checkbox"], input[type="radio"] {
  width: 1rem; height: 1rem; margin: 0; flex-shrink: 0;
  accent-color: var(--primary);
}

label { font-size: 0.875rem; }

/* ---------- card ---------- */

.card, .panel {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin: 0 0 1.5rem;
}
.card-header { display: grid; gap: 0.375rem; margin-bottom: 1.5rem; }
.card-title, .panel > h2, .panel h2:first-child, .panel > header h2 {
  font-size: 1rem; font-weight: 600; line-height: 1.2; margin: 0 0 1rem; letter-spacing: -0.01em;
}
.panel h2 { font-size: 1rem; font-weight: 600; margin: 0 0 1rem; }
.panel h3 { font-size: 0.9375rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.card-description { color: var(--muted-foreground); font-size: 0.875rem; margin: 0; }
.card-footer { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.5rem; }
.panel--warn { border-color: color-mix(in oklch, var(--warn) 45%, var(--border)); }
.panel--inset { box-shadow: none; border-radius: var(--radius-lg); padding: 1rem; margin: 0.75rem 0; background: transparent; }
.panel-note { color: var(--muted-foreground); font-size: 0.875rem; margin: 0 0 1rem; }
.panel-note:last-child { margin: 1rem 0 0; }

/* ---------- badge ---------- */

.badge, .pill, .badge-inline {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem;
  width: fit-content; white-space: nowrap; flex-shrink: 0; vertical-align: middle;
  padding: 0.125rem 0.5rem;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500; line-height: 1rem;
  font-family: var(--font-sans); letter-spacing: 0; text-transform: none;
  background: var(--primary); color: var(--primary-foreground);
}
.badge--secondary, .pill, .pill--muted, .pill--draft, .pill--pending { background: var(--secondary); color: var(--secondary-foreground); }
.badge--outline, .badge-inline { background: transparent; color: var(--foreground); border-color: var(--border); }
.badge--destructive, .pill--bad, .pill--archived, .pill--cancelled, .pill--refunded, .pill--failed {
  background: color-mix(in oklch, var(--destructive) 10%, transparent); color: var(--destructive);
  border-color: color-mix(in oklch, var(--destructive) 25%, transparent);
}
.badge--ok, .badge-inline--ok, .pill--ok, .pill--active, .pill--delivered, .pill--paid {
  background: color-mix(in oklch, var(--ok) 10%, transparent); color: var(--ok);
  border-color: color-mix(in oklch, var(--ok) 25%, transparent);
}
.badge--warn, .badge-inline--warn, .pill--warn, .pill--confirmed, .pill--processing, .pill--shipped, .pill--partial {
  background: color-mix(in oklch, var(--warn) 10%, transparent); color: var(--warn);
  border-color: color-mix(in oklch, var(--warn) 25%, transparent);
}
.badge--default { background: var(--primary); color: var(--primary-foreground); }

/* ---------- alert and flash ---------- */

.alert, .flash {
  position: relative; display: block;
  padding: 0.75rem 1rem; margin: 0 0 1.25rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); color: var(--card-foreground);
  font-size: 0.875rem;
}
.alert a, .flash a { color: inherit; font-weight: 500; }
.alert--destructive, .flash--bad { color: var(--destructive); border-color: color-mix(in oklch, var(--destructive) 35%, var(--border)); }
.flash--warn { border-color: color-mix(in oklch, var(--warn) 45%, var(--border)); }
.flash--warn::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--warn); margin-right: 0.5rem; vertical-align: 0.05em; }
.flash--ok::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ok); margin-right: 0.5rem; vertical-align: 0.05em; }
.flash--info { color: var(--muted-foreground); }

/* ---------- toast (sonner-like) ---------- */

.toaster {
  position: fixed; z-index: 100; right: 1.5rem; bottom: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem; width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--popover); color: var(--popover-foreground);
  box-shadow: var(--shadow-lg); font-size: 0.875rem;
  animation: eui-toast-in 0.2s ease-out;
}
.toast.is-leaving { opacity: 0; transform: translateY(0.5rem); transition: opacity 0.2s, transform 0.2s; }
.toast::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.toast--bad::before { background: var(--destructive); }
.toast-close { margin-left: auto; background: none; border: 0; color: var(--muted-foreground); cursor: pointer; font: inherit; padding: 0 0.25rem; }
@keyframes eui-toast-in { from { opacity: 0; transform: translateY(0.5rem); } }

/* ---------- dialog ---------- */

dialog.dialog {
  width: min(32rem, calc(100% - 2rem)); padding: 1.5rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background); color: var(--foreground);
  box-shadow: var(--shadow-lg);
}
dialog.dialog::backdrop { background: rgb(0 0 0 / 0.5); }
dialog.dialog[open] { animation: eui-zoom 0.2s ease-out; }
.dialog-title { font-size: 1.125rem; font-weight: 600; line-height: 1; margin: 0 0 0.5rem; }
.dialog-description { color: var(--muted-foreground); font-size: 0.875rem; margin: 0; }
.dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }
@keyframes eui-zoom { from { opacity: 0; transform: scale(0.95); } }

/* ---------- tabs ---------- */

.tabs {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0;
  min-height: 2.25rem; padding: 3px; border-radius: var(--radius-lg);
  background: var(--muted); color: var(--muted-foreground);
}
.tab, .tabs > a, .tabs > button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  height: calc(2.25rem - 7px); padding: 0.25rem 0.625rem;
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent; color: var(--foreground);
  font: inherit; font-size: 0.875rem; font-weight: 500; white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
.dark .tab, .dark .tabs > a, .dark .tabs > button { color: var(--muted-foreground); }
.tab.is-active, .tabs > a.is-active, .tabs > [aria-selected="true"] {
  background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm);
}
.dark .tab.is-active, .dark .tabs > a.is-active, .dark .tabs > [aria-selected="true"] {
  background: color-mix(in oklch, var(--input) 30%, transparent); border-color: var(--input); color: var(--foreground);
}
.tab-count { font-variant-numeric: tabular-nums; font-size: 0.75rem; color: var(--muted-foreground); }
[data-tab-panel][hidden] { display: none; }

/* ---------- dropdown ---------- */

.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50;
  min-width: 12rem; padding: 0.25rem;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--popover); color: var(--popover-foreground);
  box-shadow: var(--shadow-lg);
}
.dropdown-menu[hidden] { display: none; }
.dropdown-label { padding: 0.375rem 0.5rem; font-size: 0.875rem; font-weight: 500; }
.dropdown-label small { display: block; font-weight: 400; color: var(--muted-foreground); font-size: 0.75rem; }
.dropdown-sep { height: 1px; margin: 0.25rem -0.25rem; background: var(--border); }
.dropdown-item, .dropdown-menu form button {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  padding: 0.375rem 0.5rem; border: 0; border-radius: var(--radius-sm);
  background: none; color: inherit; font: inherit; font-size: 0.875rem; text-align: left;
  text-decoration: none; cursor: pointer;
}
.dropdown-item:hover, .dropdown-menu form button:hover, .dropdown-item:focus-visible { background: var(--accent); color: var(--accent-foreground); box-shadow: none; }
.dropdown-menu form { margin: 0; }

/* ---------- skeleton ---------- */

.skeleton { background: var(--accent); border-radius: var(--radius-md); animation: eui-pulse 2s ease-in-out infinite; }
@keyframes eui-pulse { 50% { opacity: 0.5; } }

/* ---------- table ---------- */

.table-scroll, .scroll { position: relative; width: 100%; overflow-x: auto; }
.table-scroll { margin-bottom: 1rem; }
.table, .grid { width: 100%; border-collapse: collapse; caption-side: bottom; font-size: 0.875rem; }
.grid th, .grid td, .table th, .table td {
  padding: 0.5rem; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.grid thead th, .table thead th {
  height: 2.5rem; font-weight: 500; color: var(--muted-foreground);
  white-space: nowrap; font-size: 0.875rem; letter-spacing: 0; text-transform: none;
}
.grid tbody tr, .table tbody tr { transition: background-color 0.15s; }
.grid tbody tr:hover, .table tbody tr:hover { background: color-mix(in oklch, var(--muted) 50%, transparent); }
.grid tbody tr:last-child > *, .table tbody tr:last-child > * { border-bottom: 0; }
.grid tfoot th, .grid tfoot td { border-bottom: 0; padding-top: 0.375rem; padding-bottom: 0.375rem; font-weight: 400; }
.grid tfoot .total th, .grid tfoot .total td { border-top: 1px solid var(--border); font-weight: 600; padding-top: 0.625rem; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid .strong { font-weight: 600; }
.grid tr.is-stale { background: color-mix(in oklch, var(--warn) 8%, transparent); }
.grid--tight th, .grid--tight td { padding: 0.375rem 0.5rem; }
.grid--breakup th { font-weight: 400; }
.grid--breakup .sub { display: block; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground); }
.grid--breakup .total th, .grid--breakup .total td { border-top: 1px solid var(--border); font-weight: 600; padding-top: 0.625rem; }
.grid input:not([type="checkbox"]):not([type="radio"]) { min-width: 5rem; height: 2rem; padding: 0.25rem 0.5rem; font-size: 0.8125rem; }
.grid-art { width: 44px; }
.grid-art img { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius-md); display: block; border: 1px solid var(--border); }
.grid-art-empty { display: block; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--muted); border: 1px solid var(--border); }
.grid-name { font-weight: 500; color: var(--foreground); text-decoration: none; }
.grid-name:hover { text-decoration: underline; }
.row--action { box-shadow: inset 2px 0 0 var(--primary); }

/* ---------- app shell: top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--background) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-row {
  max-width: 80rem; margin: 0 auto; padding: 0 1.5rem;
  height: 3.5rem; display: flex; align-items: center; gap: 1rem;
}
.topbar-brand { display: inline-flex; align-items: center; gap: 0.625rem; text-decoration: none; color: inherit; min-width: 0; }
.topbar-logo {
  display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0;
  border-radius: var(--radius-md); background: var(--primary); color: var(--primary-foreground);
  font-weight: 600; font-size: 0.875rem;
}
.topbar-name { font-weight: 600; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.topbar-sep { color: var(--border); font-size: 1.25rem; font-weight: 300; }
.topbar-label { color: var(--muted-foreground); font-size: 0.875rem; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.topbar-actions > a:not(.btn) { color: var(--muted-foreground); text-decoration: none; font-size: 0.875rem; padding: 0.375rem 0.625rem; border-radius: var(--radius-md); white-space: nowrap; }
.topbar-actions > a:not(.btn):hover { color: var(--foreground); background: var(--accent); }
.topbar-nav {
  max-width: 80rem; margin: 0 auto; padding: 0 1.25rem;
  display: flex; gap: 0.125rem; overflow-x: auto; scrollbar-width: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-nav a {
  position: relative; flex-shrink: 0;
  padding: 0.5rem 0.625rem 0.75rem; font-size: 0.875rem; font-weight: 500;
  color: var(--muted-foreground); text-decoration: none; white-space: nowrap;
}
.topbar-nav a:hover { color: var(--foreground); }
.topbar-nav a.is-active { color: var(--foreground); }
.topbar-nav a.is-active::after {
  content: ""; position: absolute; left: 0.625rem; right: 0.625rem; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--primary);
}
.avatar {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px;
  background: var(--muted); color: var(--foreground); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; border: 1px solid var(--border); cursor: pointer; padding: 0;
}

/* theme toggle: show the icon for the theme you would switch to */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
.dark .theme-toggle .icon-moon { display: none; }
.dark .theme-toggle .icon-sun { display: block; }

/* ---------- page ---------- */

.shell { width: 100%; max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.page { padding: 2rem 0 4rem; }
.foot { padding: 1.5rem 0 2.5rem; color: var(--muted-foreground); font-size: 0.75rem; border-top: 1px solid var(--border); }

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.head h1 { font-size: 1.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; margin: 0 0 0.25rem; }
.head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: 0.8125rem; font-weight: 500; color: var(--muted-foreground); margin: 0 0 0.25rem; letter-spacing: 0; text-transform: none; font-family: var(--font-sans); }
.eyebrow a { color: inherit; }
.eyebrow a:hover { color: var(--foreground); }
.lede { color: var(--muted-foreground); max-width: 65ch; margin: 0; font-size: 0.875rem; }
.muted { color: var(--muted-foreground); }
.strong { font-weight: 600; }
.block { display: block; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.narrow { width: 4rem; }
.contents { display: contents; }
.empty { padding: 2.5rem 0; color: var(--muted-foreground); text-align: center; margin: 0; font-size: 0.875rem; }
.note { color: var(--muted-foreground); font-size: 0.8125rem; margin: 0.375rem 0 0; }
p.note:first-child { margin-top: 0; }
.panel > .note { margin: 0 0 1rem; }

/* settings sub-navigation: an underline tab row */
.subnav {
  display: flex; flex-wrap: wrap; gap: 0.25rem;
  margin: 0 0 1.5rem; padding: 3px; border-radius: var(--radius-lg);
  background: var(--muted); width: fit-content; max-width: 100%;
}
.subnav a {
  padding: 0.25rem 0.625rem; border-radius: var(--radius-md); border: 1px solid transparent;
  font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); text-decoration: none; white-space: nowrap;
}
.subnav a:hover { color: var(--foreground); }
.subnav a.is-active { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm); }
.dark .subnav a.is-active { background: color-mix(in oklch, var(--input) 30%, transparent); border-color: var(--input); }

/* ---------- forms ---------- */

.form, .stack { display: grid; gap: 1rem; }
.form { max-width: 54rem; }
.stack label { display: flex; flex-direction: column; gap: 0.5rem; }
.stack label > span { font-size: 0.875rem; font-weight: 500; }
.stack > .panel { margin: 0; }
.field { display: flex; flex-direction: column; gap: 0.5rem; margin: 0 0 1rem; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > span { font-size: 0.875rem; font-weight: 500; color: var(--foreground); }
.field > span em, .field label em { font-style: normal; color: var(--muted-foreground); font-weight: 400; }
.field small { font-size: 0.75rem; color: var(--muted-foreground); }
.field > .note { margin: 0; }
.field--wide { grid-column: 1 / -1; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 1rem; }
.field-row:last-child { margin-bottom: 0; }
.field-row > .field { margin: 0; }
.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 400; margin: 0.25rem 0; }
.field > label.check { font-weight: 400; }
.stack label.check { flex-direction: row; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.25rem 1rem; }
.actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.confirm { grid-column: 1 / -1; display: flex; gap: 0.5rem; align-items: center; font-size: 0.875rem; color: var(--muted-foreground); }
.inline-form { display: inline-flex; gap: 0.5rem; align-items: center; margin: 0; }
.inline-form select { width: auto; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.inline-actions form { margin: 0; }
.publish { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; align-items: end; }
.publish .field { margin: 0; }

.money-input { display: flex; align-items: stretch; }
.money-prefix {
  display: flex; align-items: center; padding: 0 0.75rem;
  border: 1px solid var(--input); border-right: 0; border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--muted); color: var(--muted-foreground); font-family: var(--font-mono); font-size: 0.875rem;
}
.money-input input { border-radius: 0 var(--radius-md) var(--radius-md) 0; font-family: var(--font-mono); }

.copyable { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.copyable code {
  font-size: 0.8125rem; background: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.375rem 0.625rem; overflow-wrap: anywhere;
}
.linkbox { margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.8125rem; }

details summary { cursor: pointer; font-size: 0.875rem; font-weight: 500; margin: 0.5rem 0; }
details summary:hover { text-decoration: underline; text-underline-offset: 4px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; }
.search, .search-form { display: flex; gap: 0.5rem; align-items: center; }
.search-form { margin: 0 0 1rem; }
.search input, .search-form input { min-width: 16rem; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.75rem; }
.bulk-bar select, .bulk-bar input { width: auto; }
.bulk-grid input { width: 100%; min-width: 5rem; }
.row-problem { color: var(--destructive); font-size: 0.8125rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; font-size: 0.875rem; color: var(--muted-foreground); }

.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
address { font-style: normal; line-height: 1.6; font-size: 0.875rem; }

/* ---------- sign in ---------- */

.signin {
  max-width: 24rem; margin: 4rem auto;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); padding: 1.5rem;
}
.signin h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 1.5rem; }
.signin .btn { width: 100%; }

/* ---------- dashboard ---------- */

.attention { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 1.5rem; }
.attention-item {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  padding: 0.625rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); box-shadow: var(--shadow-xs);
  text-decoration: none; color: var(--foreground); font-size: 0.875rem;
}
.attention-item:hover { background: var(--accent); }
.attention-item--bad { border-color: color-mix(in oklch, var(--destructive) 35%, var(--border)); }
.attention-item--bad .attention-count { color: var(--destructive); }
.attention-count { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat {
  padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--card); box-shadow: var(--shadow-sm);
}
.stat-label { margin: 0; font-size: 0.875rem; color: var(--muted-foreground); font-weight: 500; }
.stat-figure { margin: 0.5rem 0 0.25rem; font-size: 1.875rem; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-meta { margin: 0; font-size: 0.8125rem; color: var(--muted-foreground); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.trend { font-variant-numeric: tabular-nums; font-weight: 500; }
.trend--up { color: var(--ok); }
.trend--down { color: var(--destructive); }
.trend--flat { color: var(--muted-foreground); }
.delta { font-family: var(--font-mono); font-size: 0.8125rem; }
.delta--up { color: var(--ok); }
.delta--down { color: var(--destructive); }
.stock--low { color: var(--warn); font-weight: 600; }
.stock--out { color: var(--destructive); font-weight: 600; }
.rate-note { display: block; font-size: 0.75rem; color: var(--muted-foreground); }

.stocklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.stocklist li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.875rem; }
.stocklist a { color: var(--foreground); text-decoration: none; }
.stocklist a:hover { text-decoration: underline; }

/* setup checklist */
.setup h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.setup-count { font-size: 0.8125rem; font-weight: 400; color: var(--muted-foreground); }
.setup-steps { list-style: none; margin: 0; padding: 0; }
.setup-step { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.setup-step:first-child { border-top: 0; padding-top: 0.25rem; }
.setup-mark {
  width: 1.25rem; height: 1.25rem; border: 1px solid var(--input); border-radius: 50%;
  display: grid; place-items: center; font-size: 0.6875rem; line-height: 1;
}
.setup-step.is-done .setup-mark { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.setup-step.is-done .setup-title { color: var(--muted-foreground); text-decoration: line-through; }
.setup-title { margin: 0; font-weight: 500; font-size: 0.875rem; }
.setup-optional { font-weight: 400; font-size: 0.75rem; color: var(--muted-foreground); margin-left: 0.375rem; }
.setup-body { margin: 0.25rem 0 0.375rem; color: var(--muted-foreground); font-size: 0.875rem; max-width: 65ch; }
.setup-link { font-size: 0.875rem; font-weight: 500; }
.setup-open { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.setup-open .panel-note { margin: 0; }

/* ---------- smaller screens' pieces ---------- */

.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.25rem 1rem; margin-top: 0.5rem; font-size: 0.875rem; }
.addline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.addline .field { flex: 1; min-width: 12rem; margin: 0; }
.field--narrow { flex: 0 0 5rem !important; min-width: 0 !important; }
.withdraw { margin-top: 1rem; }
.sectionblock { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; margin: 0 0 1rem; }
.sectionblock legend { font-size: 0.8125rem; font-weight: 500; color: var(--muted-foreground); padding: 0 0.375rem; }
.review-queue { display: grid; gap: 0.75rem; }
.queued { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; }
.queued-head { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; font-size: 0.875rem; }
.queued-stars { font-family: var(--font-mono); font-weight: 600; }
.queued-title { margin: 0.5rem 0 0.25rem; font-weight: 600; }
.queued-comment { margin: 0; color: var(--muted-foreground); line-height: 1.5; }
.queued-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.worked { margin: 0.5rem 0 1rem; padding: 0.75rem 1rem; border-left: 2px solid var(--primary); background: var(--muted); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 0.875rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; margin: 0 0 1rem; font-size: 0.875rem; }
.facts dt { color: var(--muted-foreground); }
.facts dd { margin: 0; }
.plain-list { margin: 0; padding-left: 1.1rem; font-size: 0.875rem; line-height: 1.8; }
.plain-list .note { display: inline; margin: 0 0 0 0.25rem; }
.theme-shelf-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.2rem 0 0.4rem; }
.theme-shelf-nav .chip { display: inline-block; padding: 0.3rem 0.75rem; border: 1px solid var(--line, #e4e4e7); border-radius: 999px; font-size: 0.82rem; text-decoration: none; color: inherit; }
.theme-shelf-title { margin: 1.6rem 0 0.7rem; font-size: 1.05rem; scroll-margin-top: 4rem; }
.samples-note { margin-bottom: 1rem; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.theme-grid > .panel { margin: 0; }
.theme-card.is-live { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.swatches { display: flex; height: 2.5rem; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); margin-bottom: 0.75rem; }
.swatches span { flex: 1; }
.plan-price { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 0.75rem; }
.prose { line-height: 1.7; font-size: 0.9375rem; }
.prose > * { max-width: 70ch; }
.prose p, .prose ol, .prose ul { margin: 0 0 1rem; }
.meter { display: block; height: 0.5rem; background: var(--chart-1); border-radius: 999px; min-width: 1px; }
.rule-list { list-style: none; padding: 0; margin: 0; }
.rate-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.timeline { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; gap: 0.75rem; font-size: 0.875rem; }
.timeline li { border-left: 2px solid var(--border); padding-left: 0.75rem; }
.timeline-comment { border-left-color: var(--primary) !important; }
.thumbs { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.thumb { margin: 0; text-align: center; }
.thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border); }
.thumb figcaption { font-size: 0.75rem; color: var(--muted-foreground); margin-top: 0.25rem; }
.theme-thumb { aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 0.75rem; background: var(--muted); }
.theme-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.theme-custom { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem 1.25rem; align-items: end; }
.theme-custom label { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; }
.theme-custom-wide { grid-column: 1 / -1; }
.theme-custom .theme-custom-check { flex-direction: row; align-items: center; gap: 0.5rem; }
.chat-turn { margin: 0 0 0.75rem; }
.email-preview { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }

@media (max-width: 60rem) {
  .split, .field-row { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .search input, .search-form input { min-width: 0; flex: 1; }
  .topbar-label, .topbar-sep { display: none; }
  .shell, .topbar-row { padding: 0 1rem; }
}

/* =====================================================================
 * Suite look (COMMERCE_ADMIN_UI=suite): the Edesy Tables / Boards app shell.
 * New blocks are additive and safe in both looks; overrides of the classic
 * vocabulary are scoped to body.ui-suite so the classic look is unchanged.
 *
 * mirrors (edesy-tables/frontend/src):
 *   .icon               lucide-react size-4                      components/ui/button.tsx [&_svg]:size-4
 *   .app-header(-row)   sticky h-14 border-b bg-background/95    components/app-shell.tsx:98-99
 *   .app-logo, mark     LogoMark size-7 + font-semibold          components/app-shell.tsx:101, logo.tsx
 *   .crumb-sep          text-neutral-300 "/"                     components/app-shell.tsx:102
 *   .store-name         WorkspaceSwitcher trigger                components/app-shell.tsx:47
 *   .app-nav a          rounded-md px-3 py-1.5 gap-1.5 pills     components/app-shell.tsx:104-108
 *   .app-nav--mobile    overflow-x-auto px-4 pb-2                components/app-shell.tsx:113-117
 *   .avatar--solid      size-8 rounded-full bg-neutral-900       components/app-shell.tsx:26
 *   canvas, .app-main   bg-neutral-50/60, py-6 md:py-8           components/app-shell.tsx:97,119
 *   .section-layout/nav md:w-52 md:flex-col, md:max-w-3xl        pages/settings.tsx:32-41
 *   .section-card       rounded-xl border; head border-b px-5 py-4; body p-5  components/settings/common.tsx:29-41
 *   .empty-state        Card flex-col items-center gap-3 p-10    pages/home.tsx:80-86
 *   .start-card         rounded-xl border p-4 shadow-xs, size-10 tile  pages/home.tsx:145-151
 *   .section-label      text-sm font-semibold uppercase tracking-wide  pages/home.tsx:76
 *   .perm-note          rounded-md border-dashed px-3 py-2 text-xs     components/settings/common.tsx:45
 *   .auth-split         grid lg:grid-cols-2, bg-neutral-950 p-12       pages/login.tsx:40-60
 * ===================================================================== */

:root { --canvas: color-mix(in oklch, oklch(0.985 0 0) 60%, var(--background)); --mark-bg: oklch(0.145 0 0); --mark-fg: #fff; --crumb: oklch(0.87 0 0); }
.dark { --canvas: var(--background); --mark-bg: oklch(0.985 0 0); --mark-fg: oklch(0.145 0 0); --crumb: oklch(0.439 0 0); }

.icon { width: 1rem; height: 1rem; flex-shrink: 0; vertical-align: -0.125em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge .icon, .pill .icon { width: 0.75rem; height: 0.75rem; }

.skip-link { position: absolute; left: -999px; top: 0.5rem; z-index: 60; }
.skip-link:focus { left: 0.5rem; padding: 0.5rem 0.75rem; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-md); }

body.ui-suite { background: var(--canvas); }
.app-mark { width: 1.75rem; height: 1.75rem; flex-shrink: 0; display: block; }
.app-mark-tile { fill: var(--mark-bg); }
.app-mark-glyph { stroke: var(--mark-fg); }
.app-logo--inverted .app-mark-tile { fill: #fff; }
.app-logo--inverted .app-mark-glyph { stroke: oklch(0.145 0 0); }

.app-header {
  position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--background) 95%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.app-header-row { max-width: 80rem; margin: 0 auto; height: 3.5rem; padding: 0 1rem; display: flex; align-items: center; gap: 0.75rem; }
.app-logo { display: inline-flex; align-items: center; gap: 0.5rem; color: inherit; text-decoration: none; flex-shrink: 0; }
.app-logo-name { font-weight: 600; letter-spacing: -0.015em; font-size: 0.9375rem; }
.crumb-sep { color: var(--crumb); }
.store-name { min-width: 0; max-width: 14rem; padding: 0.25rem 0.5rem; font-size: 0.875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-nav { display: none; margin-left: 0.75rem; min-width: 0; align-items: center; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.app-nav::-webkit-scrollbar { display: none; }
.app-nav a {
  display: inline-flex; align-items: center; gap: 0.375rem; flex-shrink: 0;
  padding: 0.375rem 0.75rem; border-radius: var(--radius-md);
  font-size: 0.875rem; color: var(--muted-foreground); text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.app-nav a:hover, .app-nav a.is-active { background: var(--accent); color: var(--foreground); }
.app-nav--mobile { display: flex; margin: 0; padding: 0 1rem 0.5rem; }
.app-nav--mobile a { padding: 0.25rem 0.75rem; }
.app-nav--mobile .icon { display: none; }
.app-actions { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.app-actions .btn--icon { color: var(--muted-foreground); }
.app-actions .btn--icon:hover, .app-actions .btn--icon.is-active { color: var(--foreground); background: var(--accent); }
.avatar--solid { width: 2rem; height: 2rem; border: 0; margin-left: 0.25rem; background: oklch(0.205 0 0); color: #fff; }
.dark .avatar--solid { background: oklch(0.922 0 0); color: oklch(0.205 0 0); }
.dropdown-item .icon, .dropdown-menu form button .icon { color: var(--muted-foreground); }

.app-main { padding: 1.5rem 0 4rem; }
.ui-suite .shell { padding: 0 1rem; }

@media (min-width: 48rem) {
  .app-header-row, .ui-suite .shell { padding: 0 1.5rem; }
  .app-main { padding-top: 2rem; }
}
@media (min-width: 64rem) {
  .app-nav { display: flex; }
  .app-nav--mobile { display: none; }
}
@media (min-width: 64rem) and (max-width: 82rem) {
  .app-logo-name { display: none; }
  .store-name { max-width: 9rem; }
  .app-nav { margin-left: 0.25rem; }
  .app-nav a { padding: 0.375rem 0.5rem; }
}
@media (max-width: 40rem) { .app-logo-name { display: none; } }

/* left section menu */
.section-layout { display: flex; flex-direction: column; gap: 1.5rem; }
.section-nav { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
  padding: 0.375rem 0.75rem; border-radius: var(--radius-md);
  font-size: 0.875rem; color: var(--muted-foreground); text-decoration: none; white-space: nowrap;
}
.section-nav a:hover { background: var(--accent); color: var(--foreground); }
.section-nav a.is-active { background: var(--accent); color: var(--foreground); font-weight: 500; }
.section-main { min-width: 0; flex: 1; }
@media (min-width: 48rem) {
  .section-layout { flex-direction: row; gap: 2.5rem; }
  .section-nav { flex-direction: column; width: 13rem; overflow: visible; }
  .section-nav a { white-space: normal; }
  .section-layout--settings .section-main { max-width: 48rem; }
}

/* section card */
.section-card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius-xl); margin: 0 0 1.5rem; transition: box-shadow 0.15s; }
.section-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.section-card-head h2 { font-size: 1rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.section-card-head p { margin: 0.125rem 0 0; font-size: 0.875rem; color: var(--muted-foreground); }
.section-card-body { padding: 1.25rem; }
.section-card-body--flush { padding: 0; }
.section-card--danger { border-color: color-mix(in oklch, var(--destructive) 40%, var(--border)); }
.section-card--danger .section-card-head h2 { color: var(--destructive); }
.section-card > .table-scroll { margin: 0; }
.section-card .grid :is(th, td):first-child { padding-left: 1.25rem; }
.section-card .grid :is(th, td):last-child { padding-right: 1.25rem; }
.section-card-foot { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); font-size: 0.875rem; }

/* empty states */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2.5rem; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); margin: 0 0 1.5rem; }
.empty-state > .icon { width: 2rem; height: 2rem; color: var(--muted-foreground); }
.empty-state-title { margin: 0; font-weight: 500; font-size: 0.875rem; }
.empty-state-text { margin: 0.125rem 0 0; color: var(--muted-foreground); font-size: 0.875rem; }
.empty-state--dashed { background: transparent; box-shadow: none; border-style: dashed; padding: 4rem 1.5rem; }
.empty-state--dashed > .icon { color: var(--crumb); }
.section-card .empty-state, .panel .empty-state { border: 0; box-shadow: none; margin: 0; background: transparent; }

/* start cards */
.start-cards { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); margin: 0 0 2rem; }
.start-card {
  display: flex; align-items: center; gap: 0.75rem; padding: 1rem; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs); color: var(--foreground); text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.start-card:hover { border-color: oklch(0.708 0 0); box-shadow: var(--shadow-sm); text-decoration: none; }
.start-card-tile { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex-shrink: 0; border-radius: var(--radius-lg); background: oklch(0.205 0 0); color: #fff; }
.dark .start-card-tile { background: oklch(0.922 0 0); color: oklch(0.205 0 0); }
.start-card-tile .icon { width: 1.25rem; height: 1.25rem; }
.start-card-text { min-width: 0; }
.start-card-title { display: block; font-weight: 500; }
.start-card-sub { display: block; font-size: 0.75rem; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.section-label { margin: 0 0 0.75rem; font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.025em; color: var(--muted-foreground); }
.perm-note { margin: 0 0 1rem; padding: 0.5rem 0.75rem; border: 1px dashed var(--border); border-radius: var(--radius-md); font-size: 0.75rem; color: var(--muted-foreground); }
.icon-rows { list-style: none; margin: 0; padding: 0; }
.icon-rows a { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem; color: var(--foreground); text-decoration: none; border-top: 1px solid var(--border); }
.icon-rows li:first-child a { border-top: 0; }
.icon-rows a:hover { background: color-mix(in oklch, var(--muted) 50%, transparent); }
.icon-rows .icon-rows-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.icon-rows .icon-rows-go { margin-left: auto; color: var(--muted-foreground); }
.icon-rows .is-bad .icon:first-child, .icon-rows .is-bad .icon-rows-count { color: var(--destructive); }
.search-field { position: relative; display: block; flex: 1; }
.search-field > .icon { position: absolute; left: 0.625rem; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.search-field > input { padding-left: 2rem; }
.setup-mark .icon { width: 0.75rem; height: 0.75rem; }

/* auth: split-screen sign-in */
.auth-split { display: grid; min-height: 100dvh; }
.auth-panel { display: none; flex-direction: column; justify-content: space-between; padding: 3rem; background: oklch(0.145 0 0); color: #fff; }
.auth-panel .app-logo-name { color: #fff; }
.auth-pitch h2 { color: #fff; max-width: 28rem; margin: 0 0 2rem; font-size: 2.25rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; }
.auth-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.auth-pitch li { display: flex; align-items: flex-start; gap: 0.75rem; max-width: 28rem; font-size: 0.875rem; color: oklch(0.87 0 0); }
.auth-pitch li .icon { color: #fff; margin-top: 0.125rem; }
.auth-foot { margin: 0; font-size: 0.75rem; color: oklch(0.556 0 0); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: var(--background); }
.auth-box { width: 100%; max-width: 24rem; display: grid; gap: 1.5rem; }
.auth-logo-sm { margin-bottom: -0.5rem; }
.ui-suite .auth-box .signin { margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; max-width: none; }
.ui-suite .auth-box .signin h1 { margin-bottom: 1.25rem; }
.ui-suite .auth-box .flash { margin: 0; }
@media (min-width: 64rem) {
  .auth-split { grid-template-columns: 1fr 1fr; }
  .auth-panel { display: flex; }
  .auth-logo-sm { display: none; }
}

/* classic vocabulary, restyled in the suite look */
.ui-suite .panel { background: var(--card); box-shadow: none; padding: 1.25rem; transition: box-shadow 0.15s; }
.ui-suite .panel > h2:first-child, .ui-suite .panel > header:first-child {
  margin: -1.25rem -1.25rem 1.25rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.ui-suite .panel > h2:first-child:has(+ p.note), .ui-suite .panel > h2:first-child:has(+ p.panel-note) { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.ui-suite .panel > h2:first-child + :is(p.note, p.panel-note) { margin: 0.125rem -1.25rem 1.25rem; padding: 0 1.25rem 1rem; border-bottom: 1px solid var(--border); }
.ui-suite .panel > header:first-child h2 { margin: 0; }
.ui-suite .panel--warn { border-color: color-mix(in oklch, var(--destructive) 40%, var(--border)); }
.ui-suite .panel--inset { padding: 1rem; }
.ui-suite .stat { box-shadow: none; padding: 1.25rem; }
.ui-suite .head { margin-bottom: 1.5rem; }
.ui-suite .head h1 { margin: 0; }
.ui-suite .head .lede { margin-top: 0.25rem; }
.ui-suite .head .eyebrow:not(:has(a)) { display: none; }
.ui-suite .head .eyebrow a { color: var(--muted-foreground); text-decoration: none; }
.ui-suite .head .eyebrow a:hover { color: var(--foreground); text-decoration: underline; }
.ui-suite .head .eyebrow::after { content: " /"; color: var(--crumb); }
.ui-suite .empty { padding: 2.5rem 1rem; }
.ui-suite .pill[class*="pill--"]::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: currentColor; }
.ui-suite .pill--muted::before, .ui-suite .pill--draft::before { opacity: 0.5; }
.ui-suite .timeline li { position: relative; border-left: 0; padding-left: 1.25rem; }
.ui-suite .timeline li::before { content: ""; position: absolute; left: 0; top: 0.4rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 2px var(--crumb); }
.ui-suite .timeline li:not(:last-child)::after { content: ""; position: absolute; left: 0.21rem; top: 1.1rem; bottom: -0.6rem; width: 1px; background: var(--border); }
.ui-suite .timeline .timeline-comment::before { box-shadow: 0 0 0 2px var(--primary); }
@media (max-width: 47.99rem) { .ui-suite .section-nav { margin: 0 -1rem; padding: 0 1rem; } }
/* detail pages: main section cards on the left, a summary aside on the right (lg) */
@media (min-width: 64rem) {
  .ui-suite .detail-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .ui-suite .form:has(> .detail-split) { max-width: none; }
}
.ui-suite .form > .actions { position: sticky; bottom: 0; z-index: 5; padding: 0.75rem 0; background: var(--canvas); border-top: 1px solid var(--border); }
.ui-suite .panel > h2 { display: flex; align-items: center; gap: 0.5rem; }
.ui-suite .panel--warn > h2:first-child { color: var(--destructive); }
/* settings: the save button sits right-aligned under the cards */
.ui-suite .section-layout--settings form.stack > p:last-child:has(> button[type="submit"]:only-child),
.ui-suite .section-layout--settings form.stack > .actions:last-child { display: flex; justify-content: flex-end; margin: 0; }
.section-card-head { align-items: center; }
.section-card-head:has(p) { align-items: flex-start; }
.setup .section-card-head h2 { justify-content: flex-start; }
@media (min-width: 82rem) { .store-name { flex-shrink: 0; } .app-nav { margin-left: 0.5rem; gap: 0.125rem; } }
.ui-suite .panel > .panel-note:only-child { margin: 0; }
