/* ============================================================================
   Loveworld Merchant Portal — LDM vendor dashboard design system.
   Class contract is preserved so existing PHP and JS keep working.
   ========================================================================== */

:root {
  --brand: #003d9b;
  --brand-strong: #002f78;
  --brand-2: #4648d4;
  --brand-soft: #dae2ff;
  --brand-dark: #003d9b;

  --bg: #faf8ff;
  --surface: #ffffff;
  --low: #f3f3fd;
  --mid: #ededf8;
  --high: #e1e2ec;
  --line: #d9dbe9;

  --text: #191b23;
  --muted: #5b5f70;
  --outline: #737685;

  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;
  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --ok-line: #bbf7d0;
  --gold: #f59e0b;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 8px rgba(25, 27, 35, .04);
  --shadow: 0 16px 38px rgba(25, 27, 35, .08);
  --shadow-brand: 0 10px 24px rgba(0, 61, 155, .14);

  --display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.01em; }

.material-symbols-outlined { line-height: 1; vertical-align: middle; font-size: 20px; }
.material-symbols-outlined.filled { font-variation-settings: 'FILL' 1; }

/* ── App shell ─────────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: linear-gradient(185deg, var(--brand-strong) 0%, #0a1f52 100%);
  color: #eaf0ff;
  padding: 26px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow-y: auto;
}

.brand {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.05;
}
.brand small {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .18em;
  color: #9fb4e6;
  margin-top: 3px;
}
.brand .brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .12);
  display: grid; place-items: center;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.brand .brand-logo {
  display: block;
  width: auto;
  height: 48px;
  max-width: 170px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 5px 8px;
}
.brand .brand-sub {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #9fb4e6;
}
.merchant-store-chip {
  display: grid;
  gap: 4px;
  margin-top: -14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
}
.merchant-store-chip small,
.page-title-group small {
  color: #7f95c9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.merchant-store-chip strong {
  min-width: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-nav .nav-group {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #7f95c9;
  margin: 16px 12px 6px;
}
.sidebar-nav .nav-group:first-child { margin-top: 0; }

.sidebar-nav a {
  color: #c3d2f2;
  padding: 11px 13px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: background .16s ease, color .16s ease;
}
.sidebar-nav a .material-symbols-outlined { font-size: 21px; }
.sidebar-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.sidebar-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.sidebar-nav a.active .material-symbols-outlined { font-variation-settings: 'FILL' 1; }

.sidebar-status {
  margin-top: auto;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-status small { color: #9fb4e6; font-size: 11px; font-weight: 600; }
.sidebar-status span {
  display: flex; align-items: center; gap: 7px;
  color: #fff; font-weight: 700; font-size: 13px;
}
.sidebar-status span i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .25);
}
.sidebar-status span b { font: inherit; }
.sidebar-status.is-loading span i,
.sidebar-status.is-unknown span i {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, .22);
}
.sidebar-status.is-pending span i,
.sidebar-status.is-draft span i {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .24);
}
.sidebar-status.is-not_submitted span i,
.sidebar-status.is-rejected span i {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .22);
}
.sidebar-status.is-inactive span i {
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .22);
}

.logout-link {
  color: #c3d2f2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 11px;
  font-weight: 600;
}
.logout-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* LDM light vendor shell overrides */
body.ldm-merchant .sidebar {
  background: var(--low);
  color: var(--text);
  border-right: 1px solid rgba(195, 198, 214, .3);
  padding: 30px 16px 18px;
  gap: 22px;
}

body.ldm-merchant .brand {
  color: var(--brand);
  font-size: 19px;
  letter-spacing: -.02em;
  line-height: 1.15;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(195, 198, 214, .25);
}

body.ldm-merchant .brand small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

body.ldm-merchant .sidebar-nav .nav-group {
  color: var(--muted);
}

