:root {
  --mw-bp-sm: 480px;
  --mw-bp-md: 768px;
  --mw-bp-lg: 1024px;
  --mw-tap: 44px;
  --mw-fs-base-mobile: 16px;
  --mw-mobile-bottombar-h: 56px;
  --mw-mobile-actionbar-h: 64px;
}

:root.light {
  /* Shop category accents only - core palette is defined in system.css */
  --sidebar: 248px;
  --shop-cat-vapes: #7c3aed;
  --shop-cat-cigarettes: #1e40af;
  --shop-cat-cigarillos: #92400e;
  --shop-cat-drinks: #065f46;
  --shop-cat-water: #0369a1;
  --shop-cat-medicine: #dc2626;
  --shop-cat-bathroom: #0891b2;
  --shop-cat-snacks: #d97706;
  --shop-cat-other: #6b7280;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; letter-spacing: normal; }
h1, h2, h3, h4 { font-family: 'Inter', sans-serif; font-weight: 600; letter-spacing: normal; }
.mono,
.cart-price,
.product-price,
.qty-num,
.stat-value,
.fs-row-price,
.fs-qty-badge,
.wo-bottom-bar-3 .mono,
.fs-bottom-stats .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg3); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

#loading { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.4s, visibility 0s linear 0s; }
#loading.hide { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.4s, visibility 0s linear 0.4s; }
.loader-logo { font-family: 'Inter', sans-serif; font-size: 2rem; font-weight: 700; color: var(--accent); margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.loader-bar { width: 200px; height: 3px; background: var(--border); border-radius: 3px; overflow: hidden; }
.loader-fill { height: 100%; background: var(--accent); border-radius: 3px; animation: load 1.2s ease forwards; }
@keyframes load { from { width: 0; } to { width: 100%; } }

/* ── Public landing (pre-login) ───────────────────────────── */
#landingPage {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--brand-light);
  color: var(--brand-text);
}
.mw-landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: max(0.75rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  background: #ffffff;
  border-bottom: 1px solid var(--brand-border);
  box-sizing: border-box;
}
.mw-landing-nav .mw-landing-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.mw-landing-nav .mw-landing-signin:hover { background: var(--brand-hover); }
.mw-landing-nav .mw-logo-host {
  align-items: center;
  min-width: 0;
  margin-right: 0.75rem;
}
.mw-landing-nav .mw-logo-lockup__name {
  color: var(--brand-text);
}
.mw-landing-main {
  flex: 1;
  /* Nav row ~52px + safe-area (notch / status bar) */
  padding-top: calc(3.25rem + env(safe-area-inset-top, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mw-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mw-landing-promo-banner {
  padding: 0.35rem 0 0.65rem;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.mw-landing-promo-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 max(0.75rem, env(safe-area-inset-left, 0px)) 0 max(0.75rem, env(safe-area-inset-right, 0px));
}
.mw-landing-promo-banner__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.09);
}
.mw-landing-hero--wholesale.mw-landing-hero--after-promo {
  padding: 1.15rem max(1rem, env(safe-area-inset-left, 0px)) 2rem max(1rem, env(safe-area-inset-right, 0px));
  background: linear-gradient(165deg, #f9fafb 0%, #f0f4f8 55%, #e8edf3 100%);
}
@media (min-width: 768px) {
  .mw-landing-hero--wholesale.mw-landing-hero--after-promo {
    padding: 1.35rem 1.75rem 2.25rem;
  }
}
@media (max-width: 520px) {
  .mw-landing-hero--wholesale.mw-landing-hero--after-promo {
    padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
  }
  .mw-landing-hero--wholesale .mw-landing-hero-note {
    font-size: 0.86rem;
    margin-top: 1rem;
    padding: 0 0.15rem;
  }
  .mw-landing-hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    gap: 0.65rem;
  }
  .mw-landing-hero-actions .mw-landing-btn-primary,
  .mw-landing-hero-actions .mw-landing-btn-outline {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
}
.mw-landing-hero-shell--compact {
  text-align: center;
}
.mw-landing-hero {
  border-bottom: 1px solid var(--brand-border);
}
/* Centered fallback if a plain `.mw-landing-hero` is used without `--wholesale` */
.mw-landing-hero:not(.mw-landing-hero--wholesale) {
  background: #ffffff;
  padding: 3rem 1.5rem 3.5rem;
  text-align: center;
}
.mw-landing-hero:not(.mw-landing-hero--wholesale) h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  max-width: 920px;
  margin: 0 auto 1rem;
  color: var(--brand-text);
}
.mw-landing-hero:not(.mw-landing-hero--wholesale) p {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.65;
  color: var(--brand-dark);
  max-width: 720px;
  margin: 0 auto 1.75rem;
}

/* ── Wholesale-style promo hero (blobs + 3-col + strip) ───── */
.mw-landing-hero--wholesale {
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 2.25rem 1.25rem 2rem;
  background: linear-gradient(165deg, #f9fafb 0%, #f3f4f6 42%, #eef2f7 100%);
}
@media (min-width: 768px) {
  .mw-landing-hero--wholesale { padding: 2.75rem 1.75rem 2.25rem; }
}
.mw-landing-hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.mw-landing-hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
  opacity: 0.42;
}
.mw-landing-hero-blob--a {
  width: min(52vw, 420px);
  height: min(52vw, 420px);
  background: radial-gradient(circle at 30% 30%, #93c5fd, #60a5fa 45%, transparent 70%);
  top: -12%;
  right: -8%;
}
.mw-landing-hero-blob--b {
  width: min(44vw, 340px);
  height: min(44vw, 340px);
  background: radial-gradient(circle at 70% 40%, #bfdbfe, #3b82f6 50%, transparent 72%);
  bottom: -18%;
  left: -10%;
}
.mw-landing-hero-blob--c {
  width: min(36vw, 280px);
  height: min(36vw, 280px);
  background: radial-gradient(circle at 50% 50%, #dbeafe, #93c5fd 55%, transparent 75%);
  top: 38%;
  left: 32%;
  opacity: 0.28;
}
.mw-landing-hero-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
}
.mw-landing-hero-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .mw-landing-hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 0.95fr);
    gap: 1.75rem 1.5rem;
    align-items: stretch;
  }
}
.mw-landing-hero-brand h1 {
  font-size: clamp(1.45rem, 3.6vw, 2.05rem);
  font-weight: 800;
  line-height: 1.18;
  margin: 0 0 0.65rem;
  color: var(--brand-text);
  letter-spacing: -0.02em;
}
.mw-landing-hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand);
  margin: 0 0 0.5rem;
}
.mw-landing-hero-lede {
  font-size: clamp(0.92rem, 1.8vw, 1.02rem);
  line-height: 1.55;
  color: #374151;
  margin: 0 0 0.75rem;
  max-width: 34rem;
}
.mw-landing-hero-meta {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
}
.mw-landing-hero-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.mw-announce-pill {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--green-border);
  background: var(--green-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}
.mw-announce-pill--soft {
  background: var(--blue-bg);
  border-color: var(--blue-border);
}
.mw-announce-pill__title {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--green);
  margin: 0 0 0.35rem;
  letter-spacing: 0.01em;
}
.mw-announce-pill--soft .mw-announce-pill__title {
  color: var(--blue);
}
.mw-announce-pill__text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #166534;
}
.mw-announce-pill--soft .mw-announce-pill__text {
  color: #1e40af;
}
.mw-cta-speech {
  position: relative;
  width: 100%;
  max-width: 20rem;
  padding: 1.1rem 1.15rem 1rem;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
.mw-cta-speech::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  transform: rotate(45deg);
  bottom: -7px;
  left: 50%;
  margin-left: -6px;
}
.mw-cta-speech__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
}
.mw-cta-speech__line {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #374151;
}
.mw-cta-speech__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
@media (min-width: 400px) {
  .mw-cta-speech__actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}
.mw-cta-speech__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.mw-cta-speech__btn--catalog {
  background: #fef2f2;
  color: #b42318;
  border: 1px solid #fecdca;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.mw-cta-speech__btn--catalog:hover {
  background: #fee4e2;
  color: #912018;
}
.mw-cta-speech__btn--signin {
  background: var(--brand);
  color: #fff;
  border: 1px solid transparent;
}
.mw-cta-speech__btn--signin:hover {
  background: var(--brand-hover);
}
.mw-landing-hero-announce-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mw-landing-hero-bubble-wrap {
  display: flex;
  justify-content: center;
}
@media (min-width: 1024px) {
  .mw-landing-hero-bubble-wrap { justify-content: flex-end; align-items: stretch; }
}
.mw-landing-product-strip {
  margin-top: 1.5rem;
  padding: 0.5rem 0 0.25rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.mw-landing-product-strip__track {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.35rem 0.15rem 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.mw-landing-product-strip__track::-webkit-scrollbar { height: 6px; }
.mw-landing-product-strip__track::-webkit-scrollbar-thumb {
  background: #c5cad3;
  border-radius: 999px;
}
.mw-landing-product-strip__fig {
  flex: 0 0 auto;
  margin: 0;
  width: clamp(4.5rem, 14vw, 6.25rem);
  height: clamp(4.5rem, 14vw, 6.25rem);
  border-radius: 14px;
  overflow: hidden;
  scroll-snap-align: start;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.05);
  transform: rotate(-3deg);
}
.mw-landing-product-strip__fig:nth-child(even) { transform: rotate(2deg); }
.mw-landing-product-strip__fig:nth-child(3n) { transform: rotate(-1.5deg); }
.mw-landing-product-strip__fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}
@supports (object-position: center block-end) {
  .mw-landing-product-strip__fig img {
    object-position: center block-end;
  }
}
.mw-landing-hero--wholesale .mw-landing-hero-note {
  font-size: 0.92rem;
  color: var(--text2);
  max-width: 38rem;
  margin: 1.35rem auto 0;
  line-height: 1.45;
  text-align: center;
}
.mw-landing-hero--wholesale .mw-landing-hero-actions {
  margin-top: 1.25rem;
  justify-content: center;
}

/* Guest cart strip under hero CTAs (landing) */
.mw-guest-cart-bar {
  display: none;
  max-width: 42rem;
  margin: 1.25rem auto 0;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  box-sizing: border-box;
  width: 100%;
}
.mw-guest-cart-bar.is-visible {
  display: flex;
}
@media (max-width: 520px) {
  .mw-guest-cart-bar.is-visible {
    flex-direction: column;
    align-items: stretch;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
  .mw-guest-cart-bar .btn {
    width: 100%;
  }
}

/* Trust / feature bar */
.mw-landing-trust-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--brand-border);
  padding: 1.75rem 1.25rem 2rem;
}
.mw-landing-trust-bar__inner {
  max-width: 1120px;
  margin: 0 auto;
}
.mw-landing-trust-bar__heading {
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 1.25rem;
  color: #111827;
  letter-spacing: -0.02em;
}
.mw-landing-trust-bar__tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 520px) {
  .mw-landing-trust-bar__tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .mw-landing-trust-bar__tiles { grid-template-columns: repeat(5, 1fr); gap: 1rem; }
}
.mw-trust-tile {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1rem 1.05rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.mw-trust-tile__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  border: 1px solid #e5e7eb;
}
.mw-trust-tile__icon svg { display: block; }
.mw-trust-tile__title {
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  color: #111827;
  line-height: 1.25;
}
.mw-trust-tile__sub {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #6b7280;
}

/* Spotlight product row */
.mw-landing-spotlight {
  padding: 2rem max(1.25rem, env(safe-area-inset-left, 0px)) 2.25rem max(1.25rem, env(safe-area-inset-right, 0px));
  background: var(--brand-light);
  border-bottom: 1px solid var(--brand-border);
}
.mw-landing-spotlight__heading {
  max-width: 1120px;
  margin: 0 auto 1.25rem;
  padding: 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  color: #111827;
  letter-spacing: -0.02em;
}
.mw-landing-spotlight__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .mw-landing-spotlight__inner { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .mw-landing-spotlight__inner { grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
}
.mw-spot-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8eaed;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 0.65rem 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.mw-spot-card__media {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  margin-bottom: 0.65rem;
}
.mw-spot-card__media img {
  width: 100%;
  height: 100%;
  /* Contain + bottom anchor: full product visible (block-end where supported) */
  object-fit: contain;
  object-position: center bottom;
  display: block;
  padding: 0.2rem 0.35rem 0;
  box-sizing: border-box;
}
@supports (object-position: center block-end) {
  .mw-spot-card__media img {
    object-position: center block-end;
  }
}
.mw-spot-card__title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.3rem;
  color: #111827;
  line-height: 1.3;
}
.mw-spot-card__sub {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.45;
  flex: 1;
}
.mw-spot-card__cta {
  align-self: flex-start;
  margin-top: auto;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #b42318;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mw-spot-card__cta:hover { color: #912018; }

.mw-landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}
.mw-landing-btn-primary {
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.mw-landing-btn-primary:hover { background: var(--brand-hover); }
.mw-landing-btn-outline {
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--brand);
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: 10px;
  cursor: pointer;
}
.mw-landing-btn-outline:hover { background: var(--brand-light); }
.mw-landing-section {
  padding: 2.75rem max(1.25rem, env(safe-area-inset-left, 0px)) 3rem max(1.25rem, env(safe-area-inset-right, 0px));
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 420px) {
  .mw-landing-section {
    padding-top: 2.25rem;
    padding-bottom: 2.5rem;
  }
  .mw-landing-section h2 {
    font-size: 1.2rem;
    line-height: 1.25;
    padding: 0 0.15rem;
  }
  .mw-landing-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}
