/* app Demo styles, converted from the owner's single-file Demo. */

:root {
  --demo-top: 0px;
  --bg: #fdf2f8;
  --bg-2: #fce7f3;
  --surface: #ffffff;
  --surface-2: #fffafc;
  --text: #1a0a14;
  --text-2: #4a2535;
  --muted: #9d6b82;
  --faint: #c9a5b6;
  --border: #fbcfe8;
  --border-2: #f9a8d4;
  --primary: #db2777;
  --primary-2: #ec4899;
  --primary-soft: #fce7f3;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --shadow-sm: 0 1px 2px rgba(26, 10, 20, 0.05);
  --shadow: 0 4px 14px rgba(26, 10, 20, 0.08);
  --shadow-lg: 0 18px 40px rgba(26, 10, 20, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --topbar-h: 60px;
  --sidebar-w: 264px;
  --font: system-ui, 'Segoe UI', Tahoma, sans-serif;
}
html[data-theme='dark'] {
  --bg: #1a0a14;
  --bg-2: #2a1421;
  --surface: #26101e;
  --surface-2: #321628;
  --text: #fce7f3;
  --text-2: #f9a8d4;
  --muted: #d68ba8;
  --faint: #a76684;
  --border: #4a2038;
  --border-2: #6d3050;
  --primary: #f472b6;
  --primary-2: #f9a8d4;
  --primary-soft: #4a1438;
  --accent: #fbbf24;
  --accent-soft: #3b2a06;
  --success: #4ade80;
  --success-soft: #052e1a;
  --warn: #fbbf24;
  --warn-soft: #3b2a06;
  --danger: #f87171;
  --danger-soft: #3b0e0e;
  --info: #60a5fa;
  --info-soft: #0c1e3d;
  --purple: #a78bfa;
  --purple-soft: #1e1b4b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.6);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  padding-top: var(--demo-top, 0px);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 8px;
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: linear-gradient(160deg, var(--primary) 0%, #be185d 55%, #9d174d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.45s,
    visibility 0.45s;
}
html[data-theme='dark'] .splash {
  background: linear-gradient(160deg, #4a1438 0%, #2a0a20 60%, #1a0614 100%);
}
.splash.hide {
  opacity: 0;
  visibility: hidden;
}
.splash-inner {
  text-align: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: splashIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes splashIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.splash-logo {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: blur(6px);
}
.splash-brandname {
  filter: blur(7px);
  font-weight: 800;
  font-size: 20px;
}
.splash-generic {
  font-size: 12px;
  opacity: 0.85;
  margin-top: -8px;
}
.splash-title {
  font-size: 19px;
  font-weight: 700;
  margin-top: 4px;
}
.splash-credit {
  font-size: 10.5px;
  letter-spacing: 3px;
  font-weight: 300;
  opacity: 0.75;
  margin-top: 24px;
}
.splash-credit span {
  animation: glow 2.6s ease-in-out infinite;
}
@keyframes glow {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
html.mobile-layout .app-shell {
  grid-template-columns: 1fr;
}
.sidebar {
  background: var(--surface);
  border-inline-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--demo-top, 0px);
  height: calc(100dvh - var(--demo-top, 0px));
  overflow-y: auto;
}
html.mobile-layout .sidebar {
  display: none;
}
.side-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  filter: blur(5px);
}
.brand-txt {
  min-width: 0;
}
.brand-name {
  font-weight: 800;
  font-size: 14px;
  filter: blur(6px);
  white-space: nowrap;
  overflow: hidden;
}
.brand-sub {
  font-size: 10.5px;
  color: var(--muted);
}
.lock-mini {
  margin-inline-start: auto;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  color: var(--muted);
  flex-shrink: 0;
  cursor: help;
}
.lock-mini:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.side-nav {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.15s,
    color 0.15s;
  text-align: start;
  width: 100%;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-2);
}
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}
html[data-theme='dark'] .nav-item.active {
  color: var(--primary-2);
}
.nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.nav-badge {
  margin-inline-start: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 6px;
}
.side-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}
.view-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
  justify-content: center;
}
html[data-theme='dark'] .view-btn {
  color: var(--primary-2);
}
.view-btn svg {
  width: 16px;
  height: 16px;
}
.credit {
  font-size: 10px;
  letter-spacing: 2.6px;
  font-weight: 300;
  color: var(--faint);
  text-align: center;
  margin-top: 8px;
}

