/* ============================================================================
 * Sellora Seller Hub — design system (clean rebuild from
 * design_handoff_sellora_seller_hub/Sellora Seller Hub.dc.html).
 * The prototype styles everything inline; this file is a faithful class-based
 * translation of its exact tokens so the real server-rendered app matches it.
 *
 * Contrast (WCAG, computed against each real background):
 *   primary #0E8A6B on white 4.54:1 · success #047857 5.36:1 · danger #B91C1C
 *   7.06:1 · muted #6B7280 4.83:1 · sidebar link #A9B1BD on #101828 8.2:1.
 *   Status-pill text uses the darker shade from each pill pair so it clears AA
 *   on its tint (e.g. #B91C1C on #FEE2E2 = 5.9:1, not the spec's #DC2626).
 * ==========================================================================*/
:root {
  --ink: #101828;
  --primary: #0E8A6B;
  --primary-hover: #0B6E55;
  --primary-tint: #ECFDF5;
  --primary-tint-border: #A7F3D0;
  --primary-row: #F0FAF6;
  --sidebar-active-text: #6EE7C8;
  --bg: #F4F5F7;
  --card: #ffffff;
  --border: #E5E7EB;
  --border-inner: #F3F4F6;
  --row-divider: #F9FAFB;
  --text: #1F2937;
  --text-2: #374151;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --danger: #B91C1C;
  --success: #047857;
  --warning: #B45309;
  --info: #1D4ED8;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --sidebar-w: 232px;
  --ch-shopee: #EE4D2D;
  --ch-tiktok: #111111;
  --ch-lazada: #1A4DBE;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

button, .btn, input, select, textarea, .side-nav a, .nav-toggle, .stepper-btn, .pill-tab {
  transition: all 0.15s ease;
}
@media (prefers-reduced-motion: reduce) {
  main { animation: none !important; }
  * { transition: none !important; }
}

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--ink);
  display: flex; flex-direction: column;
  color: #E5E7EB; z-index: 60;
}
.side-logo { padding: 20px 20px 16px; display: flex; align-items: center; gap: 10px; }
.side-logo .logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
}
.side-logo .logo-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: #fff; letter-spacing: 0.2px; line-height: 1.15; }
.side-logo .logo-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; margin-top: 2px; }

.side-nav { padding: 0 12px; margin-top: 4px; display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; }
.side-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px;
  color: #556070; font-weight: 700; padding: 12px 12px 5px;
}
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  color: #A9B1BD; text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.side-nav a .nav-icon { width: 18px; text-align: center; font-size: 15px; flex: none; }
.side-nav a .nav-label { flex: 1; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,0.07); text-decoration: none; }
.side-nav a.active { background: rgba(14,138,107,0.22); color: var(--sidebar-active-text); font-weight: 600; }
.side-nav a:focus-visible { outline: 2px solid var(--sidebar-active-text); outline-offset: 2px; }
.nav-badge {
  background: #EF4444; color: #fff; font-size: 10.5px; font-weight: 600;
  border-radius: 999px; padding: 2px 7px; line-height: 1.3;
}

.side-foot { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.side-foot-label { font-size: 11px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.5px; text-transform: uppercase; }
.channel-chips { display: flex; gap: 8px; }
.channel-chip {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff; font-family: var(--font-display);
}
.channel-chip.is-off { opacity: 0.3; }

.app-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

header.topbar {
  height: 58px; flex-shrink: 0;
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
header.topbar .page-title { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text); white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-search input {
  width: 260px; background: var(--border-inner); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-family: inherit; color: var(--text);
}
.topbar-search input::placeholder { color: var(--faint); }
.sync-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary-tint); border: 1px solid var(--primary-tint-border); color: var(--primary);
  font-weight: 600; font-size: 12.5px; border-radius: 999px; padding: 5px 12px; white-space: nowrap;
}
.sync-pill .sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }

.bell { position: relative; }
.bell-btn {
  width: 34px; height: 34px; border-radius: 9px; background: transparent; border: none;
  display: grid; place-items: center; cursor: pointer; color: var(--text-2); position: relative;
}
.bell-btn:hover { background: var(--border-inner); }
.bell-badge {
  position: absolute; top: 1px; right: 1px;
  background: #EF4444; color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 999px;
  min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff;
}
.bell-menu {
  position: absolute; top: 46px; right: 0; width: 344px; max-width: 88vw;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.16); z-index: 80; overflow: hidden;
}
.bell-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border-inner); font-family: var(--font-display); font-weight: 600; }
.bell-empty { padding: 20px 16px; color: var(--muted); font-size: 13px; }
.bell-item { display: flex; gap: 11px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--row-divider); text-decoration: none; color: var(--text); font-size: 13px; }
.bell-item:hover { background: var(--primary-row); text-decoration: none; }
.bell-item.unread { background: #F0FAF6; }
.bell-item-msg { flex: 1; line-height: 1.4; }
.bell-all { display: block; padding: 12px 16px; text-align: center; font-size: 12.5px; font-weight: 600; }
.bell-mark-read button { background: none; border: none; padding: 0; color: var(--primary); font-weight: 600; font-size: 12px; cursor: pointer; width: auto; }
.bell-mark-read button:hover { text-decoration: underline; }
.sync-pill.is-error { background: #FEE2E2; border: 1px solid #FECACA; color: var(--danger); }
.sync-pill.is-error .sync-dot { background: var(--danger); }

header.topbar .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 13px; font-family: var(--font-display);
}
header.topbar .user-info { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
header.topbar .user-info a { color: var(--text-2); }
header.topbar form.logout-form { display: inline; }
header.topbar form.logout-form button {
  background: #fff; border: 1px solid var(--border); color: var(--text-2);
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; border-radius: 8px;
}
header.topbar form.logout-form button:hover { background: var(--row-divider); border-color: var(--faint); }

.nav-toggle {
  display: none; background: #fff; border: 1px solid var(--border); color: var(--text-2);
  font-size: 17px; line-height: 1; padding: 7px 11px; border-radius: 8px; cursor: pointer;
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(16,24,40,0.55); z-index: 55; }

main {
  flex: 1; overflow-y: auto; padding: 24px;
  max-width: 1280px; width: 100%;
  animation: fadeUp 0.3s ease;
}

/* ---------- Flash / toast ---------- */
.flash { font-size: 13px; font-weight: 500; }
.flash-success {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 10px; padding: 11px 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.28); z-index: 90;
  display: flex; align-items: center; gap: 9px; white-space: nowrap; max-width: 92vw;
  animation: fadeUp 0.25s ease;
}
.flash-success::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34D399; flex: none; }
.flash-success.toast-hide { opacity: 0; transition: opacity 0.3s ease; }
.flash-error { background: #FEE2E2; color: var(--danger); border: 1px solid #FECACA; padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; }

/* ---------- Cards & headings ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 0 0 4px; }
.card-sub { font-size: 12px; color: var(--faint); margin-bottom: 14px; }

h1 { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--text); margin: 0 0 16px; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); margin: 0 0 12px; }

/* ---------- KPI / stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
a.stat { text-decoration: none; color: inherit; display: block; }
a.stat:hover { border-color: var(--primary-tint-border); }
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .value { font-family: var(--font-display); font-weight: 700; font-size: 26px; margin-top: 6px; color: var(--text); font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12px; margin-top: 6px; font-weight: 600; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--row-divider); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; background: #FAFAFA; border-bottom: 1px solid var(--border-inner); }
tbody tr:hover { background: var(--row-divider); }
td { color: var(--text-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.table-wrap table { border-radius: 12px; overflow: hidden; }
.table-wrap th:first-child, .table-wrap td:first-child { padding-left: 18px; }
.table-wrap tr:last-child td { border-bottom: none; }

/* ---------- Badges / status pills ---------- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; font-family: var(--font-body); border: 1px solid transparent; }
.badge.success { background: #D1FAE5; color: var(--success); }
.badge.error { background: #FEE2E2; color: var(--danger); }
.badge.serious { background: #FEF3C7; color: var(--warning); }
.badge.running { background: #DBEAFE; color: var(--info); }
.badge.neutral { background: var(--border-inner); color: var(--text-2); }
/* Channel sync pills */
.sync-live { background: #fff; color: var(--success); border-color: var(--primary-tint-border); }
.sync-pending { background: #FEF3C7; color: var(--warning); }
.sync-off { background: var(--border-inner); color: var(--faint); }

/* ---------- Product / entity tiles ---------- */
.tile { width: 40px; height: 40px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; font-family: var(--font-display); }
.tile-lg { width: 56px; height: 56px; border-radius: 12px; font-size: 20px; }
.entity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.entity-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-sub { font-size: 11.5px; color: var(--faint); }

/* ---------- Pills / tabs ---------- */
.pill-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill-tab { padding: 7px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; background: #fff; color: var(--text-2); border: 1px solid var(--border); text-decoration: none; }
.pill-tab:hover { background: var(--row-divider); text-decoration: none; }
.pill-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Buttons ---------- */
button, .btn {
  background: var(--primary); color: #fff; border: none;
  padding: 9px 16px; border-radius: 8px; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  text-decoration: none; display: inline-block;
}
button:hover:not(:disabled), .btn:hover { background: var(--primary-hover); text-decoration: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--text-2); border: 1px solid var(--border); }
button.secondary:hover:not(:disabled), .btn.secondary:hover { background: var(--row-divider); border-color: var(--faint); }
button.ghost, .btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
button.ghost:hover:not(:disabled), .btn.ghost:hover { background: var(--primary-tint); }
button.danger, .btn.danger { background: #fff; color: var(--danger); border: 1px solid #FECACA; }
button.danger:hover:not(:disabled), .btn.danger:hover { background: #FEE2E2; border-color: var(--danger); }
button:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Stepper (−/+ quantity) */
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper-btn { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: #fff; display: grid; place-items: center; cursor: pointer; font-weight: 700; color: var(--muted); font-size: 16px; user-select: none; padding: 0; }
.stepper-btn:hover { background: var(--border-inner); }
.stepper-val { min-width: 40px; text-align: center; font-weight: 700; font-family: var(--font-display); font-size: 15px; }

/* ---------- Forms ---------- */
input[type=text], input[type=url], input[type=number], input[type=password], input[type=date], input[type=search], textarea, select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; color: var(--text); background: #fff;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,138,107,0.12); outline: none; }
input[type=file] { border: 1px solid var(--border); border-radius: 8px; padding: 9px; background: #fff; font-size: 13px; width: 100%; }
input.input-sm { width: 100px; }
input.quick-search-input { font-size: 17px; padding: 13px 16px; }
label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 5px; margin-top: 14px; }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); font-size: 12.5px; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.error-text { color: var(--danger); }
.mt-3 { margin-top: 12px; }
.input-sm { width: 100px; }
.text-right { text-align: right; }
.dim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.result-banner { padding: 18px 20px; border-radius: 12px; font-size: 15px; font-weight: 700; margin-bottom: 16px; font-family: var(--font-display); }
.result-banner.success { background: var(--primary-tint); color: var(--success); border: 1px solid var(--primary-tint-border); }
.result-banner.error { background: #FEE2E2; color: var(--danger); border: 1px solid #FECACA; }
pre.code { background: var(--border-inner); padding: 12px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* ---------- Fulfilment timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-step { display: flex; gap: 12px; }
.tl-marker { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid var(--border); background: #fff; color: var(--faint); }
.tl-line { width: 2px; flex: 1; min-height: 20px; background: var(--border); }
.tl-step.done .tl-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.tl-step.done .tl-line { background: var(--primary); }
.tl-step.current .tl-dot { background: #FEF3C7; border-color: var(--warning); color: var(--warning); }
.tl-body { padding-bottom: 16px; padding-top: 1px; }
.tl-label { font-weight: 600; font-size: 13.5px; }
.tl-step.todo .tl-label { color: var(--faint); font-weight: 500; }

/* ---------- Payment breakdown rows ---------- */
.pay-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; }
.pay-row.total { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 12px; font-weight: 700; font-family: var(--font-display); }
.pay-row .fee { color: var(--danger); }
.pay-row .payout { color: var(--success); font-weight: 700; }

/* ---------- Return / list cards ---------- */
.list-card { display: block; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-decoration: none; color: inherit; }
.list-card:hover { border-color: var(--primary-tint-border); text-decoration: none; }
.reason-box { background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--danger); margin: 10px 0; }

/* Custom checkbox */
.chk { width: 20px; height: 20px; border: 1.5px solid var(--border); border-radius: 6px; display: inline-grid; place-items: center; cursor: pointer; background: #fff; vertical-align: middle; }
input[type=checkbox].chk-native { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; cursor: pointer; }
.chk-wrap { position: relative; display: inline-flex; }
input[type=checkbox].chk-native:checked + .chk { background: var(--primary); border-color: var(--primary); }
input[type=checkbox].chk-native:checked + .chk::after { content: "✓"; color: #fff; font-size: 12px; font-weight: 700; }
input[type=checkbox].chk-native:focus-visible + .chk { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Empty state */
.empty-state { padding: 52px 20px; text-align: center; }
.empty-state .empty-glyph { font-size: 28px; color: #D1D5DB; margin-bottom: 10px; }
.empty-state .empty-title { font-weight: 600; color: var(--text-2); }
.empty-state .empty-sub { font-size: 12.5px; color: var(--faint); margin-top: 4px; }

/* ---------- Feature-specific bits ---------- */
.shop-switcher { display: flex; align-items: center; gap: 6px; }
.shop-switcher select { width: auto; padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.quick-result { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.quick-result-name { font-size: 14.5px; font-weight: 600; flex: 1; min-width: 160px; }
.quick-result-price { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.order-item-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; }
.photo-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-gallery-item { width: 90px; height: 90px; }
.image-zoom-overlay { position: fixed; inset: 0; background: rgba(16,24,40,0.85); display: flex; align-items: center; justify-content: center; cursor: zoom-out; z-index: 100; padding: 40px; }
.image-zoom-overlay img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ---------- Auth screens (login/setup, no shell) ---------- */
.auth-screen { max-width: none; min-height: 100vh; display: flex; align-items: center; justify-content: center; margin: 0; padding: 16px; background: var(--bg); animation: none; }
.auth-card { width: 100%; max-width: 380px; margin-bottom: 0; }
.brand-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.brand-logo-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1; letter-spacing: .01em; color: var(--text); }
.brand-logo-tagline { font-size: 10px; font-weight: 600; letter-spacing: .22em; color: var(--muted); margin-top: 6px; }

/* ---------- Step breadcrumb (Add Product flow — 2 real pages, not a JS wizard) ---------- */
.step-track { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.step-pill { display: flex; align-items: center; gap: 8px; }
.step-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 11.5px; background: var(--border-inner); color: var(--faint); flex: none; }
.step-pill.done .step-num { background: var(--primary); color: #fff; }
.step-pill.current .step-num { background: var(--ink); color: #fff; }
.step-pill .step-label { font-size: 13px; font-weight: 600; color: var(--faint); }
.step-pill.done .step-label, .step-pill.current .step-label { color: var(--text); }
.step-sep { color: var(--border); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.side-open { transform: translateX(0); }
  .sidebar-overlay.side-open { display: block; }
  .app-main { margin-left: 0; }
  .nav-toggle { display: inline-block; }
  header.topbar { padding: 0 16px; gap: 10px; }
  .topbar-search, .sync-pill, .user-meta { display: none; }
  main { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .dim-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Chat (buyer inbox, 2-panel) ----------
 * Not built on .grid-2 — that's a fluid 1.5fr/1fr layout meant for stacked
 * cards. This needs a fixed-width list column and two independently
 * scrolling panels inside a viewport-height shell, so it gets its own class
 * names instead of overloading .grid-2's contract. */
.chat-shell { display: grid; grid-template-columns: 320px 1fr; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; height: calc(100vh - 190px); min-height: 420px; }
.chat-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { padding: 14px 16px; border-bottom: 1px solid var(--border-inner); font-family: var(--font-display); font-weight: 600; }
.chat-list-body { overflow-y: auto; flex: 1; }
.chat-row { display: flex; gap: 11px; padding: 13px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--row-divider); }
.chat-row:hover { background: var(--row-divider); text-decoration: none; }
.chat-row.active { background: var(--primary-row); }
.chat-row-name { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.chat-row-time { font-size: 11px; color: var(--faint); font-weight: 400; flex-shrink: 0; }
.chat-row-preview { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.chat-unread { background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 6px; flex-shrink: 0; margin-left: auto; }
.chat-thread { display: flex; flex-direction: column; min-height: 0; }
.chat-thread-head { padding: 13px 20px; border-bottom: 1px solid var(--border-inner); display: flex; align-items: center; gap: 10px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.chat-bubble { max-width: 70%; border-radius: 12px; padding: 9px 14px; font-size: 13.5px; line-height: 1.45; }
.chat-bubble.from-buyer { align-self: flex-start; background: #fff; color: var(--text); border: 1px solid var(--border); }
.chat-bubble.from-seller { align-self: flex-end; background: var(--primary); color: #fff; }
.chat-compose { padding: 14px 16px; border-top: 1px solid var(--border-inner); display: flex; gap: 10px; }
.chat-compose input { flex: 1; }

@media (max-width: 900px) {
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-list { border-right: none; border-bottom: 1px solid var(--border); max-height: 260px; }
  .chat-thread { height: 60vh; }
}

/* ---------- Reviews (260px sticky rating summary + review list) ----------
 * Not .grid-2 — that ratio is 1.5fr/1fr, this needs a fixed 260px sidebar
 * per the Sellora spec, so it gets its own class instead of overloading
 * .grid-2's contract (same reasoning as .chat-shell above). */
.reviews-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }

@media (max-width: 900px) {
  .reviews-layout { grid-template-columns: 1fr; }
}
