/* ==========================================================================
   ShopEarn Seller Dashboard — "The Ledger"
   A shop-ledger / bookkeeping visual identity.
   Palette:
     --paper   #F4EDE0  warm paper background
     --forest  #1F3A2E  deep forest green (primary brand)
     --gold    #C9962E  aged gold (accent / CTA)
     --rust    #B5502F  rust terracotta (warning / pending)
     --sage    #7C9081  muted sage (secondary text / borders)
     --ink     #241E17  near-black brown (body text)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Palette */
  --paper: #F4EDE0;
  --paper-raised: #FBF7EE;
  --paper-line: #E4D9C2;
  --forest: #1F3A2E;
  --forest-light: #2B4E3D;
  --forest-dark: #16281F;
  --gold: #C9962E;
  --gold-light: #E0B563;
  --gold-dark: #9C7420;
  --rust: #B5502F;
  --rust-light: #D97A55;
  --sage: #7C9081;
  --sage-light: #A9B9AC;
  --ink: #241E17;
  --ink-soft: #4A4136;

  /* Semantic */
  --bg: var(--paper);
  --surface: var(--paper-raised);
  --border: var(--paper-line);
  --text: var(--ink);
  --text-muted: var(--ink-soft);
  --text-on-forest: #EFE8D8;
  --danger: var(--rust);
  --success: var(--forest);

  /* Type */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* Layout */
  --sidebar-w: 248px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(36, 30, 23, 0.06), 0 2px 8px rgba(36, 30, 23, 0.05);
  --shadow-raised: 0 4px 16px rgba(36, 30, 23, 0.10), 0 2px 4px rgba(36, 30, 23, 0.08);
  --shadow-modal: 0 20px 60px rgba(22, 40, 31, 0.35), 0 4px 16px rgba(22, 40, 31, 0.2);

  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
}

/* Reduced motion: kill transitions/animations globally */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(36, 30, 23, 0.035) 1px, transparent 0),
    radial-gradient(ellipse at top left, rgba(201, 150, 46, 0.06), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(31, 58, 46, 0.05), transparent 55%);
  background-size: 22px 22px, 100% 100%, 100% 100%;
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

p { margin: 0; }

a { color: inherit; }

button {
  font-family: inherit;
}

::selection {
  background: var(--gold-light);
  color: var(--forest-dark);
}

.num,
.mono,
.stat-value,
.ledger-amount,
.price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.material-icons-round {
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

/* Safety net: anything toggled with a plain ".hidden" class collapses too */
.hidden {
  display: none !important;
}

/* ==========================================================================
   App shell
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* NOTE: index.html uses class="main-area" on the content wrapper (not "main") */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Auth overlay
   ========================================================================== */

#authOverlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: var(--forest-dark);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(233, 213, 158, 0.06) 1px, transparent 0);
  background-size: 24px 24px;
}

#authOverlay[hidden] {
  display: none;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--paper-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 36px 32px 32px;
  position: relative;
  border: 1px solid var(--paper-line);
  margin: 40px auto;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  border-radius: 0 0 3px 3px;
}

.auth-card {
  box-shadow: var(--shadow-modal), 0 0 0 1px rgba(201, 150, 46, 0.08);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* NOTE: index.html uses .auth-brand-icon / .auth-brand-name / .auth-brand-tagline
   (the original CSS only styled ".auth-brand .mark" / ".auth-brand .name",
   which don't exist in the HTML, so the brand header was unstyled). */
.auth-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--forest);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px !important;
}

.auth-brand-name {
  font-weight: 800;
  font-size: 18px;
  color: var(--forest);
}

.auth-brand-tagline {
  width: 100%;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.auth-tab.active {
  background: var(--forest);
  color: var(--text-on-forest);
}

.auth-tab:not(.active):hover {
  background: var(--paper-line);
}

.auth-view-title {
  font-size: 17px;
  margin-bottom: 18px;
  color: var(--forest);
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-switch-link {
  border: none;
  background: transparent;
  color: var(--gold-dark);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.image-preview {
  display: block;
  margin-top: 10px;
  width: 140px;
  height: 140px;
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg);
}

/* ==========================================================================
   Sidebar — the ledger spine
   ========================================================================== */

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--forest);
  color: var(--text-on-forest);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition-base);
}

#sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--gold) 0px,
    var(--gold) 2px,
    transparent 2px,
    transparent 11px
  );
  background-position: right 2px top 0;
  opacity: 0.85;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(233, 213, 158, 0.14);
}