.mw-landing-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 0.5rem;
  color: #1a1f36;
}
.mw-landing-section .mw-landing-sub {
  text-align: center;
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0 0 2rem;
  line-height: 1.5;
}
.mw-landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.mw-landing-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.35rem 1rem;
  text-align: center;
  border: 1px solid #e8eaed;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.mw-landing-card .mw-landing-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-left: auto;
  margin-right: auto;
  border-radius: 999px;
  font-size: 1.65rem;
  line-height: 1;
  margin-bottom: 0.65rem;
}
.mw-landing-card .mw-landing-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a1f36;
  line-height: 1.35;
}
.mw-landing-grid button.mw-landing-card {
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}
.mw-landing-grid button.mw-landing-card:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}
.mw-landing-accent-catalog {
  border-top: 3px solid #7c3aed;
}
.mw-landing-accent-catalog .mw-landing-card-icon {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
}
.mw-landing-accent-catalog:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.18);
}
.mw-landing-accent-incoming {
  border-top: 3px solid #065f46;
}
.mw-landing-accent-incoming .mw-landing-card-icon {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.mw-landing-accent-incoming:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(6, 95, 70, 0.16);
}
.mw-landing-accent-customers {
  border-top: 3px solid #0369a1;
}
.mw-landing-accent-customers .mw-landing-card-icon {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}
.mw-landing-accent-customers:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(3, 105, 161, 0.16);
}
.mw-landing-accent-outgoing {
  border-top: 3px solid #c2410c;
}
.mw-landing-accent-outgoing .mw-landing-card-icon {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.mw-landing-accent-outgoing:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(194, 65, 12, 0.16);
}
.mw-landing-step--accent-catalog {
  border-top: 3px solid #7c3aed;
}
.mw-landing-step--accent-catalog .mw-landing-step-num {
  color: #7c3aed;
}
.mw-landing-step--accent-customers {
  border-top: 3px solid #0369a1;
}
.mw-landing-step--accent-customers .mw-landing-step-num {
  color: #0369a1;
}
.mw-landing-step--accent-incoming {
  border-top: 3px solid #065f46;
}
.mw-landing-step--accent-incoming .mw-landing-step-num {
  color: #065f46;
}
.mw-landing-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .mw-landing-steps { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
.mw-landing-step {
  background: #ffffff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.mw-landing-step .mw-landing-step-num { font-size: 1.75rem; margin-bottom: 0.5rem; }
.mw-landing-step h3 { font-size: 1rem; font-weight: 700; margin: 0 0 0.5rem; color: #1a1f36; }
.mw-landing-step p { font-size: 0.88rem; color: #6b7280; line-height: 1.55; margin: 0; }
.mw-landing-footer {
  background: var(--brand-dark);
  color: #e8ecf5;
  padding: 2rem max(1.5rem, env(safe-area-inset-left, 0px)) max(1.5rem, env(safe-area-inset-bottom, 0px))
    max(1.5rem, env(safe-area-inset-right, 0px));
  margin-top: auto;
}
.mw-landing-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
}
@media (min-width: 900px) {
  .mw-landing-footer-inner { grid-template-columns: 1fr 1fr 1fr; align-items: start; }
  .mw-landing-footer-inner > div:nth-child(2) { text-align: center; }
}
.mw-landing-footer .mw-landing-footer-logo { font-weight: 700; font-size: 1rem; color: #fff; margin-bottom: 0.35rem; }
.mw-landing-footer a {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 500;
}
.mw-landing-footer a:hover { text-decoration: underline; }
.mw-landing-footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; justify-content: flex-start; }
@media (min-width: 900px) {
  .mw-landing-footer-links { justify-content: flex-end; }
}
.mw-landing-footer-copy {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 1.25rem;
  margin-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  font-size: 0.78rem;
}

#loginWrap { min-height: 100vh; display: none; align-items: center; justify-content: center; padding: 2rem; background: var(--brand-light); position: relative; overflow: hidden; }

.login-back-home {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brand);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: 'Inter', sans-serif;
}
.login-back-home:hover { text-decoration: underline; }
.login-card { width: 100%; max-width: 440px; background: #ffffff; border: 1px solid var(--brand-border); border-radius: 12px; padding: 2.5rem; position: relative; z-index: 1; box-shadow: none; }

.login-brand {
  margin-bottom: 2.5rem;
  text-align: center;
}
.login-brand .mw-logo-host {
  margin-bottom: 0.5rem;
  justify-content: center;
  width: 100%;
}
.login-brand .mw-logo--layout-full {
  justify-content: center;
  width: 100%;
}

.login-brand .tagline { color: var(--text3); font-size: 0.85rem; margin-top: 0.25rem; }
.login-brand .address { color: var(--text3); font-size: 0.8rem; margin-top: 0.1rem; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.login-title { font-size: 1.6rem; font-weight: 600; margin-bottom: 0.5rem; }
.login-sub { color: var(--text2); font-size: 0.9rem; margin-bottom: 2rem; }
.demo-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.75rem; background: var(--brand-light); border-radius: var(--radius-sm); padding: 0.25rem; border: 1px solid var(--brand-border); }

.demo-tab { flex: 1; padding: 0.5rem; border: none; background: none; color: var(--text2); font-size: 0.8rem; border-radius: 6px; cursor: pointer; font-family: 'Inter', sans-serif; font-weight: 500; transition: background 0.2s, color 0.2s; text-align: center; }
.demo-tab.active { background: #ffffff; color: #1a1f36; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* Shared admin component styles should live in system.css. Keep app.css for shell/layout and feature-specific styles. */

.field { margin-bottom: 1.25rem; }
.field label { display: block; font-size: 0.78rem; font-weight: 500; color: #374151; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }

.field input,
.field select,
.field textarea { width: 100%; background: #ffffff; border: 1px solid #d1d5db; color: var(--text); padding: 0.75rem 1rem; border-radius: 7px; font-family: 'Inter', sans-serif; font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s; }

.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--chrome-focus-ring); }

.field input::placeholder { color: var(--text3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* F2a: .btn / .btn-primary / .btn-secondary / .btn-danger / .btn-ghost / .btn-sm are canonical in system.css (loads after). Duplicate visual rules below deferred until full audit. */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.25rem; border-radius: 7px; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 0.9rem; cursor: pointer; border: none; transition: background 0.2s, border-color 0.2s, color 0.2s; white-space: nowrap; box-shadow: none; }
.btn-primary {
  background: var(--brand);
  color: #ffffff;
  border: none;
  box-shadow: 0 1px 2px var(--chrome-shadow-30);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
/* [LEGACY] Button hover transforms (translateY) are overridden by system.css
   (.btn:hover { transform: none }). Keep this block until full CSS audit. */
.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: 0 2px 8px var(--chrome-shadow-40);
  transform: translateY(-1px);
}

.btn-catalog {
  background: #7c3aed;
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.35);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-catalog:hover {
  background: #6d28d9;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.btn-incoming {
  background: #065f46;
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(6, 95, 70, 0.35);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-incoming:hover {
  background: #064e3b;
  box-shadow: 0 2px 8px rgba(6, 95, 70, 0.35);
  transform: translateY(-1px);
}

.btn-outgoing {
  background: #c2410c;
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(194, 65, 12, 0.35);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-outgoing:hover {
  background: #9a3412;
  box-shadow: 0 2px 8px rgba(194, 65, 12, 0.4);
  transform: translateY(-1px);
}

.btn-customers {
  background: #0369a1;
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(3, 105, 161, 0.35);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-customers:hover {
  background: #0284c7;
  box-shadow: 0 2px 8px rgba(3, 105, 161, 0.35);
  transform: translateY(-1px);
}

.btn-ghost { background: none; color: var(--text2); padding: 0.5rem 0.75rem; }
.btn-ghost:hover { color: var(--text); background: var(--bg3); }
.btn-danger { background: #fff1f1; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }

.btn-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.btn-success:hover { background: #dcfce7; }

.btn-full { width: 100%; justify-content: center; padding: 0.9rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

#app { display: none; min-height: 100vh; }
#app.visible { display: flex; }

.sidebar { width: var(--sidebar); height: 100vh; min-height: 100vh; overflow: hidden; background: var(--sidebar-bg) !important; border-right: 1px solid var(--sidebar-border); display: flex; flex-direction: column; position: sticky; top: 0; flex-shrink: 0; }
.sidebar-brand { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--sidebar-border); flex-shrink: 0; }
.sidebar-brand .logo { display: none; }
.sidebar-brand .role-badge { display: inline-block; margin-top: 0.4rem; font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.07em; }
.role-ADMIN { background: rgba(79, 134, 247, 0.2); color: #93c5fd; }
.role-WAREHOUSE { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.role-CUSTOMER { background: rgba(34, 197, 94, 0.18); color: #86efac; }

.sidebar-user { padding: 1rem 1.5rem; border-bottom: 1px solid var(--sidebar-border); flex-shrink: 0; }
.sidebar-user .user-name { font-weight: 600; font-size: 0.9rem; color: var(--brand-dark); }
.sidebar-user .user-email { color: var(--sidebar-text-muted); font-size: 0.78rem; margin-top: 0.15rem; }
.sidebar-nav { flex: 1; min-height: 0; padding: 0.75rem 0; overflow-y: auto; }
.nav-section {
  padding: 0.5rem 1.5rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #6b7a99;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-section[data-section='catalog'] {
  color: var(--color-catalog);
}
.nav-section[data-section='customers'] {
  color: var(--color-customers);
}
.nav-section[data-section='incoming'] {
  color: var(--color-incoming);
}
.nav-section[data-section='outgoing'] {
  color: var(--color-outgoing);
}
.nav-section[data-section='finance'] {
  color: var(--color-finance);
}
.nav-section[data-section='settings'],
.nav-section[data-section='overview'] {
  color: #6b7a99;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: #a8b3cf;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border-left: 3px solid transparent;
  background: transparent;
}
.nav-item:hover {
  background: #252e42;
  color: #ffffff;
}
.nav-item.active {
  background: #2d3748;
  border-left: 3px solid #4f86f7;
  color: #ffffff;
}
.nav-item.active[data-section='catalog'] {
  border-left-color: var(--color-catalog);
  color: var(--color-catalog);
  background: rgba(167, 139, 250, 0.12);
}
.nav-item.active[data-section='incoming'] {
  border-left-color: var(--color-incoming);
  color: var(--color-incoming);
  background: rgba(52, 211, 153, 0.1);
}
.nav-item.active[data-section='outgoing'],
.nav-item.active[data-section='orders'] {
  border-left-color: var(--color-outgoing);
  color: var(--color-outgoing);
  background: rgba(251, 146, 60, 0.1);
}
.nav-item.active[data-section='finance'] {
  border-left-color: var(--color-finance);
  color: var(--color-finance);
  background: rgba(96, 165, 250, 0.12);
}
.nav-item.active[data-section='customers'] {
  border-left-color: var(--color-customers);
  color: var(--color-customers);
  background: rgba(56, 189, 248, 0.1);
}
.nav-item.active[data-section='overview'],
.nav-item.active[data-section='settings'] {
  border-left-color: #93c5fd;
  color: #ffffff;
  background: #2d3748;
}
.nav-item .icon { font-size: 1.1rem; width: 1.2rem; text-align: center; }

/* Customer shop: category filters in sidebar (after Cart) + mobile drawer (shop.js) */
.sidebar-shop-categories {
  padding: 0 0.65rem 0.85rem 1.15rem;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-shop-categories-inner {
  min-width: 0;
}
.sidebar-shop-cat-header-row {
  margin-bottom: 0.35rem;
}
.sidebar-shop-cat-header-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.25rem 0.25rem 0;
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.sidebar-shop-cat-header-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #6b7a99;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar-shop-categories[data-section='catalog'] .sidebar-shop-cat-header-label {
  color: var(--color-catalog);
}
.sidebar-shop-cat-chevron {
  font-size: 0.65rem;
  color: var(--sidebar-text-muted);
  flex-shrink: 0;
  margin-left: 0.35rem;
}
.shop-cat-filter-toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 0.35rem;
}
.shop-cat-filter-clearall.is-hidden {
  display: none !important;
}
.shop-cat-filter-clearall {
  font-size: 0.68rem !important;
  padding: 0.25rem 0.5rem !important;
  line-height: 1.2 !important;
  border-radius: 6px !important;
}
.shop-cat-filter-panel.is-collapsed {
  display: none;
}
.shop-cat-filter-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.shop-cat-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.shop-cat-filter-list--scroll {
  max-height: 14rem;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}
.shop-cat-filter-list--scroll::-webkit-scrollbar {
  width: 5px;
}
.shop-cat-filter-list--scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 4px;
}
.shop-cat-filter-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.22rem 0;
  color: var(--sidebar-text);
  line-height: 1.25;
  border-radius: 4px;
  margin: 0 -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
.shop-cat-filter-row:hover {
  background: rgba(255, 255, 255, 0.06);
}
.shop-cat-filter-row input {
  margin-top: 0.12rem;
  accent-color: var(--accent, #4ecca3);
  flex-shrink: 0;
  cursor: pointer;
}
.shop-cat-filter-label {
  font-size: 0.76rem;
  flex: 1;
  cursor: pointer;
}
.shop-cat-filter-count {
  color: var(--sidebar-text-muted);
  font-weight: 500;
}

.shop-mobile-cart-bar {
  display: none;
}
.shop-mobile-filters-bar {
  display: none;
  margin-bottom: 0.65rem;
}
.shop-mobile-filters-btn {
  width: 100%;
}

.shop-filters-drawer {
  position: fixed;
  inset: 0;
  z-index: 220;
  pointer-events: none;
  visibility: hidden;
}
.shop-filters-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}
.shop-filters-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.shop-filters-drawer.is-open .shop-filters-drawer-backdrop {
  opacity: 1;
}
.shop-filters-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(22rem, 92vw);
  height: 100%;
  max-height: 100dvh;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 28px rgba(15, 23, 42, 0.14);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shop-filters-drawer.is-open .shop-filters-drawer-panel {
  transform: translateX(0);
}
.shop-filters-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.shop-filters-drawer-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.shop-filters-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem 1.25rem;
}

@media (max-width: 767px) {
  #customerShopCategorySidebar.sidebar-shop-categories {
    display: none !important;
  }
  .shop-mobile-filters-bar {
    display: flex;
  }
}

.shop-filters-drawer-body .shop-cat-filter-row {
  color: var(--text);
}
.shop-filters-drawer-body .shop-cat-filter-row:hover {
  background: var(--bg3);
}
.shop-filters-drawer-body .shop-cat-filter-count {
  color: var(--text3);
}

.badge { background: #dc2626; color: #fff; font-size: 0.65rem; font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 10px; margin-left: auto; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--sidebar-border); flex-shrink: 0; background: var(--sidebar-bg); }

.sidebar-footer .btn-ghost { color: var(--sidebar-text); background: transparent; }
.sidebar-footer .btn-ghost:hover { color: var(--brand-dark); }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.topbar { background: #ffffff; border-bottom: 1px solid var(--brand-border); padding: 1rem 2rem; display: flex; align-items: center; gap: 1rem; box-shadow: none; }
.topbar #mwLogoTopbar[role='button'] { cursor: pointer; }

.tb-menu { display: none; }
.topbar-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  letter-spacing: normal;
  color: #1a1f36;
}
.topbar-title .topbar-title-text {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
.topbar-section-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  color: var(--text2);
  background: var(--bg3);
}
.topbar-section-pill--catalog {
  color: var(--color-catalog);
  background: var(--color-catalog-bg);
  border-color: var(--color-catalog-border);
}
.topbar-section-pill--customers {
  color: var(--color-customers);
  background: var(--color-customers-bg);
  border-color: var(--color-customers-border);
}
.topbar-section-pill--incoming {
  color: var(--color-incoming);
  background: var(--color-incoming-bg);
  border-color: var(--color-incoming-border);
}
.topbar-section-pill--orders,
.topbar-section-pill--outgoing {
  color: var(--color-outgoing);
  background: var(--color-outgoing-bg);
  border-color: var(--color-outgoing-border);
}
.topbar-section-pill--finance,
.topbar-section-pill--overview {
  color: var(--color-finance);
  background: var(--color-finance-bg);
  border-color: var(--color-finance-border);
}
.topbar-section-pill--settings {
  color: var(--text2);
  background: var(--bg3);
  border-color: var(--border2);
}

.content { flex: 1; padding: 2rem; overflow-y: auto; }

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  --stat-top: var(--border);
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--stat-top);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: border-top-color 0.2s, box-shadow 0.2s, transform 0.2s, border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}
.stat-card:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.06); }

.stat-card.stat-accent {
  --stat-top: var(--color-finance);
}
.stat-card.stat-green {
  --stat-top: var(--color-incoming);
}
.stat-card.stat-red {
  --stat-top: var(--red);
}
.stat-card.stat-blue {
  --stat-top: var(--color-customers);
}
.stat-card.stat-purple {
  --stat-top: var(--color-catalog);
}
.stat-card.stat-orange {
  --stat-top: var(--color-outgoing);
}
.stat-label { font-size: 0.72rem; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.stat-sub { font-size: 0.78rem; color: var(--text3); margin-top: 0.35rem; }
.stat-value.stat-accent { color: var(--accent); }
.stat-value.stat-green,
.mono.stat-green {
  color: var(--green);
}
.stat-value.stat-red,
.mono.stat-red {
  color: var(--red);
}
.stat-value.stat-blue,
.mono.stat-blue {
  color: var(--blue);
}
.stat-value.stat-purple {
  color: var(--color-catalog);
}
.stat-value.stat-amber,
.mono.stat-amber {
  color: #b45309;
}

.stat-card--click {
  cursor: pointer;
}
.stat-card--click:hover {
  border-color: var(--accent);
  border-top-color: var(--stat-top);
  background: var(--accent-glow);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dash-zones {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.dash-zone {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}
.dash-zone-header {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.dash-zone.incoming {
  border-top: 3px solid var(--color-incoming);
}
.dash-zone.outgoing {
  border-top: 3px solid var(--color-outgoing);
}
.dash-zone.invoices {
  border-top: 3px solid var(--color-finance);
}

.payment-balance-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}
.balance-owed { color: var(--red); }
.balance-clear { color: var(--green); }
.balance-credit { color: var(--blue); }
.payment-method-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
}
.method-CASH {
  background: rgba(22, 163, 74, 0.12);
  color: var(--green);
}
.method-CHECK {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue);
}
.method-OTHER {
  background: var(--bg3);
  color: var(--text2);
}
.unpaid-alert {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--red);
}

.dash-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.dash-pipeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
.dash-pipeline-row:last-child {
  border-bottom: none;
}
.dash-pipeline-row:hover {
  background: var(--bg3);
  padding-left: 4px;
}
.dash-pipeline-row--static {
  cursor: default;
}
.dash-pipeline-row--static:hover {
  background: transparent;
  padding-left: 0;
}
.dash-pipeline-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
}
.quick-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}
.quick-action-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.quick-action-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
}
.quick-action-icon {
  font-size: 1.5rem;
}
.quick-action-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
}
.quick-action-btn:hover .quick-action-label {
  color: var(--accent);
}
.dash-mini-order {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  cursor: pointer;
}
.dash-mini-order:last-child {
  border-bottom: none;
}
.dash-mini-order:hover {
  background: var(--bg3);
}
.dash-zone-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dash-alerts-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1.25rem;
}
.dash-alerts-stack .alert {
  margin-bottom: 0.75rem;
}
.dash-alerts-stack .alert:last-child {
  margin-bottom: 0;
}
.dash-license-placeholder {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.5;
}
.dash-license-note {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 0.75rem;
}
.dash-inv-mail {
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
}
.dash-inv-mail:hover {
  background: var(--bg3);
}

.license-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
}
.license-card.expired {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.03);
}
.license-card.expiring {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.03);
}
.license-card.missing {
  border-color: var(--border2);
  background: var(--bg3);
}
.license-type-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.license-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.license-field {
  margin-bottom: 0.75rem;
}
.license-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.license-field-value {
  font-size: 0.9rem;
  color: var(--text);
}
.license-upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1rem;
}
.license-upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.license-table-type {
  font-size: 0.9rem;
}
.license-badge-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.license-mini {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .license-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .dash-zones {
    grid-template-columns: 1fr;
  }
  .dash-bottom {
    grid-template-columns: 1fr;
  }
  .quick-action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card { background: var(--card); border: none; border-radius: 10px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04); }

