/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ── Design tokens — Light (default) ─────────────────────────────────────── */
:root {
  --sw-hh:  64px;   /* layout header height — used for sticky offsets */
  --sw-fbh: 58px;   /* filter bar height — set dynamically by swSidebar.init() */
  --paper:          #E9E7DF;
  --panel:          #F7F6F1;
  --panel-2:        #FCFBF7;
  --ink:            #1B1C1E;
  --ink-soft:       #5C5E62;
  --ink-faint:      #8C8E90;
  --line:           #D7D3C8;
  --line-soft:      #E4E0D6;
  --accent:         #21406F;
  --accent-soft:    #E7ECF4;
  --brand:          #AECE3B;
  --brand-ink:      #1A2207;
  --header:         #101113;
  --header-2:       #17181b;
  --header-line:    #2c2d31;
  --radius:         13px;
  --shadow:         0 1px 0 rgba(0,0,0,.03), 0 8px 24px -16px rgba(20,22,26,.55);
  --shadow-lift:    0 2px 0 rgba(0,0,0,.04), 0 18px 40px -20px rgba(20,22,26,.6);
  --mono:           'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sans:           'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ── Design tokens — Dark ─────────────────────────────────────────────────── */
[data-theme="dark"] {
  --paper:          #16181C;
  --panel:          #1E2027;
  --panel-2:        #23262F;
  --ink:            #E8E9EC;
  --ink-soft:       #9EA3AD;
  --ink-faint:      #5C6270;
  --line:           #2E3240;
  --line-soft:      #272B38;
  --accent:         #4A7AC7;
  --accent-soft:    #1B2B45;
  --brand:          #AECE3B;
  --brand-ink:      #1A2207;
  --radius:         13px;
  --shadow:         0 1px 0 rgba(0,0,0,.18), 0 8px 24px -16px rgba(0,0,0,.65);
  --shadow-lift:    0 2px 0 rgba(0,0,0,.22), 0 18px 40px -20px rgba(0,0,0,.7);
}

/* ── Reset / base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overscroll-behavior-y: none; }

body {
  background: radial-gradient(120% 80% at 50% -10%, #F1EFE8 0%, var(--paper) 55%, #E2DFD5 100%) fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  transition: background .25s ease, color .25s ease;
}

[data-theme="dark"] body {
  background: radial-gradient(120% 80% at 50% -10%, #1B1E26 0%, var(--paper) 55%, #111318 100%) fixed;
}

button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

/* ── Layout helpers ───────────────────────────────────────────────────────── */
.sw-wrap { max-width: 1280px; margin: 0 auto; padding: 0 22px; }
.sw-mono { font-family: var(--mono); }

/* ── Layout header ────────────────────────────────────────────────────────── */
.sw-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--sw-hh);
  background: linear-gradient(var(--header), var(--header-2));
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--header-line);
}

.sw-top-row {
  display: flex; align-items: center; gap: 18px; height: 100%;
}

.sw-brand { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; text-decoration: none; }
.sw-logo  { height: 36px; width: auto; display: block; }

/* ── Home filter bar (sticky below layout header) ─────────────────────────── */
.sw-filters-bar {
  position: sticky; top: var(--sw-hh); z-index: 20;
  background: linear-gradient(var(--header), var(--header-2));
  border-bottom: 1px solid var(--header-line);
}
.sw-filters-row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; padding: 10px 22px;
}

.sw-mark {
  font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1;
  color: #fff; display: flex; align-items: center; gap: 9px;
}

.sw-mark .sw-dot-brand {
  width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(from 210deg,#c0392b,#e8852a,#f2c40f,#4a8c3f,#21406f,#6b4ea0,#c0392b);
  box-shadow: inset 0 0 0 2px var(--header), inset 0 0 0 3px rgba(255,255,255,.22);
}

.sw-sub {
  font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.5);
  letter-spacing: .04em; text-transform: uppercase;
}

/* Search field */
.sw-search { flex: 1 1 220px; max-width: 320px; }

.sw-search .mud-input-root,
.sw-search .mud-input-outlined {
  background: transparent !important;
  border-radius: 10px !important;
  color: #fff !important;
}
.sw-search .mud-input-root:hover,
.sw-search .mud-input-root.mud-focused {
  background: transparent !important;
  box-shadow: none !important;
}
.sw-search .mud-input-adornment svg { color: rgba(255,255,255,.45); }
.sw-search .mud-input-clear-button { color: rgba(255,255,255,.4) !important; }
.sw-search .mud-input-clear-button:hover { color: #fff !important; }
.sw-search input::placeholder { color: rgba(255,255,255,.4) !important; }
/* text-indent shifts caret + text without conflicting with MudBlazor's adornment padding */
.sw-search input { font-family: var(--mono); font-size: 13px; color: #fff !important; text-indent: 6px; }
.sw-search .mud-input-label { color: rgba(255,255,255,.4) !important; }
/* Static border — same color at rest, hover, and focus */
.sw-search .mud-input-outlined .mud-input-outlined-border,
.sw-search .mud-focused .mud-input-outlined-border { border-color: rgba(255,255,255,.22) !important; }

.sw-count {
  font-family: var(--mono); font-size: 12px;
  color: rgba(255,255,255,.65); white-space: nowrap;
}

/* ── User menu button ─────────────────────────────────────────────────────── */
.sw-user-btn {
  color: rgba(255,255,255,.75) !important;
  border-color: rgba(255,255,255,.18) !important;
  font-family: var(--mono) !important;
  font-size: 11.5px !important;
  text-transform: none !important;
}
.sw-user-btn:hover {
  border-color: rgba(255,255,255,.42) !important;
  color: #fff !important;
  background: rgba(255,255,255,.06) !important;
}


/* ── View toggle ──────────────────────────────────────────────────────────── */
.sw-viewtoggle {
  display: inline-flex; margin-left: auto;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 11px; padding: 3px; gap: 3px; flex: 0 0 auto;
}
.sw-vbtn {
  border: none; background: none; border-radius: 8px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 600;
  color: rgba(255,255,255,.6);
  display: inline-flex; align-items: center; gap: 6px; transition: .14s;
}
.sw-vbtn:hover { color: #fff; }
.sw-vbtn.active { background: var(--brand); color: var(--brand-ink); }
.sw-vbtn svg { width: 14px; height: 14px; }

/* ── Main content area ────────────────────────────────────────────────────── */
.sw-main { padding: 22px 0 90px; }

/* ── Colour card grid ─────────────────────────────────────────────────────── */
.sw-section-hd {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-3); padding: 20px 0 8px; border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}
.sw-section-hd:first-child { padding-top: 4px; }

.sw-deck {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  margin-bottom: 24px;
}
.sw-deck:last-child { margin-bottom: 0; }

.sw-chipcard {
  position: relative; border: none; background: none; padding: 0; text-align: left;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease;
  display: flex; flex-direction: column; cursor: pointer;
}
.sw-chipcard:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; z-index: 6; }
.sw-chipcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); z-index: 5; }
.sw-chipcard--private { outline: 2px solid var(--accent); outline-offset: -1px; }

