:root {
  /* Extracted directly from official Devs Wellness Pharma Pvt. Ltd. logo */
  --brand: #981080;
  --brand-dark: #6b0a5b;
  --brand-deep: #48053d;
  --brand-soft: #f9ecf8;
  --lavender: #d0a0d0;
  --lavender-mid: #b078b8;
  --green: #089040;
  --green-dark: #067031;
  --green-soft: #e7f6ed;
  --accent: #d97706;
  --accent-soft: #fef3c7;
  --bg: #f8f4f8;
  --surface: #ffffff;
  --border: #e6d8e7;
  --text: #1f1221;
  --muted: #69546b;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius: 14px;
  --shadow: 0 3px 14px rgba(107, 10, 91, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-dark) 55%, var(--brand));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  box-shadow: 0 3px 14px rgba(72, 5, 61, 0.22);
  border-bottom: 2px solid rgba(208, 160, 208, 0.35);
}

.app-header.header-auth-minimal {
  background: #ffffff;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(107, 10, 91, 0.05);
}

.app-header.header-auth-minimal .brand-sub {
  color: var(--muted);
  opacity: 1;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid var(--lavender);
  flex-shrink: 0;
}

.brand-name {
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.header-auth-minimal .brand-name {
  color: var(--green);
}

.header-auth-minimal .brand-name-sub {
  color: var(--brand);
}

.brand-sub {
  font-size: 0.72rem;
  opacity: 0.86;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-header-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

.portal-header-pill.is-rep {
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid rgba(8, 144, 64, 0.25);
}

.portal-header-pill.is-admin {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid var(--lavender);
}

.net-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
}

.net-pill.online {
  background: rgba(8, 144, 64, 0.16);
  color: #067031;
}

.app-header:not(.header-auth-minimal) .net-pill.online {
  background: rgba(8, 144, 64, 0.35);
  color: #d1fae5;
}

.net-pill.offline {
  background: rgba(245, 158, 11, 0.25);
  color: #92400e;
}

.app-header:not(.header-auth-minimal) .net-pill.offline {
  color: #fde68a;
}

.btn-header-logout {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.btn-header-logout:hover {
  background: rgba(255, 255, 255, 0.26);
}

.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 14px 92px;
}

body.mode-auth .app-main {
  padding-bottom: 28px;
}

/* Auth / Separate Login Portals */
.auth-page {
  min-height: calc(100vh - 110px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  border-radius: 20px;
}

.auth-rep-bg {
  background: radial-gradient(circle at top left, rgba(8, 144, 64, 0.09), transparent 50%),
    radial-gradient(circle at bottom right, rgba(152, 16, 128, 0.12), transparent 55%);
}

.auth-admin-bg {
  background: radial-gradient(circle at top right, rgba(152, 16, 128, 0.15), transparent 52%),
    radial-gradient(circle at bottom left, rgba(176, 120, 184, 0.16), transparent 55%);
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid var(--brand);
  border-radius: 20px;
  padding: 26px 24px 22px;
  box-shadow: 0 18px 44px rgba(107, 10, 91, 0.12);
}

.auth-card-admin {
  border-top-color: var(--green);
}

.auth-brand-top {
  text-align: center;
  margin-bottom: 18px;
}

.auth-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--lavender);
  box-shadow: 0 6px 18px rgba(152, 16, 128, 0.16);
  background: #fff;
  margin-bottom: 10px;
}

.portal-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.portal-rep {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid var(--lavender);
}

.portal-admin {
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid rgba(8, 144, 64, 0.25);
}

.auth-company-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text);
}

.auth-subtitle {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-error {
  margin-top: 10px;
  background: var(--danger-soft);
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-demo-hint {
  margin-top: 14px;
  background: var(--bg);
  border: 1px dashed var(--lavender-mid);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.auth-footer-switch {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--brand);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
  padding: 4px 6px;
}

.link-btn:hover {
  text-decoration: underline;
}

/* Shared UI primitives */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gap-sm { gap: 8px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 16px; }
.px-0 { padding-left: 0; padding-right: 0; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 10px;
}

.section-head h3 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--brand-deep);
}

