/* PokeTCG Distribution brand: Navy #161A2B · Cream #F7F6F2 · Amber #F2A93B · Violet #5B3FE0 (on light) / #8C74FF (on dark)
   Type: Unbounded (display, wordmark) · Space Grotesk (UI) */
:root {
  --navy: #161A2B;
  --cream: #F7F6F2;
  --amber: #F2A93B;
  --violet: #5B3FE0;
  --violet-light: #8C74FF;

  --bg: #F7F6F2;
  --surface: #ffffff;
  --surface-2: #F1EFE9;
  --border: #E4E1D8;
  --text: #161A2B;
  --muted: #5E6274;
  --accent: #5B3FE0;
  --accent-soft: #ECE8FF;
  --good: #137A4B;
  --good-soft: #E3F4EA;
  --warn: #9A5B00;
  --warn-soft: #FDF0D9;
  --bad: #B42318;
  --bad-soft: #FDECEA;
  --side: #161A2B;
  --side-text: #C9CCDA;
  --side-active: #242A44;
  --shadow: 0 1px 2px rgb(22 26 43 / 6%), 0 4px 16px rgb(22 26 43 / 5%);
  --radius: 12px;
  --display: 'Unbounded', 'Space Grotesk', system-ui, sans-serif;
  --ui: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wallpaper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23161A2B' fill-opacity='.05'%3E%3Cpath d='M30 16 C32 27 34 29 44 32 C34 35 32 37 30 48 C28 37 26 35 16 32 C26 29 28 27 30 16 Z'/%3E%3Cpath d='M90 76 C91 82 92 83 98 85 C92 87 91 88 90 94 C89 88 88 87 82 85 C88 83 89 82 90 76 Z'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10131F; --surface: #191D2F; --surface-2: #20253A; --border: #2B3149; --text: #F7F6F2; --muted: #A0A4B8;
    --accent: #8C74FF; --accent-soft: #29244D; --good: #4ADE95; --good-soft: #12291F; --warn: #F2A93B; --warn-soft: #30230F;
    --bad: #FF7A6E; --bad-soft: #33171A; --side: #0C0F19; --side-text: #B9BCCB; --side-active: #1E2338;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%); --wallpaper: var(--wallpaper-dark); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10131F; --surface: #191D2F; --surface-2: #20253A; --border: #2B3149; --text: #F7F6F2; --muted: #A0A4B8;
  --accent: #8C74FF; --accent-soft: #29244D; --good: #4ADE95; --good-soft: #12291F; --warn: #F2A93B; --warn-soft: #30230F;
  --bad: #FF7A6E; --bad-soft: #33171A; --side: #0C0F19; --side-text: #B9BCCB; --side-active: #1E2338;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%); --wallpaper: var(--wallpaper-dark); color-scheme: dark;
}
:root {
  --wallpaper-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23F7F6F2' fill-opacity='.035'%3E%3Cpath d='M30 16 C32 27 34 29 44 32 C34 35 32 37 30 48 C28 37 26 35 16 32 C26 29 28 27 30 16 Z'/%3E%3Cpath d='M90 76 C91 82 92 83 98 85 C92 87 91 88 90 94 C89 88 88 87 82 85 C88 83 89 82 90 76 Z'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--text);
  font: 14px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  /* Wallpaper: a faint field of the brand's card sparkle */
  background: var(--wallpaper) var(--bg);
  background-size: 120px 120px;
  background-attachment: fixed;
}
h1, h2, h3, .topbar h1 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
small { font-size: 12px; }

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.app[hidden] { display: none; }