.sw-chipcard .sw-paint {
  width: 100%; height: 75px; position: relative;
  display: flex; align-items: flex-start; justify-content: space-between; padding: 11px 12px;
}
.sw-chipcard .sw-paint::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 38%;
  background: linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,0));
  pointer-events: none;
}

.sw-serial {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 6px; border-radius: 5px; background: rgba(0,0,0,.14);
}
.sw-lead-badge {
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .06em;
  padding: 3px 5px; border-radius: 5px; border: 1px solid currentColor; opacity: .8;
}

.sw-card-label {
  width: 100%; background: var(--panel-2); padding: 9px 12px 11px; border-top: 1px solid var(--line-soft);
  display: block;
}
.sw-card-nm {
  display: block;
  font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2;
}
.sw-card-code {
  display: block;
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .06em; margin-top: 3px;
}

/* Recipe peek on card hover */
.sw-peek {
  position: absolute; left: 10px; bottom: 10px;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 7px; border-radius: 999px;
  background: rgba(252,251,247,.9); backdrop-filter: blur(5px);
  box-shadow: 0 1px 3px rgba(0,0,0,.22);
  opacity: 0; transform: translateY(7px);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.sw-chipcard:hover .sw-peek,
.sw-chipcard:focus-visible .sw-peek { opacity: 1; transform: none; }
.sw-peek-dot {
  width: 9px; height: 9px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.28); flex: 0 0 auto;
}
.sw-peek-label {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  color: #1B1C1E; letter-spacing: .02em; white-space: nowrap;
}

/* ── Wheel view ───────────────────────────────────────────────────────────── */
.sw-wheel-wrap { position: relative; width: min(680px, 94vw); margin: 8px auto 0; aspect-ratio: 1/1; }

.sw-wheel-dot {
  position: absolute; border: none; padding: 0; border-radius: 50%;
  transform: translate(-50%, -50%); cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.16), 0 1px 2px rgba(0,0,0,.18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.sw-wheel-dot::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,0) 55%);
}
.sw-wheel-dot:hover,
.sw-wheel-dot:focus-visible {
  transform: translate(-50%, -50%) scale(1.9); z-index: 30; outline: none;
  box-shadow: 0 12px 28px -8px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.2);
}
.sw-wheel-tip {
  position: absolute; left: 50%; bottom: 122%;
  transform: translateX(-50%) scale(.75); transform-origin: bottom center;
  white-space: nowrap; background: var(--ink); color: #fff;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  padding: 5px 8px; border-radius: 7px; opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; letter-spacing: .02em;
}
.sw-wheel-tip::after {
  content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink);
}
.sw-wheel-dot:hover .sw-wheel-tip,
.sw-wheel-dot:focus-visible .sw-wheel-tip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.sw-wheel-hint {
  text-align: center; font-family: var(--mono); font-size: 11px;
  color: var(--ink-faint); margin-top: 18px; letter-spacing: .03em;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.sw-empty { padding: 80px 0; text-align: center; color: var(--ink-soft); }
.sw-empty b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 6px; font-weight: 600; }

/* ── Series picker gate (shown once after login, or when no series is active) ── */
.sw-series-gate { max-width: 640px; margin: 60px auto; text-align: center; padding: 0 16px; }
.sw-series-gate h2 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.sw-series-gate p  { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 28px; }
.sw-series-gate-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.sw-series-card {
  padding: 20px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; text-align: center;
  font-size: 14px; font-weight: 600; color: var(--ink);
  transition: border-color .15s, background .15s, transform .1s;
}
.sw-series-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }

/* ── Detail drawer (right panel) ──────────────────────────────────────────── */
.sw-scrim {
  position: fixed; inset: 0; background: rgba(24,24,26,.34); z-index: 100;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.sw-scrim.show { opacity: 1; pointer-events: auto; }

.sw-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(460px, 100%); z-index: 110;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -30px rgba(20,22,26,.6);
  transform: translateX(102%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.sw-drawer.show { transform: translateX(0); }

.sw-d-head {
  position: relative; color: #fff; padding: 20px 20px 18px; flex: 0 0 auto;
}
.sw-d-head::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 40%;
  background: linear-gradient(rgba(255,255,255,.18), rgba(255,255,255,0));
}
.sw-d-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 8px; background: rgba(0,0,0,.16); border: none;
  display: grid; place-items: center;
  z-index: 2; cursor: pointer;
}
.sw-d-close svg { pointer-events: none; }
.sw-d-close:hover { background: rgba(0,0,0,.28); }
.sw-d-actions {
  position: absolute; top: 54px; right: 14px;
  display: flex; flex-direction: row; gap: 6px; z-index: 2;
}
.sw-d-action {
  width: 30px; height: 30px; border-radius: 7px;
  background: rgba(0,0,0,.16); border: none;
  display: grid; place-items: center; cursor: pointer; color: inherit;
}
.sw-d-action svg { pointer-events: none; }
.sw-d-action:hover { background: rgba(0,0,0,.28); }
.sw-d-action-danger:hover { background: rgba(220,38,38,.55); }
.sw-d-serial { font-family: var(--mono); font-size: 12px; font-weight: 700; opacity: .85; letter-spacing: .04em; }
.sw-d-name   { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }

.sw-d-body { overflow: auto; padding: 18px 20px 30px; }

.sw-d-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.sw-meta {
  flex: 1 1 120px; background: var(--panel-2);
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 11px;
}
.sw-meta .sw-mk { font-family: var(--mono); font-size: 9.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; }
.sw-meta .sw-mv { font-family: var(--mono); font-size: 14px; font-weight: 700; margin-top: 2px; }

.sw-d-pricing { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }

.sw-variant-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.sw-vtab {
  flex: 1; border: 1px solid var(--line); background: var(--panel-2); border-radius: 9px;
  padding: 8px 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft);
  transition: .14s; line-height: 1.25; cursor: pointer;
}
.sw-vtab small { display: block; font-family: var(--mono); font-size: 9.5px; font-weight: 400; color: var(--ink-faint); margin-top: 2px; }
.sw-vtab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sw-vtab.active small { color: rgba(255,255,255,.72); }

.sw-section-h {
  display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 9px;
}
.sw-section-h .sw-sh-t { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.sw-batch-btns { display: flex; gap: 5px; }
.sw-bbtn {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 7px;
  padding: 4px 8px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-soft);
  transition: .12s; cursor: pointer;
}
.sw-bbtn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