.muted-label {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.input,
.inline-select {
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.input:focus {
  outline: 2px solid var(--brand);
  border-color: var(--brand);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 6px 11px; font-size: 0.8rem; }
.btn-lg { padding: 11px 16px; font-size: 0.95rem; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }

.btn-outline {
  background: #fff;
  color: var(--brand-dark);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--brand-soft); border-color: var(--lavender); }

.btn-amber { background: var(--accent); color: #fff; }
.btn-whatsapp { background: var(--green); color: #fff; }

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

.text-danger-btn {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.icon-btn {
  border: none;
  background: var(--bg);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: none;
}

.badge-ok { background: var(--green-soft); color: var(--green-dark); }
.badge-warn { background: var(--accent-soft); color: #92400e; }
.badge-danger { background: var(--danger-soft); color: #991b1b; }
.badge-neutral { background: var(--brand-soft); color: var(--brand-dark); }

.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #ede9fe; color: #5b21b6; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-confirmed { background: #f3e8ff; color: #6b21a8; }
.status-packed { background: #ede9fe; color: #5b21b6; }
.status-dispatched { background: #dbeafe; color: #1e40af; }
.status-delivered { background: var(--green-soft); color: var(--green-dark); }
.wa-status-sent { background: #dcfce7; color: #166534; }
.wa-status-pending { background: #f1f5f9; color: #475569; }

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 24px 16px;
}

/* Rep Mobile Shell */
.rep-shell {
  max-width: 760px;
  margin: 0 auto;
}

.rep-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
}

.rep-selector-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rep-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.rep-select-label {
  font-size: 0.7rem;
  color: var(--green-dark);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rep-profile-name {
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--text);
}

.rep-mini-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
}

.kpi-mini-label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
}

.hero-target-card {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand) 65%, var(--lavender-mid));
  color: #fff;
  border: none;
}

.hero-target-card .muted-label {
  color: rgba(255, 255, 255, 0.85);
}

.big-figure {
  margin: 4px 0 0;
  font-size: 1.5rem;
}

.target-of {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.84;
}

.pct-pill {
  background: rgba(255, 255, 255, 0.22);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(152, 16, 128, 0.14);
  overflow: hidden;
  margin-top: 10px;
}

.hero-target-card .progress-track {
  background: rgba(255, 255, 255, 0.24);
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
}

.hero-target-card .progress-fill {
  background: #4ade80;
}

.hero-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-top: 10px;
  opacity: 0.94;
}

.shop-title { font-weight: 700; font-size: 0.98rem; }
.shop-meta { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.credit-tag { font-size: 0.75rem; font-weight: 700; color: var(--accent); margin-top: 4px; }

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.catalog-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.pill-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-pill {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding-bottom: 96px;
}

.product-card.in-cart {
  border-color: var(--brand);
  background: #fdf8fd;
}

.product-card.out-stock {
  opacity: 0.65;
}

.admin-product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-product-thumb {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.product-image-upload {
  display: grid;
  gap: 8px;
}

.product-image-preview {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.product-photo {
  display: block;
  width: 100%;
  height: 150px;
  margin: 0 0 10px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.cat-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 3px 8px;
  border-radius: 6px;
}

.scheme-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--green-soft);
  padding: 3px 8px;
  border-radius: 6px;
}

.prod-name {
  margin: 8px 0 2px;
  font-size: 0.98rem;
}

.prod-pack {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand);
}

.prod-comp {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 6px 0 10px;
  min-height: 28px;
}

.prod-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ptr-price {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
}

.mrp-price {
  font-size: 0.72rem;
  color: var(--muted);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--brand);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.qty-stepper button {
  border: none;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 800;
  width: 32px;
  height: 34px;
  font-size: 1.05rem;
  cursor: pointer;
}

.qty-stepper input {
  width: 44px;
  border: none;
  text-align: center;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
}

.free-earned {
  margin-top: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--green-soft);
  padding: 4px 8px;
  border-radius: 6px;
}

.order-card-mid {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  font-size: 0.88rem;
}

.sync-tag { font-size: 0.76rem; font-weight: 700; }
.sync-tag.ok { color: var(--green-dark); }
.sync-tag.warn { color: #b45309; }

.sticky-cart-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 70px;
  width: min(740px, calc(100% - 24px));
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-dark));
  color: #fff;
  border: 1px solid var(--lavender);
  border-radius: 14px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 25px rgba(72, 5, 61, 0.32);
  z-index: 35;
}

.sticky-cart-bar .btn-primary {
  background: var(--green);
}

.cart-bar-title { font-size: 0.78rem; opacity: 0.92; }
.cart-bar-total { font-size: 1.05rem; font-weight: 800; }

.rep-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}

.rep-nav-btn {
  border: none;
  background: transparent;
  font-family: inherit;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.rep-nav-btn.active {
  color: var(--brand);
}

.nav-icon {
  position: relative;
  font-size: 1.15rem;
}

.nav-count {
  position: absolute;
  top: -4px;
  right: -11px;
  background: var(--green);
  color: #fff;
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 999px;
}

/* Admin Dashboard */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

.admin-main {
  min-width: 0;
}

.admin-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 74px;
  box-shadow: var(--shadow);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--lavender);
}