/* Main */
.main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: var(--demo-top, 0px);
  z-index: 60;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}
.topbar-title {
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-title .t-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-title .t-ic svg {
  width: 17px;
  height: 17px;
}
.spacer {
  flex: 1;
}
html.mobile-layout {
  --topbar-h: 84px;
}
html.mobile-layout .badge-demo {
  margin-inline-start: auto;
  order: 10;
}
html.mobile-layout .spacer {
  display: none;
}
html.mobile-layout .topbar {
  padding-inline: 10px;
  gap: 2px 6px;
  align-content: center;
  flex-wrap: wrap;
}
html.mobile-layout .topbar-title {
  overflow: hidden;
  flex: 1 1 auto;
}
html.mobile-layout .topbar-title .t-txt {
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  line-height: 1.3;
  overflow: hidden;
}
.badge-demo {
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}
.view-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.view-chip.store {
  background: #dcfce7;
  color: #16a34a;
}
.view-chip.seller {
  background: var(--primary-soft);
  color: var(--primary);
}
html[data-theme='dark'] .view-chip.seller {
  color: var(--primary-2);
}
.view-chip .v-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  position: relative;
  transition: background 0.15s;
}
.icon-btn:hover {
  background: var(--bg-2);
}
.icon-btn svg {
  width: 19px;
  height: 19px;
}
.dot-badge {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-badge {
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.content {
  padding: 18px;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
html.mobile-layout .content {
  padding: 14px 14px 96px;
}

/* Bottom nav */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: center;
}
html.mobile-layout .bottom-nav {
  display: flex;
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  min-height: 48px;
  justify-content: center;
  position: relative;
}
.bn-item svg {
  width: 21px;
  height: 21px;
}
.bn-item.active {
  color: var(--primary);
}
html[data-theme='dark'] .bn-item.active {
  color: var(--primary-2);
}
.bn-ic-wrap {
  padding: 3px 10px;
  border-radius: 10px;
  display: flex;
}
.bn-item.active .bn-ic-wrap {
  background: var(--primary-soft);
}
.fab {
  display: none;
  position: fixed;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  inset-inline-end: 16px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--shadow-lg);
  z-index: 71;
  align-items: center;
  justify-content: center;
}
html.mobile-layout .fab {
  display: flex;
}
.fab svg {
  width: 24px;
  height: 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13.5px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition:
    transform 0.1s,
    background 0.15s;
  min-height: 42px;
}
.btn:hover {
  background: var(--bg-2);
}
.btn:active {
  transform: scale(0.975);
}
.btn svg {
  width: 17px;
  height: 17px;
}
.btn-primary {
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn-primary:hover {
  filter: brightness(1.06);
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.btn-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  min-height: 36px;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 14.5px;
  font-weight: 800;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.grid {
  display: grid;
  gap: 14px;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
html.mobile-layout .grid-2,
html.mobile-layout .grid-3,
html.mobile-layout .grid-4 {
  grid-template-columns: 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
  min-height: 42px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.field input.err {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.field-err {
  font-size: 11.5px;
  color: var(--danger);
  font-weight: 600;
  min-height: 14px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 21px;
  font-weight: 800;
  margin: 0;
}
.page-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 0;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.kpi .k-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 9px;
}
html[data-theme='dark'] .kpi .k-ic {
  color: var(--primary-2);
}
.kpi .k-ic svg {
  width: 17px;
  height: 17px;
}
.kpi .k-lbl {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.kpi .k-val {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}
.kpi .k-sub {
  font-size: 11px;
  color: var(--faint);
  margin-top: 3px;
  font-weight: 600;
}
.kpi.green .k-ic {
  background: var(--success-soft);
  color: var(--success);
}
.kpi.amber .k-ic {
  background: var(--warn-soft);
  color: var(--warn);
}
.kpi.red .k-ic {
  background: var(--danger-soft);
  color: var(--danger);
}
.kpi.purple .k-ic {
  background: var(--purple-soft);
  color: var(--purple);
}

/* Store hero */
.store-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  color: #fff;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.store-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  inset-inline-end: -15%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.store-hero::after {
  content: '';
  position: absolute;
  bottom: -50%;
  inset-inline-start: -10%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}
.store-hero .sh-inner {
  position: relative;
  z-index: 1;
}
.store-hero .sh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.store-hero .sh-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: blur(5px);
}
.store-hero .sh-brandname {
  font-weight: 800;
  font-size: 16px;
  filter: blur(6px);
}
.store-hero .sh-tag {
  font-size: 11.5px;
  opacity: 0.8;
}
.store-hero h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.4px;
}
.store-hero p {
  margin: 0 0 14px;
  font-size: 13.5px;
  opacity: 0.9;
  max-width: 420px;
  line-height: 1.6;
}

/* Search */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.search-wrap svg {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}
.search-wrap input {
  padding-inline-start: 36px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
  min-height: 42px;
}
.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.toolbar {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
  transition: all 0.15s;
}
.chip:hover {
  background: var(--bg-2);
}
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

/* Categories */
.cats-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin-bottom: 6px;
}
.cat-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  min-width: 80px;
  cursor: pointer;
}
.cat-btn .cat-ic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: all 0.2s;
}
.cat-btn.active .cat-ic {
  background: var(--primary-soft);
  border-color: var(--primary);
  transform: scale(1.05);
}
.cat-btn .cat-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
  white-space: nowrap;
}
.cat-btn.active .cat-lbl {
  color: var(--primary);
}