.card:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.06); }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.card-title { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600; letter-spacing: normal; }
.card-header-catalog {
  border-left: 3px solid var(--color-catalog);
  padding-left: 0.75rem;
}
.card-header-customers {
  border-left: 3px solid var(--color-customers);
  padding-left: 0.75rem;
}
.card-header-incoming {
  border-left: 3px solid var(--color-incoming);
  padding-left: 0.75rem;
}
.card-header-outgoing {
  border-left: 3px solid var(--color-outgoing);
  padding-left: 0.75rem;
}
.card-header-finance {
  border-left: 3px solid var(--color-finance);
  padding-left: 0.75rem;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; border-radius: 0; }
th {
  text-align: left;
  background: var(--bg3);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.65rem 1rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

td { padding: 0.75rem 1rem; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }

tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}

tr:hover td { background: #fafbfc; }

:root.light tbody tr:nth-child(even):hover td {
  background: #f5f6f8;
}

.status { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.04em; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-PENDING,
.s-PLACED { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }
.s-CONFIRMED,
.s-READY { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue); }
.s-PACKED {
  background: var(--purple-bg, #f5f3ff);
  color: var(--purple, #7c3aed);
  border: 1px solid var(--purple, #7c3aed);
}
.s-OUT_FOR_DELIVERY { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange); }
.s-DELIVERED { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.s-CANCELLED { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }

:root.light .s-PENDING,
:root.light .s-PLACED { color: var(--amber); border-color: var(--amber); }
:root.light .s-CONFIRMED,
:root.light .s-READY { color: var(--blue); border-color: var(--blue); }
:root.light .s-PACKED { color: var(--purple, #7c3aed); border-color: var(--purple, #7c3aed); }
:root.light .s-OUT_FOR_DELIVERY { color: var(--orange); border-color: var(--orange); }
:root.light .s-DELIVERED { color: var(--green); border-color: var(--green); }
:root.light .s-CANCELLED { color: var(--red); border-color: var(--red); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.product-card {
  background: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 1.25rem;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border-top: 3px solid var(--shop-cat-other);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

/* Catalog cards: image strip + body/footer (mirrors system.css) */
.product-card-media {
  flex-shrink: 0;
  height: 128px;
  border-radius: 8px;
  margin: 0 0 0.65rem;
  background: linear-gradient(160deg, rgba(12, 100, 114, 0.08) 0%, #f4f7f8 100%);
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-card-media--zoomable {
  cursor: zoom-in;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.product-card-media--zoomable:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(12, 100, 114, 0.12);
}
.product-card-media--zoomable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.product-card-media.is-missing .product-card-img {
  display: none !important;
}
.product-card-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  padding: 6px;
  box-sizing: border-box;
}
.product-card-media-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.product-card-media.is-missing .product-card-media-ph {
  opacity: 1;
}
.product-card-media-ph-text {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
  user-select: none;
}
.product-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.product-card-footer {
  margin-top: auto;
  padding-top: 0.25rem;
}

/* [LEGACY] Per-category product card border-top colors and hover box-shadows are
   normalized by system.css (uniform border, no per-category glow). Keep until
   catalog CSS cleanup. */
.product-card[data-category='vapes'] { border-top-color: var(--shop-cat-vapes); }
.product-card[data-category='cigarettes'] { border-top-color: var(--shop-cat-cigarettes); }
.product-card[data-category='cigarillos'] { border-top-color: var(--shop-cat-cigarillos); }
.product-card[data-category='drinks'] { border-top-color: var(--shop-cat-drinks); }
.product-card[data-category='water'] { border-top-color: var(--shop-cat-water); }
.product-card[data-category='medicine'] { border-top-color: var(--shop-cat-medicine); }
.product-card[data-category='bathroom'] { border-top-color: var(--shop-cat-bathroom); }
.product-card[data-category='snacks'] { border-top-color: var(--shop-cat-snacks); }
.product-card[data-category='other'] { border-top-color: var(--shop-cat-other); }
.product-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); transform: translateY(-2px); }
.product-card[data-category='vapes']:hover { box-shadow: 0 8px 22px rgba(124, 58, 237, 0.2); }
.product-card[data-category='cigarettes']:hover { box-shadow: 0 8px 22px rgba(30, 64, 175, 0.18); }
.product-card[data-category='cigarillos']:hover { box-shadow: 0 8px 22px rgba(146, 64, 14, 0.18); }
.product-card[data-category='drinks']:hover { box-shadow: 0 8px 22px rgba(6, 95, 70, 0.18); }
.product-card[data-category='water']:hover { box-shadow: 0 8px 22px rgba(3, 105, 161, 0.18); }
.product-card[data-category='medicine']:hover { box-shadow: 0 8px 22px rgba(220, 38, 38, 0.16); }
.product-card[data-category='bathroom']:hover { box-shadow: 0 8px 22px rgba(8, 145, 178, 0.18); }
.product-card[data-category='snacks']:hover { box-shadow: 0 8px 22px rgba(217, 119, 6, 0.18); }
.product-card[data-category='other']:hover { box-shadow: 0 8px 22px rgba(107, 114, 128, 0.16); }

.product-card.selected { box-shadow: 0 0 0 2px var(--brand), 0 4px 16px rgba(0, 0, 0, 0.08); background: var(--chrome-fill-04); }

.product-cat { display: inline-block; font-size: 0.7rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.product-name { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.95rem; line-height: 1.3; margin-bottom: 0.25rem; letter-spacing: normal; }
.product-brand { color: var(--text3); font-size: 0.8rem; margin-bottom: 0.75rem; }
.product-price { font-size: 1.1rem; font-weight: 600; color: var(--accent); }
.product-case { font-size: 0.75rem; color: var(--text3); margin-top: 0.15rem; }
.product-stock { position: absolute; top: 0.75rem; right: 0.75rem; font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 6px; }
.in-stock { background: rgba(22, 163, 74, 0.1); color: var(--green); }
.low-stock { background: rgba(234, 179, 8, 0.12); color: #b45309; }
.out-stock { background: rgba(220, 38, 38, 0.1); color: var(--red); }

.search-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
@media (max-width: 540px) {
  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input {
    min-width: 0;
    width: 100%;
  }
  .filter-select {
    width: 100%;
  }
}
.search-input { flex: 1; min-width: 200px; background: #ffffff; border: 1px solid #d1d5db; color: var(--text); padding: 0.7rem 1rem; border-radius: 7px; font-family: 'Inter', sans-serif; font-size: 0.9rem; }

.search-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--chrome-focus-ring); }

.filter-select { background: #ffffff; border: 1px solid #d1d5db; color: var(--text); padding: 0.7rem 1rem; border-radius: 7px; font-family: 'Inter', sans-serif; font-size: 0.9rem; cursor: pointer; }

.filter-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--chrome-focus-ring); }

.scanner-box { background: #f8f9fb; border: 2px dashed #d1d5db; border-radius: var(--radius); padding: 2rem; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.scanner-box:hover { border-color: var(--brand); background: #f0f5ff; }

.scanner-icon { font-size: 3rem; margin-bottom: 1rem; }
.scanner-result { background: rgba(22, 163, 74, 0.08); border: 1px solid rgba(22, 163, 74, 0.25); border-radius: var(--radius); padding: 1.25rem; margin-top: 1rem; }
.scanner-error { background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.25); border-radius: var(--radius); padding: 1.25rem; margin-top: 1rem; }
#scannerVideo { width: 100%; max-width: 400px; border-radius: 8px; margin-top: 1rem; }

.cart-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-info { flex: 1; }
.cart-name { font-weight: 600; font-size: 0.9rem; }
.cart-sub { color: var(--text3); font-size: 0.78rem; margin-top: 0.15rem; }
.cart-price { color: var(--accent); font-size: 0.95rem; font-weight: 600; }
.qty-ctrl { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s, color 0.15s; }
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-num { font-size: 0.9rem; width: 2rem; text-align: center; }

/* [LEGACY] Modal shell styling (backdrop, radius, shadow, padding) is standardized
   in system.css. This declaration keeps .modal-bg display:none as the off state.
   Keep until modal CSS cleanup. */
.modal-bg { position: fixed; inset: 0; background: rgba(26, 31, 54, 0.4); backdrop-filter: blur(2px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 1rem; pointer-events: none; }

.modal-bg.open { display: flex; pointer-events: auto; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; animation: modalIn 0.25s ease; box-shadow: var(--shadow-lg); }
.modal-lg { max-width: 760px; }
.modal-order-review { max-width: 920px; }
.review-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: background 0.2s, border-color 0.2s;
}
.review-item.out-of-stock {
  background: rgba(220, 38, 38, 0.05);
  border-color: rgba(220, 38, 38, 0.3);
}
.review-item.replace {
  background: rgba(217, 119, 6, 0.05);
  border-color: rgba(217, 119, 6, 0.3);
}
.review-item.confirmed {
  background: rgba(22, 163, 74, 0.05);
  border-color: rgba(22, 163, 74, 0.3);
}
.review-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 8px;
  margin-bottom: 6px;
  transition: all 0.15s;
}
.review-radio.selected-confirm {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  font-weight: 600;
}
.review-radio.selected-oos {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  font-weight: 600;
}
.review-radio.selected-replace {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  font-weight: 600;
}
.product-search-wrap { position: relative; }
.product-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.product-search-result {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}
.product-search-result:last-child { border-bottom: none; }
.product-search-result:hover { background: var(--bg3); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-family: 'Inter', sans-serif; font-size: 1.2rem; font-weight: 600; letter-spacing: normal; }
.close-btn { background: var(--bg2); border: 1px solid var(--border); color: var(--text2); width: 32px; height: 32px; border-radius: 6px; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.close-btn:hover { color: var(--text); }

.stock-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 0.4rem; }
.stock-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }

#toasts { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { background: #ffffff; border: 1px solid #e8eaed; border-radius: 10px; padding: 0.85rem 1.25rem; font-size: 0.88rem; font-weight: 500; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04); animation: toastIn 0.3s ease; display: flex; align-items: center; gap: 0.75rem; min-width: 280px; }

.toast.success { border-left: 3px solid #16a34a; }
.toast.error { border-left: 3px solid #dc2626; }
.toast.info { border-left: 3px solid var(--brand); }

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.empty { text-align: center; padding: 4rem 2rem; color: var(--text3); }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-text { font-size: 1rem; }

.tabs { display: flex; gap: 0.25rem; background: #f4f5f7; border-radius: var(--radius-sm); padding: 0.25rem; margin-bottom: 1.5rem; border: 1px solid #e8eaed; }

.tab { flex: none; padding: 0.5rem 1rem; border-radius: 6px; border: none; background: none; color: var(--text2); font-size: 0.85rem; cursor: pointer; font-family: 'Inter', sans-serif; font-weight: 500; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.tab.active { background: #ffffff; color: #1a1f36; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.alert { padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.88rem; display: flex; align-items: center; gap: 0.75rem; }
.alert-warn { background: rgba(234, 179, 8, 0.08); border: 1px solid rgba(234, 179, 8, 0.28); color: #92400e; }
.alert-info { background: rgba(37, 99, 235, 0.08); border: 1px solid rgba(37, 99, 235, 0.22); color: var(--blue); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) {
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar: 240px; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex !important;
  }
  .sidebar-nav { min-height: 0; flex: 1; overflow-y: auto; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12); }
  
  .sb-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.35); backdrop-filter: blur(3px); z-index: 199; pointer-events: none; }
  
  .sb-overlay.open { display: block; pointer-events: auto; }
  /* Top hamburger hidden on mobile (sidebar via bottom bar “Menu”). Desktop keeps .tb-menu { display: none } above. */
  #tbMenu,
  .tb-menu {
    display: none !important;
  }
  .topbar {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.35rem;
  }
  .topbar .mw-logo-host--topbar {
    flex: 1 1 100%;
    display: flex;
    justify-content: center;
    max-width: min(92vw, 300px);
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  .topbar-title {
    flex: 1 1 100%;
    justify-content: center;
    text-align: center;
  }
  #topbarActions {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }
  .content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .products-grid { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .f-row { grid-template-columns: 1fr; }
  .f-row-3 { grid-template-columns: 1fr 1fr; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .content.content-fast-scan { min-height: calc(100dvh - 56px); height: calc(100dvh - 56px); }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .f-row-3 { grid-template-columns: 1fr; }
}

#mobileBottomBar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #ffffff;
  border-top: 1px solid #e8eaed;
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 150;
  padding-bottom: env(safe-area-inset-bottom);
}

#mobileBottomBar button {
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  transition: color 0.15s;
}
#mobileBottomBar button:hover,
#mobileBottomBar button:active { color: var(--brand); }

@media (max-width: 768px) {
  #mobileBottomBar.visible {
    display: flex !important;
  }
  /* Legacy 72px rule - superseded by F5a calc at 767.98px (system.css + app mobile baseline) */
}
@media (min-width: 769px) {
  #mobileBottomBar { display: none !important; }
}

.scan-bulk-toggle { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; margin: 0.35rem 0; }
.scan-bulk-toggle button {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.scan-bulk-toggle button.on { border-color: var(--brand); color: var(--brand); background: var(--chrome-fill-08); }

.fast-scan-page.fs-bulk-active .fs-bottom-bar,
.wo-create-page.fs-bulk-active .wo-bottom-bar-3,
.wo-create-page.fs-bulk-active .wcf-bulk-hide { display: none !important; }
.fast-scan-page.fs-bulk-active .fs-list-section,
.wo-create-page.fs-bulk-active .fs-list-section { display: none !important; }
.fs-bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.fast-scan-page.fs-bulk-active .fs-bulk-bar,
.wo-create-page.fs-bulk-active .fs-bulk-bar { display: flex; }
.fs-bulk-done {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 140;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--border);
}
.fast-scan-page.fs-bulk-active .fs-bulk-done,
.wo-create-page.fs-bulk-active .fs-bulk-done { display: block; }
.fs-bulk-done { display: none; }
.bulk-review-overlay { position: fixed; inset: 0; z-index: 500; background: var(--bg); display: none; flex-direction: column; overflow: hidden; pointer-events: none; }
.bulk-review-overlay.open { display: flex; pointer-events: auto; }
.bulk-review-scroll { flex: 1; overflow-y: auto; padding: 1rem; padding-bottom: 1.5rem; }
.bulk-review-actions { flex-shrink: 0; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); display: flex; gap: 0.5rem; background: var(--card); }
.bulk-review-actions .btn { flex: 1; justify-content: center; }

.register-page { background: #ffffff; border: 1px solid #e8eaed; border-radius: 12px; padding: 2.5rem; max-width: 520px; margin: 0 auto; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04); }

.content.content-fast-scan { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fast-scan-page { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; position: relative; }
.fs-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--chrome-fill-10);
  color: var(--accent);
  border: 1px solid var(--chrome-border-22);
  margin-bottom: 0.5rem;
}

@media (min-width: 901px) {
  .content.content-fast-scan { padding: 0 0 1rem !important; }
}
.fs-list-section { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0.75rem 1rem 0; overflow: hidden; }
.fs-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; flex-shrink: 0; }
.fs-list-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.5rem; }
.fs-row { display: flex; align-items: stretch; gap: 0.65rem; padding: 0.65rem 0.75rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.5rem; touch-action: pan-y; position: relative; transition: background 0.2s ease, box-shadow 0.2s ease; }
.fs-row.fs-row-flash { animation: fsRowFlash 0.55s ease; }
@keyframes fsRowFlash { 0% { background: rgba(234, 179, 8, 0.2); box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.45); } 100% { background: var(--card); box-shadow: none; } }
.fs-row.removing { opacity: 0; transform: translateX(-100%); transition: all 0.25s ease; }
.fs-row-main { flex: 1; min-width: 0; }
.fs-row-name { font-weight: 600; font-size: 0.88rem; line-height: 1.25; }
.fs-row-meta { color: var(--text3); font-size: 0.76rem; margin-top: 0.15rem; }
.fs-row-price { color: var(--accent); font-size: 0.85rem; margin-top: 0.25rem; font-weight: 600; }
.fs-qty-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; padding: 0.15rem 0.45rem; border-radius: 8px; font-size: 0.75rem; font-weight: 600; margin-left: 0.35rem; vertical-align: middle; }
.fs-qty-badge.q1 { background: var(--bg3); color: var(--text2); }
.fs-qty-badge.q2 { background: rgba(234, 179, 8, 0.15); color: #a16207; border: 1px solid rgba(234, 179, 8, 0.35); }
.fs-qty-badge.q3 { background: rgba(234, 88, 12, 0.12); color: var(--orange); border: 1px solid rgba(234, 88, 12, 0.3); }
.fs-row-actions { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.fs-row-qty { display: flex; align-items: center; gap: 0.35rem; }
.fs-swipe-bg { position: absolute; right: 0; top: 0; bottom: 0; width: 56px; background: rgba(220, 38, 38, 0.1); display: flex; align-items: center; justify-content: center; color: var(--red); font-weight: 600; font-size: 0.75rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; opacity: 0; pointer-events: none; }
.fs-row.fs-swipe-open .fs-swipe-bg { opacity: 1; }
.fs-bottom-bar { flex-shrink: 0; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.65rem; box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06); }

.fs-bottom-stats { display: flex; justify-content: space-between; align-items: center; font-size: 0.88rem; }
.fs-bottom-stats .mono { color: var(--accent); font-weight: 600; font-size: 1rem; }
.fs-bottom-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.fs-bottom-actions .btn { flex: 1; min-width: 120px; justify-content: center; }
.fs-field-mini { font-size: 0.78rem; }
.fs-field-mini input,
.fs-field-mini textarea { width: 100%; padding: 0.5rem 0.65rem; font-size: 0.85rem; }
.toast.fs-scan-toast { position: fixed; bottom: 5.5rem; left: 50%; transform: translateX(-50%); right: auto; min-width: 240px; max-width: 90vw; z-index: 10000; }

.fulfill-item { background: var(--bg2); border-radius: 9px; padding: 0.85rem; margin-bottom: 0.5rem; border-left: 4px solid var(--border); transition: background 0.3s; }
.fulfill-item.pending { border-left-color: var(--border2); }
.fulfill-item.partial { border-left-color: var(--brand); background: var(--chrome-fill-06); }

.fulfill-item.complete { border-left-color: #22c55e; background: rgba(34, 197, 94, 0.08); }
.fulfill-line-flash { animation: fulfillLineFlash 0.55s ease; }
@keyframes fulfillLineFlash { 0% { background: rgba(34, 197, 94, 0.38); } 100% { } }
.progress-bar-wrap { width: 100%; height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; margin: 0.5rem 0; }
.progress-bar-fill { height: 100%; background: #22c55e; transition: width 0.35s ease; border-radius: 6px; }
.progress-bar-wrap.disp-prog-wrap-done .progress-bar-fill { background: #22c55e; }
.dispatch-dl-check-item { padding: 16px; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--border); background: var(--card); }
.dispatch-dl-check-item.checked { background: #f0fdf4; border: 1px solid #bbf7d0; }
.dispatch-dl-check-item.checked.qty-changed { background: #fffbeb; border: 1px solid #fde68a; }
.dispatch-dl-check-item.qty-changed { background: #fffbeb; border: 1px solid #fde68a; }
.dispatch-dl-check-item.short { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.dispatch-dl-check-item.damaged { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.chk-lg { width: 40px; height: 40px; min-width: 40px; min-height: 40px; accent-color: #16a34a; cursor: pointer; flex-shrink: 0; }
a[href^="tel"] { color: var(--accent); text-decoration: none; font-weight: 500; }
.wh-camera-wrap { position: relative; width: 100%; max-height: 42vh; min-height: 180px; background: #000; border-radius: var(--radius); overflow: hidden; border: 3px solid var(--border2); transition: border-color 0.12s ease, box-shadow 0.12s ease; }
.wh-camera-wrap.flash-green { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35); }
.wh-camera-wrap.flash-red { border-color: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.35); }
.wh-camera-wrap.flash-orange { border-color: #ea580c; box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.35); }
.wh-camera-wrap.flash-yellow { border-color: #ca8a04; box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.35); }
.wh-video { width: 100%; height: 100%; min-height: 180px; object-fit: cover; display: block; }
.delivery-confirm-screen { position: fixed; inset: 0; background: #f4f5f7; color: #1a1f36; z-index: 9999; overflow-y: auto; font-family: 'Inter', sans-serif; padding: 1.25rem; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); pointer-events: auto; }
.deliv-steps { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.deliv-step { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 600; padding: 0.35rem 0.65rem; border-radius: 999px; background: var(--bg3); color: var(--text3); border: 1px solid var(--border); }
.deliv-step--active { background: var(--chrome-fill-10); color: var(--brand); border-color: var(--chrome-border-28); }
.deliv-step--done { background: rgba(34, 197, 94, 0.1); color: var(--green); border-color: rgba(34, 197, 94, 0.28); }
.deliv-step-num { width: 1.25rem; height: 1.25rem; border-radius: 50%; background: rgba(0,0,0,0.06); display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; }
.deliv-compact-table tbody tr.deliv-line-row:hover { background: var(--bg2); }
.deliv-return-row td { border-top: 1px dashed var(--border); }
.deliv-invoice-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.deliv-invoice-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  font-weight: 600;
}
.deliv-invoice-table td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.deliv-invoice-table tfoot td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  padding: 0.75rem 0.65rem;
  background: var(--bg2);
}
.deliv-invoice-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}
.deliv-add-product-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.75rem;
}
.deliv-add-product-row input { flex: 1; min-width: 12rem; }
.deliv-add-hits {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-height: 10rem;
  overflow-y: auto;
}
.deliv-add-hits li button {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: 0;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.85rem;
}
.deliv-add-hits li button:hover { background: var(--bg2); }
.inv-line--return .inv-item-title { color: #b91c1c; }
.confirm-btn-large { background: #22c55e; color: #fff; font-size: 1.2rem; font-weight: 600; padding: 1.25rem 2rem; border-radius: 14px; width: 100%; border: none; cursor: pointer; font-family: 'Inter', sans-serif; }
.confirm-btn-large:active { opacity: 0.92; }
.wh-overlay-complete { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.82); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 1.5rem; pointer-events: auto; }
.wh-overlay-inner { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; max-width: 420px; text-align: center; }

.content.content-wo-create { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wo-create-page { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; position: relative; }
.wo-step-indicator { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: center; }
.wo-step-indicator .step-pill { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.35rem 0.65rem; border-radius: 999px; background: var(--bg3); color: var(--text3); border: 1px solid var(--border); }
.wo-step-indicator .step-pill.active { background: var(--chrome-fill-10); color: var(--brand); border-color: var(--chrome-border-28); }

.wo-step-indicator .step-pill.done { background: rgba(34, 197, 94, 0.1); color: var(--green); border-color: rgba(34, 197, 94, 0.28); }
.wo-customer-card { background: var(--bg2); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1rem; cursor: pointer; transition: border-color 0.2s, background 0.2s; margin-bottom: 0.65rem; position: relative; }
.wo-customer-card:hover { border-color: var(--border2); }
.wo-customer-card.selected { border-color: var(--brand); background: var(--chrome-fill-06); }

.wo-customer-card .wo-check { position: absolute; top: 0.65rem; right: 0.65rem; color: var(--green); font-size: 1.1rem; display: none; }
.wo-customer-card.selected .wo-check { display: block; }
.wo-customer-card .biz { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.35rem; padding-right: 1.5rem; }
.wo-customer-card .meta { color: var(--text3); font-size: 0.82rem; line-height: 1.45; }
.walkin-badge { display: inline-block; font-size: 0.65rem; font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 4px; background: var(--chrome-fill-10); color: var(--brand); text-transform: uppercase; letter-spacing: 0.05em; margin-left: 0.35rem; vertical-align: middle; }

.wo-camera-wrap { position: relative; flex: 0 0 50vh; min-height: 200px; max-height: 55vh; background: #000; border-radius: 0; overflow: hidden; border: 3px solid var(--border2); transition: border-color 0.12s ease, box-shadow 0.12s ease; }
@media (min-width: 901px) {
  .wo-camera-wrap { flex: 0 0 38vh; max-height: 420px; border-radius: var(--radius); margin: 0 1rem; margin-top: 0.5rem; }
}
.wo-camera-wrap.flash-green { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35); }
.wo-camera-wrap.flash-red { border-color: var(--red); box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.35); }
.wo-camera-wrap.flash-yellow { border-color: #ca8a04; box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.4); }
#woVideo,
#woPsVideo,
#wcfPsVideo,
#fsPsVideo { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 200px; }
#woCanvas { display: none; }

/* ProductSearchInput (shop + create order) */
.shop-product-search-mount {
  padding: 0 1rem;
  margin-bottom: 0.65rem;
}
.mw-product-search-root {
  position: relative;
  z-index: 4;
}
.mw-ps-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.mw-ps-input {
  flex: 1;
  width: 100%;
  min-height: 52px;
  font-size: 1.05rem;
  padding: 0.65rem 11rem 0.65rem 0.85rem;
  border-radius: var(--radius, 10px);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  box-sizing: border-box;
}
.mw-ps-input:focus {
  outline: none;
  border-color: var(--brand, var(--accent));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.mw-ps-input-icons {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.mw-ps-spinner {
  font-size: 1rem;
  opacity: 0.85;
  animation: mw-ps-spin 0.9s linear infinite;
}
@keyframes mw-ps-spin {
  to {
    transform: rotate(360deg);
  }
}
.mw-ps-cam-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.mw-ps-cam-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mw-ps-cam-ico {
  font-size: 1.1rem;
  line-height: 1;
}
@media (max-width: 520px) {
  .mw-ps-cam-lbl {
    display: none;
  }
  .mw-ps-input {
    padding-right: 5rem;
  }
}
.mw-ps-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
.mw-ps-dd-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.mw-ps-dd-row:last-child {
  border-bottom: none;
}
.mw-ps-dd-row:hover {
  background: var(--bg2);
}
.mw-ps-dd-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mw-ps-dd-thumb-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}
.mw-ps-dd-thumb-ph {
  font-size: 1.1rem;
  opacity: 0.45;
}
.mw-ps-dd-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
}
.mw-ps-dd-meta {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.3;
  margin-top: 0.15rem;
}
.mw-ps-dd-price {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}
.mw-ps-dd-add {
  min-height: 40px;
  min-width: 40px;
}
.mw-ps-camera-panel {
  margin-top: 0.75rem;
}
.mw-ps-cam-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding: 0 0.15rem;
  gap: 0.5rem;
}
.mw-ps-cam-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.mw-ps-mini-status {
  display: none;
}
.mw-ps-cam-title {
  font-weight: 700;
  font-size: 0.95rem;
}
.mw-ps-cam-stop {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  border-radius: 8px;
}
.mw-ps-cam-stop:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mw-ps-viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(60vh, 520px);
  margin: 0 auto;
  background: #000;
  overflow: hidden;
}
.mw-ps-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mw-ps-scan-line {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 48%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f87171, #ef4444, #f87171, transparent);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  animation: mw-ps-scan-sweep 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes mw-ps-scan-sweep {
  0%,
  100% {
    transform: translateY(-18px);
    opacity: 0.65;
  }
  50% {
    transform: translateY(18px);
    opacity: 1;
  }
}
.mw-ps-cam-caption {
  font-size: 0.82rem;
  color: var(--text3);
  margin: 0.5rem 0 0;
  line-height: 1.45;
  padding: 0 0.15rem;
}
.mw-ps-cam-deny {
  padding: 1.25rem;
  color: var(--text2);
  font-size: 0.9rem;
  text-align: center;
}
.mw-ps-cam-confirm {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 5;
  background: rgba(22, 163, 74, 0.95);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  max-width: 94%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-ps-cam-confirm.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.wo-bottom-bar-3 { flex-shrink: 0; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.65rem; box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06); }

.wo-bottom-bar-3 .wo-stat { font-size: 0.88rem; }
.wo-bottom-bar-3 .wo-stat .mono { color: var(--accent); font-weight: 600; }
.wo-success-screen { text-align: center; padding: 2rem 1.25rem 3rem; max-width: 440px; margin: 0 auto; }
.wo-success-screen .big-check { font-size: 3.5rem; line-height: 1; margin-bottom: 1rem; }
.wo-tab-btn { padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg2); color: var(--text2); cursor: pointer; font-size: 0.88rem; }
.wo-tab-btn.active { border-color: var(--brand); color: var(--brand); background: var(--chrome-fill-06); }

.order-cycle-card.co-order-highlight {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--chrome-fill-10);
}

.wo-case-toggle { font-size: 0.68rem; font-weight: 600; padding: 0.2rem 0.45rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg3); color: var(--text2); cursor: pointer; margin-top: 0.25rem; }
.wo-case-toggle.case-on { border-color: rgba(234, 88, 12, 0.4); color: var(--orange); background: rgba(234, 88, 12, 0.08); }
.create-fulfill-card { background: #f0f5ff; border: 1px solid var(--chrome-border-22); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.direct-badge { display: inline-block; font-size: 0.65rem; font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 4px; background: rgba(100, 100, 100, 0.12); color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; margin-left: 0.35rem; vertical-align: middle; }
.wcf-review-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.wcf-review-item:last-child { border-bottom: none; }
.content.content-wcf-create { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.bottom-sheet-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px); z-index: 600; display: flex; align-items: flex-end; justify-content: center; pointer-events: auto; }

.bottom-sheet { background: var(--bg2); border: 1px solid var(--border); border-radius: 20px 20px 0 0; padding: 1.5rem; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; animation: sheetUp 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 40px; height: 4px; background: var(--border2); border-radius: 2px; margin: 0 auto 1.25rem; }
.pricing-tabs { display: flex; gap: 0.25rem; background: #f4f5f7; border-radius: 8px; padding: 0.2rem; margin-bottom: 1rem; border: 1px solid #e8eaed; }

.pricing-tab { flex: 1; padding: 0.45rem; border: none; background: none; color: var(--text2); font-size: 0.85rem; border-radius: 6px; cursor: pointer; font-family: 'Inter', sans-serif; font-weight: 500; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.pricing-tab.on { background: #ffffff; color: #1a1f36; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.edit-panel { background: var(--bg3); border: 1px solid var(--border); border-radius: 0 0 9px 9px; padding: 1rem; margin-top: -2px; animation: expandDown 0.2s ease; }
@keyframes expandDown { from { opacity: 0; transform: scaleY(0); transform-origin: top; } to { opacity: 1; transform: scaleY(1); } }
.custom-badge { display: inline-block; font-size: 0.65rem; font-weight: 600; padding: 0.12rem 0.4rem; border-radius: 4px; background: rgba(100, 100, 100, 0.15); color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; margin-left: 0.3rem; vertical-align: middle; }
.fs-row-wrap { margin-bottom: 0.5rem; }
.fs-row-edit-btn { font-size: 0.85rem; padding: 0.2rem 0.45rem; background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text2); cursor: pointer; }
.fs-row-flash-done { animation: fsRowFlashDone 0.45s ease; }
@keyframes fsRowFlashDone { 0% { background: rgba(34, 197, 94, 0.22); } 100% { background: var(--card); } }

:root.light .card { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04); }
:root.light .stat,
:root.light .stat-card { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04); }
:root.light .sidebar { box-shadow: none; background: var(--sidebar-bg) !important; }
:root.light .shop-cat-filter-row:hover {
  background: rgba(26, 31, 54, 0.06);
}
:root.light .topbar { box-shadow: none; }
:root.light .prod-card:hover,
:root.light .product-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }
:root.light tr:hover td { background: #fafbfc; }
:root.light .nav-item.active[data-section='overview'],
:root.light .nav-item.active[data-section='settings'] {
  background: var(--brand-light);
  border-left-color: transparent;
  color: var(--brand-dark);
}
:root.light .btn-ghost { background: var(--bg3); color: var(--text2); }
:root.light .btn-ghost:hover { background: var(--bg4); color: var(--text); }
:root.light .f input,
:root.light .f select,
:root.light .f textarea,
:root.light .field input,
:root.light .field select,
:root.light .field textarea,
:root.light .search-inp,
:root.light .search-input,
:root.light .sel { background: #ffffff; border-color: #d1d5db; }
:root.light .f input:focus,
:root.light .f select:focus,
:root.light .f textarea:focus,
:root.light .field input:focus,
:root.light .field select:focus,
:root.light .field textarea:focus { background: #ffffff; border-color: var(--brand); box-shadow: 0 0 0 3px var(--chrome-focus-ring); }
:root.light #mobileBottomBar { box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.06); }
:root.light .scan-zone { background: #f8f9fb; }
:root.light .bottom-sheet { background: #ffffff; }

#invoicePrintSheet { position: absolute; left: -99999px; top: 0; width: 800px; background: #fff; color: #111; font-family: 'Inter', system-ui, sans-serif; font-size: 11pt; line-height: 1.4; padding: 12mm; }
#invoicePrintSheet .inv-doc { max-width: 100%; }
#invoicePrintSheet .inv-header { margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid #e5e7eb; }
#invoicePrintSheet .inv-header-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: nowrap; }
#invoicePrintSheet .inv-header-left { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; flex-wrap: wrap; }
#invoicePrintSheet .inv-header-order { flex: 0 0 auto; width: 200px; max-width: 42%; text-align: center; }
#invoicePrintSheet .inv-header-order-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
  margin-bottom: 4px;
}
#invoicePrintSheet .inv-header-order-num {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-align: center;
  color: #1f2937;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
#invoicePrintSheet .inv-logo { margin: 0; line-height: 0; flex-shrink: 0; }
#invoicePrintSheet .inv-logo img { max-height: 56px; width: auto; object-fit: contain; display: block; }
#invoicePrintSheet .inv-company-block { min-width: 0; }
#invoicePrintSheet .inv-company-name { font-size: 1.35rem; font-weight: 700; color: #1e293b; letter-spacing: -0.02em; }
#invoicePrintSheet .inv-company-sub { font-size: 0.78rem; color: #64748b; margin-top: 0.15rem; text-transform: uppercase; letter-spacing: 0.06em; }
#invoicePrintSheet .inv-company-contact { font-size: 0.88rem; color: #475569; margin-top: 0.35rem; }
#invoicePrintSheet .mw-inv-bc-wrap { padding: 8px 12px; box-sizing: border-box; display: inline-block; max-width: 100%; }
#invoicePrintSheet .mw-inv-bc-wrap .mw-inv-bc-svg { display: block; max-width: 180px; height: auto; margin: 0 auto; }
#invoicePrintSheet .mw-inv-bc-wrap--line .mw-inv-bc-svg { max-width: 120px; }
#invoicePrintSheet .inv-order-block { margin-bottom: 1rem; }
#invoicePrintSheet .inv-invoice-title { font-size: 1rem; font-weight: 700; color: #0f172a; }
#invoicePrintSheet .inv-invoice-meta { font-size: 0.88rem; color: #475569; margin-top: 0.2rem; }
#invoicePrintSheet .inv-invoice-status { font-size: 0.85rem; margin-top: 0.35rem; color: #334155; }
#invoicePrintSheet .inv-billto { font-size: 0.9rem; color: #334155; }
#invoicePrintSheet .inv-meta { font-size: 0.85rem; color: #555; margin-bottom: 1rem; }
#invoicePrintSheet .inv-h1 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.4rem; color: #0f172a; letter-spacing: 0.02em; }
#invoicePrintSheet .inv-lines-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 12px;
  margin-top: 0.5rem;
}
#invoicePrintSheet .inv-lines { display: flex; flex-direction: column; gap: 0; }
#invoicePrintSheet .inv-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #e5e7eb;
}
#invoicePrintSheet .inv-line:first-child { border-top: none; }
#invoicePrintSheet .inv-line-main { display: flex; gap: 8px; flex: 1; min-width: 0; align-items: flex-start; }
#invoicePrintSheet .inv-item-num { font-size: 12px; font-weight: 600; color: #374151; flex-shrink: 0; padding-top: 2px; }
#invoicePrintSheet .inv-line-main-inner { flex: 1; min-width: 0; }
#invoicePrintSheet .inv-item-title { font-size: 13px; font-weight: 600; color: #111827; line-height: 1.35; }
#invoicePrintSheet .inv-sku-line { font-size: 11px; color: #6b7280; margin-top: 3px; }
#invoicePrintSheet .inv-sku-lbl { font-family: 'Inter', system-ui, sans-serif; }
#invoicePrintSheet .inv-sku-val { color: #6b7280; }
#invoicePrintSheet .inv-metrics { font-size: 12px; color: #374151; margin-top: 6px; line-height: 1.4; }
#invoicePrintSheet .inv-metrics strong { font-weight: 700; }
#invoicePrintSheet .inv-metrics-was { color: #6b7280; font-size: 11px; }
#invoicePrintSheet .inv-metrics-disc { color: #059669; font-size: 11px; }
#invoicePrintSheet .inv-line-bc { flex: 0 0 140px; width: 140px; display: flex; align-items: center; justify-content: flex-end; }
#invoicePrintSheet .inv-line-bc .mw-inv-line-bcCol { text-align: right; width: 100%; }
#invoicePrintSheet .mw-inv-line-bcCol__num {
  font-size: 9px;
  margin-top: 3px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: #374151;
  letter-spacing: 0.04em;
}
#invoicePrintSheet .inv-custom { font-size: 0.72rem; color: #777; margin-top: 0.15rem; }
#invoicePrintSheet .inv-totals { margin-top: 1rem; text-align: right; font-size: 0.95rem; }
#invoicePrintSheet .inv-total-line { margin-top: 0.5rem; font-size: 1.15rem; color: #0f172a; }
#invoicePrintSheet .inv-total-line .mono { font-weight: 700; color: var(--brand-primary); }
#invoicePrintSheet .inv-footer { margin-top: 1.75rem; padding-top: 1.1rem; border-top: 2px solid #e2e8f0; font-size: 0.82rem; color: #475569; text-align: center; line-height: 1.55; }
#invoicePrintSheet .inv-footer-brand { font-weight: 700; font-size: 0.95rem; color: #1e293b; margin-bottom: 0.25rem; }
#invoicePrintSheet .inv-footer-addr { color: #64748b; }
#invoicePrintSheet .inv-footer-phone { color: #64748b; margin-top: 0.15rem; }
#invoicePrintSheet .inv-footer-note { margin-top: 0.65rem; font-style: italic; color: #94a3b8; font-size: 0.8rem; }

/* While preparing to print, keep the sheet in the viewport (not far off-screen)
   so inline SVG barcodes render; off-screen SVGs can print blank in some engines. */
body.invoice-print-mode #invoicePrintSheet {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: 800px !important;
  max-width: 100vw !important;
  z-index: 2147483646 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
@media print {
  body.invoice-print-mode * { visibility: hidden !important; }
  body.invoice-print-mode #invoicePrintSheet,
  body.invoice-print-mode #invoicePrintSheet * { visibility: visible !important; }
  body.invoice-print-mode #invoicePrintSheet {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    min-height: 100%;
    background: #fff !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  body.invoice-print-mode #invoicePrintSheet svg.mw-inv-bc-svg {
    max-width: 100% !important;
    height: auto !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Order modal / list: invoice-style barcode blocks */
.mw-order-header-bcinv { text-align: center; margin-bottom: 1rem; max-width: 220px; }
.mw-order-header-bcinv__label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
  margin-bottom: 4px;
}
.mw-order-header-bcinv__num {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #1f2937;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
.mw-order-header-bcinv .mw-inv-bc-wrap { padding: 8px 12px; display: inline-block; }
.mw-modal-inv-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.mw-modal-inv-line__main { flex: 1; min-width: 0; }
.mw-modal-inv-line__bc { flex: 0 0 140px; text-align: right; }
.mw-modal-inv-line__bc .mw-inv-bc-wrap { padding: 6px 10px; display: inline-block; }
.mw-modal-inv-line__bc .mw-inv-line-bcCol__num { font-size: 9px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: #374151; margin-top: 2px; }
.mw-modal-sku-row { font-size: 11px; color: var(--text3); margin-top: 4px; }
.mw-modal-sku-row .mono { color: var(--text3); }

/* Product CSV import (admin) */
.import-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 1.5rem; font-size: 0.85rem; color: var(--text3); }
.import-step-active { font-weight: 600; color: var(--brand); }
.import-dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.import-dropzone:hover,
.import-dropzone.import-dz-drag {
  border-color: var(--brand);
  background: #f0f5ff;
}
.badge-import-new {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.badge-import-update {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.badge-import-skip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* ── Admin Reports ─────────────────────────────────────────── */
.report-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  min-height: calc(100vh - 120px);
}
.report-sidebar-tabs {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
}
.report-tab-section {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 12px 16px 4px;
}
.report-tab-section--sales { color: var(--brand); }
.report-tab-section--customers { color: #0369a1; }
.report-tab-section--inventory { color: #92400e; }
.report-tab-section--vendors { color: #065f46; }
.report-tab {
  display: block;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text2);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.report-tab:hover {
  color: var(--text);
  background: var(--bg3);
}
.report-tab.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-left-color: var(--accent);
  font-weight: 600;
}
.report-content {
  padding: 1.5rem;
  overflow-y: auto;
}
.report-filter-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.date-quick-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.date-quick-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
  font-weight: 600;
}
.report-print-header {
  display: none;
  margin-bottom: 1.5rem;
}
.report-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 1100px) {
  .report-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.report-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.report-stat-card .lbl { font-size: 0.75rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; }
.report-stat-card .val { font-size: 1.35rem; font-weight: 700; color: var(--text); margin-top: 0.35rem; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.report-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.report-table th, .report-table td { padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--border); text-align: left; }
.report-table th { color: var(--text3); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.report-table tr:hover td { background: var(--bg3); }
.report-row-expand td { background: var(--bg3); font-size: 0.8rem; }
.report-actions-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.report-error { color: var(--red); padding: 1rem; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
.report-loading { color: var(--text2); padding: 1rem; }
.report-cust-box, .report-sum-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.report-cust-box h4, .report-sum-box h4 { font-size: 0.75rem; color: var(--text3); text-transform: uppercase; margin-bottom: 0.5rem; }

.dash-report-links {
  margin-bottom: 0.75rem;
}
.dash-report-link {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
}
.dash-report-link:last-child {
  border-bottom: none;
}

.rep-overview-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 1.5rem;
}
.rep-overview-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--text);
}
.rep-overview-sub {
  font-size: 0.9rem;
  color: var(--text2);
  margin: 0 0 1.5rem;
}
.rep-ov-section {
  margin-bottom: 24px;
}
.rep-ov-head {
  border-radius: 10px 10px 0 0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.rep-ov-head--sales {
  background: var(--brand);
}
.rep-ov-head--customers {
  background: #0369a1;
}
.rep-ov-head--vendor {
  background: #065f46;
}
.rep-ov-head--inventory {
  background: #92400e;
}
.rep-ov-head-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.rep-ov-head-text h3 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}
.rep-ov-head-text p {
  margin: 0.25rem 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  line-height: 1.45;
}
.rep-ov-card-grid {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .rep-ov-card-grid {
    grid-template-columns: 1fr;
  }
}
.rep-ov-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.rep-ov-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.rep-ov-card-desc {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.45;
  margin-bottom: 0.65rem;
  flex: 1;
}
.rep-ov-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.rep-ov-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 20px;
}
.rep-ov-pill--sales {
  background: var(--chrome-fill-10);
  color: var(--brand);
  border: 1px solid var(--chrome-border-30);
}
.rep-ov-pill--customers {
  background: rgba(3, 105, 161, 0.1);
  color: #0369a1;
  border: 1px solid rgba(3, 105, 161, 0.3);
}
.rep-ov-pill--vendor {
  background: rgba(6, 95, 70, 0.1);
  color: #065f46;
  border: 1px solid rgba(6, 95, 70, 0.3);
}
.rep-ov-pill--inventory {
  background: rgba(146, 64, 14, 0.1);
  color: #92400e;
  border: 1px solid rgba(146, 64, 14, 0.3);
}

.report-sidebar-tabs.rep-sidebar-dimmed {
  opacity: 0.72;
}

/* Admin products: margin badges + thumb + bulk bar (products.js) */
.margin-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  white-space: nowrap;
}
.margin-green {
  background: #e6f9f2;
  color: #1a8a5a;
}
.margin-yellow {
  background: #fff8e6;
  color: #b07d00;
}
.margin-red {
  background: #fdf0f0;
  color: #c0392b;
}
.margin-na {
  background: #f0f0f0;
  color: #999;
}
.admin-prod-thumb-wrap {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-prod-thumb-wrap img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  display: block;
}
.admin-prod-thumb-wrap.no-img {
  font-size: 1.1rem;
  color: var(--text3);
}
.products-admin-bulk-bar {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  background: #1a1a2e;
  color: #e8e8ef;
  font-size: 0.88rem;
}
.products-admin-bulk-bar.is-visible {
  display: flex;
}
.products-admin-bulk-bar .btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}
.products-admin-missing-img-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.65rem;
  border-radius: 8px;
  background: rgba(180, 83, 9, 0.12);
  border: 1px solid rgba(180, 83, 9, 0.35);
  font-size: 0.86rem;
}
.products-admin-missing-img-banner.is-visible {
  display: flex;
}
.admin-cases-only-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.admin-cases-only-toggle input[type='checkbox'] {
  width: 44px;
  height: 24px;
  appearance: none;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.admin-cases-only-toggle input[type='checkbox']::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  top: 2px;
  left: 3px;
  transition: transform 0.15s;
}
.admin-cases-only-toggle input[type='checkbox']:checked {
  background: var(--accent, #3b82f6);
  border-color: transparent;
}
.admin-cases-only-toggle input[type='checkbox']:checked::after {
  transform: translateX(18px);
}
.admin-edit-image-dropzone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text2);
  font-size: 0.88rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-edit-image-dropzone.is-dragover {
  border-color: var(--accent, #3b82f6);
  background: var(--bg3);
}
.admin-edit-image-hero {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  background: var(--bg2);
}
.admin-edit-image-hero-wrap {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text3);
}

/* ── Mobile baseline (max-width 767.98px) ───────────────────────────── */
@media (max-width: 767.98px) {
  html,
  body {
    font-size: var(--mw-fs-base-mobile);
  }
  input,
  select,
  textarea,
  button {
    min-height: var(--mw-tap);
    font-size: 16px;
  }
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-ghost {
    min-height: var(--mw-tap);
    padding: 0 1rem;
  }
  table {
    font-size: 14px;
  }
  /* F5a: avoid edge-to-edge fullscreen - inset scrollable modals finalized in system.css */
  .modal {
    max-width: min(100vw, 560px);
    width: calc(100vw - 1rem);
    height: auto;
    max-height: calc(100dvh - 2rem);
    border-radius: var(--radius-md, 12px);
    margin: 0;
  }
  .modal-bg {
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
  }
  .field-row {
    grid-template-columns: 1fr !important;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
  }
  /* F5a: bottom nav clearance only when bar is shown (canonical rule also in system.css) */
  body:has(#mobileBottomBar.visible) #mainContent.content {
    padding-bottom: calc(var(--mw-mobile-bottombar-h, 56px) + env(safe-area-inset-bottom, 0px) + 0.75rem);
  }
  .close-btn {
    min-width: var(--mw-tap);
    min-height: var(--mw-tap);
    width: var(--mw-tap);
    height: var(--mw-tap);
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mw-desktop-only {
    display: none !important;
  }
  .mw-ps-camera-panel {
    max-height: 38vh;
  }
  .mw-ps-camera-panel[hidden] {
    display: none;
  }
  .mw-product-search-root[data-mw-ps-state='open-mini'] .mw-ps-camera-panel {
    position: fixed;
    bottom: calc(var(--mw-mobile-bottombar-h) + 12px);
    right: 12px;
    width: 96px;
    height: auto;
    max-height: none;
    padding: 0;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 40;
    background: var(--card);
    border: 1px solid var(--border);
  }
  .mw-product-search-root[data-mw-ps-state='open-mini'] .mw-ps-cam-head,
  .mw-product-search-root[data-mw-ps-state='open-mini'] .mw-ps-cam-caption {
    display: none;
  }
  .mw-product-search-root[data-mw-ps-state='open-mini'] .mw-ps-viewfinder {
    width: 96px;
    height: 96px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
  }
  .mw-product-search-root[data-mw-ps-state='open-mini'] .mw-ps-mini-status {
    display: block;
    font-size: 0.65rem;
    line-height: 1.25;
    padding: 0.35rem 0.4rem;
    text-align: center;
    color: var(--text2);
    max-width: 96px;
    word-break: break-word;
  }
  .wo-cart-footer,
  .wcf-cart-footer,
  .fs-cart-footer,
  .whf-cart-footer {
    position: sticky;
    bottom: var(--mw-mobile-bottombar-h);
    background: var(--bg1, var(--card));
    border-top: 1px solid var(--border);
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 20;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  }
  .wo-cart-footer .btn-primary,
  .wcf-cart-footer .btn-primary,
  .fs-cart-footer .btn-primary,
  .whf-cart-footer .btn-primary,
  .whf-cart-footer .btn-secondary.btn-full {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }
  .shop-mobile-filters-btn {
    min-height: var(--mw-tap);
  }
  .shop-mobile-cart-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--mw-mobile-bottombar-h) + env(safe-area-inset-bottom));
    z-index: 25;
    padding: 0.5rem 0.75rem;
    background: var(--accent);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  }
  .shop-mobile-cart-bar .btn {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
    font-weight: 600;
    background: #fff;
    color: var(--accent);
    border: none;
  }
  .products-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .products-grid .product-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    grid-template-rows: auto;
    gap: 0 0.75rem;
    align-items: start;
    padding: 0.75rem;
  }
  .products-grid .product-card .product-stock {
    grid-column: 1 / -1;
  }
  .products-grid .product-card .product-card-media,
  .products-grid .product-card > .product-card-media {
    grid-column: 1;
    grid-row: 2;
    width: 96px;
    height: 96px;
    margin: 0;
  }
  .products-grid .product-card .product-card-body {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }
  .products-grid .product-card .product-card-footer {
    grid-column: 1 / -1;
  }
  .products-grid .product-card:hover {
    transform: none;
  }
  .fs-list-scroll .fs-row-card,
  .wo-create-page .fs-list-scroll .fs-row-card,
  .content-wcf-create .fs-list-scroll .fs-row-card {
    display: block;
  }
  .fs-row-card .fs-row-card-inner {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    margin-bottom: 0.5rem;
  }
  .fs-row-card .fs-row-card-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--bg2);
  }
  .fs-row-card .fs-row-card-thumb-ph {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg2);
    border-radius: 8px;
    font-size: 1.5rem;
  }
  .mw-mobile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
  }
  .mw-mobile-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
  }
  .mw-mobile-card-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
  }
  .mw-mobile-card-sub {
    font-size: 0.88rem;
    color: var(--text2);
    margin-bottom: 0.25rem;
  }
  .mw-mobile-card-meta {
    font-size: 0.82rem;
    color: var(--text3);
    margin-bottom: 0.2rem;
  }
  .mw-mobile-card-actions {
    margin-top: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  .mw-mobile-card-actions .btn {
    width: 100%;
  }
  .mw-mobile-card-product-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
  }
  .mw-mobile-card-thumb .product-card-media {
    width: 72px;
    height: 72px;
  }
  .mw-ps-cam-min {
    min-height: var(--mw-tap);
    padding: 0 0.65rem;
    font-size: 0.8rem;
  }
}
@media (min-width: 480px) and (max-width: 767.98px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .products-grid .product-card {
    display: flex;
    flex-direction: column;
  }
  .products-grid .product-card .product-card-media {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
  .products-grid .product-card .product-card-body {
    grid-column: auto;
  }
}
@media (min-width: 768px) {
  .mw-mobile-only {
    display: none !important;
  }
  .shop-mobile-cart-bar {
    display: none !important;
  }
  .mw-ps-mini-status {
    display: none;
  }
}

/* Order cycle list (admin orders) */
.order-cycle-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.order-cycle-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.order-cycle-card-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.order-invoice-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.order-invoice-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.order-invoice-card-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.order-invoice-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.rp-sig-canvas {
  display: block;
  width: 100%;
  max-width: 560px;
  height: 100px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
:root:not(.light) .rp-sig-canvas {
  background: #fafafa;
}
.order-cycle-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.order-cycle-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.order-cycle-card-header .mono {
  font-weight: 700;
  font-size: 1.02rem;
}
.order-cycle-card-total {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--accent);
}
.order-cycle-card-customer {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
  color: var(--text);
}
.order-cycle-lines {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}
.order-cycle-lines li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.28rem 0;
  font-size: 0.92rem;
  line-height: 1.35;
}
.order-cycle-lines .oc-qty {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text2);
  white-space: nowrap;
}
.order-cycle-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text3);
}
.order-cycle-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}
.order-cycle-secondary .btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}
.oc-order-num {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
}
.oc-date {
  font-size: 0.78rem;
  color: var(--text3);
}
.oc-stats {
  font-size: 0.82rem;
  color: var(--text3);
  margin: 0.3rem 0 0.75rem;
}
.oc-placed-by {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  color: var(--text2);
}
.oc-placed-by-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.oc-placed-by-cust {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent, #3b82f6);
  border-color: rgba(59, 130, 246, 0.25);
}
.order-cycle-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--accent-soft, rgba(59,130,246,.3));
  transition: box-shadow .15s, border-color .15s;
}