/* NOTE: index.html uses .sidebar-brand-icon / .sidebar-brand-name
   (original CSS only styled ".sidebar-brand .mark" / ".sidebar-brand .name"). */
.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: var(--forest-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px !important;
}

.sidebar-brand-name {
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: 0.01em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 16px;
  border-radius: var(--radius-sm);
  color: rgba(239, 232, 216, 0.72);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-item .material-icons-round {
  font-size: 19px;
  opacity: 0.85;
}

.nav-item:hover {
  background: rgba(233, 213, 158, 0.08);
  color: var(--text-on-forest);
}

.nav-item.active {
  background: rgba(233, 213, 158, 0.1);
  color: var(--text-on-forest);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid var(--gold);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 20px;
  margin: 0 6px 6px;
  border-top: 1px solid rgba(233, 213, 158, 0.14);
  border-left: none;
  border-right: none;
  border-bottom: none;
  background: transparent;
  color: rgba(239, 232, 216, 0.72);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-logout:hover {
  background: rgba(233, 213, 158, 0.08);
  color: var(--text-on-forest);
}

/* ==========================================================================
   Pending verification overlay
   ========================================================================== */

.pending-card {
  text-align: center;
}

.pending-icon {
  width: 56px;
  height: 56px;
  margin: 4px auto 18px;
  border-radius: 50%;
  background: rgba(201, 150, 46, 0.14);
  color: var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pending-icon .material-icons-round {
  font-size: 28px;
}

.pending-text {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 10px;
}

.pending-subtext {
  font-size: 12px;
  color: var(--sage);
  margin-bottom: 22px;
}

/* ==========================================================================
   Order category filter chips
   ========================================================================== */

.order-categories-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.order-category-chip {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.order-category-chip:hover {
  border-color: var(--gold);
}

.order-category-chip.active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--text-on-forest);
}

/* ==========================================================================
   Order status badge (read-only — seller can track but not change status)
   ========================================================================== */

.order-status-badge {
  justify-self: end;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.03em;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.order-status-badge--pending {
  color: var(--rust);
  background: rgba(181, 80, 47, 0.1);
}

.order-status-badge--shipped {
  color: var(--gold-dark);
  background: rgba(201, 150, 46, 0.14);
}

.order-status-badge--delivered {
  color: var(--forest);
  background: rgba(31, 58, 46, 0.1);
}
.order-status-badge--confirmed { color: var(--gold-dark); background: rgba(201, 150, 46, 0.14); }
.order-status-badge--cancelled { color: var(--rust); background: rgba(181, 80, 47, 0.1); }

.btn-ship-item, .btn-deliver-item {
  background: var(--forest); color: var(--text-on-forest); border: 1px solid var(--forest);
  padding: 6px 12px; font-size: 12px;
}
.btn-ship-item:hover, .btn-deliver-item:hover { background: var(--forest-light); }
.btn-ship-item .material-icons-round, .btn-deliver-item .material-icons-round { font-size: 15px; }

/* Mobile scrim: hidden by default, shown by JS adding ".visible" (see media query below) */
.sidebar-scrim {
  display: none;
}

/* ==========================================================================
   Topbar
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--forest);
  flex: 1;
}

/* NOTE: index.html has no ".topbar-actions" element — it uses
   ".topbar-seller-info" to show the shop name + verified badge. */
.topbar-seller-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.shop-name-display {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.shop-uid-display {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sage);
  letter-spacing: 0.01em;
}

@media (max-width: 480px) {
  .shop-uid-display {
    display: none;
  }
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--forest);
  background: rgba(31, 58, 46, 0.08);
  border: 1px solid rgba(31, 58, 46, 0.18);
  padding: 4px 9px;
  border-radius: 20px;
}

.verified-badge .material-icons-round {
  font-size: 14px;
}

.topbar-seller-info { position: relative; }

.notif-bell-btn {
  position: relative; border: none; background: transparent; color: var(--ink-soft);
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast);
}
.notif-bell-btn:hover { background: var(--bg); color: var(--forest); }
.notif-bell-badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--rust); color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--paper-raised);
}
.notif-dropdown {
  position: absolute; top: 46px; right: 0; width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal); z-index: 260; animation: modal-pop 0.18s ease;
}
.notif-dropdown-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-dropdown-header h4 { font-size: 14px; font-weight: 800; color: var(--forest); }
.notif-dropdown-list { padding: 6px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition-fast); }
.notif-item:hover { background: var(--bg); }
.notif-item.is-unread { background: rgba(201, 150, 46, 0.08); }
.notif-item-icon { color: var(--gold-dark); font-size: 19px; flex-shrink: 0; margin-top: 2px; }
.notif-item-body strong { font-size: 12.5px; display: block; margin-bottom: 2px; }
.notif-item-body p { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.notif-item-body small { font-size: 10.5px; color: var(--sage); font-family: var(--font-mono); }
.notif-empty { padding: 30px 16px; text-align: center; font-size: 12.5px; color: var(--text-muted); }

.btn-primary-sm-tab { background: var(--surface); color: var(--ink-soft); border: 1.5px solid var(--border); padding: 9px 16px; font-size: 13px; font-weight: 700; border-radius: var(--radius-sm); cursor: pointer; }
.btn-primary-sm-tab.active { background: var(--forest); color: var(--text-on-forest); border-color: var(--forest); }

.star-filled { color: var(--gold); }
.star-empty { color: var(--paper-line); }

.seller-reviews-list, .seller-questions-list { display: flex; flex-direction: column; gap: 14px; }
.seller-review-card, .seller-question-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: 16px 18px; transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.seller-review-card:hover, .seller-question-card:hover { box-shadow: var(--shadow-raised); transform: translateY(-2px); }
.seller-review-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.seller-review-product, .seller-question-product { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.seller-review-product img, .seller-question-product img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.seller-review-body strong, .seller-question-body strong { font-size: 13px; color: var(--ink); display: block; margin-bottom: 4px; }
.seller-review-body p, .seller-question-body p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.seller-review-date { margin-top: 8px; font-size: 11px; color: var(--sage); font-family: var(--font-mono); }
.review-photos-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.review-photo { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; transition: transform var(--transition-fast); }
.review-photo:hover { transform: scale(1.06); }
.seller-question-body { margin: 8px 0 12px; }
.seller-answer-block { background: rgba(31, 58, 46, 0.06); border-radius: var(--radius-sm); padding: 10px 12px; }
.seller-answer-tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--forest); letter-spacing: 0.04em; }
.seller-answer-form { display: flex; flex-direction: column; gap: 8px; }
.seller-answer-form textarea { width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-family: var(--font-ui); font-size: 13px; resize: vertical; }
.seller-question-card.is-pending { border-left: 3px solid var(--rust); }
.seller-question-card.is-answered { border-left: 3px solid var(--forest); }