/* Product cards */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .prod-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 400px) {
  .prod-grid {
    grid-template-columns: 1fr;
  }
}
html.mobile-layout .prod-grid {
  grid-template-columns: repeat(2, 1fr);
}
.prod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.2s,
    border-color 0.2s;
  text-align: start;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.prod-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-2);
}
.prod-img {
  aspect-ratio: 1;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px;
  position: relative;
}
.prod-img svg {
  width: 100%;
  height: 100%;
  max-width: 140px;
}
.prod-img .sold-out-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.prod-img .discount-tag {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.prod-info {
  padding: 11px 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prod-info .p-name {
  font-weight: 700;
  font-size: 13.5px;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.prod-info .p-cat {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.prod-info .p-price-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}
.prod-info .p-price {
  font-weight: 900;
  font-size: 15.5px;
  color: var(--primary);
}
html[data-theme='dark'] .prod-info .p-price {
  color: var(--primary-2);
}
.prod-info .p-old {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 700;
}
.prod-info .p-colors {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}
.prod-info .p-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
}
.prod-info .p-low {
  font-size: 10.5px;
  color: var(--warn);
  font-weight: 700;
}

/* Product detail */
.prod-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) {
  .prod-detail {
    grid-template-columns: 1fr;
  }
}
.detail-gallery {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  max-height: 500px;
}
.detail-gallery svg {
  width: 100%;
  height: 100%;
  max-width: 320px;
}
.detail-info h1 {
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 6px;
}
.detail-info .di-cat {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
.detail-info .di-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.detail-info .di-price {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
}
html[data-theme='dark'] .detail-info .di-price {
  color: var(--primary-2);
}
.detail-info .di-old {
  font-size: 17px;
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 700;
}
.detail-info .di-disc {
  font-size: 12.5px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
}
.detail-info .di-label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-2);
  margin: 16px 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.size-btn {
  min-width: 48px;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 800;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: 13.5px;
}
.size-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.size-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.size-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}
.color-btn {
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
}
.color-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
html[data-theme='dark'] .color-btn.active {
  color: var(--primary-2);
}
.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text-2);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.qty-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.qty-ctrl .qty-val {
  min-width: 36px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
}
.di-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.di-actions .btn {
  flex: 1;
  min-width: 140px;
}