.sidebar-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.admin-nav-btn {
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.admin-nav-btn:hover {
  background: var(--bg);
}

.admin-nav-btn.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-left: 3px solid var(--brand);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-card {
  border-top: 3px solid var(--brand);
}

.kpi-card:nth-child(2n) {
  border-top-color: var(--green);
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  margin: 6px 0 2px;
  color: var(--brand-dark);
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--muted);
}

.admin-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.rep-perf-row,
.visit-row {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.rep-perf-nums {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.filter-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.filter-bar-admin {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.orders-summary-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--brand-soft);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--brand-dark);
}

.table-wrap {
  overflow-x: auto;
}

.data-table,
.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td,
.inv-table th,
.inv-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th,
.inv-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--muted);
}

.num { text-align: right !important; }

.status-select {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Modals & Invoice */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(40, 8, 36, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 60;
}

.modal-card {
  background: #fff;
  width: min(560px, 100%);
  max-height: 92vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(40, 8, 36, 0.28);
}

.modal-card.modal-lg {
  width: min(760px, 100%);
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { margin: 0; font-size: 1.02rem; color: var(--brand-deep); }

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.cart-line-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.cart-totals-box {
  margin-top: 12px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.cart-totals-box > div {
  display: flex;
  justify-content: space-between;
}

.grand-row {
  border-top: 1px solid var(--border);
  padding-top: 6px;
  font-size: 1rem;
  color: var(--brand-dark);
}

.invoice-sheet {
  padding: 18px;
  overflow-y: auto;
}

.inv-brand-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.inv-brand-flex {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.inv-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--lavender);
  flex-shrink: 0;
}

.inv-brand-row h2 { margin: 0 0 4px; color: var(--brand-dark); font-size: 1.15rem; }
.inv-sub { font-size: 0.75rem; color: var(--muted); margin: 2px 0; }
.inv-meta { text-align: right; font-size: 0.82rem; display: flex; flex-direction: column; gap: 3px; }

.inv-party-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.inv-party-box {
  background: var(--bg);
  padding: 10px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.inv-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 3px;
}

.inv-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.inv-notes { font-size: 0.82rem; max-width: 340px; }
.inv-totals { min-width: 240px; display: flex; flex-direction: column; gap: 5px; font-size: 0.86rem; }
.inv-totals > div { display: flex; justify-content: space-between; }
.inv-grand { border-top: 2px solid var(--text); padding-top: 5px; font-size: 1rem; color: var(--brand-dark); }

.toast {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--brand-deep);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }
  .sidebar-brand { display: none; }
  .admin-nav-btn { white-space: nowrap; }
  .admin-nav-btn.active { border-left: none; border-bottom: 3px solid var(--brand); }
  .filter-bar { grid-template-columns: 1fr; }
  .form-grid, .inv-party-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .app-header {
    padding: 8px 12px;
  }
  .brand-sub,
  .brand-name-sub { display: none; }
  .brand-name { font-size: 0.92rem; }
  .auth-card { padding: 20px 16px 18px; }
  .rep-selector-wrap { min-width: 0; flex: 1; }
  .rep-selector-wrap > div { min-width: 0; flex: 1; }
  .inv-meta { text-align: left; }
  .modal-card { max-height: 90dvh; }
}

@media print {
  .no-print,
  .app-header,
  .app-main,
  .rep-bottom-nav,
  .sticky-cart-bar {
    display: none !important;
  }
  .modal-backdrop {
    display: block;
    position: static;
    background: #fff;
    padding: 0;
  }
  .modal-card {
    box-shadow: none;
    max-height: none;
    width: 100%;
    overflow: visible;
  }
}

/* Shop info display in order pad */
.selected-shop-info {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--brand-soft);
  border-radius: 10px;
  border-left: 3px solid var(--brand);
}
.selected-shop-name {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--brand-dark);
  margin-bottom: 3px;
}

/* Product card company name & selected bar */
.prod-company {
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.prod-selected-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
}

/* Cart summary shop box & compact stepper */
.summary-shop-box {
  background: var(--brand-soft);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--brand);
}
.qty-stepper-sm button {
  width: 26px;
  height: 28px;
  font-size: 0.95rem;
}
.qty-stepper-sm input {
  width: 40px;
  font-size: 0.82rem;
}
.cart-qty-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Order items preview chips */
.order-items-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 4px;
}
.mini-item-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}

/* Order success modal */
.success-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px 16px;
  gap: 10px;
}
.success-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 2rem;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.success-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--green-dark);
}
.success-order-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  width: 100%;
}
.success-order-id {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: 0.03em;
}

/* Utilities */
.mb-sm { margin-bottom: 10px; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.gap-sm { gap: 8px; }