/* Hamburger menu button (index.html uses class="menu-toggle", not "sidebar-toggle") */
.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-toggle:hover {
  background: var(--paper-line);
}

/* ==========================================================================
   Page content
   ========================================================================== */

.content {
  padding: 24px 28px 60px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.section-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* ==========================================================================
   Stat cards
   (index.html uses class="stat-cards", not "stat-grid")
   ========================================================================== */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.stat-card .stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--bg);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sage);
  margin-bottom: 8px;
  padding-right: 36px;
  order: 2;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  order: 1;
}

/* ==========================================================================
   Panels
   ========================================================================== */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

/* index.html panel headers use <h3>, not <h2> */
.panel-header h2,
.panel-header h3 {
  font-size: 15.5px;
  font-weight: 700;
}

/* Recent orders (dashboard) + payout history (earnings) lists */
.recent-orders-list,
.payout-history-list {
  padding: 4px 0;
}

.payout-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}

.payout-row:last-child {
  border-bottom: none;
}

.payout-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink);
}

.payout-date {
  color: var(--text-muted);
  font-size: 12.5px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.payout-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  justify-self: end;
}

.payout-status--requested,
.payout-status--processing {
  color: var(--rust);
  background: rgba(181, 80, 47, 0.1);
}

.payout-status--paid {
  color: var(--forest);
  background: rgba(31, 58, 46, 0.1);
}

/* ==========================================================================
   Product grid
   (JS renders .product-card-image / .product-card-body / .product-card-name /
   .product-card-category / .product-card-price / .product-card-stock)
   ========================================================================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  cursor: pointer;
}

.product-card:hover {
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.product-card-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--bg);
  object-fit: cover;
  display: block;
}

.product-card-image--placeholder {
  background: linear-gradient(135deg, var(--paper-line), var(--bg));
}

.product-card-body {
  padding: 12px 14px 14px;
}

.product-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-category {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.product-card-price {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--forest);
}

.product-card-stock {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.product-card-stock--low {
  color: var(--rust);
  font-weight: 600;
}

/* ==========================================================================
   Orders list
   (JS renders .order-card > .order-card-header + .order-items > .order-item)
   ========================================================================== */

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}