body.ldm-merchant .sidebar-nav a {
  color: var(--muted);
  border-radius: 12px;
  padding: 11px 14px;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

body.ldm-merchant .sidebar-nav a:hover {
  color: var(--brand);
  background: var(--mid);
}

body.ldm-merchant .sidebar-nav a.active {
  color: var(--brand);
  background: var(--brand-soft);
  box-shadow: none;
  font-weight: 700;
}

body.ldm-merchant .sidebar-status {
  background: var(--brand-soft);
  border: 1px solid rgba(0, 61, 155, .08);
  border-radius: 16px;
  padding: 14px 16px;
  gap: 7px;
}

body.ldm-merchant .sidebar-status small {
  color: var(--brand);
  font-weight: 700;
}

body.ldm-merchant .sidebar-status span {
  color: var(--brand-strong);
}

body.ldm-merchant .logout-link {
  color: var(--muted);
  border-radius: 12px;
}

body.ldm-merchant .logout-link:hover {
  color: var(--brand);
  background: var(--mid);
}

/* ── Main column ───────────────────────────────────────────────────────── */
.page-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px clamp(18px, 3vw, 34px);
  background: rgba(250, 248, 255, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(195, 198, 214, .5);
}
.page-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title-group {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.page-title-group small {
  color: var(--muted);
}
.page-header h1 i { color: var(--brand); font-size: 20px; }
.page-header .header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  min-width: 220px;
  color: var(--muted);
}
.page-header .header-search input {
  border: 0; padding: 0; background: transparent; width: 100%; font-size: 13px;
}
.page-header .header-search input:focus { outline: none; }
.page-header .header-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
}
.page-header .header-icon:hover { color: var(--brand); border-color: var(--brand); }
.page-header .header-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--surface); box-shadow: var(--shadow-sm);
}

body.ldm-merchant .page-header {
  padding: 14px 32px;
  background: rgba(250, 248, 255, .86);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(195, 198, 214, .3);
}

body.ldm-merchant .page-header h1 {
  color: var(--brand);
  font-size: 24px;
}

body.ldm-merchant .page-header .header-search {
  background: var(--low);
  border: none;
  min-width: min(320px, 34vw);
}

body.ldm-merchant .page-header .header-icon {
  border: none;
  background: transparent;
}

/* Inner page body — everything after .page-header lives directly in <main> */
.page-content > :not(.page-header) {
  padding-left: clamp(18px, 3vw, 34px);
  padding-right: clamp(18px, 3vw, 34px);
}
.page-content > .card:first-of-type,
.page-content > .grid-cards:first-of-type,
.page-content > section:first-of-type { margin-top: clamp(18px, 3vw, 28px); }
.page-content > :last-child { margin-bottom: 34px; }