/* ── Order card accordion ──────────────────────────────────────────── */
.oc-accordion .oc-collapsed {
  user-select: none;
}
.oc-accordion .oc-collapsed:hover {
  opacity: 0.88;
}
.oc-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.oc-status-badge {
  flex-shrink: 0;
}
.oc-expanded-inner {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.oc-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}
.oc-lines-table th {
  text-align: left;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  padding: 0.2rem 0.3rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
.oc-lines-table td {
  padding: 0.35rem 0.3rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.oc-lines-table tfoot td {
  border-bottom: none;
  padding-top: 0.55rem;
}
.oc-total-cell {
  font-weight: 700;
  color: var(--accent);
}
.oc-qty-inp,
.oc-price-inp {
  width: 5rem;
  padding: 0.22rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--text);
}
.oc-rm-btn {
  padding: 0.15rem 0.4rem !important;
  font-size: 0.78rem !important;
  color: var(--text3) !important;
}
.oc-rm-btn:hover {
  color: var(--red) !important;
}
.oc-add-product {
  margin-bottom: 0.75rem;
}
.oc-add-label {
  display: block;
  font-size: 0.74rem;
  color: var(--text3);
  margin-bottom: 0.3rem;
}
.oc-expanded-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}
.oc-err {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(220,38,38,0.08);
  border: 1px solid rgba(220,38,38,0.25);
  color: var(--red);
  border-radius: 7px;
  font-size: 0.84rem;
}
/* Mark ready verify screen */
.mark-ready-page {
  max-width: 42rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mark-ready-header {
  padding: 1rem 1.1rem;
}
.mark-ready-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.mark-ready-order-num {
  font-weight: 700;
  font-size: 1.05rem;
}
.mark-ready-total {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--accent);
}
.mark-ready-customer {
  font-weight: 600;
  font-size: 0.95rem;
}
.mark-ready-stats {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--text3);
  line-height: 1.4;
}
.mark-ready-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  margin: 0.65rem 0 0.35rem;
  font-weight: 600;
}
.mark-ready-section-label--extra {
  color: #d97706;
}
.mark-ready-extra-list {
  margin-top: 0;
}
.mark-ready-verify-row--extra {
  border-left: 3px solid #f59e0b;
  padding-left: 0.65rem;
}
.mark-ready-verify-row--over .mark-ready-scan-progress {
  color: #d97706;
  font-weight: 600;
}
.mark-ready-line-table {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mark-ready-line-head,
.mark-ready-line-row {
  display: grid;
  grid-template-columns: 1fr 4.5rem 5.5rem 5rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--bg2);
}
.mark-ready-line-head {
  background: transparent;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  font-weight: 600;
  padding: 0.25rem 0.65rem;
}
.mark-ready-line-name {
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 1.3;
  min-width: 0;
}
.mark-ready-line-qty-inp,
.mark-ready-line-price-inp {
  width: 100%;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg);
}
.mark-ready-line-total {
  text-align: right;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent);
}
.mark-ready-line-row--complete {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.mark-ready-line-row--new {
  border-left: 3px solid var(--accent);
}
.mark-ready-case-tag {
  font-size: 0.68rem;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
}
.mark-ready-footer-totals {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 2px solid var(--border);
  font-size: 0.95rem;
}
.mark-ready-footer-total {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
}
.mark-ready-mode-tabs {
  margin-bottom: 0;
}
.whq-toolbar {
  align-items: center;
  gap: 0.75rem;
}
.whq-all-orders-link {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}
.whq-all-orders-link:hover {
  text-decoration: underline;
}
.whq-tab-hint {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  color: var(--text3);
  line-height: 1.4;
}
.mark-ready-banner {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.4;
}
.mark-ready-banner--error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: var(--red);
}
.mark-ready-banner--warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--amber);
}
.mark-ready-scan-host {
  margin-bottom: 0.25rem;
}
.mark-ready-scan-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  margin-bottom: 0.35rem;
}
.mark-ready-scan-input {
  width: 100%;
  font-size: 1.35rem;
  padding: 0.85rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg2);
}
.mark-ready-scan-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.mark-ready-verify-card {
  padding: 0.85rem 1rem 1rem;
}
.mark-ready-verify-hint {
  font-size: 0.82rem;
  color: var(--text3);
  margin-bottom: 0.75rem;
  line-height: 1.45;
}
.mark-ready-verify-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mark-ready-verify-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  cursor: default;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.mark-ready-verify-row--tap {
  cursor: pointer;
}
.mark-ready-verify-row--tap:hover {
  border-color: var(--accent);
}
.mark-ready-verify-row--complete {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.45);
}
.mark-ready-check {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  accent-color: var(--green);
}
.mark-ready-verify-name {
  flex: 1 1 12rem;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
}
.mark-ready-verify-qty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text2);
  white-space: nowrap;
}
.mark-ready-scan-progress {
  font-weight: 600;
}
.mark-ready-verify-row--complete .mark-ready-verify-qty,
.mark-ready-verify-row--complete .mark-ready-scan-progress {
  color: var(--green);
}
.mark-ready-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-bottom: 1.5rem;
}

