/* CardMint for Shops. The consumer app's dark slate system, with a teal
   accent instead of blue so it's plainly a different product, and denser,
   table-first layouts for staff doing volume work. */
:root {
  color-scheme: dark;     /* native date pickers and scrollbars match */
  --bg: #0b1220;
  --panel: #111a2e;
  --panel-2: #0f172a;
  --line: #1e293b;
  --line-2: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #14b8a6;
  --accent-strong: #0d9488;
  --accent-soft: rgba(20, 184, 166, .14);
  --accent-text: #5eead4;
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .14);
  --bad: #f87171;
  --good: #34d399;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 650; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; }

/* ── Header ─────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--panel-2);
  border-bottom: 1px solid var(--line); border-top: 3px solid var(--accent); }
.topbar-inner { display: flex; align-items: center; gap: 14px; padding: 8px 16px;
  max-width: 1400px; margin: 0 auto; flex-wrap: wrap; }
.wordmark { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700;
  letter-spacing: .01em; white-space: nowrap; }
.wordmark:hover { text-decoration: none; }
.wordmark img { height: 26px; width: auto; }
.wordmark .for { color: var(--accent-text); font-weight: 600; }

.switcher { position: relative; }
.switcher-btn { display: flex; align-items: center; gap: 8px; background: var(--accent-soft);
  border: 1px solid var(--accent-strong); color: var(--text); border-radius: 8px;
  padding: 5px 10px; cursor: pointer; max-width: 280px; }
.switcher-btn .kind { color: var(--accent-text); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; }
.switcher-btn .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.45); display: none; }
.switcher.open .switcher-menu { display: block; }
.switcher-menu .group { color: var(--faint); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; padding: 6px 8px 4px; }
.switcher-menu a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 8px;
  border-radius: 6px; color: var(--text); }
.switcher-menu a:hover { background: var(--line); text-decoration: none; }
.switcher-menu a.current { background: var(--accent-soft); }
.switcher-menu .role { color: var(--muted); font-size: 12px; }

.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs a { color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.tabs a:hover { color: var(--text); background: var(--line); text-decoration: none; }
.tabs a.on { color: var(--text); background: var(--line); box-shadow: inset 0 -2px 0 var(--accent); }
.who { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
/* Sections on their own row under the bar, so the shop, the Collection |
   Shop switch and the account menu always fit on the first. */
.topbar-inner { row-gap: 4px; }
.topbar-inner .tabs { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -10px; scrollbar-width: none; }
.topbar-inner .tabs:empty { display: none; }
.topbar-inner .who { order: 2; }

/* ── Body ───────────────────────────────────────────────────────────── */
main { max-width: 1400px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }

.btn { background: var(--line); border: 1px solid var(--line-2); border-radius: 7px;
  padding: 6px 12px; cursor: pointer; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=email], input[type=number], select {
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px;
  padding: 6px 9px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label.field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }

/* Tables: the product's main surface. */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; background: var(--panel-2); color: var(--muted); font-weight: 600;
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(148, 163, 184, .05); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .thumb { width: 34px; height: 46px; object-fit: cover; border-radius: 3px; background: var(--line); display: block; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--good); border-color: rgba(52,211,153,.4); }
.pill.review { color: var(--warn); border-color: rgba(245,158,11,.45); background: var(--warn-soft); }
.pill.bad { color: var(--bad); border-color: rgba(248,113,113,.45); }
.pill.role { color: var(--accent-text); border-color: var(--accent-strong); }

.meter { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; background: var(--accent); }
.stat { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }

.notice { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line-2); margin-bottom: 12px; }
.notice.error { border-color: rgba(248,113,113,.5); color: #fecaca; background: rgba(248,113,113,.08); }
.notice.ok { border-color: rgba(52,211,153,.4); color: #bbf7d0; background: rgba(52,211,153,.07); }
.center-card { max-width: 460px; margin: 48px auto; }

@media (max-width: 720px) {
  .topbar-inner { gap: 8px; }
  .ws-label, .acct-name { display: none; }
}

/* Collection | Shop switch and the account menu (the collector app has the twin) */
.who { display: flex; align-items: center; gap: 10px; }
.ws-switch { display: inline-flex; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.ws-seg { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 7px; font-size: 13px;
  font-weight: 600; color: var(--muted); white-space: nowrap; }
.ws-seg.on { background: var(--accent-soft); color: var(--accent-text); }
a.ws-seg:hover { text-decoration: none; color: var(--text); background: var(--line); }
.acct { position: relative; }
.acct-btn { display: flex; align-items: center; gap: 7px; background: transparent; border: 1px solid var(--line-2);
  border-radius: 10px; padding: 3px 9px 3px 3px; color: var(--text); font-size: 13px; cursor: pointer; }
.acct-btn:hover { background: var(--line); }
.acct-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-strong); color: #04211d;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.acct-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.45); z-index: 30; }
.acct.open .acct-menu { display: block; }
.acct-menu .group { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px 0; }
.acct-menu .acct-user { font-weight: 650; padding: 2px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-menu a, .acct-menu button { display: block; width: 100%; text-align: left; padding: 7px 8px; border-radius: 7px;
  color: var(--text); background: none; border: 0; font: inherit; font-size: 13px; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--line); text-decoration: none; }

/* ── Phase 5: filters, selection, the item panel, import, reports ───── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.filters input[type=search] { background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 7px; padding: 6px 9px; min-width: 200px; flex: 1; max-width: 320px; }
td.check, th.check { width: 28px; padding-right: 0; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
tbody tr.clickable { cursor: pointer; }
tbody tr.selected td { background: var(--accent-soft); }
.bulkbar { position: sticky; bottom: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--accent-strong); border-radius: 10px;
  padding: 8px 12px; margin-top: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; }

.drawer-back { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 41;
  background: var(--panel); border-left: 1px solid var(--line-2); overflow-y: auto; padding: 16px;
  box-shadow: -12px 0 30px rgba(0,0,0,.45); }
.drawer .photos { display: flex; gap: 8px; margin: 8px 0 12px; }
.drawer .photos img { width: 120px; border-radius: 6px; background: var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
textarea { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px;
  padding: 6px 9px; font: inherit; color: inherit; min-height: 60px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0 0 10px; font-size: 13px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .stat { font-size: 20px; }
.up { color: var(--good); }
.down { color: var(--bad); }
.steps-row { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.steps-row span { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: 12px; }
.steps-row span.on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.map-table select { min-width: 220px; }

/* Buy counter */
.buy-total { text-align: right; }
.buy-total .big { font-size: 30px; font-weight: 700; color: var(--accent-text); }
.buy-lines tr.marked td { background: rgba(248,113,113,.07); }
.buy-lines tr.marked td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.flag { color: var(--bad); font-size: 12.5px; margin-top: 3px; }

/* How to use */
.help-grid { display: grid; grid-template-columns: 230px 1fr; gap: 16px; align-items: start; }
.help-toc { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 120px); overflow-y: auto; }
.help-toc strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 6px; }
.help-toc a { color: var(--muted); padding: 5px 8px; border-radius: 6px; font-size: 13px; }
.help-toc a:hover { background: var(--line); color: var(--text); text-decoration: none; }
.help-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.help-sec { scroll-margin-top: 110px; padding: 18px 20px; }
.help-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.help-head h2 { font-size: 17px; margin: 0; }
.help-what { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.help-sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin: 14px 0 6px; }
.help-steps { margin: 0; padding-left: 20px; display: grid; gap: 7px; line-height: 1.55; }
.help-list { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 12px 0 0; }
.help-list dt { font-weight: 600; }
.help-list dd { margin: 0; color: var(--muted); line-height: 1.55; }
.help-tips { margin-top: 14px; padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); border: 1px solid rgba(20,184,166,.3); }
.help-tips strong { font-size: 13px; color: var(--accent-text); }
.help-tips ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 5px; line-height: 1.5; }
@media (max-width: 820px) {
  .help-grid { grid-template-columns: 1fr; }
  .help-toc { position: static; max-height: none; }
  .help-list { grid-template-columns: 1fr; }
}
