/* ProductLove — Merchant dashboard
   Mobile-first: designed for a phone, enhanced to a sidebar layout on desktop.
   Brand-consistent with the app: warm canvas, coral accent, green likes. */

:root {
  --color-bg: #f4f1ec;
  --color-surface: #ffffff;
  --color-surface-2: #faf8f4;
  --color-ink: #1a1714;
  --color-muted: #6f6a63;
  --color-faint: #a8a29a;

  --color-accent: #f0435b;
  --color-accent-ink: #c8203a;
  --color-accent-2: #ff8a5b; /* warm tail of the gradient */
  --color-like: #2fb86b;
  --color-sponsored: #f5a623;

  --grad-brand: linear-gradient(135deg, #ff8a5b 0%, #f0435b 52%, #d61e57 100%);

  --hairline: rgba(20, 18, 15, 0.09);
  --hairline-strong: rgba(20, 18, 15, 0.16);
  --shadow-sm: 0 1px 2px rgba(20, 18, 15, 0.06), 0 2px 8px rgba(20, 18, 15, 0.05);
  --shadow-md: 0 10px 30px rgba(20, 18, 15, 0.1);
  --shadow-lg: 0 24px 60px rgba(20, 18, 15, 0.22);
  --shadow-accent: 0 10px 24px rgba(240, 67, 91, 0.32);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --topbar-h: 60px;
  --bottomnav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
}

/* =====================================================================
   LOGIN
   ===================================================================== */

.auth {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px calc(28px + var(--safe-b));
  overflow: hidden;
  background: var(--grad-brand);
}
/* Soft glowing blobs + fine grain for depth */
.auth::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 38% at 15% 12%, rgba(255, 225, 190, 0.55) 0, transparent 60%),
    radial-gradient(42% 42% at 88% 82%, rgba(150, 20, 70, 0.55) 0, transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}
.auth::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 26px 26px;
}
.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--grad-brand);
  box-shadow: var(--shadow-accent);
  color: #fff;
  font-size: 26px;
  margin-bottom: 18px;
}
.auth-card h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.7px;
}
.auth-card .brandline {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 4px;
}
.auth-sub {
  color: var(--color-muted);
  margin: 6px 0 24px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.check-inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}
.auth-mini-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
}
.auth-mini-link:hover {
  color: var(--color-accent-ink);
}

.auth-alt {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--color-muted);
}
.auth-alt a {
  color: var(--color-accent);
  font-weight: 800;
}
.auth-alt a:hover {
  color: var(--color-accent-ink);
}

.demo {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}
.demo-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--color-faint);
  margin-bottom: 10px;
}
.demo-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.demo-chip:hover {
  border-color: var(--color-accent);
}
.demo-chip:active {
  transform: scale(0.98);
}
.demo-chip .avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  flex-shrink: 0;
}
.demo-chip small {
  display: block;
  font-weight: 500;
  color: var(--color-faint);
  font-size: 12px;
}

/* =====================================================================
   ADMIN extras
   ===================================================================== */

/* Impersonation banner (shown in the merchant space while admin is viewing) */
.imp-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  background: #1a1714;
  color: #fff;
  font-size: 13px;
}
.imp-banner span {
  flex: 1;
}
.imp-banner button {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.imp-banner button:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Segmented filter (All / Live / Drafts) */
.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--color-surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
}
.seg a {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-muted);
}
.seg a.is-active {
  background: var(--color-ink);
  color: #fff;
}

/* Preview link chip in the merchant list */
.preview-link {
  display: block;
  margin: 10px 0 2px;
  padding: 9px 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-muted);
  word-break: break-all;
}
.preview-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* =====================================================================
   STOREFRONT PREVIEW (public approval page)
   ===================================================================== */

.pv {
  min-height: 100dvh;
  padding-bottom: calc(84px + var(--safe-b));
}
.pv-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--color-ink);
  color: #fff;
}
.pv-banner .tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
}
.pv-banner .txt {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.92;
}
.pv-hero {
  position: relative;
  padding: 40px 20px 34px;
  text-align: center;
  color: #fff;
  background: var(--grad-brand);
  overflow: hidden;
}
.pv-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 0%, rgba(255, 255, 255, 0.22) 0, transparent 70%);
  pointer-events: none;
}
.pv-logo {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  margin: 0 auto 14px;
}
.pv-hero .eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.85;
}
.pv-hero h1 {
  margin: 6px 0 4px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.8px;
}
.pv-hero .city {
  font-size: 15px;
  opacity: 0.9;
}
.pv-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}
.pv-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: -22px auto 28px;
  position: relative;
  z-index: 1;
}
.pv-step {
  background: var(--color-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 10px;
  text-align: center;
}
.pv-step .n {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  border-radius: var(--radius-pill);
  background: rgba(240, 67, 91, 0.12);
  color: var(--color-accent);
  font-weight: 900;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.pv-step .t {
  font-size: 12.5px;
  font-weight: 700;
}
.pv-section-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.4px;
  margin: 8px 0 14px;
}
.pv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.pv-card {
  background: var(--color-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.pv-card .img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--color-bg);
  display: block;
}
.pv-card .body {
  padding: 11px 12px 13px;
}
.pv-card .title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}
.pv-card .price {
  margin-top: 4px;
  font-weight: 900;
  color: var(--color-accent);
}
.pv-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--hairline);
}
.pv-cta .inner {
  max-width: 720px;
  margin: 0 auto;
}
.pv-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-muted);
  background: var(--color-surface-2);
  border: 1px solid var(--hairline);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  margin: 24px 0 4px;
}