body.ldm-merchant .page-content > :not(.page-header) {
  padding-left: 32px;
  padding-right: 32px;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

body.ldm-merchant .card {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(195, 198, 214, .28);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(25, 27, 35, .04);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

body.ldm-merchant .grid-cards {
  gap: 24px;
  margin-bottom: 24px;
}

/* .card already carries its own margin-bottom for stacking outside a grid — inside
   .grid-cards that doubles up with the grid's own `gap` (worse once cards wrap to a
   second row), throwing off the vertical rhythm between stat cards. */
.grid-cards > .card {
  margin-bottom: 0;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

body.ldm-merchant .metric {
  padding: 24px;
  transition: transform .2s ease, box-shadow .2s ease;
}

body.ldm-merchant .metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

body.ldm-merchant .metric::before {
  display: none;
}

body.ldm-merchant .metric-ico {
  position: static;
  margin-bottom: 16px;
}
.metric::before {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(var(--brand), var(--brand-2));
}
.metric-ico {
  position: absolute;
  top: 18px; right: 18px;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.metric-ico .material-symbols-outlined { font-size: 23px; }
.metric-ico.blue { background: #eaf0ff; color: #0052cc; }
.metric-ico.green { background: var(--ok-soft); color: var(--ok); }
.metric-ico.gold { background: #fff7ed; color: var(--gold); }
.metric-ico.purple { background: #f0f0ff; color: var(--brand-2); }
.metric h2 {
  margin: 0;
  font-family: var(--body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.metric p {
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Give each stat its own accent color (matching its icon) instead of every number
   reading identically in plain --text — the only thing distinguishing the four
   cards otherwise is a small 23px icon glyph. */
.metric-ico.blue ~ p { color: #0052cc; }
.metric-ico.green ~ p { color: var(--ok); }
.metric-ico.gold ~ p { color: var(--gold); }
.metric-ico.purple ~ p { color: var(--brand-2); }

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.section-title-row h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.section-title-row .currency-converter {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.section-title-row .currency-converter select {
  width: auto;
  min-width: 160px;
}

.currency-summary-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.currency-summary-note strong {
  color: var(--text);
  font-weight: 700;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

/* ── Forms ─────────────────────────────────────────────────────────────── */
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #9aa0b4; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { resize: vertical; }

/* Password field with show/hide reveal toggle */
.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 44px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.password-toggle:hover { color: var(--text); background: var(--brand-soft); }
.password-toggle:focus-visible {
  outline: none;
  color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.password-toggle .material-symbols-outlined { font-size: 20px; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b5f70' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover {
  text-decoration: none;
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  box-shadow: var(--shadow-brand);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn.secondary {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--line);
}
.btn.secondary:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-strong);
  box-shadow: none;
}

.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #dc2626; border-color: #dc2626; }

.btn.small { padding: 7px 12px; font-size: 12px; border-radius: 8px; }

.button-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

body.ldm-merchant input,
body.ldm-merchant select,
body.ldm-merchant textarea {
  border: 1px solid rgba(195, 198, 214, .45);
  border-radius: 12px;
  background: #fff;
}

body.ldm-merchant .btn {
  border-radius: 999px;
}

body.ldm-merchant .btn.secondary {
  border-color: rgba(195, 198, 214, .45);
  background: #fff;
}

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

body.ldm-merchant .table-wrap {
  border: 1px solid rgba(195, 198, 214, .3);
  border-radius: 20px;
  background: #fff;
}
table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
thead th {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--low);
  border-bottom: 1px solid var(--line);
}
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--low); }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; }

/* ── Status pills ──────────────────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid var(--high);
  background: var(--low);
  color: var(--muted);
}
.status-pill.low {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: #b42318;
}
.status-pill.good {
  background: var(--ok-soft);
  border-color: var(--ok-line);
  color: #067647;
}

/* ── Form grids ────────────────────────────────────────────────────────── */
.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid-form .full { grid-column: 1 / -1; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.meta-grid .item {
  background: var(--low);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.meta-grid .item .k {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.meta-grid .item .v { display: block; margin-top: 6px; font-weight: 700; font-size: 15px; }

/* ── Feedback ──────────────────────────────────────────────────────────── */
.feedback {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ok-line);
  background: var(--ok-soft);
  color: #067647;
  font-weight: 600;
  font-size: 13px;
}
.feedback.error {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: #b42318;
}

.activity-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.activity-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text);
  display: flex;
  gap: 10px;
}
.activity-list li::before {
  content: "";
  flex-shrink: 0;
  margin-top: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
}
.activity-list li:last-child { border-bottom: 0; }

/* ── Auth pages ────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.auth-aside {
  position: relative;
  overflow: hidden;
  padding: 56px 52px;
  color: #eaf0ff;
  background: linear-gradient(150deg, var(--brand-strong) 0%, #0a1f52 60%, var(--brand-2) 140%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-aside::after {
  content: "";
  position: absolute; right: -120px; bottom: -140px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(70, 72, 212, .55), transparent 70%);
}
.auth-aside .brand { color: #fff; font-size: 24px; }
.auth-aside .brand small { color: #9fb4e6; }
.auth-aside h2 {
  font-size: 34px; font-weight: 800; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.02em;
  max-width: 15ch;
}
.auth-aside p { color: #c3d2f2; font-size: 15px; max-width: 34ch; margin: 0; }
.auth-aside .auth-points { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; position: relative; z-index: 1; }
.auth-aside .auth-points span { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; }
.auth-aside .auth-points .material-symbols-outlined {
  background: rgba(255, 255, 255, .14); border-radius: 9px; padding: 7px; font-size: 20px;
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.auth-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 8px; font-size: 26px; font-weight: 800; }
.auth-card > p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: grid;
  gap: 14px;
  margin: 0;
}
.auth-card legend {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  padding: 0 6px;
  color: var(--brand);
}
.auth-card .btn { width: 100%; padding: 13px; font-size: 15px; }
.auth-card .btn + .btn { margin-top: 10px; }
.helper-text { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.helper-text a { font-weight: 700; }
.verification-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid rgba(0, 61, 155, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(0, 82, 204, 0.06);
  padding: 14px;
  margin-bottom: 18px;
}
.verification-note .material-symbols-outlined {
  color: var(--brand);
  font-size: 24px;
}
.verification-note strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}
.verification-note small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ── Image gallery upload widget ───────────────────────────────────────── */
.image-gallery-section { display: flex; flex-direction: column; gap: 10px; }
.image-gallery-label { font-size: 13px; font-weight: 600; color: var(--text); }
.image-gallery-hint-inline { font-weight: 400; color: var(--muted); }
.image-grid { display: flex; flex-wrap: wrap; gap: 12px; }

.image-slot {
  width: 116px; height: 116px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--low);
}
.image-slot.filled img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-slot.empty {
  border-style: dashed;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; text-align: center; font-weight: 600;
}
.image-slot.empty:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.image-slot.uploading {
  border-style: dashed;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; text-align: center; opacity: .7; pointer-events: none;
}
.img-primary-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; pointer-events: none;
}
.img-delete-btn {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0, 0, 0, .5); color: #fff; border: none; cursor: pointer;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0;
}
.img-delete-btn:hover { background: var(--danger); }

/* ── Product video slot ────────────────────────────────────────────────── */
.video-slot {
  position: relative;
  max-width: 320px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--low);
}
.video-slot.filled video { width: 100%; display: block; background: #000; }
.video-slot.empty {
  border-style: dashed;
  cursor: pointer;
  min-height: 96px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; text-align: center; font-weight: 600;
}
.video-slot.empty:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.video-slot.uploading {
  border-style: dashed;
  min-height: 96px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; text-align: center; opacity: .7; pointer-events: none;
}

/* ── Store media upload widgets (logo + banner) ────────────────────────── */
.store-media-section { display: flex; flex-direction: column; gap: 10px; }
.store-media-label { font-size: 13px; font-weight: 600; color: var(--text); }
.store-media-row { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.store-media-field { display: flex; flex-direction: column; gap: 8px; }
.store-media-field--banner { flex: 1; min-width: 260px; }
.store-media-field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.store-media-hint { font-size: 12px; color: var(--muted); margin: 0; }

.store-logo-slot {
  width: 124px; height: 124px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  position: relative; overflow: hidden; flex-shrink: 0; background: var(--low); cursor: pointer;
}
.store-banner-slot {
  height: 132px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  position: relative; overflow: hidden; background: var(--low); cursor: pointer;
}
.store-logo-slot.empty, .store-banner-slot.empty {
  border-style: dashed;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; text-align: center; font-weight: 600;
}
.store-logo-slot.empty:hover, .store-banner-slot.empty:hover {
  border-color: var(--brand); color: var(--brand); background: var(--brand-soft);
}
.store-logo-slot.uploading, .store-banner-slot.uploading {
  border-style: dashed;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; opacity: .7; pointer-events: none;
}
.store-logo-slot.filled img, .store-banner-slot.filled img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.store-media-change-btn {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0, 0, 0, .55); color: #fff; border: none; border-radius: 6px;
  font-size: 11px; font-weight: 600; padding: 4px 10px; cursor: pointer; line-height: 1.5;
}
.store-media-change-btn:hover { background: var(--brand); }

/* ── Dashboard split (Recent Activity + Recent Orders) ─────────────────── */
.dashboard-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.dashboard-split > .card { margin: 0; min-width: 0; }

/* ── Dashboard product strip ───────────────────────────────────────────── */
.product-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}
.product-strip-empty { color: var(--muted); font-size: 13px; margin: 0; grid-column: 1 / -1; }

.product-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.product-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.product-card-actions { display: flex; gap: 8px; margin-top: 8px; }
.product-card-actions .btn { flex: 1; }
.product-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--low);
  display: flex; align-items: center; justify-content: center;
}
.product-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card-image-fallback { color: var(--muted); font-size: 12px; }
.product-card-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.35; min-height: 2.7em;
}
.product-card-price { font-size: 14px; font-weight: 700; color: var(--brand-strong); margin-top: 2px; }

/* ── KYC / Verification ────────────────────────────────────────────────── */
.kyc-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-left: 4px solid var(--brand);
}
.kyc-banner .material-symbols-outlined {
  font-size: 30px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 10px;
}
.kyc-banner h2 { margin: 0 0 4px; font-size: 17px; }
.kyc-banner p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.kyc-banner.is-pending { border-left-color: var(--gold); }
.kyc-banner.is-pending .material-symbols-outlined { color: var(--gold); background: #fff7ed; }
.kyc-banner.is-approved { border-left-color: var(--ok); }
.kyc-banner.is-approved .material-symbols-outlined { color: var(--ok); background: var(--ok-soft); }
.kyc-banner.is-rejected { border-left-color: var(--danger); }
.kyc-banner.is-rejected .material-symbols-outlined { color: var(--danger); background: var(--danger-soft); }

.kyc-help { color: var(--muted); font-size: 13px; margin: 0 0 18px; line-height: 1.5; }
.kyc-subhead {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
}
.kyc-upload-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 14px;
  align-items: end;
}
.kyc-upload-action { display: flex; align-items: flex-end; }
@media (max-width: 700px) {
  .kyc-upload-row { grid-template-columns: 1fr; }
}