/* Warehouse queue - payment status chips (F4a) */
.whq-pay-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.35rem;
  vertical-align: middle;
  line-height: 1.3;
}
.whq-pay-badge--paid {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.whq-pay-badge--partial {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.whq-pay-badge--unpaid {
  background: rgba(220, 38, 38, 0.1);
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.28);
}
.whq-meta-note,
.whq-meta-address {
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
  line-height: 1.45;
}
.whq-meta-note {
  background: var(--bg2);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  color: var(--text2);
}
.whq-meta-address {
  font-size: 0.82rem;
  color: var(--text3);
}
.whq-meta-label {
  font-weight: 600;
  color: var(--text2);
  margin-right: 0.25rem;
}

/* Payments admin tables (F4a) */
#payPendingHost .table-wrap,
#payTableHost .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#payPendingHost table,
#payTableHost table {
  min-width: 52rem;
  font-size: 0.86rem;
}
#payPendingHost th,
#payTableHost th {
  font-size: 0.74rem;
  white-space: nowrap;
}
#payPendingHost td,
#payTableHost td {
  vertical-align: middle;
}
#payPendingHost .payment-method-badge,
#payTableHost .payment-method-badge {
  margin-right: 0.15rem;
}
#payPendingHost .badge,
#payTableHost .badge,
#payPendingHost .status,
#payTableHost .status {
  white-space: nowrap;
}
#payPendingHost td:last-child,
#payTableHost td:last-child {
  min-width: 9rem;
}
#payPendingHost .btn-sm,
#payTableHost .btn-sm {
  margin: 0.1rem 0;
}