@media (min-width: 720px) {
  .pv-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =====================================================================
   APP SHELL (mobile-first)
   ===================================================================== */

.app {
  min-height: 100dvh;
  padding-bottom: calc(var(--bottomnav-h) + var(--safe-b));
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.topbar .brand {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.topbar .brand span {
  color: var(--color-accent);
}
.topbar .spacer {
  flex: 1;
}
.topbar .vendor {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar .vendor .avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  background: var(--color-bg);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--color-accent);
  border: 1px solid var(--hairline);
}
.topbar .vendor .name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--color-surface-2);
  color: var(--color-ink);
}

/* Content */
.content {
  padding: 20px 16px 8px;
  max-width: 780px;
  margin: 0 auto;
}

/* Bottom navigation (mobile) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: calc(var(--bottomnav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--hairline);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-faint);
  transition: color 0.15s ease;
}
.bottom-nav a svg {
  width: 24px;
  height: 24px;
}
.bottom-nav a.is-active {
  color: var(--color-accent);
}
.bottom-nav a .fab-slot {
  transition: transform 0.15s ease;
}
.bottom-nav a.is-active .fab-slot {
  transform: translateY(-1px);
}

/* Desktop sidebar — hidden on mobile */
.sidebar {
  display: none;
}

/* =====================================================================
   PAGE HEADER
   ===================================================================== */

.page-head {
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.7px;
}
.page-head p {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 14px;
}
.page-head .actions {
  margin-top: 14px;
}

/* Flash */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: rgba(47, 184, 107, 0.12);
  border: 1px solid rgba(47, 184, 107, 0.3);
  color: #1f7a48;
  font-weight: 600;
}

/* =====================================================================
   STATS
   ===================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
}
.stat .label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-faint);
}
.stat .value {
  margin-top: 6px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -1.4px;
  line-height: 1;
}
.stat .value.accent {
  color: var(--color-accent);
}
.stat .value.like {
  color: var(--color-like);
}
.stat .sub {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--color-muted);
}

/* =====================================================================
   PANELS
   ===================================================================== */

.panel {
  background: var(--color-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--hairline);
}
.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.panel-body {
  padding: 8px 16px 12px;
}
.panel-body.pad {
  padding: 18px 16px;
}

/* =====================================================================
   PRODUCT / ITEM LISTS  (cards, not tables — mobile-friendly)
   ===================================================================== */

.list {
  display: flex;
  flex-direction: column;
}
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.item:last-child {
  border-bottom: none;
}
.thumb {
  width: 56px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-bg);
  flex-shrink: 0;
  border: 1px solid var(--hairline);
}
.thumb.sq {
  height: 56px;
}
.item .grow {
  flex: 1;
  min-width: 0;
}
.item .title {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item .meta {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--color-muted);
}
.item .desc {
  font-size: 13px;
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.price {
  font-weight: 800;
  white-space: nowrap;
}
.item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
/* Product management row = card on mobile so actions have room */
.pcard {
  background: var(--color-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  margin-bottom: 12px;
}
.pcard-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* =====================================================================
   BADGES
   ===================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
}
.badge.sponsored {
  background: rgba(245, 166, 35, 0.16);
  color: #a96b00;
}
.badge.likes {
  background: rgba(47, 184, 107, 0.14);
  color: #1f7a48;
}
.badge.muted {
  background: var(--color-surface-2);
  color: var(--color-muted);
}

/* =====================================================================
   BUTTONS
   ===================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease,
    filter 0.15s ease;
  background: var(--color-surface);
  color: var(--color-ink);
}
.btn:active {
  transform: scale(0.97);
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  filter: brightness(1.04);
}
.btn-ghost {
  background: var(--color-surface);
  border-color: var(--hairline-strong);
  color: var(--color-ink);
}
.btn-ghost:hover {
  background: var(--color-surface-2);
}
.btn-wa {
  background: #25d366;
  color: #05391b;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.28);
}
.btn-wa:hover {
  filter: brightness(0.96);
}
.btn-danger-ghost {
  background: transparent;
  border-color: rgba(240, 67, 91, 0.35);
  color: var(--color-accent-ink);
}
.btn-danger-ghost:hover {
  background: rgba(240, 67, 91, 0.08);
}
.btn-sm {
  min-height: 38px;
  padding: 0 15px;
  font-size: 13.5px;
}

/* =====================================================================
   FORMS
   ===================================================================== */

.form {
  width: 100%;
}
.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 7px;
}
.field .hint {
  font-weight: 400;
  color: var(--color-faint);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="url"],
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  font: inherit;
  font-size: 16px; /* >=16px stops iOS zoom-on-focus */
  color: var(--color-ink);
  background: var(--color-surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(240, 67, 91, 0.14);
}
.field .error {
  margin-top: 6px;
  font-size: 13px;
  color: var(--color-accent-ink);
  font-weight: 600;
}
/* input with a leading icon */
.field-icon {
  position: relative;
}
.field-icon svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--color-faint);
  pointer-events: none;
}
.field-icon input {
  padding-left: 46px !important;
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}
.input-prefix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.input-prefix span {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--color-surface-2);
  color: var(--color-muted);
  font-weight: 800;
  border-right: 1px solid var(--hairline);
}
.input-prefix input {
  border: none !important;
  border-radius: 0 !important;
}
.input-prefix input:focus {
  box-shadow: none !important;
}
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