.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.order-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.order-date {
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-mono);
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
}

.order-item-details {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
}

.order-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.order-item-qty {
  font-size: 12.5px;
  color: var(--text-muted);
}

.order-item-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--forest);
}

.order-item-status {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 26px 6px 10px;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--sage) 50%),
                     linear-gradient(135deg, var(--sage) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color var(--transition-fast);
}

.order-item-status:hover {
  border-color: var(--sage);
}

.order-item-actions {
  display: flex;
  gap: 8px;
  justify-self: end;
  flex-wrap: wrap;
}

.btn-print-confirm-item {
  background: var(--forest);
  color: var(--text-on-forest);
  border: 1px solid var(--forest);
  padding: 6px 12px;
  font-size: 12px;
}
.btn-print-confirm-item:hover {
  background: var(--forest-light);
}

.btn-cancel-item {
  background: rgba(181, 80, 47, 0.08);
  color: var(--rust);
  border: 1px solid rgba(181, 80, 47, 0.25);
  padding: 6px 12px;
  font-size: 12px;
}
.btn-cancel-item:hover {
  background: rgba(181, 80, 47, 0.16);
}

.btn-print-confirm-item .material-icons-round,
.btn-cancel-item .material-icons-round {
  font-size: 15px;
}

/* ===== Cancel Order Modal — premium styling ===== */
.cancel-modal-overlay {
  background: rgba(22, 40, 31, 0.55);
  backdrop-filter: blur(3px);
}

.cancel-modal-card {
  max-width: 440px;
  border: 1px solid var(--paper-line);
  animation: cancel-modal-pop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cancel-modal-pop {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cancel-modal-header {
  position: relative;
  text-align: center;
  padding: 28px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.cancel-modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(181, 80, 47, 0.12);
  color: var(--rust);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cancel-icon-pulse 1.8s ease-in-out infinite;
}

.cancel-modal-icon .material-icons-round {
  font-size: 26px;
}

@keyframes cancel-icon-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(181, 80, 47, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(181, 80, 47, 0); }
}

.cancel-modal-header h3 {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 6px;
}

.cancel-modal-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.cancel-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.cancel-modal-body {
  padding: 20px 26px 24px;
}

.cancel-reason-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cancel-reason-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.cancel-reason-option:hover {
  border-color: var(--sage);
  background: var(--bg);
}

.cancel-reason-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cancel-reason-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--sage-light);
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--transition-fast);
}

.cancel-reason-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--rust);
  transform: scale(0);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cancel-reason-option input:checked + .cancel-reason-radio {
  border-color: var(--rust);
}

.cancel-reason-option input:checked + .cancel-reason-radio::after {
  transform: scale(1);
}

.cancel-reason-option.is-checked {
  border-color: var(--rust);
  background: rgba(181, 80, 47, 0.05);
  transform: translateX(2px);
}

.cancel-reason-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.cancel-reason-other-wrap {
  margin-top: 12px;
  animation: reason-reveal 0.24s ease;
}

@keyframes reason-reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cancel-reason-other-wrap textarea {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  resize: vertical;
  min-height: 70px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.cancel-reason-other-wrap textarea:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(181, 80, 47, 0.15);
}

.cancel-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.cancel-modal-confirm-btn {
  background: var(--rust);
  color: #fff;
  border-color: var(--rust);
}

.cancel-modal-confirm-btn:hover:not(:disabled) {
  background: var(--rust-light);
  box-shadow: 0 4px 14px rgba(181, 80, 47, 0.35);
  transform: translateY(-1px);
}

.order-buyer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 0;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.order-buyer-info div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.order-buyer-info .material-icons-round {
  font-size: 15px;
  color: var(--sage);
}

.order-card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.recent-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px dashed var(--border);
}

.recent-order-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.recent-order-row:last-child {
  border-bottom: none;
}

.recent-order-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.recent-order-id {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.recent-order-buyer {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.recent-order-items {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

.recent-order-meta {
  flex-shrink: 0;
}

.recent-order-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 40, 31, 0.45);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--paper-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--paper-line);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2,
.modal-header h3 {
  font-size: 17px;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--ink);
}