.size-guide-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.size-guide-tbl th,
.size-guide-tbl td {
  padding: 9px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.size-guide-tbl th {
  background: var(--bg-2);
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
}

/* Cart */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
}
.cart-row {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-row:last-child {
  border-bottom: none;
}
.cart-thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 6px;
}
.cart-thumb svg {
  width: 100%;
  height: 100%;
}
.cart-body {
  flex: 1;
  min-width: 0;
}
.cart-body .cb-name {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 3px;
}
.cart-body .cb-meta {
  font-size: 11.5px;
  color: var(--muted);
}
.cart-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.cart-right .cr-price {
  font-weight: 800;
  font-size: 14px;
  color: var(--primary);
}
html[data-theme='dark'] .cart-right .cr-price {
  color: var(--primary-2);
}
.cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: calc(var(--topbar-h) + var(--demo-top, 0px) + 12px);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13.5px;
  color: var(--text-2);
}
.summary-row.disc {
  color: var(--danger);
}
.summary-row.total {
  padding-top: 12px;
  margin-top: 6px;
  border-top: 2px solid var(--border);
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
}
.free-ship-bar {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}
html[data-theme='dark'] .free-ship-bar {
  color: var(--accent);
}
.free-ship-bar.done {
  background: var(--success-soft);
  color: var(--success);
}
.coupon-row {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}
.coupon-row input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  outline: none;
  font-size: 13px;
  text-transform: uppercase;
}
.coupon-row input:focus {
  border-color: var(--primary);
}
.coupon-ok {
  background: var(--success-soft);
  color: var(--success);
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* WhatsApp bubble */
.wa-bubble {
  background: #dcf8c6;
  color: #111827;
  padding: 14px 16px;
  border-radius: 16px 16px 4px 16px;
  font-size: 13px;
  line-height: 1.8;
  max-width: 95%;
  margin: 8px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: pre-wrap;
  font-family: inherit;
}
html[data-theme='dark'] .wa-bubble {
  background: #075e54;
  color: #e9edef;
}
.wa-container {
  background: #e5ddd5;
  padding: 20px;
  border-radius: 12px;
  max-height: 400px;
  overflow-y: auto;
  position: relative;
}
html[data-theme='dark'] .wa-container {
  background: #0b141a;
}
.wa-time {
  font-size: 10px;
  color: #667781;
  text-align: end;
  margin-top: 4px;
}
html[data-theme='dark'] .wa-time {
  color: #8696a0;
}

/* Status timeline */
.status-tl {
  position: relative;
  padding-inline-start: 28px;
  margin-top: 8px;
}
.status-tl::before {
  content: '';
  position: absolute;
  inset-inline-start: 10px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--border);
}
.status-step {
  position: relative;
  padding-bottom: 18px;
}
.status-step::before {
  content: '';
  position: absolute;
  inset-inline-start: -24px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-2);
  z-index: 1;
}
.status-step.done::before {
  background: var(--success);
  border-color: var(--success);
}
.status-step.done::after {
  content: '✓';
  position: absolute;
  inset-inline-start: -24px;
  top: 2px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  z-index: 2;
}
.status-step.active::before {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-soft);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px var(--primary-soft);
  }
  50% {
    box-shadow: 0 0 0 9px color-mix(in srgb, var(--primary) 15%, transparent);
  }
}
.status-step .st-lbl {
  font-weight: 800;
  font-size: 14px;
}
.status-step .st-date {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab.active {
  color: var(--primary);
  border-color: var(--primary);
}
html[data-theme='dark'] .tab.active {
  color: var(--primary-2);
  border-color: var(--primary-2);
}
.tab .t-count {
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
}
.tab.active .t-count {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Order cards (seller) */
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  gap: 10px;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.2s;
  text-align: start;
  width: 100%;
  margin-bottom: 8px;
}
.order-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.order-card.new-order {
  border-inline-start: 4px solid var(--primary);
  animation: newPulse 2s ease-in-out infinite;
}
@keyframes newPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 30%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}
.order-card .oc-body {
  flex: 1;
  min-width: 0;
}
.order-card .oc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.order-card .oc-id {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 8px;
}
html[data-theme='dark'] .order-card .oc-id {
  color: var(--primary-2);
}
.order-card .oc-cust {
  font-weight: 800;
  font-size: 13.5px;
}
.order-card .oc-meta {
  font-size: 11.5px;
  color: var(--muted);
}
.order-card .oc-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.order-card .oc-amount {
  font-weight: 900;
  font-size: 14px;
}
.status-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill.new {
  background: var(--info-soft);
  color: var(--info);
}
.status-pill.confirmed {
  background: var(--purple-soft);
  color: var(--purple);
}
.status-pill.shipping {
  background: var(--warn-soft);
  color: var(--warn);
}
.status-pill.delivered {
  background: var(--success-soft);
  color: var(--success);
}
.status-pill.cancelled {
  background: var(--bg-2);
  color: var(--muted);
}

/* Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 20, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s,
    visibility 0.2s;
  backdrop-filter: blur(3px);
}
.overlay.show {
  opacity: 1;
  visibility: visible;
}
html.mobile-layout .overlay {
  align-items: flex-end;
  padding: 0;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.overlay.show .modal {
  transform: none;
}
html.mobile-layout .modal {
  border-radius: 22px 22px 0 0;
  max-width: none;
  max-height: 94vh;
  transform: translateY(100%);
}
html.mobile-layout .overlay.show .modal {
  transform: none;
}
.modal-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}
.modal-body {
  padding: 18px;
}
.modal-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  flex-wrap: wrap;
}
.grabber {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: var(--border-2);
  margin: 9px auto 0;
}

/* Toast */
.toasts {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  inset-inline-start: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
html.mobile-layout .toasts {
  bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  inset-inline: 14px;
}
.toast {
  background: var(--text);
  color: var(--surface);
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: auto;
  max-width: 340px;
}
html[data-theme='dark'] .toast {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.toast button {
  color: var(--primary-2);
  font-weight: 800;
  font-size: 12.5px;
  text-decoration: underline;
}

/* Tour */
.tour-spot {
  position: fixed;
  z-index: 400;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(8, 12, 16, 0.62);
  transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
  border: 2px solid var(--primary-2);
}
.tour-tip {
  position: fixed;
  z-index: 401;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  max-width: 300px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.tour-tip .t-step {
  font-size: 11px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.tour-tip .t-txt {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 11px;
}
.tour-tip .t-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tour-tip .t-skip {
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
}

/* Empty */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty .e-ic {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  margin: 0 auto 14px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}
.empty .e-ic svg {
  width: 32px;
  height: 32px;
}
.empty h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 16px;
}
.empty p {
  margin: 0 0 16px;
  font-size: 13px;
}

/* Skeleton */
.skel {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--border) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shim 1.1s infinite;
  border-radius: 8px;
}
@keyframes shim {
  to {
    background-position: -200% 0;
  }
}

/* Chart */
.chart-svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.bar-anim {
  transform-origin: bottom;
  animation: barGrow 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) backwards;
}
@keyframes barGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

/* Detail rows */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  gap: 8px;
}
.detail-row:last-child {
  border-bottom: none;
}
.detail-row .dr-l {
  color: var(--muted);
  font-weight: 600;
}
.detail-row .dr-r {
  font-weight: 700;
  text-align: end;
}

/* Phone mode */
html.phone-mode {
  background: #0c1216;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 0;
}
html.phone-mode body {
  width: 390px;
  height: 790px;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 44px;
  border: 11px solid #1b2429;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  padding-top: 0;
  position: relative;
  background: var(--bg);
}
html.phone-mode .app-shell {
  height: 100%;
  overflow: hidden;
  grid-template-columns: 1fr;
}
html.phone-mode .main-col {
  height: 100%;
  overflow: hidden;
}
html.phone-mode .content {
  overflow-y: auto;
  height: calc(100% - var(--topbar-h));
  padding-bottom: 96px;
}
html.phone-mode .sidebar {
  display: none;
}
html.phone-mode .bottom-nav {
  display: flex;
  position: absolute;
}
html.phone-mode .fab {
  display: flex;
  position: absolute;
}
html.phone-mode .toasts {
  position: absolute;
}
html.phone-mode .overlay {
  position: absolute;
}
html.phone-mode .tour-spot,
html.phone-mode .tour-tip {
  position: absolute;
}
html.phone-mode .topbar {
  top: 0;
}
html.phone-mode .prod-grid {
  grid-template-columns: repeat(2, 1fr);
}
.mobile-toggle {
  display: none;
}
@media (min-width: 768px) {
  .mobile-toggle {
    display: inline-flex;
  }
}
html.phone-mode .mobile-toggle {
  display: inline-flex;
}

/* Print */
@media print {
  body {
    background: #fff;
    padding: 0;
  }
  .sidebar,
  .topbar,
  .bottom-nav,
  .fab,
  .toasts,
  .no-print,
  .tour-spot,
  .tour-tip {
    display: none !important;
  }
  .content {
    padding: 0;
    max-width: none;
  }
  .card,
  .tbl-wrap,
  .wa-bubble {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

@media (max-width: 520px) {
  .page-title {
    font-size: 19px;
  }
  .store-hero h1 {
    font-size: 20px;
  }
  .kpi .k-val {
    font-size: 20px;
  }
}

/* Table */
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.tbl th,
table.tbl td {
  padding: 11px 13px;
  text-align: start;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl th {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface-2);
  position: sticky;
  top: 0;
}
table.tbl tr:last-child td {
  border-bottom: none;
}
table.tbl tbody tr:hover {
  background: var(--surface-2);
}
.num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Flying animation for add to cart */
.fly-dot {
  position: fixed;
  z-index: 9000;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: all 0.8s cubic-bezier(0.5, 0.1, 0.5, 1);
}