/* File inputs & previews */
.field input[type="file"] {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--color-muted);
}
.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-strong);
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.thumb-lg {
  width: 72px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--color-bg);
}
.logo-field {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  background: var(--color-bg);
  border: 1px solid var(--hairline);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 26px;
  color: var(--color-accent);
}
.logo-field .grow {
  flex: 1;
  min-width: 0;
}

/* =====================================================================
   LEADS
   ===================================================================== */

.lead-group {
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.lead-group:last-child {
  border-bottom: none;
}
.lead-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.lead-head .grow {
  flex: 1;
  min-width: 0;
}
.lead-head .btn-wa {
  flex-shrink: 0;
}
.buyer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.buyer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.buyer .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-like);
  flex-shrink: 0;
}
.buyer .who {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buyer .who small {
  display: block;
  font-weight: 400;
  color: var(--color-faint);
  font-size: 12px;
}
.buyer .when {
  color: var(--color-faint);
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Empty states */
.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--color-muted);
}
.empty h3 {
  color: var(--color-ink);
  margin: 0 0 6px;
  font-size: 18px;
}

/* =====================================================================
   DESKTOP  (>= 900px): promote to a sidebar app
   ===================================================================== */

@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: 260px 1fr;
    padding-bottom: 0;
  }
  .topbar,
  .bottom-nav {
    display: none;
  }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 26px;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    padding: 26px 18px;
    background: var(--color-surface);
    border-right: 1px solid var(--hairline);
  }
  .sidebar .brand {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -0.5px;
  }
  .sidebar .brand span {
    color: var(--color-accent);
  }
  .sidebar .brand small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-faint);
  }
  .sidebar .vendor-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
    border: 1px solid var(--hairline);
  }
  .sidebar .vendor-chip .avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    object-fit: cover;
    background: var(--color-bg);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--color-accent);
    flex-shrink: 0;
  }
  .sidebar .vendor-chip .meta {
    min-width: 0;
  }
  .sidebar .vendor-chip strong {
    display: block;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sidebar .vendor-chip span {
    font-size: 12px;
    color: var(--color-muted);
  }
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 15px;
    color: var(--color-muted);
    transition: background 0.15s ease, color 0.15s ease;
  }
  .sidebar-nav a svg {
    width: 20px;
    height: 20px;
  }
  .sidebar-nav a:hover {
    background: var(--color-surface-2);
    color: var(--color-ink);
  }
  .sidebar-nav a.is-active {
    background: var(--color-ink);
    color: #fff;
  }
  .sidebar-foot {
    margin-top: auto;
  }
  .sidebar-foot button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-muted);
    cursor: pointer;
  }
  .sidebar-foot button:hover {
    background: var(--color-surface-2);
    color: var(--color-accent);
  }
  .sidebar-foot button svg {
    width: 20px;
    height: 20px;
  }

  .content {
    padding: 34px 40px 60px;
    max-width: 1080px;
    margin: 0;
  }
  .page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
  }
  .page-head h1 {
    font-size: 30px;
  }
  .page-head .actions {
    margin-top: 0;
  }
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .stat .value {
    font-size: 40px;
  }
  /* On desktop, product management rows read fine inline */
  .form-actions {
    flex-direction: row;
    align-items: center;
  }
  .form-actions .btn {
    width: auto;
  }
}