/* ── Confirmation modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 15, 40, .55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 440px; width: 100%;
  box-shadow: 0 24px 70px rgba(10, 15, 40, .35);
}
.modal h3 { margin: 0 0 10px; font-size: 19px; font-weight: 800; }
.modal p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .dashboard-split { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(10, 15, 40, .5);
  }
  .page-header { padding-left: 16px; padding-right: 16px; }
  .nav-toggle { display: grid !important; }
  .grid-form { grid-template-columns: 1fr; }
  .page-header .header-search { display: none; }
  body.ldm-merchant .page-content > :not(.page-header) {
    padding-left: 16px;
    padding-right: 16px;
  }
  body.ldm-merchant .page-header {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Hamburger — hidden on desktop, shown on mobile via media query */
.nav-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer; place-items: center;
}
@media (max-width: 500px) {
  .grid-cards { grid-template-columns: 1fr; }
  .metric p { font-size: 28px; }
}

/* ── Messages (customer ↔ merchant chat) ─────────────────────────────────── */
.msg-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 16px;
  height: calc(100vh - 150px);
  min-height: 460px;
}
.msg-shell .card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

.msg-list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.msg-list-head h2 { margin: 0; font-size: 16px; }
.msg-refresh {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; padding: 4px; border-radius: 8px;
}
.msg-refresh:hover { background: var(--low); color: var(--brand); }