@media (max-width: 767.98px) {
  .deliv-invoice-actions {
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .deliv-invoice-actions .btn-sm {
    min-height: 2.25rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .mark-ready-page {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
  }
  .mark-ready-line-head {
    display: none;
  }
  .mark-ready-line-row {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
      'mr-name mr-name mr-name'
      'mr-qty mr-price mr-total';
    gap: 0.45rem 0.5rem;
    padding: 0.65rem 0.7rem;
  }
  .mark-ready-line-name {
    grid-area: mr-name;
  }
  .mark-ready-line-qty-inp {
    grid-area: mr-qty;
    min-width: 0;
  }
  .mark-ready-line-price-inp {
    grid-area: mr-price;
    min-width: 0;
  }
  .mark-ready-line-total {
    grid-area: mr-total;
    align-self: center;
  }
  .mark-ready-line-row--tap .mark-ready-line-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
  }
  .mark-ready-line-row--tap .btn {
    min-height: 2.25rem;
  }
  .mark-ready-verify-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .mark-ready-verify-name {
    flex: 1 1 auto;
  }
  .mark-ready-verify-qty,
  .mark-ready-scan-progress {
    align-self: flex-start;
  }
  .mark-ready-actions {
    position: sticky;
    bottom: 0;
    z-index: 25;
    margin: 0 -0.15rem;
    padding: 0.75rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    background: var(--card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
    justify-content: stretch;
    gap: 0.45rem;
  }
  .mark-ready-actions .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 7rem;
    justify-content: center;
  }
  .mark-ready-actions #markReadySubmitBtn {
    flex: 1 1 100%;
    order: -1;
  }

  #payPendingHost table,
  #payTableHost table {
    min-width: 44rem;
    font-size: 0.82rem;
  }
}