table.sw-recipe { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sw-recipe th {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); text-align: left; font-weight: 400; padding: 0 0 7px;
  border-bottom: 1px solid var(--line);
}
table.sw-recipe th.num, table.sw-recipe td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.sw-recipe td { padding: 9px 0; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.sw-recipe tr:last-child td { border-bottom: none; }

.sw-tint { display: flex; align-items: center; gap: 9px; }
.sw-tint .sw-tsw { width: 15px; height: 15px; border-radius: 4px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.sw-tint .sw-tco { font-family: var(--mono); font-size: 11px; font-weight: 700; }
.sw-tint .sw-tcn { font-size: 12px; color: var(--ink-soft); margin-top: -2px; }
td.num { font-family: var(--mono); font-weight: 700; }
td.num .sw-u { font-weight: 400; color: var(--ink-faint); font-size: 10px; margin-left: 2px; }
tr.sw-total td { padding-top: 11px; border-top: 2px solid var(--ink); border-bottom: none; font-weight: 700; }
tr.sw-total .sw-tlab { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

.sw-note {
  margin-top: 16px; display: flex; gap: 9px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid #cdd9ec; border-radius: 10px;
  padding: 11px 12px; font-size: 12px; color: #2c456f; line-height: 1.4;
}
.sw-note svg { flex: 0 0 auto; margin-top: 1px; }

.sw-d-foot {
  flex: 0 0 auto; border-top: 1px solid var(--line);
  padding: 14px 20px; background: var(--panel-2); display: flex; gap: 10px;
}
.sw-btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; transition: .14s; cursor: pointer;
}
.sw-btn:hover { border-color: var(--ink-faint); }
.sw-btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  flex: 1; justify-content: center;
}
.sw-btn.primary:hover { background: #1b3760; }
.sw-btn.danger { border-color: #c0392b; color: #c0392b; }
.sw-btn.danger:hover { background: #c0392b; color: #fff; }
.sw-confirm-msg { flex: 1; font-size: 13px; font-weight: 600; color: var(--ink); }

/* ── Page body layout (catalog sidebar + content) ────────────────────────── */
.sw-page-body {
  display: flex; align-items: flex-start; gap: 24px;
  padding: 22px;
}

/* ── Catalog sidebar ──────────────────────────────────────────────────────── */
.sw-catalog-sidebar {
  width: 190px; flex-shrink: 0;
  position: sticky; top: calc(var(--sw-hh) + var(--sw-fbh) + 22px);
  height: calc(100dvh - var(--sw-hh) - var(--sw-fbh) - 44px);
  display: flex; flex-direction: column; gap: 0;
  overflow: hidden;
}
/* Each section takes 50% of the sidebar height */
.sw-sidebar-section {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}
.sw-sidebar-section + .sw-sidebar-section {
  border-top: 1px solid var(--line);
  padding-top: 4px;
}
/* Fixed section header */
.sw-sidebar-section-hd {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 6px;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint);
}
/* "+" button next to section header */
.sw-sidebar-add {
  width: 20px; height: 20px; border-radius: 5px; border: none;
  background: none; cursor: pointer; display: grid; place-items: center;
  color: var(--ink-faint); transition: .13s;
}
.sw-sidebar-add:hover { background: var(--panel); color: var(--accent); }
/* "Add colour" button in the filter bar */
.sw-add-colour-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 8px; border: 1px solid var(--accent);
  background: none; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--accent); white-space: nowrap; transition: .13s;
}
.sw-add-colour-btn:hover { background: var(--accent); color: #fff; }
/* Scrollable nav list within section */
.sw-catalog-nav {
  list-style: none; margin: 0; padding: 0 0 4px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto; flex: 1; min-height: 0;
}
.sw-catalog-btn {
  width: 100%; text-align: left; border: none; background: none;
  padding: 7px 12px; font-size: 13px; font-weight: 500; line-height: 1.3;
  color: var(--ink-soft); cursor: pointer; border-radius: 9px; transition: .13s;
  display: flex; align-items: center; gap: 6px;
}
.sw-catalog-btn:hover { background: var(--panel); color: var(--ink); }
.sw-catalog-btn.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
/* Row wrapper for private catalog — positions the edit button */
.sw-catalog-item {
  display: flex; align-items: center; gap: 2px; position: relative;
}
.sw-catalog-item .sw-catalog-btn { flex: 1; }
/* Pencil edit button — hidden until row is hovered */
.sw-catalog-edit {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; border: none;
  background: none; cursor: pointer; display: grid; place-items: center;
  color: var(--ink-faint); opacity: 0; transition: opacity .13s, background .13s;
}
.sw-catalog-item:hover .sw-catalog-edit { opacity: 1; }
.sw-catalog-edit:hover { background: var(--panel); color: var(--accent); }
.sw-catalog-delete:hover { background: rgba(220,53,69,.12); color: #dc3545; }

/* ── Hide scrollbars while keeping scroll ─────────────────────────────────── */
.sw-content,
.sw-catalog-nav {
  scrollbar-width: none;        /* Firefox */
}
.sw-content::-webkit-scrollbar,
.sw-catalog-nav::-webkit-scrollbar {
  display: none;                /* Chrome / Safari / Edge */
}

/* ── Content area ─────────────────────────────────────────────────────────── */
.sw-content {
  flex: 1; min-width: 0;
  height: calc(100dvh - var(--sw-hh) - var(--sw-fbh) - 44px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 40px;
}

/* ── Grid / list view ─────────────────────────────────────────────────────── */
.sw-grid-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.sw-grid-table th {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-faint); font-weight: 400;
  text-align: left; padding: 0 12px 9px; border-bottom: 1.5px solid var(--line);
}
.sw-grid-table th:first-child, .sw-grid-table td:first-child { padding-left: 0; }
.sw-grid-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.sw-grid-table tbody tr:last-child td { border-bottom: none; }
.sw-grid-row { cursor: pointer; transition: background .1s; }
.sw-grid-row:hover { background: var(--panel-2); border-radius: 8px; }
.sw-grid-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sw-grid-row--private td:first-child { border-left: 3px solid var(--accent); padding-left: 9px; }
.sw-grid-section-hd td {
  padding: 18px 12px 6px;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-3); border-bottom: 1px solid var(--line-soft);
}
.sw-grid-section-hd:first-child td { padding-top: 8px; }

.sw-grid-rp {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.sw-grid-pb {
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .06em;
  border: 1px solid var(--ink-faint); color: var(--ink-soft);
  border-radius: 4px; padding: 1px 4px;
}
.sw-grid-code { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); }

/* ── Colour detail modal ──────────────────────────────────────────────────── */
.sw-modal-scrim {
  position: fixed; inset: 0; background: rgba(24,24,26,.52); z-index: 100;
  animation: sw-scrim-in .18s ease;
}
@keyframes sw-scrim-in {
  from { opacity: 0; } to { opacity: 1; }
}
.sw-modal-wrap {
  position: fixed; inset: 0; z-index: 101;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
}
.sw-modal-card {
  width: min(460px, 100%); max-height: calc(100dvh - 48px);
  background: var(--panel); border-radius: 18px;
  box-shadow: 0 32px 80px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.08);
  display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0;
  animation: sw-modal-in .22s cubic-bezier(.25,.46,.45,.94);
}
@keyframes sw-modal-in {
  from { opacity: 0; transform: scale(.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
/* Make body scroll within the fixed-height modal */
.sw-modal-card .sw-d-body { flex: 1; min-height: 0; }

/* ── Private colour editor modal ──────────────────────────────────────────── */
.sw-editor-modal { width: min(560px, 100%); }
.sw-em-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.sw-em-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.sw-em-sub   { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.sw-em-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--ink-faint); display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 7px;
}
.sw-em-close:hover { background: var(--panel-2); color: var(--ink); }
.sw-em-body { padding: 0 20px; overflow-y: auto; scrollbar-width: none; }
.sw-em-hint { font-size: 12px; color: var(--ink-faint); margin: 6px 0 0; font-style: italic; }

/* ── Container chips ──────────────────────────────────────────────────────── */
.sw-container-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px;
}
.sw-container-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 10px; border-radius: 20px;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: .13s; user-select: none;
}
.sw-container-chip:hover { border-color: var(--accent); color: var(--accent); }
.sw-container-chip.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.sw-chip-remove {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 14px; line-height: 1; color: inherit; opacity: .7;
  display: grid; place-items: center; width: 14px; height: 14px;
}
.sw-chip-remove:hover { opacity: 1; }
.sw-add-container-btn { margin-top: 6px; }

/* ── Container picker sub-modal ───────────────────────────────────────────── */
.sw-picker-card { width: min(320px, 100%); }
.sw-picker-body { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.sw-picker-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; border: none;
  background: none; cursor: pointer; text-align: left; width: 100%;
  transition: background .12s;
}
.sw-picker-item:hover { background: var(--panel-2); }
.sw-picker-abbr {
  font-size: 13px; font-weight: 700; font-family: var(--mono);
  min-width: 48px; color: var(--ink);
}
.sw-picker-name { font-size: 13px; color: var(--ink-faint); }

/* ── Print ticket ─────────────────────────────────────────────────────────── */
.sw-ticket { display: none; }
@media print {
  .sw-header, .sw-filters-bar, .sw-page-body,
  .sw-modal-scrim, .sw-modal-wrap,
  .sw-home-bulk-bar,
  [class*="mud-snackbar"] { display: none !important; }
  body { background: #fff; }
  .sw-ticket { display: block; padding: 0; color: #000; }

  /* By default (letter) hide sticker; when sticker mode hide letter */
  body:not(.sw-print-sticker) .sw-ticket-sticker { display: none; }
  body.sw-print-sticker .sw-ticket-letter { display: none; }

  /* ── Letter format ── */
  .sw-ticket-letter { max-width: 560px; margin: 0 auto; font-family: var(--sans); }
  .sw-ticket-letter .sw-thdr { border: 1.5px solid #000; }
  .sw-ticket-letter .sw-thdr .sw-tr { display: flex; border-bottom: 1.5px solid #000; }
  .sw-ticket-letter .sw-thdr .sw-tr:last-child { border-bottom: none; }
  .sw-ticket-letter .sw-thdr .sw-tk { width: 150px; padding: 9px 12px; font-weight: 700; border-right: 1.5px solid #000; font-size: 13px; }
  .sw-ticket-letter .sw-thdr .sw-tv { padding: 9px 12px; font-family: var(--mono); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; }
  .sw-ticket-letter .sw-swbig { width: 18px; height: 18px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
  .sw-ticket-letter table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 12.5px; }
  .sw-ticket-letter th, .sw-ticket-letter td { border: 1px solid #000; padding: 7px 10px; text-align: left; }
  .sw-ticket-letter th { background: #eee; font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
  .sw-ticket-letter td.sw-pn, .sw-ticket-letter th.sw-pn { text-align: right; font-family: var(--mono); }
  .sw-ticket-letter .sw-pcolorant { font-family: var(--mono); font-weight: 700; }
  .sw-ticket-letter tfoot td { font-family: var(--mono); font-weight: 700; background: #f3f3f3; }
  .sw-ticket-letter .sw-pnote { margin-top: 12px; font-size: 11px; font-style: italic; }
  .sw-ticket-letter .sw-pfoot { margin-top: 24px; display: flex; justify-content: space-between; font-size: 10px; color: #444; font-family: var(--mono); border-top: 1px solid #999; padding-top: 8px; }

  /* ── Sticker format (8 × 10 cm) ── */
  .sw-ticket-sticker { width: 100%; font-family: var(--sans); }
  .sw-stk-bar { height: 10px; width: 100%; margin-bottom: 6px; }
  .sw-stk-id { margin-bottom: 4px; }
  .sw-stk-rp { display: block; font-family: var(--mono); font-weight: 700; font-size: 15px; line-height: 1.2; }
  .sw-stk-nm { display: block; font-size: 11px; font-weight: 600; color: #222; }
  .sw-stk-meta { font-size: 9.5px; color: #333; border-top: 1px solid #bbb; border-bottom: 1px solid #bbb; padding: 3px 0; margin: 5px 0; display: flex; justify-content: space-between; }
  .sw-ticket-sticker table { width: 100%; border-collapse: collapse; font-size: 9.5px; }
  .sw-ticket-sticker td { padding: 2px 3px; border-bottom: 1px solid #e0e0e0; }
  .sw-ticket-sticker td:last-child { text-align: right; font-family: var(--mono); }
  .sw-ticket-sticker .sw-stk-code { font-family: var(--mono); font-weight: 700; }
  .sw-ticket-sticker tfoot td { font-weight: 700; border-top: 1.5px solid #000; border-bottom: none; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .sw-catalog-sidebar { display: none; } /* collapse sidebar on small screens */
  .sw-page-body { padding: 14px 16px 60px; gap: 0; }
}
@media (max-width: 560px) {
  .sw-top-row { flex-wrap: wrap; gap: 12px; }
  .sw-search { margin-left: 0; order: 3; max-width: none; flex-basis: 100%; }
  .sw-deck { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 11px; }
  .sw-modal-wrap { padding: 0; align-items: flex-end; }
  .sw-modal-card { width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── Auth pages (login / forgot-password / reset-password) ───────────────── */
.sw-login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(var(--header), var(--header-2));
}
.sw-login-card {
  background: var(--panel); border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
  padding: 40px 36px 36px; width: 100%; max-width: 380px;
}
.sw-login-brand { margin-bottom: 28px; color: var(--ink); }
.sw-login-brand .sw-sub { color: var(--ink-faint); text-align: center; }
.sw-login-hint {
  font-size: 13px; color: var(--ink-soft);
  text-align: center; margin: 0 0 22px;
}
.sw-login-form { display: flex; flex-direction: column; gap: 16px; }
.sw-login-field { display: flex; flex-direction: column; gap: 6px; }
.sw-login-field label {
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .06em;
}
.sw-login-field input {
  border: 1.5px solid var(--line); border-radius: 9px;
  padding: 11px 13px; font-family: var(--sans); font-size: 14px;
  color: var(--ink); background: var(--panel-2); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.sw-login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(33,64,111,.15);
}
.sw-login-btn {
  display: block; width: 100%; margin-top: 6px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 13px; font-size: 14px; font-weight: 600;
  font-family: var(--sans); cursor: pointer; text-align: center;
  text-decoration: none; transition: background .14s;
}
.sw-login-btn:hover { background: #1b3760; }
.sw-login-forgot {
  display: block; text-align: center; margin-top: 14px;
  font-size: 12px; color: var(--ink-faint); text-decoration: none;
  transition: color .15s;
}
.sw-login-forgot:hover { color: var(--ink-soft); }
.sw-login-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 24px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--ink-faint);
}
.sw-login-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 4px;
}
.sw-login-success {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  border-radius: 8px; padding: 12px 14px; font-size: 13px; margin-bottom: 18px;
}

/* ── Admin pages ──────────────────────────────────────────────────────────── */
.sw-admin-wrap { max-width: 1100px; margin: 0 auto; padding: 16px 22px 0; }

/* Prevent page-level scroll on admin pages */
html:has(.sw-admin-wrap) { overflow: hidden; }

.sw-admin-header { margin-bottom: 6px; }
.sw-admin-header h2 {
  font-size: 24px; font-weight: 700; letter-spacing: -.02em;
  color: var(--ink); margin: 0 0 4px;
}

/* Reset MudBlazor's default 16px panel padding so our own div controls layout */
.sw-admin-wrap .mud-tab-panel { padding: 0 !important; }

.sw-tab-panel {
  /*
    Height = 100dvh
      - var(--sw-hh)  app header  (64 px, CSS var)
      - 16px          admin wrap top padding
      - ~39px         admin page h2 title + margins
      - ~48px         MudBlazor tab bar
    ≈ calc(100dvh - var(--sw-hh) - 103px)
    html:has(.sw-admin-wrap) { overflow:hidden } is the safety net.
  */
  height: calc(100dvh - var(--sw-hh) - 103px);
  padding: 0 0 18px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* Users page — same logic as sw-tab-panel, no tab bar to subtract */
.sw-users-content {
  height: calc(100dvh - var(--sw-hh) - 55px);
  /* 55px = 16px wrap top padding + ~39px admin h2 title + margins */
  padding: 0 0 18px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex; flex-direction: column;
}

.sw-tab-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 16px; margin-bottom: 14px;
}

.sw-row-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* Right-align digits in numeric inputs (e.g. Set Prices page) */
.sw-num-right input { text-align: right; }

/* ── Set Prices footer bar (Back / Cancel / Save) ─────────────────────────── */
.sw-prices-footer {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; box-sizing: border-box;
  padding: 10px 22px; border-top: 1px solid var(--line);
}
.sw-prices-footer-actions { display: flex; gap: 10px; }

/* Force uppercase display in MudColorPicker hex input */
.mud-picker-color-inputs input { text-transform: uppercase; }

/* Swatch dots used in tables */
.sw-swbig {
    display: inline-block;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}
.sw-tsw {
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); flex: 0 0 auto;
}

/* ── Colour / variant editor drawer (wider variant) ──────────────────────── */
.sw-editor-drawer { width: min(560px, 100%) !important; }

/* Two-column input row inside editor sections */
.sw-ed-row {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 10px;
}
.sw-ed-row > * { flex: 1; min-width: 0; }

/* Color preview row (swatch aligned to inputs) */
.sw-color-row { align-items: center; }

/* Editor section grouping */
.sw-editor-section {
  border: 1px solid var(--line-soft); border-radius: 11px;
  padding: 14px 14px 10px; margin-bottom: 14px;
  background: var(--panel-2);
}

/* Section header: title + live preview dot */
.sw-section-h {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.sw-preview-dot {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.2);
  transition: background .2s;
}

/* Tint select item */
.sw-tint-opt {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.sw-tint-opt .sw-tsw {
  width: 16px; height: 16px; border-radius: 4px;
}

/* Recipe editor table inside drawer */
.sw-recipe-editor { margin-top: 4px; }
.sw-recipe-editor table.sw-recipe td { padding: 5px 0; }
.sw-recipe-editor input[type="text"], 
.sw-recipe-editor input[type="number"] {
        text-align: right !important;
}
/* "Add tint" row button */
.sw-add-row {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  border: 1px dashed var(--line); border-radius: 8px;
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  color: var(--ink-soft); background: none; transition: .14s; cursor: pointer;
}
.sw-add-row:hover { border-color: var(--accent); color: var(--accent); }

/* Container recipe list */
.sw-container-recipes { display: flex; flex-direction: column; gap: 10px; }
.sw-container-recipe-block {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; background: var(--surface-raised, var(--surface));
}
.sw-container-recipe-hd {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.sw-add-container-btn { margin-top: 4px; }

.sw-d-close svg {
    pointer-events: none;
    z-index: 2;
}
/* ── Language editor ──────────────────────────────────────────────────────── */
.sw-lang-editor {
  border: 1px solid var(--line-soft); border-radius: 11px;
  padding: 12px 14px 8px; margin-bottom: 14px;
  background: var(--panel-2);
}
.sw-lang-editor-label {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft);
}
.sw-lang-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.sw-lang-badge {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 5px; padding: 2px 6px; flex: 0 0 auto; width: 42px; text-align: center;
  letter-spacing: .02em;
}

/* ── Catalog admin split layout ──────────────────────────────────────────── */
.sw-cat-layout {
  display: flex; align-items: stretch;
  flex: 1; min-height: 0;
  border: 1px solid var(--line-soft); border-radius: 12px;
  overflow: hidden; background: var(--panel-2);
}

.sw-cat-sidebar {
  width: 250px; flex-shrink: 0;
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  background: var(--panel);
  /* fixed height — only the tree scrolls, page never scrolls */
  overflow: hidden;
}

.sw-cat-sidebar-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); flex-shrink: 0;
}

/* ── Filter bar ────────────────────────────────────────────────────────── */
.sw-cat-sidebar-filter {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0;
}
.sw-cat-search-wrap {
  flex: 1; display: flex; align-items: center; gap: 5px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 8px;
}
/* In the tab toolbar, stretch to match the button's height */
.sw-tab-toolbar .sw-cat-search-wrap {
  align-self: stretch; padding: 0 8px;
}
.sw-cat-search-icon { color: var(--ink-faint); flex-shrink: 0; }
.sw-cat-search {
  flex: 1; background: none; border: none; outline: none;
  font-size: 12px; color: var(--ink); font-family: inherit;
}
.sw-cat-search::placeholder { color: var(--ink-faint); }
.sw-cat-clear {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--ink-faint); padding: 0; transition: color .1s, background .1s;
}
.sw-cat-clear:hover { color: var(--ink); background: var(--line-soft); }
.sw-cat-rocker {
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); cursor: pointer;
  color: var(--ink-soft); transition: background .12s, color .12s, border-color .12s;
}
.sw-cat-rocker:hover  { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sw-cat-rocker.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Tree ──────────────────────────────────────────────────────────────── */
.sw-cat-tree { flex: 1; overflow-y: auto; padding: 4px 0; min-height: 0; }

.sw-cat-node {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 12px; cursor: pointer;
  border-left: 2px solid transparent;
  user-select: none; transition: background .1s;
}
.sw-cat-node:hover { background: var(--accent-soft); }
.sw-cat-node.selected {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
.sw-cat-node.selected .sw-cat-node-name { color: var(--accent); }

.sw-cat-chevron {
  width: 14px; height: 14px; flex-shrink: 0; color: var(--ink-faint);
  transition: transform .15s; align-self: flex-start; margin-top: 3px;
}
.sw-cat-node.expanded .sw-cat-chevron { transform: rotate(90deg); }

/* Two-line node label */
.sw-cat-node-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sw-cat-node-name {
  font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sw-cat-node-name.private { color: var(--accent); }
.sw-cat-node-owner {
  font-size: 10.5px; color: var(--ink-faint); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sw-cat-count {
  font-size: 11px; font-family: var(--mono);
  color: var(--ink-faint); background: var(--line-soft);
  border-radius: 10px; padding: 1px 6px; flex-shrink: 0;
}
.sw-cat-node.selected .sw-cat-count { background: var(--accent-soft); color: var(--accent); }

.sw-cat-add-btn {
  display: none;
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  background: none; border: 1px solid var(--line); cursor: pointer;
  align-items: center; justify-content: center; color: var(--ink-soft);
  transition: background .1s, color .1s, border-color .1s; align-self: flex-start; margin-top: 1px;
}
.sw-cat-add-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.sw-cat-node:hover .sw-cat-add-btn,
.sw-cat-node.selected .sw-cat-add-btn { display: flex; }

.sw-colour-list { padding: 2px 0; }

.sw-colour-node {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 28px; cursor: pointer;
  font-size: 12px; border-left: 2px solid transparent;
  color: var(--ink-soft); user-select: none;
  transition: background .1s;
}
.sw-colour-node:hover { background: var(--accent-soft); color: var(--ink); }
.sw-colour-node.selected {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--ink);
}
.sw-colour-node .sw-swatch-sm {
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}
.sw-colour-node-rp { font-weight: 600; color: var(--ink); font-family: var(--mono); font-size: 11px; }
.sw-colour-node-nm { color: var(--ink-soft); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.sw-colour-node-del {
  margin-left: auto; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 4px; border: none; background: transparent;
  color: var(--ink-faint); cursor: pointer; opacity: 0; transition: opacity .1s, background .1s;
}
.sw-colour-node:hover .sw-colour-node-del { opacity: 1; }
.sw-colour-node-del:hover { background: var(--error-soft, rgba(220,50,47,.12)); color: var(--error, #dc322f); }

/* Right pane */
.sw-cat-pane {
  flex: 1; padding: 20px 24px;
  display: flex; flex-direction: column; min-width: 0;
  overflow: hidden;
}

.sw-bulk-bar {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  padding: 8px 12px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
  border: 1px solid var(--mud-palette-primary);
  border-radius: 8px;
}
.sw-bulk-count {
  font-size: 13px; font-weight: 600;
  color: var(--mud-palette-primary); white-space: nowrap;
}
.sw-bulk-actions {
  display: flex; align-items: center; gap: 8px; flex: 1;
}

.sw-tint-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
}
/* Let .sw-tint-scroll be the sole scroll container so position:sticky works */
.sw-tint-scroll .mud-table,
.sw-tint-scroll .mud-table-container { overflow: visible; }
.sw-tint-scroll thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--mud-palette-surface);
}

/* ── Simple grid wrap (Series / Containers / Languages) ──────────────── */
.sw-grid-wrap {
  flex: 1; min-height: 0; overflow-y: auto;
  border: 1px solid var(--line-soft); border-radius: 10px;
}
.sw-grid-wrap .mud-table,
.sw-grid-wrap .mud-table-container { overflow: visible; }
.sw-grid-wrap thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--mud-palette-surface);
}

.sw-cat-pane-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--ink-faint); font-size: 14px; text-align: center;
}
.sw-cat-pane-empty svg { opacity: .3; }

.sw-cat-pane-hd {
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.sw-cat-edit-form { display: flex; flex-direction: column; gap: 14px; max-width: 360px; }

/* Public / Private toggle */
.sw-vis-toggle { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: fit-content; }
.sw-vis-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; font-size: 13px; font-weight: 500;
  background: none; border: none; cursor: pointer; color: var(--ink-soft);
  transition: background .12s, color .12s;
}
.sw-vis-btn:first-child { border-right: 1px solid var(--line); }
.sw-vis-btn:hover  { background: var(--accent-soft); color: var(--ink); }
.sw-vis-btn.active { background: var(--accent); color: #fff; }
.sw-vis-btn.active svg { stroke: #fff; }

.sw-cat-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* Colour preview card in right pane */
.sw-colour-preview-card {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--panel); margin-bottom: 16px;
}
.sw-colour-preview-swatch {
  width: 60px; height: 60px; border-radius: 10px; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}
.sw-colour-preview-info { display: flex; flex-direction: column; gap: 3px; }
.sw-colour-preview-rp { font-size: 16px; font-weight: 700; color: var(--ink); font-family: var(--mono); }
.sw-colour-preview-name { font-size: 13px; color: var(--ink-soft); }
.sw-colour-preview-meta { font-size: 12px; color: var(--ink-faint); }

/* ── Inline colour editor panel (right pane) ─────────────────────────────── */
.sw-panel-editor {
  display: flex; flex-direction: column; height: 100%; min-height: 0;
}
.sw-panel-editor-hd {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; color: var(--ink);
  padding-bottom: 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft); flex-shrink: 0;
}
.sw-panel-close {
  background: none; border: none; padding: 4px; cursor: pointer;
  color: var(--ink-faint); border-radius: 6px; display: flex; align-items: center;
  transition: background .1s, color .1s;
}
.sw-panel-close:hover { background: var(--accent-soft); color: var(--ink); }

.sw-panel-editor-body {
  flex: 1; overflow-y: auto; padding: 14px 0 4px;
  display: flex; flex-direction: column; gap: 0;
}
.sw-panel-editor-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 14px; border-top: 1px solid var(--line-soft); flex-shrink: 0;
}

/* Visibility toggle pills */
.sw-vis-toggle {
  display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.sw-vis-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; font-size: 12px; font-weight: 500;
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); transition: background .12s, color .12s;
}
.sw-vis-btn + .sw-vis-btn { border-left: 1px solid var(--line); }
.sw-vis-btn:hover { background: var(--accent-soft); color: var(--ink); }
.sw-vis-btn.active { background: var(--accent); color: #fff; }

/* ── Home multi-select cards ──────────────────────────────────────────────── */
.sw-card-slot { position: relative; display: flex; flex-direction: column; }
.sw-card-slot .sw-chipcard { flex: 1; width: 100%; }

.sw-card-cb {
  position: absolute; top: 7px; left: 7px; z-index: 10;
  width: 22px; height: 22px; border-radius: 5px;
  display: grid; place-items: center;
  background: rgba(0,0,0,.32); backdrop-filter: blur(3px);
  cursor: pointer; transition: opacity .13s, background .13s;
  opacity: 0; border: 1.5px solid rgba(255,255,255,.35);
}
.sw-card-slot:hover .sw-card-cb,
.sw-card-slot.selected .sw-card-cb { opacity: 1; }
.sw-card-cb.checked { background: var(--accent); border-color: var(--accent); opacity: 1; }
.sw-card-cb svg { color: #fff; pointer-events: none; }

/* Slide the RP serial badge right when the checkbox is visible */
.sw-serial { transition: margin-left .13s; }
.sw-card-slot:hover .sw-serial,
.sw-card-slot.selected .sw-serial { margin-left: 20px; }

/* blue ring when card is selected */
.sw-card-slot.selected .sw-chipcard {
  outline: 2.5px solid var(--accent); outline-offset: -1px;
}

/* grid view checkbox cell */
.sw-grid-cb-cell { width: 36px; padding: 0 8px !important; cursor: default; }
.sw-grid-check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--line);
  background: var(--panel-2);
  display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0;
  transition: background .12s, border-color .12s;
}
.sw-grid-check:hover { border-color: var(--accent); }
.sw-grid-check.checked { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Home bulk action bar ──────────────────────────────────────────────────── */
.sw-home-bulk-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: 14px;
  /* Fixed dark background so the bar looks the same in light and dark mode.
     var(--ink) inverts to near-white in dark mode, breaking the white text. */
  background: #1a1c1f; color: #e8e9ec;
  box-shadow: 0 4px 24px -8px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.07);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  animation: sw-bulk-in .2s cubic-bezier(.25,.46,.45,.94);
}
@keyframes sw-bulk-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.sw-hbb-count {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--brand); padding-right: 2px;
}
.sw-hbb-sep { width: 1px; height: 20px; background: rgba(255,255,255,.18); flex-shrink: 0; }
.sw-hbb-actions { display: flex; gap: 6px; }
.sw-hbb-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 9px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.15);
  color: inherit; font-family: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.sw-hbb-btn:hover { background: rgba(255,255,255,.18); }
.sw-hbb-btn svg { flex-shrink: 0; }
.sw-hbb-deselect {
  background: rgba(255,255,255,.05) !important;
  border-color: rgba(255,255,255,.1) !important;
  color: rgba(255,255,255,.65) !important;
}
.sw-hbb-deselect:hover {
  background: rgba(255,255,255,.13) !important;
  color: #fff !important;
}

/* ── Bulk print container (hidden, shown only during print) ───────────────── */
.sw-bulk-tickets { display: none; }

@media print {
  /* Show bulk tickets only when sw-bulk-printing body class is active */
  body.sw-bulk-printing .sw-bulk-tickets { display: block; }
  /* During bulk print, suppress the single-colour ticket */
  body.sw-bulk-printing .sw-ticket { display: none !important; }
  /* Page break between individual bulk tickets */
  .sw-bulk-tickets .sw-ticket-letter + .sw-ticket-letter,
  .sw-bulk-tickets .sw-ticket-sticker + .sw-ticket-sticker { page-break-before: always; }
}

/* ── Blazor error UI ──────────────────────────────────────────────────────── */
#blazor-error-ui {
  background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
  display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