/* index.html has no ".modal-body" wrapper — the form itself needs the padding */
.product-form {
  padding: 20px 22px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-row .form-group {
  flex: 1;
}

/* index.html uses .modal-actions / .modal-actions-right (original CSS had .modal-footer) */
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
}

.modal-actions-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* ==========================================================================
   Fields / forms
   (index.html uses class="form-group", not "field")
   ========================================================================== */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 150, 46, 0.22);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--sage-light);
}

.form-group input[readonly],
.form-group input[disabled] {
  background: var(--paper-line);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Auth form spacing */
.auth-form {
  display: flex;
  flex-direction: column;
}

.profile-form {
  padding: 20px 22px;
}

/* Inline error text (login/register/product forms) */
.form-error {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rust);
  background: rgba(181, 80, 47, 0.08);
  border: 1px solid rgba(181, 80, 47, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 14px;
}

.form-error[hidden] {
  display: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-block {
  width: 100%;
  margin-top: 4px;
}

/* Premium CTA for Create Account / Log in submit buttons */
#registerSubmitBtn,
#loginSubmitBtn {
  background: var(--forest);
  color: var(--text-on-forest);
  border: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(31, 58, 46, 0.25);
}

#registerSubmitBtn:hover,
#loginSubmitBtn:hover {
  background: var(--forest-light);
  box-shadow: 0 4px 14px rgba(31, 58, 46, 0.35);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--forest), var(--forest-light));
  color: var(--text-on-forest);
  border-color: var(--forest);
  background-size: 200% 200%;
  background-position: 0% 50%;
}

.btn-primary:hover {
  background-position: 100% 50%;
  box-shadow: 0 6px 20px rgba(31, 58, 46, 0.35), 0 0 0 3px rgba(201, 150, 46, 0.15);
  transform: translateY(-1px);
}

/* Ripple effect container for ALL buttons */
.btn {
  overflow: hidden;
  isolation: isolate;
}

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: btn-ripple-anim 0.6s ease-out;
  pointer-events: none;
  z-index: 0;
}

@keyframes btn-ripple-anim {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

.btn-secondary .btn-ripple,
.btn-ghost .btn-ripple,
.btn-danger .btn-ripple {
  background: rgba(31, 58, 46, 0.18);
}

.btn-secondary {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--sage);
}

.btn-gold {
  background: var(--gold);
  color: var(--forest-dark);
  border-color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold-light);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--sage);
}

.btn-danger {
  background: transparent;
  color: var(--rust);
  border-color: var(--rust);
}

.btn-danger:hover {
  background: rgba(181, 80, 47, 0.08);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn .material-icons-round {
  font-size: 17px;
}

/* ==========================================================================
   Toast
   (index.html's #toast has no wrapping ".toast-stack" — position it directly)
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(10px);
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--forest);
  color: var(--text-on-forest);
  font-size: 13px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
  border-left: 3px solid var(--gold);
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   Empty states
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.empty-state[hidden] {
  display: none;
}

/* ==========================================================================
   Store Decor — theme picker
   ========================================================================== */

.muted-note {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px;
}

.theme-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  background: var(--bg);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  position: relative;
}

.theme-card:hover {
  border-color: var(--sage);
  transform: translateY(-2px);
}

.theme-card--active {
  border-color: var(--gold);
  background: rgba(201, 150, 46, 0.06);
}

.theme-card-swatches {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.theme-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
}

.theme-card-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.theme-card-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.theme-card-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-dark);
}

.theme-card-badge .material-icons-round {
  font-size: 15px;
}

.banner-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 16px 20px;
}

.banner-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 7;
}

.banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(36, 30, 23, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.banner-remove-btn:hover {
  background: var(--rust);
}

.banner-remove-btn .material-icons-round {
  font-size: 16px;
}

/* ==========================================================================
   Store Preview
   ========================================================================== */

.store-preview-frame {
  margin: 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.preview-store-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 800;
}

.preview-banner-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 20px 16px;
}

.preview-banner-img {
  height: 130px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}

.preview-banner-placeholder {
  margin: 0 20px 16px;
  padding: 30px;
  text-align: center;
  font-size: 13px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted);
}

.preview-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  padding: 0 20px 24px;
}

.preview-product-card {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
}

.preview-product-card img,
.preview-product-placeholder {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
  background: rgba(0,0,0,0.06);
}

.preview-product-name {
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 8px 2px;
}