/* Mark delivered screen */
.md-header {
  margin-bottom: 0.85rem;
  padding: 1rem 1.1rem;
}
.md-header-order {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.md-header-deliver {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text2);
}
.md-error-banner {
  display: none;
  margin-bottom: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.4;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: var(--red);
}
.md-line-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.md-line-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.05rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.md-line-card--delivered {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
}
.md-line-card--short {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}
.md-line-card--damaged {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.06);
}
.md-line-card--note-invalid .md-line-note {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}
.md-line-card--qty-flash .md-qty-input {
  animation: md-qty-flash 0.45s ease;
}
@keyframes md-qty-flash {
  0%,
  100% {
    border-color: var(--border);
    background: var(--bg2);
  }
  50% {
    border-color: var(--red);
    background: rgba(220, 38, 38, 0.12);
  }
}
.md-line-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}
.md-line-ordered {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text2);
}
.md-condition-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.md-cond-btn {
  min-height: 44px;
  padding: 0.55rem 0.4rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg2);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.md-cond-btn--delivered.is-active {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}
.md-cond-btn--short.is-active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}
.md-cond-btn--damaged.is-active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}
.md-qty-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.md-qty-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
}
.md-qty-input {
  min-height: 44px;
  width: 5rem;
  padding: 0.5rem 0.65rem;
  font-size: 1.1rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg2);
}
.md-qty-readonly {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
}
.md-line-note-wrap {
  margin-top: 0.35rem;
}
.md-line-note-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text3);
  margin-bottom: 0.25rem;
}
.md-line-note {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.92rem;
  resize: vertical;
}
.md-overall-note {
  margin-bottom: 0.85rem;
  padding: 1rem 1.1rem;
}
.md-overall-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.md-optional {
  font-weight: 400;
  color: var(--text3);
}
.md-overall-textarea {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.92rem;
  resize: vertical;
}
.md-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  padding-bottom: 1.5rem;
}
.md-footer-btn {
  min-height: 48px;
}

/* Mark-delivered: payment capture section */
.md-pay-section {
  margin-bottom: 1rem;
}
.md-pay-header {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.md-pay-status-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.md-pay-btn {
  flex: 1;
  min-width: 7rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  text-align: center;
}
.md-pay-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.md-pay-btn--active.md-pay-btn--paid {
  background: rgba(22,163,74,0.12);
  border-color: rgba(22,163,74,0.6);
  color: #16a34a;
}
.md-pay-btn--active.md-pay-btn--unpaid {
  background: rgba(220,38,38,0.1);
  border-color: rgba(220,38,38,0.5);
  color: var(--red);
}
.md-pay-btn--active.md-pay-btn--pending {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.5);
  color: #b45309;
}
.md-pay-detail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.md-pay-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.md-pay-label {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 500;
}
.md-pay-inp {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.92rem;
  width: 100%;
  box-sizing: border-box;
}
.md-pay-methods {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.md-pay-method-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.md-pay-method-btn--active {
  background: var(--brand, #0c6472);
  color: #fff;
  border-color: var(--brand, #0c6472);
}

/* Mark-delivered: resolution radio for short/damaged items */
.md-resolution-wrap {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border);
}
.md-resolution-label {
  font-size: 0.76rem;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  display: block;
}
.md-resolution-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.md-res-option {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  font-size: 0.8rem;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.md-res-option.is-selected {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.4);
  color: var(--accent, #3b82f6);
  font-weight: 600;
}
.md-res-option input[type="radio"] {
  accent-color: var(--accent, #3b82f6);
}

/* Admin product catalog (catalog.js) + customers grid - sidebar fixed, grid scrolls */
.content:has(.catalog-layout) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.content:has(.catalog-layout) > #custPendingBanner {
  flex-shrink: 0;
}
.catalog-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 1.25rem;
  overflow: hidden;
  align-items: stretch;
}
.catalog-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  z-index: 2;
}
.catalog-sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin: 0 0.5rem 0.75rem;
  flex-shrink: 0;
}
.catalog-cat-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.catalog-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}
.catalog-cat-row:hover {
  background: var(--bg3);
}
.catalog-cat-row--active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  font-weight: 600;
}
.catalog-cat-count {
  font-size: 0.75rem;
  color: var(--text3);
}
.catalog-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}
.catalog-breadcrumb {
  margin: 0;
  font-size: 1.35rem;
}
.catalog-sub {
  margin: 0.25rem 0 0;
  color: var(--text3);
  font-size: 0.85rem;
}
.catalog-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.catalog-search {
  min-width: 200px;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.catalog-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 5rem;
  scrollbar-width: thin;
}
.catalog-card {
  width: 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem;
  background: var(--bg);
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.15s;
}
.catalog-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.catalog-card--inactive {
  opacity: 0.5;
}
.catalog-card-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}
.catalog-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg2);
  display: block;
}
.catalog-card-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.catalog-card-name {
  margin: 0.5rem 0 0.15rem;
  font-size: 0.92rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-card-brand {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text3);
}
.catalog-card-category {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--text3);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-card-price {
  margin: 0.35rem 0 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.catalog-card-pill {
  font-size: 0.65rem;
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 6px;
  border-radius: 4px;
}
.catalog-card--customer .catalog-card-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.catalog-sidebar-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  padding: 0.75rem 0.5rem 0.25rem;
  margin: 0;
}
.cust-card-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.catalog-card--customer {
  display: flex;
  flex-direction: column;
}
.catalog-card--customer .catalog-card-body {
  flex: 1;
}
.catalog-card--customer .cust-card-licenses {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.78rem;
}
.catalog-grid--customers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  flex: none;
  min-height: 0;
  overflow: visible;
  align-content: start;
}
.catalog-grid--customers .catalog-card {
  width: 100%;
}

/* Admin hub: customers vs orders */
.admin-page-intro {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.5;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.admin-page-intro--customers {
  border-left: 4px solid var(--color-customers, #38bdf8);
}
.admin-page-intro--orders {
  border-left: 4px solid var(--color-outgoing, #fb923c);
}
.admin-page-intro__sep {
  color: var(--text3);
  margin: 0 0.35rem;
}
.admin-inline-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.admin-inline-link:hover {
  color: var(--brand-hover, var(--accent));
}
.admin-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.admin-toolbar-actions {
  align-items: center;
}
.admin-tb-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.admin-card-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.admin-card-actions__label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin: 0.5rem 0 0.35rem;
}
.admin-card-actions__label:first-child {
  margin-top: 0;
}
.admin-card-actions__row {
  display: grid;
  gap: 0.4rem;
}
.admin-card-actions__row--primary {
  grid-template-columns: repeat(3, 1fr);
}
.admin-card-actions__row--pay {
  grid-template-columns: repeat(3, 1fr);
}
.admin-card-actions__row--secondary {
  grid-template-columns: 1fr;
  margin-top: 0.35rem;
}

.admin-action-btn,
.admin-order-actions .admin-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 3rem;
  padding: 0.45rem 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.admin-action-btn:hover {
  background: var(--bg3);
  border-color: var(--text3);
}
.admin-action-btn:active {
  transform: scale(0.98);
}
.admin-action-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.admin-action-btn--manage {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
}
.admin-action-btn--license {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}
.admin-action-btn--payments {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}
.admin-action-btn--record {
  border-color: rgba(22, 163, 74, 0.4);
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-weight: 700;
}
.admin-action-btn--credit {
  border-color: rgba(180, 83, 9, 0.3);
  background: rgba(251, 191, 36, 0.1);
}
.admin-action-btn--approve {
  border-color: rgba(22, 163, 74, 0.45);
  background: #f0fdf4;
  color: #16a34a;
}
.admin-action-btn--pick {
  border-color: rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.12);
  color: #c2410c;
  font-weight: 700;
}
.admin-action-btn--deliver {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-weight: 700;
}
.admin-action-btn--invoice {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  font-weight: 700;
}
.admin-action-btn--muted {
  color: var(--text2);
  background: var(--bg2);
}

.admin-order-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.admin-order-actions .btn-sm {
  flex: 0 1 auto;
  min-width: 4.25rem;
  justify-content: center;
  white-space: nowrap;
}
.admin-order-actions .btn-order-pick {
  min-width: 7rem;
  border-color: rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.12);
  color: #c2410c;
  font-weight: 700;
}
.admin-order-actions .btn-order-deliver {
  flex: 1 1 auto;
  min-width: 10.5rem;
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-weight: 700;
}
.admin-order-actions .btn-order-edit {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
  color: #4338ca;
  font-weight: 600;
}
.admin-order-actions .btn-order-invoice {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  font-weight: 700;
}
.admin-order-actions .btn-order-trash,
.btn-order-trash {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
  color: #b91c1c;
  font-weight: 600;
  min-width: 4.5rem;
}
.admin-order-actions .btn-order-trash:hover,
.btn-order-trash:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.55);
}
.order-edit-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}
.order-edit-modal-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid var(--border);
}
.order-edit-modal-table td {
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.order-edit-modal-table .order-edit-qty-inp,
.order-edit-modal-table .order-edit-price-inp {
  width: 4.5rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.85rem;
}
.order-edit-scan-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.order-edit-scan-row .barcode-input {
  flex: 1;
}
.order-edit-totals {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  text-align: right;
}
.order-edit-totals .mono {
  font-weight: 700;
}

.order-lifecycle-tabs .tab.active {
  font-weight: 700;
}
.order-invoice-card-actions .admin-action-btn {
  flex-direction: row;
  min-height: auto;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  gap: 0.35rem;
}
.order-invoice-card-actions .admin-action-icon {
  font-size: 1rem;
}

.cust-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.cust-card-actions .btn-sm {
  font-size: 0.7rem;
  padding: 0.22rem 0.45rem;
}
.catalog-empty {
  color: var(--text3);
  padding: 2rem;
}
.catalog-bulk-bar {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #1a1a2e;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.catalog-modal {
  max-width: 640px;
}
.catalog-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}
.catalog-gallery-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.catalog-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.catalog-gallery-star {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 12px;
  color: #f59e0b;
}
.catalog-gallery-star-btn,
.catalog-gallery-del {
  position: absolute;
  bottom: 2px;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 1;
  font-size: 11px;
}
.catalog-gallery-star-btn {
  left: 2px;
}
.catalog-gallery-del {
  right: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .catalog-gallery-star-btn,
  .catalog-gallery-del {
    opacity: 0;
  }
  .catalog-gallery-thumb:hover .catalog-gallery-star-btn,
  .catalog-gallery-thumb:hover .catalog-gallery-del {
    opacity: 1;
  }
}
@media (pointer: coarse), (max-width: 767.98px) {
  .catalog-gallery-star-btn,
  .catalog-gallery-del {
    min-width: 44px;
    min-height: 44px;
    width: auto;
    height: auto;
    padding: 0 8px;
    font-size: 12px;
    line-height: 1.2;
    bottom: 0;
  }
  .catalog-gallery-star-btn {
    left: 0;
    border-radius: 4px 0 0 0;
  }
  .catalog-gallery-del {
    right: 0;
    border-radius: 0 4px 0 0;
  }
}
.catalog-gallery-drop {
  width: 80px;
  height: 80px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  text-align: center;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
}
.catalog-gallery-drop--over {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.06);
}
.catalog-modal-hint {
  font-size: 0.82rem;
  color: var(--text3);
  margin: 0 0 0.75rem;
}
.catalog-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
.catalog-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.catalog-form-grid input,
.catalog-form-grid select,
.catalog-form-grid textarea {
  font-weight: 400;
}
.catalog-form-full {
  grid-column: 1 / -1;
}
.catalog-check {
  flex-direction: row !important;
  align-items: center;
  font-weight: 500 !important;
}
.catalog-field-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.catalog-field-row input {
  flex: 1;
}
.catalog-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.modal.catalog-edit-modal {
  max-width: 640px;
  width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

@media print {
  .sidebar, .topbar, nav, .report-sidebar-tabs, .report-filter-bar, .btn, button { display: none !important; }
  .report-layout { grid-template-columns: 1fr !important; }
  .report-content {
    padding: 0 !important;
    margin: 0 !important;
  }
  .report-print-header { display: block !important; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; }
  body.picklist-print-only * { visibility: hidden; }
  body.picklist-print-only .picklist-print-root,
  body.picklist-print-only .picklist-print-root * { visibility: visible; }
  body.picklist-print-only .picklist-print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}

/* Customer workspace drawer */
body.cust-workspace-open {
  overflow: hidden;
}
.cust-workspace {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}
.cust-workspace[hidden] {
  display: none !important;
}
.cust-workspace__backdrop {
  flex: 1;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}
.cust-workspace__panel {
  width: min(520px, 100vw);
  max-width: 100%;
  height: 100%;
  background: var(--card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}
.cust-workspace__header {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cust-workspace__header-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
}
.cust-workspace__header-text {
  flex: 1;
  min-width: 0;
}
.cust-workspace__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.cust-workspace__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}
.cust-ws-header-status {
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
}
.cust-workspace__close {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  min-width: auto;
  line-height: 1.2;
}
.cust-workspace__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text3);
  line-height: 1.4;
}
.cust-workspace__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}
.cust-ws-tab {
  flex: 1;
  min-width: 5rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.cust-ws-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg2);
}
.cust-workspace__content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem 1.5rem;
}
.cust-ws-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}
@media (max-width: 420px) {
  .cust-ws-kpi-grid {
    grid-template-columns: 1fr;
  }
}
.cust-ws-kpi {
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.cust-ws-kpi--due {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(251, 191, 36, 0.08);
}
.cust-ws-kpi--due .cust-ws-kpi-value {
  color: #b45309;
}
.cust-ws-kpi-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  font-weight: 600;
}
.cust-ws-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.2rem;
}
.cust-ws-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.cust-ws-actions-row--primary {
  margin-bottom: 1.25rem;
}
.cust-ws-actions-row--primary .btn-primary {
  flex: 1 1 auto;
  min-width: 8rem;
}
.cust-ws-alert-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.cust-ws-alert--info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--text);
}
.cust-ws-overview-detail {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}
.cust-ws-overview-link {
  margin: 0.65rem 0 0;
}
.cust-ws-hint--compact {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}
.cust-ws-pay-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
}
.cust-ws-table-scroll--invoices,
.cust-ws-table-scroll--history {
  max-height: 240px;
}
.cust-ws-col--hide-narrow {
  /* visible by default */
}
.cust-ws-account-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.cust-ws-account-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}
.cust-ws-account-grid--profile,
.cust-ws-account-grid--status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}
.cust-ws-account-span {
  grid-column: 1 / -1;
}
.cust-ws-meta-value {
  font-size: 0.88rem;
}
.cust-ws-discount-value {
  font-weight: 600;
  margin-top: 0.15rem;
}
.cust-ws-account-actions {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.cust-list-disc-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green, #16a34a);
}
.cust-ws-actions-row--stack {
  flex-direction: column;
  align-items: stretch;
}
.cust-ws-actions-row--stack .btn {
  width: 100%;
  justify-content: center;
}
.cust-ws-section-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
}
.cust-ws-hint {
  font-size: 0.82rem;
  color: var(--text3);
  margin: 0 0 1rem;
  line-height: 1.45;
}
.cust-ws-empty {
  color: var(--text3);
  padding: 1rem 0;
  font-size: 0.9rem;
}
.cust-ws-alert {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
}
.cust-ws-alert--warn {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
  color: #92400e;
}
.cust-ws-pay-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.cust-ws-pay-balance {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cust-ws-pay-balance span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  font-weight: 600;
}
.cust-ws-pay-balance strong {
  font-size: 1.5rem;
}
.cust-ws-pay-balance--due strong {
  color: #b45309;
}
.cust-ws-table-scroll {
  max-height: 220px;
  margin-bottom: 0.5rem;
}
.cust-ws-table {
  font-size: 0.82rem;
}
.cust-ws-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
}
.cust-ws-account-grid {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.cust-ws-meta-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.cust-ws-invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.cust-ws-lic-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg2);
}
.cust-ws-lic-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.cust-ws-lic-section-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.cust-ws-lic-legacy {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.cust-ws-lic-alcohol-pref {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  font-size: 0.88rem;
}
.cust-ws-lic-alcohol-pref label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-weight: 600;
}
.cust-ws-lic-alcohol-pref span small {
  display: block;
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text2);
  margin-top: 0.2rem;
}

