/* ── Lamina admin — styles ───────────────────────────────────────────────
   Tokens are a verbatim copy of public/styles.css (light on :root, dark via
   prefers-color-scheme and an explicit data-theme stamp) so the portal shares
   the app's visual language. Then: base, shell, components, screens.        */

:root {
  --bg: #f4f3ef;
  --panel: #ffffff;
  --panel-2: #ecebe5;
  --panel-3: #e3e1da;
  --ink: #1d1c1a;
  --ink-2: #615d56;
  --ink-3: #8f8a81;
  --line: #e0ddd5;
  --line-2: #cfcbc1;
  --accent: #0e7c7b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(14, 124, 123, 0.11);
  --shadow: 0 1px 2px rgba(30, 25, 15, 0.06), 0 8px 24px rgba(30, 25, 15, 0.08);
  --shadow-lg: 0 12px 40px rgba(30, 25, 15, 0.18);
  --stage-bg: #d8dee4;
  --coach: rgba(20, 18, 14, 0.58);
  --font-display: 'Archivo', 'Archivo Narrow', 'Helvetica Neue', Arial, sans-serif;
  --font-ui: 'IBM Plex Sans', 'Segoe UI', Roboto, system-ui, sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
  --topbar-h: 56px;
  --surfacebar-h: 48px;
  --catalog-w: 336px;
  /* admin-only tokens */
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.1);
  --warn: #9a6700;
  --warn-soft: rgba(154, 103, 0, 0.12);
  --ok: #0e7c7b;
  --nav-w: 228px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161614;
    --panel: #1f1f1c;
    --panel-2: #292926;
    --panel-3: #33332f;
    --ink: #efece6;
    --ink-2: #a7a39a;
    --ink-3: #7d7971;
    --line: #34332f;
    --line-2: #45433e;
    --accent: #45b8b3;
    --accent-ink: #0a1817;
    --accent-soft: rgba(69, 184, 179, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
    --stage-bg: #0f1115;
    --coach: rgba(0, 0, 0, 0.66);
    --danger: #f08a80;
    --danger-soft: rgba(240, 138, 128, 0.14);
    --warn: #e2b34c;
    --warn-soft: rgba(226, 179, 76, 0.14);
    --ok: #45b8b3;
  }
}
:root[data-theme="dark"] {
  --bg: #161614;
  --panel: #1f1f1c;
  --panel-2: #292926;
  --panel-3: #33332f;
  --ink: #efece6;
  --ink-2: #a7a39a;
  --ink-3: #7d7971;
  --line: #34332f;
  --line-2: #45433e;
  --accent: #45b8b3;
  --accent-ink: #0a1817;
  --accent-soft: rgba(69, 184, 179, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  --stage-bg: #0f1115;
  --coach: rgba(0, 0, 0, 0.66);
  --danger: #f08a80;
  --danger-soft: rgba(240, 138, 128, 0.14);
  --warn: #e2b34c;
  --warn-soft: rgba(226, 179, 76, 0.14);
  --ok: #45b8b3;
}

/* ── Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
img, canvas { display: block; max-width: 100%; }
a { color: var(--accent); }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
code { background: var(--panel-2); padding: 0.1em 0.4em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { flex: none; }
.ic { display: inline-flex; line-height: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -40px; z-index: 100; padding: 8px 12px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 8px; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ── Boot splash (same as the app) ───────────────────────────────────── */
.boot { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; gap: 18px; background: var(--bg); }
.boot-mark { font-family: var(--font-display); font-stretch: 118%; font-weight: 700; letter-spacing: 0.28em; font-size: 22px; color: var(--ink); text-align: center; }
.boot-bar { width: 160px; height: 3px; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: var(--accent); border-radius: 2px; animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }

/* ── Brand ───────────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: baseline; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { font-family: var(--font-display); font-stretch: 118%; font-weight: 700; letter-spacing: 0.26em; font-size: 15px; }
.brand-sub { font-family: var(--font-display); font-weight: 500; color: var(--ink-2); letter-spacing: 0.04em; font-size: 13px; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: filter 0.15s, background 0.15s, opacity 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--panel-2); filter: none; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--danger); border-color: var(--line-2); }
.btn.ghost.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; filter: none; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); padding: 0;
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn.small svg { width: 17px; height: 17px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; background: transparent; }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 500; }
.link-btn:hover { filter: brightness(1.1); }

/* ── Chips, tags, badges ─────────────────────────────────────────────── */
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag { font-family: var(--font-display); font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--ink-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.owner { background: var(--accent); color: var(--accent-ink); }
.count-muted { color: var(--ink-3); font-weight: 500; font-size: 0.85em; margin-left: 4px; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-2); gap: 2px; }
.seg-btn { border: 0; background: transparent; color: var(--ink-2); padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.seg-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.field .error { font-size: 12px; color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-width: 0; padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--panel-2); color: var(--ink-3); cursor: not-allowed; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input.small { padding: 6px 9px; font-size: 13px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.textarea { resize: vertical; min-height: 72px; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row > .input, .input-row > .select { flex: 1; }
.input-suffix { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink-3); min-width: 0; }
.search input { flex: 1; border: 0; background: transparent; padding: 8px 0; color: var(--ink); outline: none; min-width: 0; }
.search:focus-within { border-color: var(--accent); color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid .span-2 { grid-column: span 1; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.check input:disabled + span { color: var(--ink-3); }
.check-group { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { padding: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.range-row { display: grid; grid-template-columns: 1fr 64px; gap: 10px; align-items: center; }
.range { width: 100%; accent-color: var(--accent); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 0; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.switch-track { width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background 0.15s; flex: none; }
.switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.3); transition: transform 0.15s; }
.switch[aria-checked="true"] .switch-track { background: var(--accent); }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(16px); }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.switch.busy .switch-track { opacity: 0.6; }

/* ── Alerts, states ──────────────────────────────────────────────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; font-size: 13px; border: 1px solid transparent; }
.alert svg { width: 18px; height: 18px; margin-top: 1px; }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert.info { background: var(--accent-soft); color: var(--accent); }
.alert .alert-body { flex: 1; min-width: 0; }
.alert.error a, .alert.error .link-btn { color: inherit; }
.state { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--ink-2); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.state svg { width: 28px; height: 28px; color: var(--ink-3); }
.state h3 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink); }
.state p { margin: 0; max-width: 46ch; }
.state .btn { margin-top: 6px; }
.loading-inline { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 20px 0; }
.loading-inline .spin { width: 16px; height: 16px; border: 2px solid var(--line-2); border-right-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 37%, var(--panel-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ── Login ───────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 28px 26px 24px; display: grid; gap: 18px; }
.login-card h1 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.login-card .brand { margin-bottom: -6px; }
.login-card form { display: grid; gap: 14px; }
.login-card .lede { margin: 0; color: var(--ink-2); font-size: 13px; }
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }

/* ── Shell ───────────────────────────────────────────────────────────── */
.shell { min-height: 100vh; display: grid; grid-template-rows: var(--topbar-h) auto 1fr; grid-template-columns: 100%; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); min-width: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 999px; background: var(--panel-2); font-size: 13px; min-width: 0; }
.user-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 11px; text-transform: uppercase; flex: none; }
.user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.nav { display: flex; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--topbar-h); z-index: 20; }
.nav::-webkit-scrollbar { display: none; }
.nav-link { display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; white-space: nowrap; border: 0; background: transparent; cursor: pointer; }
.nav-link:hover { background: var(--panel-2); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link svg { width: 18px; height: 18px; }
.page { padding: 22px 16px 60px; min-width: 0; max-width: 1180px; width: 100%; margin: 0 auto; outline: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.page-head .lede { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; max-width: 64ch; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.card-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
.card-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-foot .status { margin-right: auto; font-size: 12.5px; color: var(--ink-3); }
.section-title { margin: 0 0 10px; font-family: var(--font-display); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.two-col > .card + .card { margin-top: 0; }
@media (min-width: 900px) {
  .shell { grid-template-columns: var(--nav-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; }
  .topbar { grid-column: 1 / -1; }
  .nav { flex-direction: column; gap: 2px; padding: 14px 12px; border-bottom: 0; border-right: 1px solid var(--line); position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow: auto; }
  .nav-link { padding: 9px 12px; }
  .page { padding: 28px 32px 80px; }
}
@media (max-width: 600px) {
  .user-chip .user-name, .user-chip .role-badge { display: none; }
  .user-chip { padding: 3px; }
  .topbar-right .btn span:not(.ic) { display: none; }
  .topbar-right .btn { padding: 6px 10px; }
}

/* ── Toolbar ─────────────────────────────────────────────────────────── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 220px; }
.toolbar .select { width: auto; flex: 0 1 180px; }
.toolbar .status { margin-left: auto; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--font-display); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--panel-2) 50%, transparent); }
.table tr.dragging { opacity: 0.45; }
.table tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.table tr.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
.table .actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.table .c-enabled { width: 56px; }
.table .c-actions { width: 1%; }
.swatch { width: 44px; height: 44px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); object-fit: cover; background: var(--panel-2); flex: none; }
.swatch.small { width: 32px; height: 32px; border-radius: 6px; }
.swatch.large { width: 72px; height: 72px; }
.swatch-ph { display: grid; place-items: center; color: var(--ink-3); }
.swatch-ph svg { width: 18px; height: 18px; }
.design-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.design-name { font-weight: 600; display: block; }
.design-sub { font-size: 12px; color: var(--ink-3); }
.order-cell { display: flex; align-items: center; gap: 0; }
.drag-handle { cursor: grab; color: var(--ink-3); display: grid; place-items: center; width: 26px; height: 30px; border: 0; background: transparent; border-radius: 6px; touch-action: none; padding: 0; }
.drag-handle:hover { background: var(--panel-2); color: var(--ink); }
.drag-handle:active { cursor: grabbing; }
.order-btns { display: grid; }
.order-btns .icon-btn { width: 22px; height: 18px; border-radius: 4px; }
.order-btns .icon-btn svg { width: 14px; height: 14px; }
.row-disabled .c-id, .row-disabled .c-name, .row-disabled .c-cat, .row-disabled .c-fin, .row-disabled .c-avail { opacity: 0.55; }
@media (max-width: 820px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { position: relative; display: grid; grid-template-columns: auto 44px 1fr auto; grid-template-areas: "order swatch id enabled" "order swatch name enabled" "order swatch cat actions" "order swatch fin actions" "order swatch avail actions"; column-gap: 12px; row-gap: 3px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: center; }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 0; border: 0; }
  .table .c-order { grid-area: order; align-self: center; }
  .table .c-swatch { grid-area: swatch; align-self: start; }
  .table .c-id { grid-area: id; }
  .table .c-name { grid-area: name; }
  .table .c-cat { grid-area: cat; font-size: 12px; color: var(--ink-2); }
  .table .c-fin { grid-area: fin; }
  .table .c-avail { grid-area: avail; }
  .table .c-enabled { grid-area: enabled; width: auto; justify-self: end; align-self: start; }
  .table .c-actions { grid-area: actions; width: auto; justify-self: end; align-self: end; }
  .table.users tr { grid-template-columns: 1fr auto; grid-template-areas: "user role" "status role" "created actions"; }
  .table.users .c-user { grid-area: user; }
  .table.users .c-role { grid-area: role; justify-self: end; align-self: start; }
  .table.users .c-status { grid-area: status; }
  .table.users .c-created { grid-area: created; font-size: 12px; color: var(--ink-3); }
  .table.users .c-actions { grid-area: actions; }
}
.designs-table .c-fin .chips { gap: 4px; }
.avail-summary { font-size: 12.5px; color: var(--ink-2); }
.avail-summary.none { color: var(--danger); }

/* ── Drawer ──────────────────────────────────────────────────────────── */
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(10, 10, 8, 0.45); opacity: 0; transition: opacity 0.2s; }
.drawer-backdrop.on { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100%); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); display: grid; grid-template-rows: auto 1fr auto; transform: translateX(40px); opacity: 0; transition: transform 0.22s ease, opacity 0.22s ease; overscroll-behavior: contain; }
.drawer-backdrop.on .drawer { transform: none; opacity: 1; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { overflow: auto; padding: 18px 22px 24px; display: grid; gap: 26px; align-content: start; }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 12px 22px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; background: var(--panel); }
.drawer-foot .alert { flex: 1 1 100%; }
.drawer-foot .status { color: var(--ink-3); font-size: 12.5px; margin-right: auto; }
.drawer-section { display: grid; gap: 12px; }
.drawer-section > h3 { margin: 0; font-family: var(--font-display); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.drawer-section > h3 .badge { font-weight: 600; }
@media (max-width: 600px) { .drawer-body { padding: 14px 14px 20px; } .drawer-head { padding-left: 14px; } .drawer-foot { padding: 10px 14px 12px; } }

/* ── Image section ───────────────────────────────────────────────────── */
.dropzone { display: grid; place-items: center; gap: 8px; text-align: center; padding: 26px 16px; border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--bg); color: var(--ink-2); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.dropzone svg { width: 28px; height: 28px; color: var(--ink-3); }
.dropzone b { color: var(--ink); }
.dropzone small { font-size: 12px; color: var(--ink-3); }
.dropzone.compact { padding: 14px; grid-auto-flow: column; justify-content: center; }
.previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.preview { display: grid; gap: 6px; min-width: 0; }
.preview-box { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--panel-2); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); display: grid; place-items: center; color: var(--ink-3); font-size: 12px; }
.preview-box > img, .preview-box > canvas { width: 100%; height: 100%; object-fit: cover; }
.preview-box.busy::after { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--panel) 60%, transparent); }
.preview-box .spin { position: absolute; width: 22px; height: 22px; border: 2px solid var(--line-2); border-right-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; z-index: 1; }
.preview-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.preview-label .dim { font-weight: 400; }
.image-meta { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.image-options { display: grid; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.image-options .row { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; }
.image-options .row > .field-label { min-width: 84px; }

/* ── Availability matrix ─────────────────────────────────────────────── */
.matrix { display: grid; gap: 10px; }
.matrix-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.matrix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.room-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px 12px; display: grid; gap: 8px; background: var(--bg); }
.room-box .room-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.room-box .room-head .check { font-weight: 600; }
.room-box .room-head .tag { font-weight: 600; }
.room-box .areas { display: grid; gap: 6px; padding-left: 2px; }
.room-box .areas .check { font-size: 13px; color: var(--ink-2); }
.room-box.on { border-color: var(--accent); }
.matrix-summary { font-size: 12.5px; color: var(--ink-2); }
.matrix-links { display: flex; gap: 12px; font-size: 12.5px; }

/* ── Meta (categories / finishes) editor ─────────────────────────────── */
.list-editor { display: grid; gap: 8px; }
.list-row { display: grid; grid-template-columns: auto minmax(90px, 120px) minmax(120px, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.list-row.with-blurb { grid-template-columns: auto minmax(90px, 120px) minmax(110px, 1fr) minmax(140px, 1.4fr) auto auto; }
.list-row .id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink-2); padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .usage { font-size: 11.5px; white-space: nowrap; }
.list-row.is-new { border-style: dashed; }
.list-empty { color: var(--ink-3); font-size: 13px; padding: 8px 4px; }
@media (max-width: 640px) {
  .list-row, .list-row.with-blurb { grid-template-columns: auto 1fr auto; grid-template-areas: "order id usage" "order name remove" "order blurb remove"; }
  .list-row .order-btns { grid-area: order; }
  .list-row .id, .list-row .id-input { grid-area: id; }
  .list-row .name-input { grid-area: name; }
  .list-row .blurb-input { grid-area: blurb; }
  .list-row .usage { grid-area: usage; justify-self: end; }
  .list-row .remove { grid-area: remove; justify-self: end; }
}

/* ── Homepage featured picker ────────────────────────────────────────── */
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .picker { grid-template-columns: 1fr; } }
.picker-col { display: grid; gap: 8px; align-content: start; min-width: 0; }
.picker-list { border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 380px; overflow: auto; background: var(--bg); display: grid; align-content: start; }
.picker-item { display: grid; grid-template-columns: auto 32px 1fr auto; gap: 10px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.picker-item:last-child { border-bottom: 0; }
.picker-item .text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .text .design-id { margin-left: 6px; }
.picker-item.chosen { background: var(--accent-soft); }
.picker-item .order-btns { display: inline-flex; }
.picker-empty { padding: 18px 12px; color: var(--ink-3); font-size: 13px; text-align: center; }

/* ── Users / account ─────────────────────────────────────────────────── */
.role-badge { font-family: var(--font-display); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--panel-3); color: var(--ink-2); }
.role-badge.owner { background: var(--accent-soft); color: var(--accent); }
.user-cell { display: grid; gap: 1px; }
.user-cell .design-sub { font-size: 12px; }
.pw-row { display: flex; gap: 8px; align-items: center; }
.pw-row .input { flex: 1; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.account-grid .card + .card { margin-top: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); margin: 0; }
.kv dd { margin: 0; font-weight: 500; }

/* ── Modals & toasts (same as the app) ───────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(10, 10, 8, 0.5); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity 0.2s; }
.modal-backdrop.on { opacity: 1; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); background: var(--panel); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; transform: translateY(6px); transition: transform 0.2s; }
.modal-backdrop.on .modal { transform: none; }
.modal.wide { width: min(840px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow: auto; display: grid; gap: 14px; }
.modal-body p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; pointer-events: none; max-width: calc(100% - 24px); }
.toast { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; max-width: 100%; }
.toast span:last-child { overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; transform: none; }
.toast-ic { display: inline-flex; color: var(--accent); }
.toast.error .toast-ic { color: #f08a80; }
.toast-ic svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