.preview-product-price {
  font-size: 13px;
  font-weight: 800;
  padding: 0 8px 10px;
}

.theme-classic {
  background: #F4EDE0;
  color: #241E17;
}
.theme-classic .preview-store-header {
  background: #1F3A2E;
  color: #EFE8D8;
}
.theme-classic .preview-product-card {
  background: #FBF7EE;
}
.theme-classic .preview-product-price {
  color: #1F3A2E;
}

.theme-vibrant {
  background: #FFF7F0;
  color: #241E17;
}
.theme-vibrant .preview-store-header {
  background: linear-gradient(135deg, #FF6B35, #EC4899, #7C3AED);
  color: #fff;
}
.theme-vibrant .preview-product-card {
  background: #fff;
  border-color: rgba(236, 73, 153, 0.25);
}
.theme-vibrant .preview-product-price {
  color: #EC4899;
}

.theme-mono {
  background: #FFFFFF;
  color: #111111;
}
.theme-mono .preview-store-header {
  background: #111111;
  color: #FFFFFF;
}
.theme-mono .preview-product-card {
  background: #FAFAFA;
  border-color: #E5E5E5;
}
.theme-mono .preview-product-price {
  color: #111111;
}

/* ==========================================================================
   Page section visibility (toggled by JS nav)
   ========================================================================== */

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-flex;
  }

  #sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-modal);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  /* JS adds/removes the ".visible" class on #sidebarScrim */
  .sidebar-scrim.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(22, 40, 31, 0.5);
    z-index: 150;
  }

  .main-area {
    margin-left: 0;
  }

  .content {
    padding: 18px 16px 48px;
  }

  .topbar {
    padding: 14px 16px;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

  .order-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .order-item-details {
    grid-template-columns: 1fr;
    row-gap: 4px;
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .modal-card {
    max-width: 100%;
  }

  .payout-row {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
  }

  .payout-date {
    grid-column: 1 / -1;
    order: 3;
  }
}

/* ==========================================================================
   Polish pass — icons, checkboxes, spinners, breakdown, motion refinements
   ========================================================================== */

.input-icon-field {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-field .input-icon {
  position: absolute;
  left: 12px;
  font-size: 18px !important;
  color: var(--sage);
  pointer-events: none;
}

.input-icon-field input {
  padding-left: 38px !important;
}

.password-field input {
  padding-right: 42px !important;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  border: none;
  background: transparent;
  color: var(--sage);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.password-toggle-btn:hover {
  color: var(--forest);
  background: var(--paper-line);
}

.field-hint {
  display: block;
  font-size: 11.5px;
  color: var(--sage);
  margin-top: 5px;
}

.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px 0 16px;
  font-size: 12.5px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--forest);
  cursor: pointer;
}

.auth-inline-link {
  border: none;
  background: transparent;
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-fast);
}

.auth-inline-link:hover {
  color: var(--forest);
  text-decoration: underline;
}

/* Button loading spinner */
.btn {
  position: relative;
}

.btn-label {
  transition: opacity var(--transition-fast);
}

.btn-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