/* Slim customer list cards - admin CRM layout */
.catalog-card--slim.cust-admin-card {
  cursor: pointer;
}
.cust-list-top {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  justify-content: space-between;
}
.cust-list-head {
  flex: 1;
  min-width: 0;
}
.cust-list-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cust-list-owner {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text2);
  line-height: 1.35;
}
.cust-list-location {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text3);
  line-height: 1.35;
}
.cust-list-balance {
  text-align: right;
  flex-shrink: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: var(--amber-bg, #fffaeb);
  border: 1px solid var(--amber-border, #fedf89);
}
.cust-list-balance-label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber, #b54708);
  font-weight: 700;
}
.cust-list-balance-amt {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}
.cust-list-balance--due .cust-list-balance-amt {
  color: var(--amber, #b54708);
}
.cust-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.cust-card-status .status {
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
}
.cust-list-meta-extra {
  margin-top: 0.35rem;
}
.cust-pay-pending-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--amber, #b54708);
  background: var(--amber-bg, #fffaeb);
  border: 1px solid var(--amber-border, #fedf89);
}
.cust-lic-summary {
  display: block;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text2);
}
.cust-lic-summary--muted {
  color: var(--text3);
  font-style: italic;
}
.cust-lic-summary--warn {
  color: var(--amber, #b54708);
  font-weight: 600;
}
.cust-list-lic {
  margin-top: 0.35rem;
}
.cust-list-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.cust-list-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  align-items: stretch;
}
.cust-list-footer-actions .cust-list-open {
  grid-column: 1 / -1;
}
.cust-list-footer-actions .btn {
  min-height: 2.5rem;
  justify-content: center;
}
.cust-list-footer-actions .cust-list-open {
  font-weight: 600;
}
.cust-list-record,
.cust-list-approve {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .cust-workspace__panel {
    width: 100vw;
    max-width: 100vw;
  }
  .cust-ws-col--hide-narrow {
    display: none;
  }
  .cust-ws-account-grid--profile,
  .cust-ws-account-grid--status {
    grid-template-columns: 1fr;
  }
  .cust-workspace__content {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
  body:has(#mobileBottomBar.visible) .cust-workspace__content {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }
  .cust-ws-actions-row--primary .btn,
  .cust-ws-pay-summary .btn-primary {
    width: 100%;
    justify-content: center;
  }
  .cust-ws-invoice-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cust-ws-invoice-actions .btn {
    width: 100%;
  }
}
.cust-ws-lic-actions {
  align-items: center;
}
.cust-ws-lic-actions .btn-danger {
  margin-left: auto;
}

/* Customers admin page - header, toolbar, filters */
.cust-page {
  display: block;
  max-width: 100%;
}
.cust-pending-banner-host {
  margin-bottom: 0;
}
.cust-pending-banner-host .cust-pending-banner {
  margin-bottom: 1rem;
}
.cust-page-header {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.cust-page-heading {
  min-width: 0;
}
.cust-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-dark, var(--text));
  line-height: 1.2;
}
.cust-page-lede {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.45;
  max-width: 42rem;
}
.cust-page-sub {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text3);
}
.cust-page-toolbar {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg2);
  border: 1px solid rgba(12, 100, 114, 0.15);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-xs);
}
.cust-toolbar-controls {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}
.cust-toolbar-search {
  flex: 1 1 16rem;
  min-width: min(100%, 12rem);
  max-width: none;
  width: auto;
  min-height: 2.75rem;
  font-size: 0.95rem;
}
.cust-toolbar-sort {
  width: auto;
  min-width: 9.25rem;
  flex-shrink: 0;
  min-height: 2.75rem;
}
.cust-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.cust-toolbar-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 2.5rem;
}
.cust-page .catalog-grid--customers {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  gap: 0.65rem;
}
body:has(#mobileBottomBar.visible) .cust-page .catalog-grid--customers {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}
body:has(#mobileBottomBar.visible) #custBulkBar.catalog-bulk-bar {
  bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
}
.cust-filter-bar {
  margin-bottom: 1rem;
}
.cust-status-tabs {
  margin-bottom: 0.65rem;
}
.cust-tab-count {
  font-size: 0.78em;
  font-weight: 600;
  opacity: 0.75;
  margin-left: 0.15rem;
}
.cust-sub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.cust-sub-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cust-sub-chip:hover {
  border-color: var(--brand-border, var(--border));
  color: var(--text);
  background: var(--brand-light, var(--bg2));
}
.cust-sub-chip--active {
  background: var(--accent-soft, rgba(12, 100, 114, 0.14));
  border-color: var(--chrome-border-28, rgba(12, 100, 114, 0.34));
  color: var(--chrome-primary, var(--brand));
  font-weight: 600;
}
@media (min-width: 900px) {
  .cust-toolbar-controls {
    flex-wrap: nowrap;
  }
  .cust-toolbar-search {
    flex: 1 1 auto;
    max-width: 22rem;
  }
}
@media (max-width: 540px) {
  .cust-page-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
  }
  .cust-page-title {
    font-size: 1.3rem;
  }
  .cust-page-toolbar {
    padding: 0.65rem;
  }
  .cust-toolbar-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .cust-toolbar-search {
    width: 100%;
    max-width: none;
    flex: none;
  }
  .cust-toolbar-sort {
    width: 100%;
  }
  .cust-toolbar-actions {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }
  .cust-toolbar-actions #custAddBtn {
    grid-column: 1 / -1;
  }
  .cust-toolbar-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
  }
  .cust-list-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .cust-list-balance {
    text-align: left;
    align-self: flex-start;
  }
  .cust-list-footer-actions {
    grid-template-columns: 1fr;
  }
  .cust-list-footer-actions .cust-list-open {
    grid-column: auto;
  }
}

/* ============================================================
   CATALOG (PRODUCTS) - MOBILE RESPONSIVE LAYOUT
   On small screens the 280px sidebar collapses into a
   horizontal scrolling category chip strip.
   ============================================================ */

@media (max-width: 767px) {
  .content:has(.catalog-layout) {
    overflow: visible;
  }

  .catalog-layout {
    flex-direction: column;
    overflow: visible;
    gap: 0;
  }

  .catalog-sidebar {
    width: 100%;
    border-radius: 10px 10px 0 0;
    border-bottom: none;
    padding: 0.65rem 0.75rem 0;
    overflow: visible;
  }

  .catalog-sidebar-title {
    font-size: 0.68rem;
    margin: 0 0 0.45rem;
  }

  .catalog-cat-tree {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    gap: 6px;
    padding-bottom: 0.65rem;
    scrollbar-width: none;
  }

  .catalog-cat-tree::-webkit-scrollbar {
    display: none;
  }

  .catalog-cat-row {
    white-space: nowrap;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.8rem;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text2);
  }

  .catalog-cat-row:hover {
    background: var(--bg3, var(--bg2));
    color: var(--text);
  }

  .catalog-cat-row--active {
    background: var(--chrome-primary);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
  }

  .catalog-cat-count {
    font-size: 0.72rem;
    opacity: 0.75;
  }

  .catalog-main {
    overflow: visible;
    border-radius: 0 0 10px 10px;
    border: 1px solid var(--border);
    border-top: none;
    background: var(--bg);
    padding: 0.75rem;
  }

  .catalog-grid {
    overflow: visible;
    padding-bottom: 5rem;
    gap: 10px;
  }

  .catalog-card {
    width: 100%;
  }

  .catalog-toolbar:not(.cust-page-toolbar) {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .catalog-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .catalog-search {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
}

/* ============================================================
   CUSTOMER LIST CARDS - COMPACT SLIM LAYOUT
   The avatar was rendering as a full-width square (aspect-ratio:1).
   In the slim list view it should be a small fixed-size icon.
   ============================================================ */

.catalog-card--slim .catalog-card-avatar {
  width: 38px;
  height: 38px;
  aspect-ratio: unset;
  flex-shrink: 0;
  font-size: 1.2rem;
  align-self: center;
  border-radius: 8px;
}

/* Tighter gap between customer list rows */
.cust-page .catalog-grid--customers {
  gap: 8px;
}

/* Compact slim card */
.catalog-card--slim {
  padding: 0.7rem 0.85rem;
}

.catalog-card--slim .cust-list-top {
  align-items: center;
}

/* Slightly tighter balance number */
.cust-list-balance-amt {
  font-size: 1rem;
}

/* Tighter card footer */
.catalog-card--slim .cust-list-footer {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
}

/* Product cards in catalog grid: full-width on mobile (set above),
   placeholder uses teal tint so it reads as intentional empty state */
.catalog-card-img--placeholder {
  background: var(--bg);
  color: var(--text3);
}

/* Catalog grid: 2-col on narrow-but-not-tiny mobile */
@media (max-width: 767px) and (min-width: 400px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
  }

  .catalog-card {
    width: auto;
  }
}

/* ============================================================
   CATALOG PRODUCT CARDS - WHITE CARDS ON TEAL PAGE BG
   Previously cards used var(--bg) = #e8f2f4, blending into
   the page. White cards with a teal-tinted border and shadow
   create clear separation and look modern on both desktop/mobile.
   ============================================================ */

.catalog-card {
  background: var(--bg2);
  border-color: rgba(12, 100, 114, 0.14);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s, transform 0.12s, border-color 0.12s;
}

.catalog-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  border-color: rgba(12, 100, 114, 0.28);
}

/* Wider cards on desktop: 220→240px for better image/text balance */
@media (min-width: 768px) {
  .catalog-layout .catalog-card {
    width: 240px;
  }
}

/* ============================================================
   CATALOG CATEGORY ACTIVE STATE - BRAND TEAL (not blue)
   Desktop sidebar uses a teal tint highlight + teal text
   to match the app's brand instead of the default blue.
   Mobile chip active (solid teal) is already set above.
   ============================================================ */

.catalog-cat-row--active {
  background: rgba(12, 100, 114, 0.1);
  color: var(--chrome-primary);
  font-weight: 600;
}

/* ============================================================
   CUSTOMER LIST CARDS - WHITE BACKGROUND + SHADOW
   Match the same card treatment as product cards so the whole
   admin panel has a consistent visual language.
   ============================================================ */

.catalog-card--customer {
  background: var(--bg2);
  border-color: rgba(12, 100, 114, 0.14);
  box-shadow: var(--shadow-xs);
}

.catalog-card--customer:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* ============================================================
   ADMIN PRODUCTS SEARCH BAR - CONTAINED CARD
   Floating filter controls against the teal page background
   look disconnected. A white card container grounds them.
   ============================================================ */

.search-bar {
  background: var(--bg2);
  border: 1px solid rgba(12, 100, 114, 0.15);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  gap: 0.5rem;
  align-items: center;
}

/* ============================================================
   MOBILE - TOPBAR ACTIONS: COMPACT HORIZONTAL SCROLL
   On mobile the action buttons wrap to a full-width centered
   row, making the topbar very tall (3 stacked rows).
   Switch to a single slim horizontally-scrollable strip.
   ============================================================ */

@media (max-width: 767px) {
  #topbarActions {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
    gap: 0.35rem;
  }

  #topbarActions::-webkit-scrollbar {
    display: none;
  }

  #topbarActions .btn {
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 0.3rem 0.65rem;
    white-space: nowrap;
  }
}

/* ============================================================
   MOBILE - CUSTOMER GRID: SINGLE COLUMN
   Explicit single-column below 640px so customer cards are
   full-width and readable rather than two cramped columns.
   ============================================================ */

@media (max-width: 640px) {
  .catalog-grid--customers {
    grid-template-columns: 1fr;
  }
}

/* Admin product edit modal (Phase 6C / F3) */
.mw-admin-edit-product-modal .modal-box,
.mw-admin-add-product-modal .modal-box {
  max-width: 42rem;
}
.mw-admin-edit-product-modal .mw-modal-body,
.mw-admin-add-product-modal .mw-modal-body {
  overflow: visible;
  padding: 0;
  flex: 1;
  min-height: 0;
}
@media (max-width: 767.98px) {
  .mw-admin-edit-product-modal .mw-modal-body,
  .mw-admin-add-product-modal .mw-modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mw-admin-edit-product-modal #modalBox.modal,
  .mw-admin-add-product-modal #modalBox.modal {
    max-height: calc(100dvh - 1rem);
  }
}

.admin-product-edit-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: min(72vh, 640px);
  overflow-y: auto;
  padding: 0 0.15rem;
}

.admin-product-edit-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 0.5rem 0;
  background: var(--card);
}

.admin-product-edit-section__title {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text2);
}

.admin-product-edit-note {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text3);
}

.admin-product-edit-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.admin-product-trash-btn {
  margin-left: auto;
  color: #c0392b;
}

.admin-barcode-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.admin-barcode-row input {
  flex: 1;
}

.admin-product-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin: 0;
}

.admin-product-fallback-url summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text2);
}

.admin-pricing-primary-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.35rem;
}

.admin-pricing-units-field {
  width: 7.5rem;
  min-width: 7.5rem;
}

.admin-pricing-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.admin-pricing-input-row input {
  flex: 1;
  min-width: 0;
}

.admin-pricing-input-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.admin-pricing-field-hint {
  margin: 0.25rem 0 0;
}

.admin-unit-sales-options {
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2, #f8f9fa);
}

.admin-cases-only-note {
  color: var(--amber, #b45309);
  margin-top: 0.35rem;
}

@media (max-width: 767.98px) {
  .admin-pricing-primary-row {
    grid-template-columns: 1fr;
  }
  .admin-pricing-units-field {
    width: 100%;
    min-width: 0;
  }
  .admin-pricing-input-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.mw-product-gallery-hint,
.mw-product-gallery-fallback-note {
  font-size: 0.78rem;
  color: var(--text3);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

/* ============================================================
   F5a - Order lifecycle tabs (mobile horizontal scroll)
   ============================================================ */
@media (max-width: 767.98px) {
  .order-lifecycle-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }
  .order-lifecycle-tabs::-webkit-scrollbar {
    display: none;
  }
  .order-lifecycle-tabs .tab {
    flex-shrink: 0;
    white-space: nowrap;
  }
}