/* sidebar */
.sidebar { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
/* Logo lockup (from the PokeTCG Distribution design: mark + Unbounded wordmark + spaced Space Grotesk tag) */
.brand { display: flex; gap: 8px; align-items: center; padding: 20px 16px 4px 12px; color: var(--cream); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 46px; height: 46px; flex: none; }
.wordmark { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wm-name { font-family: 'Unbounded', var(--ui); font-weight: 800; font-size: 19px; line-height: 1; letter-spacing: -.02em; color: var(--cream); white-space: nowrap; }
.wm-accent { color: var(--violet-light); }
.wm-tag { font-family: var(--ui); font-weight: 600; font-size: 8.5px; letter-spacing: .52em; text-transform: uppercase; color: var(--cream); padding-left: 1px; }
.env-tag { display: block; padding: 0 18px 12px 66px; color: var(--side-text); font-size: 11px; opacity: .8; }
nav { padding: 6px 10px; overflow-y: auto; flex: 1; }
nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--side-text);
  font-weight: 500; margin-bottom: 1px;
}
nav a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
nav .ico { width: 18px; text-align: center; opacity: .85; font-size: 15px; }
nav .badge { margin-left: auto; background: #313858; color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
nav .badge.hot { background: var(--amber); color: var(--navy); }
.sidebar-foot { border-top: 1px solid #262c45; padding: 12px 18px; font-size: 12px; }
.sidebar-foot strong { color: #fff; display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }

/* main */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
.view { padding: 24px 28px 48px; outline: none; }

/* controls */
.btn, button.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 7px 12px; border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn[hidden] { display: none; }
.icon-btn { background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); }
select, input, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
}
select:focus, input:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input:user-invalid { border-color: var(--bad); outline-color: var(--bad); background: var(--bad-soft); }
textarea { width: 100%; min-height: 110px; resize: vertical; }
.spin .sync-ico { display: inline-block; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type="search"] { flex: 1; min-width: 180px; max-width: 360px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; font: inherit; color: var(--muted); cursor: pointer; font-weight: 550; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.seg .ct { font-size: 11px; opacity: .8; margin-left: 3px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0; }
.card > header h3 { margin: 0; font-size: 14px; font-weight: 650; }
.card > header { gap: 10px; flex-wrap: wrap; }
.card > header .spacer { flex: 1; }
.load-more { padding: 14px; text-align: center; }
.modal-back { display: block; margin: 0 0 12px; color: var(--accent); }
.sort-by { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.sort-by select { padding: 5px 8px; font-size: 13px; }
.card .pad { padding: 14px 16px 16px; }
.grid { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; display: block; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 550; }
.kpi .value { font-size: 24px; font-weight: 680; letter-spacing: -.02em; margin-top: 2px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.alert .value { color: var(--bad); }
.cols-2 { grid-template-columns: 2fr 1fr; }
.cols-even { grid-template-columns: 1fr 1fr; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.r, th.r { text-align: right; }
.title-cell { display: flex; gap: 10px; align-items: center; min-width: 240px; }
.title-cell img, .thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex: none; }
.title-cell .t { font-weight: 550; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.unread td { font-weight: 600; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.acct { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.acct i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* charts */
.chart { width: 100%; height: 220px; display: block; }
.chart .grid-line { stroke: var(--border); }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { opacity: .8; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; }
.breakdown li { list-style: none; padding: 8px 0; border-bottom: 1px solid var(--border); }
.breakdown li:last-child { border: 0; }
.breakdown { margin: 0; padding: 0; }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* accounts */
.acct-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.acct-card .swatch { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acct-card .err { background: var(--bad-soft); color: var(--bad); padding: 8px 10px; border-radius: 7px; font-size: 12px; }
.acct-card.other-env { opacity: .6; }
.connect-card { border-style: dashed; display: grid; place-items: center; text-align: center; min-height: 180px; padding: 20px; box-shadow: none; }

/* activity */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: start; }
.feed li:last-child { border: 0; }
.feed .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 13px; }
.feed .dot.bad { background: var(--bad-soft); color: var(--bad); }

/* sales: profit + cost of goods */
.chart .bar.neg { fill: var(--bad); }
.scroll-y { max-height: 520px; overflow-y: auto; }
.scroll-y thead th { position: sticky; top: 0; z-index: 1; }
tr.sel td { background: var(--accent-soft); }
tfoot tr.total td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border); position: sticky; bottom: 0; }
tr.muted td { color: var(--muted); }
#salesDays td:first-child, #salesDays + tfoot td:first-child, #dayDetail td:first-child { white-space: nowrap; }
tr.dirty td { background: var(--warn-soft); }
.cost-in { display: inline-flex; align-items: center; gap: 4px; }
.cost-in input { width: 96px; text-align: right; padding: 5px 8px; }
.day-nav select { min-width: 0; flex: 1; max-width: 340px; }
.card > header .seg button { padding: 4px 10px; font-size: 12px; }

/* ship queue */
.ship-bar { position: sticky; top: 61px; z-index: 4; background: var(--bg); padding: 8px 0; margin-bottom: 4px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.chk input, .pchk input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.pchk { width: 34px; cursor: default; }
.store-tabs { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden;margin: 0 0 14px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.store-tabs button { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 9px 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.store-tabs button:hover { color: var(--text); }
.store-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.store-tabs .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bulk-bar { position: sticky; top: 61px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent); }
.bulk-bar[hidden] { display: none; }
.bulk-bar strong { margin-right: 6px; }
.ship-hint { margin: 0 0 12px; font-size: 13px; }
.ship-item { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; min-width: 220px; }
.ship-item img, .ship-item .thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; flex: none; }
#print { display: none; }

/* printed pick list / packing slips (plain black on white, paper-friendly) */
.pdoc { font-family: var(--ui); color: #111; background: #fff; padding: 0; }
.pdoc + .pdoc { margin-top: 24px; }
.pdoc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 14px; }
.pdoc-logo { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pdoc-logo svg { width: 40px; height: 40px; flex: none; }
.pdoc-wm { display: flex; flex-direction: column; line-height: 1; }
.pdoc-name { font-family: 'Unbounded', var(--ui); font-weight: 800; font-size: 17px; letter-spacing: -.01em; color: #161A2B; }
.pdoc-name span { color: #5B3FE0; }
.pdoc-tag { font-family: ui-monospace, Consolas, monospace; font-size: 7.5px; font-weight: 700; letter-spacing: .42em; text-transform: uppercase; color: #161A2B; margin-top: 4px; }
.pdoc-logo, .pdoc-logo * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pdoc h1 { font-size: 22px; margin: 4px 0 0; }
.pdoc-meta { text-align: right; font-size: 12px; line-height: 1.5; }
.ptable { width: 100%; border-collapse: collapse; font-size: 12px; }
.ptable th { background: #f2f2f2; color: #111; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.ptable th, .ptable td { border-bottom: 1px solid #ccc; padding: 6px 8px; vertical-align: top; }
.ptable img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.ptable .qty { font-size: 18px; font-weight: 700; }
.ptable .mono { font-family: ui-monospace, Consolas, monospace; }
.ptable .small, .pdoc .small { font-size: 10px; color: #555; }
.ptable .box { display: inline-block; width: 16px; height: 16px; border: 1.5px solid #111; border-radius: 3px; }
.slip-to { border: 1px solid #111; border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; line-height: 1.45; max-width: 360px; }
.slip-note { margin-top: 12px; padding: 8px 10px; border: 1px dashed #999; font-size: 12px; }
.slip-thanks { margin-top: 18px; font-size: 12px; }
@media print {
  body.printing { background: #fff !important; }
  body.printing > *:not(#print) { display: none !important; }
  body.printing #print { display: block; }
  .slip { break-after: page; page-break-after: always; }
  .slip:last-child { break-after: auto; page-break-after: auto; }
  .pdoc + .pdoc { margin-top: 0; }
  .ptable tr { break-inside: avoid; }
  @page { margin: 12mm; }
}

/* activity timeline */
.legend-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; margin-bottom: 14px; }
.legend-bar > span { margin-right: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 99px; padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.chip .ct { color: var(--muted); font-weight: 500; }
.chip:hover { border-color: var(--c); }
.chip.off { opacity: .5; }
.chip.off i { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.day { margin-bottom: 12px; }
.day > summary { list-style: none; cursor: pointer; padding: 12px 16px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.day > summary::-webkit-details-marker { display: none; }
.day > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; display: inline-block; }
.day[open] > summary::before { transform: rotate(90deg); }
.day > summary .muted { font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 0 16px 8px; }
.tl-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding: 10px 0 10px 12px; border-top: 1px solid var(--border); border-left: 3px solid var(--c); margin-left: 2px; }
.tl-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; background: var(--c); }
.tl-fail .tl-dot { background: var(--bad); }
.tl-body { min-width: 0; }
.tl-summary { font-weight: 550; margin: 4px 0 2px; }
.tl-details { margin: 4px 0 6px; padding-left: 18px; color: var(--muted); font-size: 13px; }
.tl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; white-space: nowrap; }
.quote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 6px 6px 0; }
@media (max-width: 600px) {
  .tl-item { grid-template-columns: 26px 1fr; }
  .tl-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
}

/* sign-in screens: navy brand wallpaper with the card-fan motif */
.auth-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
  background-color: var(--navy);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill-opacity='.06'%3E%3Crect x='30' y='40' width='46' height='66' rx='7' fill='%23F2A93B' transform='rotate(-14 53 73)'/%3E%3Crect x='46' y='35' width='46' height='66' rx='7' fill='%238C74FF' transform='rotate(-4 69 68)'/%3E%3Crect x='64' y='30' width='46' height='66' rx='7' fill='%23F7F6F2'/%3E%3C/g%3E%3Cpath d='M170 140 C172 151 174 153 184 156 C174 159 172 161 170 172 C168 161 166 159 156 156 C166 153 168 151 170 140 Z' fill='%23F7F6F2' fill-opacity='.07'/%3E%3C/svg%3E"),
    radial-gradient(1200px 600px at 50% -10%, rgb(140 116 255 / 22%), transparent 60%);
  background-size: 220px 220px, auto;
}
.auth-screen[hidden] { display: none; }
.auth-wrap { width: min(440px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-logo { display: flex; align-items: center; gap: 14px; }
.auth-logo svg { width: 76px; height: 76px; flex: none; }
.auth-logo .wm-name { font-size: 34px; }
.auth-logo .wm-tag { font-size: 13px; }
.auth-logo .wordmark { gap: 9px; }
.auth-card { width: 100%; padding: 28px 28px 24px; background: var(--surface); border-color: transparent; box-shadow: 0 24px 60px rgb(0 0 0 / 35%); }
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card > p { margin: 0 0 16px; }
.auth-foot { margin: 0; color: rgb(247 246 242 / 55%); font-size: 12px; letter-spacing: .04em; }
@media (max-width: 420px) { .auth-logo svg { width: 56px; height: 56px; } .auth-logo .wm-name { font-size: 26px; } .auth-logo .wm-tag { font-size: 10px; } }
.btn.big { justify-content: center; padding: 10px 14px; font-size: 15px; width: 100%; margin-top: 4px; }
.auth-switch { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.auth-switch a { font-weight: 600; }
.request-sent p { margin: 0 0 10px; }
.request-sent + .btn { margin-top: 10px; }
.requests { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), var(--shadow); }
.user-actions { display: flex; gap: 12px; margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--violet-light); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.sidebar-foot span.muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* banner, modal, toasts */
#banner:empty { display: none; }
.banner { margin: 16px 28px 0; padding: 10px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 500; display: flex; gap: 10px; align-items: center; }
.banner.info { background: var(--accent-soft); color: var(--accent); }
.modal { position: fixed; inset: 0; background: rgb(10 12 16 / 55%); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); border-radius: 12px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgb(0 0 0 / 30%); }
.modal-card > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.modal-card h2 { margin: 0; font-size: 16px; }
#modalBody { padding: 16px 18px 18px; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-weight: 550; font-size: 13px; }
.form .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0 0 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.order-link { white-space: nowrap; background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.order-link:hover, .order-link:focus-visible { text-decoration-color: currentColor; }
.sale-h { margin: 4px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sale-box { border: 1px solid var(--border); border-radius: 10px; padding: 4px 12px 8px; margin-bottom: 14px; }
.sale-box > .muted { padding: 10px 0; font-size: 13px; }
table.sale { width: 100%; font-size: 13px; }
table.sale td { padding: 4px 0; border: 0; }
table.sale tr.sec td { padding-top: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.sale tr.cost td.r { color: var(--muted); }
table.sale tr.note td { color: var(--muted); font-size: 12px; padding-top: 0; }
table.sale tr.sub td, table.sale tr.total td { border-top: 1px solid var(--border); padding-top: 6px; }
table.sale tr.total td { font-size: 14px; }
table.sale tr.profit td { color: var(--good); }
table.sale tr.profit.neg td { color: var(--bad); }
.payout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.payout-card .value { font-size: 22px; font-weight: 700; margin: 6px 0 2px; }
.payout-card .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.label-form input { width: 90px; margin: 0 6px; }
.label-form label { display: inline; }
.sale-payout { margin: 8px 0 0; font-size: 13px; }
.sale-items { margin-bottom: 8px; }
.msg-orders { margin: 0 0 14px; }
.msg-orders h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.msg-order { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.msg-order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.msg-order-link { margin-left: auto; font-size: 13px; }
.msg-order .kv { margin-bottom: 10px; }
.msg-order table { font-size: 13px; }
.msg-orders details summary { cursor: pointer; font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.msg-order-none { font-size: 13px; margin: 0 0 12px; }
.msg-frame {width: 100%; height: 300px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; font-weight: 500; }
.toast.bad { background: var(--bad); color: #fff; }

.form label.chk { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.form label.chk input { width: 18px; height: 18px; flex: none; margin: 0; }

.warn-text { color: var(--warn); }

/* Orders: drop zones for eBay's label and pick list PDFs */
.pdf-drop { border: 1.5px dashed var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2, var(--bg)); transition: border-color .15s, background .15s; }
.pdf-drop.has { border-style: solid; }
.pdf-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.pdf-drop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.form .pdf-drop-head label.btn { display: inline-flex; font-weight: 600; }
.pdf-files { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.pdf-files li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pdf-files .pdf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-empty { margin: 6px 0 0; font-size: 13px; }

/* Sales: where the money went, by-store bars */
.waterfall { width: 100%; border-collapse: collapse; font-size: 14px; }
.waterfall td { padding: 7px 4px; border-bottom: 1px solid var(--border); }
.waterfall td.sub { padding-left: 22px; font-size: 13px; }
.waterfall tr.muted td { color: var(--muted); }
.waterfall tr.total td { border-top: 2px solid var(--text); border-bottom: 0; }
.waterfall tr.total + tr.total td { border-top: 0; }
.neg { color: var(--bad); }
.pos { color: var(--good); }
.store-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.store-bars li { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.store-bars .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-bars .bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.store-bars .bar span { display: block; height: 100%; border-radius: 999px; }
@media (max-width: 600px) { .store-bars li { grid-template-columns: 1fr; gap: 4px; } }

/* Inbox pages (Messages, Offers, Returns, Disputes): stores | list | open item */
.inbox { display: grid; grid-template-columns: 190px minmax(280px, 380px) minmax(0, 1fr); gap: 12px; align-items: start; }
.inbox.one-store { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); }
.inbox.one-store .ib-stores { display: none; }
.inbox > * { min-width: 0; }
.ib-stores { padding: 6px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; position: sticky; top: 70px; overflow: hidden; }
.ib-stores button, .ib-item { box-sizing: border-box; }
.ib-stores button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-align: left; }
.ib-stores button:hover { background: var(--surface-2); color: var(--text); }
.ib-stores button.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.ib-stores .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ib-stores .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-stores .ct { font-size: 12px; font-variant-numeric: tabular-nums; }
.ib-stores .badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 17px; }
.ib-list { max-height: calc(100vh - 210px); overflow-y: auto; overflow-x: hidden; }
.ib-group { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; }
.ib-group .muted { margin-left: auto; color: #C9CCDA; font-weight: 500; }
.ib-group .dot { width: 8px; height: 8px; border-radius: 50%; }
.ib-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; }
.ib-item:hover { background: var(--surface-2); }
.ib-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ib-item.hot::before { content: ''; position: absolute; left: 4px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.ib-item.hot .ib-top strong, .ib-item.hot .ib-t { font-weight: 700; }
.ib-item > input[type=checkbox] { margin-top: 9px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.ib-av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; }
.ib-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.ib-top { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.ib-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ib-store { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.ib-top time { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ib-t { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-main small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-detail { padding: 18px; min-height: 320px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.ib-detail .empty { padding: 90px 10px; }
.ib-dh { margin-bottom: 14px; }
.ib-dh h3 { margin: 0 0 4px; font-size: 17px; }
.ib-dh .muted { font-size: 13px; }
.draft-box { margin-top: 12px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 12px; }
.draft-box h4 { margin: 0 0 8px; font-size: 13px; color: var(--accent); }

@media (max-width: 1100px) {
  .cols-2, .cols-even { grid-template-columns: 1fr; }
  .inbox, .inbox.one-store { grid-template-columns: 1fr; }
  .ib-stores { position: static; display: flex; overflow-x: auto; }
  .ib-stores button { width: auto; white-space: nowrap; flex: none; }
  .ib-list { max-height: 55vh; }
  .ib-detail { position: static; max-height: none; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; transform: translateX(-100%); transition: transform .2s; z-index: 40; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / 40%); }
  .menu-btn { display: inline-block; }
  .topbar { padding: 12px 16px; }
  .view { padding: 16px 16px 40px; }
  .banner { margin: 12px 16px 0; }
  .hide-sm { display: none; }
  .acct-filter select { max-width: 140px; }
  .kpi .value { font-size: 20px; }
}