.msg-conv-list { overflow-y: auto; flex: 1; }
.msg-conv {
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent; font: inherit;
}
.msg-conv:hover { background: var(--low); }
.msg-conv.is-active { background: var(--brand-soft); border-left-color: var(--brand); }
.msg-conv-image-wrap { width: 52px; height: 52px; border-radius: 14px; overflow: hidden; background: var(--low); }
.msg-conv-image {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.msg-conv-image.is-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); background: var(--brand-soft); font-size: 24px;
}
.msg-conv-copy { min-width: 0; display: grid; gap: 4px; }
.msg-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-conv-name { font-weight: 800; font-size: 14px; color: var(--text); }
.msg-conv-time { font-size: 11px; color: var(--outline); flex-shrink: 0; }
.msg-conv-product { font-size: 12px; color: var(--brand); font-weight: 600; }
.msg-conv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-conv-preview {
  font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 100%;
}
.msg-conv-badge {
  flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.msg-thread { position: relative; }
.msg-thread-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--muted); text-align: center; padding: 24px;
}
.msg-thread-empty[hidden],
.msg-thread-active[hidden] {
  display: none !important;
}
.msg-thread-empty .material-symbols-outlined { font-size: 44px; color: var(--high); }
.msg-thread-active { flex: 1; display: flex; flex-direction: column; min-height: 0; height: 100%; }