.btn-secondary .btn-spinner,
.btn-ghost .btn-spinner {
  border: 2px solid rgba(36, 30, 23, 0.15);
  border-top-color: var(--forest);
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* Earnings breakdown box */
.earning-breakdown {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--border);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-row--fee span:last-child {
  color: var(--rust);
  font-family: var(--font-mono);
  font-weight: 600;
}

.breakdown-row--total {
  background: rgba(31, 58, 46, 0.06);
  font-weight: 700;
  color: var(--forest);
}

.breakdown-row--total span:last-child {
  font-family: var(--font-mono);
  font-size: 14.5px;
}

/* Global motion & hover refinements */
.auth-card {
  animation: card-rise 0.35s ease;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-card {
  animation: modal-pop 0.22s cubic-bezier(0.2, 0.8, 0.3, 1.1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.page-section.active {
  animation: section-enter 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes section-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Stagger cards/panels inside the freshly-opened section */
.page-section.active .stat-card,
.page-section.active .panel,
.page-section.active .product-card,
.page-section.active .order-card,
.page-section.active .theme-card {
  animation: card-rise-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.page-section.active .stat-card:nth-child(1) { animation-delay: 0.03s; }
.page-section.active .stat-card:nth-child(2) { animation-delay: 0.08s; }
.page-section.active .stat-card:nth-child(3) { animation-delay: 0.13s; }
.page-section.active .stat-card:nth-child(4) { animation-delay: 0.18s; }

@keyframes card-rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn {
  transition: background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 14px rgba(31, 58, 46, 0.28);
}

.btn-gold:hover:not(:disabled) {
  box-shadow: 0 4px 14px rgba(201, 150, 46, 0.35);
}

.nav-item {
  transition: background var(--transition-fast), color var(--transition-fast), padding-left var(--transition-fast);
}

.nav-item:hover {
  padding-left: 20px;
}

.nav-item .material-icons-round {
  transition: transform var(--transition-fast);
}

.nav-item:hover .material-icons-round {
  transform: scale(1.12);
}

.stat-card {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-raised);
  transform: translateY(-3px);
}

.stat-card:hover .stat-icon {
  background: var(--gold);
  color: var(--forest-dark);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.product-card-image {
  transition: transform 0.35s ease;
}

.product-card:hover .product-card-image {
  transform: scale(1.05);
}

.theme-card,
.order-category-chip,
.banner-item,
.recent-order-row,
.payout-row {
  transition: all var(--transition-fast);
}

.recent-order-row:hover,
.payout-row:hover {
  background: var(--bg);
}

.banner-item:hover img {
  transform: scale(1.04);
}

.banner-item img {
  transition: transform var(--transition-base);
}

.toast {
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.toast.show {
  animation: toast-bounce 0.3s ease;
}

@keyframes toast-bounce {
  0% { transform: translateX(-50%) translateY(14px); opacity: 0; }
  60% { transform: translateX(-50%) translateY(-3px); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.verified-badge {
  animation: badge-glow 2.4s ease-in-out infinite;
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(201, 150, 46, 0); }
  50% { box-shadow: 0 0 0 4px rgba(201, 150, 46, 0.12); }
}

html {
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--sage-light);
  border-radius: 6px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--sage);
}
/* Design step lock note */
.muted-note[id="designLockNote"] {
  color: var(--rust);
  font-weight: 600;
}

/* Design grid */
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px;
}

.design-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  background: var(--bg);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  position: relative;
}
.design-card:hover { border-color: var(--sage); transform: translateY(-2px); }
.design-card--active { border-color: var(--gold); background: rgba(201, 150, 46, 0.06); }
.design-card--locked { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.design-preview {
  position: relative;
  height: 92px;
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}
.design-preview .dp-cover {
  position: absolute;
  inset: 0 0 auto 0;
  height: 60%;
  background: linear-gradient(135deg, var(--forest), var(--gold));
}
.design-preview .dp-logo {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #fff;
}
.design-preview .dp-slots {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
}
.design-preview .dp-slots i {
  flex: 1;
  height: 20px;
  background: var(--paper-line);
  border-radius: 3px;
  display: block;
  font-style: normal;
}
.design-preview--aurora .dp-logo { bottom: 30%; left: 10px; }
.design-preview--boulevard .dp-cover { height: 68%; }
.design-preview--boulevard .dp-logo { top: 8px; left: 50%; transform: translateX(-50%); }
.design-preview--atelier .dp-cover { height: 34%; }
.design-preview--atelier .dp-logo { top: 6px; left: 10px; }

.design-card-name { font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.design-card-desc { font-size: 12px; color: var(--text-muted); }

/* Logo / cover upload */
.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.logo-upload-box {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px dashed var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.logo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-plus-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--paper-raised);
  background: var(--forest);
  color: var(--text-on-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.upload-plus-btn:hover { background: var(--forest-light); }
.upload-plus-btn .material-icons-round { font-size: 16px; }

.cover-upload-box {
  position: relative;
  margin: 20px;
  height: 260px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 2px dashed var(--border);
  overflow: hidden;
}

@media (max-width: 640px) {
  .cover-upload-box {
    height: 180px;
  }
}
.cover-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-plus-btn--cover {
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
}

/* Featured product slots */
.featured-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  padding: 20px;
}
.featured-slot {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.featured-slot--filled {
  border-style: solid;
  border-color: var(--border);
  background: var(--surface);
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
}
.featured-slot-empty {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--paper-line);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.featured-slot-empty:hover { background: var(--gold); color: var(--forest-dark); }
.featured-slot-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.featured-slot-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.featured-slot-price {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--forest);
}
.featured-slot-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(36, 30, 23, 0.7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.featured-slot-remove-btn .material-icons-round { font-size: 14px; }

/* Featured picker modal list */
.featured-picker-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.featured-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.featured-picker-item:hover { border-color: var(--gold); background: var(--bg); }
.featured-picker-item--disabled { opacity: 0.45; cursor: not-allowed; }
.featured-picker-item-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg);
}
.featured-picker-item-info { flex: 1; min-width: 0; }
.featured-picker-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.featured-picker-item-meta { font-size: 11.5px; color: var(--text-muted); }
.featured-picker-item-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold-dark);
  white-space: nowrap;
  /* Multi-image product preview grid */
.product-image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.product-image-preview-item {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}
.product-image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-image-preview-item .remove-image-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(36, 30, 23, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.product-image-preview-item .remove-image-btn .material-icons-round { font-size: 13px; }
.product-image-preview-item .primary-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(31, 58, 46, 0.85);
  color: var(--text-on-forest);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
  letter-spacing: 0.03em;
}
.video-preview {
  display: block;
  margin-top: 10px;
  width: 100%;
  max-width: 280px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #000;
}
}
/* ===== Extra small screens ===== */
@media (max-width: 480px) {
  .form-group input, .form-group select, .form-group textarea { font-size: 16px; } /* stops iOS auto-zoom */
  .password-toggle-btn, .modal-close, .notif-bell-btn, .menu-toggle { width: 44px; height: 44px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-card { max-width: 100%; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 94vh; }
  .auth-card { padding: 26px 18px 22px; margin: 16px auto; }
  .shop-name-display { display: none; }
  .topbar-title { font-size: 17px; }
  .content { padding: 14px 12px 100px; }
  .modal-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .modal-actions-right { flex-direction: column-reverse; width: 100%; margin-left: 0; gap: 8px; }
  .modal-actions-right .btn, #productDeleteBtn { width: 100%; }
  .stat-cards { grid-template-columns: 1fr; }
}
body { padding-bottom: env(safe-area-inset-bottom); }
/* ===== Help Center chat ===== */
.help-chat-panel { display: flex; flex-direction: column; height: 65vh; min-height: 420px; }
.help-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px;
  background: repeating-linear-gradient(45deg, rgba(31,58,46,0.015) 0 2px, transparent 2px 40px), var(--bg);
}
.help-chat-bubble-row { display: flex; }
.help-chat-bubble-row.is-mine { justify-content: flex-end; }
.help-chat-bubble-row.is-theirs { justify-content: flex-start; }
.help-chat-bubble { max-width: 78%; padding: 9px 13px 7px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--shadow-card); }
.help-chat-bubble-row.is-mine .help-chat-bubble { background: var(--forest); color: var(--text-on-forest); border-bottom-right-radius: 3px; }
.help-chat-bubble-row.is-theirs .help-chat-bubble { background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.help-chat-time { display: block; margin-top: 4px; font-size: 10px; opacity: 0.65; font-family: var(--font-mono); }
.help-chat-input-row { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.help-chat-input-row input { flex: 1; border: 1.5px solid var(--border); border-radius: 24px; padding: 10px 16px; font-size: 14px; font-family: var(--font-ui); }
.help-chat-input-row input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,150,46,0.2); }
.help-chat-send-btn { width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--forest); color: var(--text-on-forest); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.help-chat-send-btn:hover { background: var(--forest-light); }
.nav-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rust); margin-left: auto; }

/* ===== Footer quick-contact widget ===== */
.footer-contact-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 220; width: 54px; height: 54px; border-radius: 50%;
  border: none; background: var(--gold); color: var(--forest-dark); box-shadow: var(--shadow-raised);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.footer-contact-fab:hover { background: var(--gold-light); }
.footer-contact-panel {
  position: fixed; right: 20px; bottom: 84px; z-index: 220; width: 320px; max-width: calc(100vw - 40px);
  background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal); overflow: hidden;
}
.footer-contact-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--forest); color: var(--text-on-forest); font-weight: 700; font-size: 13.5px; }
.footer-contact-panel-header .modal-close { color: var(--text-on-forest); }
.footer-contact-form { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.footer-contact-form input, .footer-contact-form textarea { width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; font-family: var(--font-ui); font-size: 14px; resize: vertical; }
.footer-contact-form input:focus, .footer-contact-form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,150,46,0.2); }

@media (max-width: 480px) {
  .footer-contact-panel { right: 12px; left: 12px; width: auto; bottom: 78px; }
  .footer-contact-fab { right: 14px; bottom: 14px; }
  .help-chat-panel { height: 72vh; }
}