.msg-thread-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.msg-back { display: none; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; }
.msg-thread-image {
  width: 44px; height: 44px; border-radius: 14px; overflow: hidden;
  flex-shrink: 0; background: var(--low);
}
.msg-thread-product-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-thread-product-img.is-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); background: var(--brand-soft); font-size: 22px;
}
.msg-thread-who strong { display: block; font-size: 15px; }
.msg-thread-who small { color: var(--muted); font-size: 12px; }

.msg-thread-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px;
  background: var(--low);
}
.msg-bubble {
  max-width: min(74%, 460px); padding: 9px 13px; border-radius: 14px; font-size: 14px;
  line-height: 1.45; display: flex; flex-direction: column; gap: 3px;
}
.msg-bubble-text { white-space: pre-wrap; word-break: break-word; }
.msg-bubble-time { font-size: 10.5px; opacity: .7; align-self: flex-end; }
.msg-bubble.is-them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.msg-bubble.is-mine { align-self: flex-end; background: var(--brand); color: #fff; }

.msg-composer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.msg-composer input {
  flex: 1; min-height: 44px; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0 16px; font: inherit; font-size: 14px; background: var(--surface); color: var(--text); outline: 0;
}
.msg-composer input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.msg-composer button {
  flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--brand); color: #fff; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
}
.msg-composer button:hover { background: var(--brand-strong); }
.msg-placeholder { padding: 24px 18px; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 820px) {
  .msg-shell { grid-template-columns: 1fr; height: calc(100vh - 130px); }
  .msg-shell .msg-thread { display: none; }
  .msg-shell.is-thread-open .msg-list { display: none; }
  .msg-shell.is-thread-open .msg-thread { display: flex; }
  .msg-back { display: inline-flex; }
}

/* ── Shipping: pickup addresses ─────────────────────────────────────────── */
.pickup-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.pickup-empty {
  display: grid;
  gap: 8px;
  justify-items: start;
  border: 1px dashed var(--line, #d8deeb);
  border-radius: 14px;
  padding: 18px;
  background: #f8faff;
}
.pickup-empty .material-symbols-outlined {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 82, 204, .1);
  color: var(--brand, #0052cc);
}
.pickup-empty p { margin: 0; max-width: 560px; }
.pickup-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  border: 1px solid var(--line, #e2e6f0); border-radius: 12px; padding: 14px 16px; background: #fff;
}
.pickup-card.is-default { border-color: var(--brand, #0052cc); box-shadow: 0 0 0 1px var(--brand, #0052cc) inset; }
.pickup-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.pickup-card__body p { margin: 2px 0; }
.pickup-card__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef1f8; color: #445; }
.badge.success { background: rgba(34,197,94,.14); color: #16a34a; }
.badge.warn { background: rgba(245,158,11,.16); color: #b45309; }
.btn.sm { padding: 6px 10px; font-size: 12px; }

.pickup-address-field { position: relative; }
.address-suggestions {
  list-style: none; margin: 8px 0 0; padding: 6px; position: static; width: 100%;
  background: #fff; border: 1px solid var(--line, #e2e6f0); border-radius: 12px; box-shadow: 0 18px 44px rgba(20,25,45,.16);
  max-height: 260px; overflow-y: auto;
}
.address-suggestions li { display: flex; flex-direction: column; gap: 1px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.address-suggestions li:hover { background: #f3f5fb; }
.address-suggestions li span { font-size: 12px; color: #6b7280; }
.address-suggestions__manual {
  border-top: 1px solid var(--line, #e2e6f0);
  margin-top: 4px;
  color: var(--brand, #0052cc);
}
.address-suggestions__manual em {
  font-size: 11px;
  font-style: normal;
  color: #6b7280;
}
