:root {
  --accent: #1F6F50;
  --accent-dark: #164f39;
  --accent2: #0F4C81;
  --accent2-dark: #0a3760;
  --grey: #595959;
  --grey-light: #8a8a8a;
  --warn: #8A5A00;
  --alert: #B0322A;
  --light-green: #E4F2EC;
  --light-blue: #E6EFF7;
  --light-warn: #FBEFDC;
  --cream: #FBFAF6;
  --ink: #1c2321;
  --border: #E4E2D8;
  --max: 1120px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
}

/* ---- page backgrounds ----------------------------------------------------
   Two directions picked from the "Ani't Huli Backdrops" review: customer
   pages get "Bagsakan Tide" (crate weave fading into a hint of sea-blue —
   the two supply lines the catalog is split into); staff pages get
   "Manifest Grid" (a quiet ledger dot-grid that gets out of the way while
   scanning a table). Both are pure CSS, no images. ---------------------- */
body.bg-bagsakan-tide {
  background: linear-gradient(180deg, #FCFBF7 0%, #FAF8F1 45%, #EEF3EE 74%, #E4EEF2 100%) fixed;
}
body.bg-bagsakan-tide::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(135deg, rgba(168,116,58,0.10) 0px, rgba(168,116,58,0.10) 2px, transparent 2px, transparent 15px),
    repeating-linear-gradient(45deg, rgba(168,116,58,0.09) 0px, rgba(168,116,58,0.09) 2px, transparent 2px, transparent 15px);
  -webkit-mask-image: linear-gradient(180deg, #000 0px, #000 420px, transparent 760px);
          mask-image: linear-gradient(180deg, #000 0px, #000 420px, transparent 760px);
}
body.bg-manifest-grid {
  background-color: var(--cream);
  background-image: radial-gradient(rgba(31,111,80,0.16) 1px, transparent 1.4px);
  background-size: 16px 16px;
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-weight: 800; margin: 0 0 12px; letter-spacing: -0.01em; }
p { margin: 0 0 10px; color: var(--grey); }

/* ---- header ---- */
header.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251,250,246,0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
/* justify-content: flex-end (not space-between) because .brand-group is
   pulled out of flow below to center it — flex-end keeps whatever's left
   (cart button, whoami, staff nav links, etc.) pinned to the right, same as
   before. min-height is a FIXED 93px (not just "tall enough for the logo")
   on purpose: .brand-group below is positioned absolutely, so it takes up
   no space of its own and .app-nav's real height is decided entirely by
   whatever else is in here. A page with no other header content (Home,
   Register/Login, logged-out Wholesale) used to end up much shorter than a
   page with a cart button or staff buttons — which either made a
   top:50%-centered logo visibly jump between pages, or, when pinned at a
   fixed distance from the top instead, made it overflow past the bottom of
   a too-short box on those emptier pages. Forcing every page's box to the
   same 93px floor fixes both: it's tall enough for the 45px logo plus
   breathing room, and every page ends up exactly this height (taller only
   if a page's own right-side content genuinely needs more room), so
   top:50% centering below lands on the same spot everywhere. */
.app-nav { position: relative; display: flex; align-items: center; justify-content: flex-end; min-height: 93px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); flex-shrink: 0; }
/* flex-shrink:0 + object-fit:contain so the logo can never get squeezed
   narrower than its natural aspect ratio by flexbox (which happened on
   pages like index.html/login.html/wholesale.html where .app-nav has little
   or no other in-flow content to share space with). */
.logo-img { height: 45px; width: auto; display: block; flex-shrink: 0; object-fit: contain; }
/* Centered in the header bar regardless of what's on the right — absolute
   positioning against .app-nav's relative box, rather than a 3-column grid,
   since not every page has a right-side element to anchor a grid column to.
   This only stays visually consistent across pages because .app-nav's
   height is now a fixed 93px floor (see the comment above) instead of
   varying with each page's own content. */
.brand-group {
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
}
/* Used on pages whose header would otherwise be just a bare logo (Home,
   Login, Wholesale portal, Privacy, Delete account) — stacks a short
   tagline directly under the logo instead of leaving the header empty. */
.brand-group.stacked { flex-direction: column; align-items: center; gap: 2px; }
/* Staff pages (admin.html, oversee.html, stock.html) pack a whoami label
   plus 2-4 buttons (Oversee/Stock cross-links, Change Password, Log Out)
   next to the logo. That's often too wide to share the app-nav row with a
   dead-centered logo without the two colliding (the row would need to reach
   past the horizontal center to fit everything, right where the absolutely
   positioned .brand-group sits). Giving these controls their own full-width
   row below app-nav — same pattern as .site-tabs — keeps the logo centered
   consistently on every page, staff ones included, with zero risk of
   overlap no matter how many buttons a role ends up with. */
.staff-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; padding: 0 0 10px; }
.tagline-stacked {
  font-size: 11.5px; font-weight: 600; color: var(--grey-light);
  white-space: nowrap; letter-spacing: 0.01em;
}
/* Pairs with .brand-group.stacked: fills the right side of an otherwise-empty
   header. flex-shrink so it can disappear first on narrow screens rather
   than forcing the logo off-center or wrapping awkwardly. */
.right-slot { display: flex; align-items: center; gap: 14px; flex-shrink: 1; }
@media (max-width: 640px) {
  .right-slot { display: none; }
  /* Below this width there usually isn't room for the centered logo (which
     stays pinned to the middle via .brand-group's absolute positioning) AND
     whatever sits next to it in the same row — a cart button (shop.html), a
     "Back to catalog" link (checkout/track/confirmation), or a whoami+Log
     Out pair (logged-in wholesale) — without the two overlapping into
     unreadable stacked text. Stacking .app-nav into a column instead (logo
     first, then that other content centered below it) sidesteps the
     collision entirely, the same way .staff-controls avoids it by using its
     own row — just done with a breakpoint here instead of a markup change,
     since which pages have that extra content varies. */
  .app-nav {
    flex-direction: column; justify-content: center; min-height: 0;
    padding: 14px 0 10px; gap: 10px;
  }
  .brand-group { position: static; left: auto; top: auto; transform: none; }
}
.site-link { font-size: 12.5px; font-weight: 600; color: var(--grey-light); }
.site-link:hover { color: var(--accent-dark); }
.env-badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--light-warn); color: var(--warn); padding: 4px 10px; border-radius: 999px; margin-left: 10px;
}
.cart-btn {
  display: flex; align-items: center; gap: 8px; background: var(--accent); color: #fff;
  border: none; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.cart-btn:hover { background: var(--accent-dark); }
.cart-count {
  background: rgba(255,255,255,0.25); border-radius: 999px; padding: 1px 8px; font-size: 12.5px;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 14.5px;
  border: 2px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #b9c9c1; cursor: not-allowed; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--ink); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-small { padding: 8px 14px; font-size: 13px; }

/* ---- category tabs ---- */
.tabs { display: flex; gap: 10px; margin: 22px 0; }
.tab {
  padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff;
  font-weight: 700; font-size: 14px; color: var(--grey); cursor: pointer;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Login page's Retail/Wholesale/Staff role picker (#typeTabs) sits directly
   above a full-width .card — as a plain .tabs row it only takes up as much
   width as its 3 pills need, leaving a big gap between "Staff" and the
   card's right edge below it. Retail and Wholesale stay grouped together
   with the normal gap; only Staff gets pushed out to the row's far right
   (margin-left: auto), landing flush with the card's right edge below. */
#typeTabs [data-type="staff"] { margin-left: auto; }

/* ---- catalog search box (shop.html, above the category tabs) ---- */
.search-wrap { position: relative; max-width: 440px; margin: 22px 0 0; }
.search-icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  font-size: 14px; opacity: .5; pointer-events: none;
}
.search-input { padding: 12px 40px 12px 40px !important; border-radius: 999px !important; }
/* Belt-and-suspenders: even though the search box now uses type="text" (see
   shop.html/wholesale.html), this keeps any browser's native search
   decorations off so our own .search-clear button is never doubled up. */
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration { display: none; -webkit-appearance: none; }
.search-clear {
  display: none; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: none; background: none; width: 26px; height: 26px; border-radius: 50%;
  font-size: 18px; line-height: 1; color: var(--grey-light); cursor: pointer;
}
.search-clear.visible { display: block; }
.search-clear:hover { background: var(--cream); color: var(--ink); }
.search-empty {
  grid-column: 1 / -1; text-align: center; color: var(--grey-light); font-size: 14.5px; padding: 48px 0;
}

/* ---- vegetable subcategory chips (second row, Vegetables tab only) ---- */
.subtabs { display: none; gap: 8px; flex-wrap: wrap; margin: -12px 0 22px; }
.subtabs.visible { display: flex; }
.subtabs .subtab { padding: 6px 14px; font-size: 12.5px; }

/* ---- admin.html section tabs (Statistics / Product Demand / ...) ----
   Deliberately its own .section-tab class, NOT a reuse of .tab — admin.html
   already has a .tab (site-tabs, top of every page) and a .demand-chart-tab
   (Daily/Monthly/Yearly toggle inside the Product Demand panel); giving
   this a separate name keeps all three click handlers from ever stepping
   on each other, same reasoning as .subtab above. */
.section-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0; }
.section-tab {
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff;
  font-weight: 700; font-size: 13.5px; color: var(--grey); cursor: pointer;
}
.section-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- site-wide nav tabs (second header row: Home / Retail app / Wholesale
   portal / Register / Admin-ops) — same .tab pill look as the category tabs
   above, just smaller, and reused as real links across every page instead
   of one prototype single-page-app view switcher. ---- */
.site-tabs { display: flex; gap: 24px; flex-wrap: wrap; padding: 0 0 14px; justify-content: center; }
.site-tabs .tab { padding: 7px 16px; font-size: 13px; }

/* ---- homepage hero ---- */
.hero { text-align: center; max-width: 760px; margin: 24px auto 48px; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; font-weight: 800; color: var(--accent-dark); margin-bottom: 10px; }
.hero-title { font-size: 38px; line-height: 1.15; margin-bottom: 14px; }
.hero-sub { font-size: 15.5px; color: var(--grey); margin: 0 auto 22px; max-width: 600px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.mv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 20px; }
.mv-card { text-align: left; }
.mv-icon { font-size: 26px; margin-bottom: 6px; }

.pillars-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.pillar { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px 18px; text-align: center; }
.pillar-icon { font-size: 24px; margin-bottom: 8px; }
.pillar-title { font-weight: 800; font-size: 14.5px; margin-bottom: 4px; }
.pillar-sub { font-size: 12.5px; color: var(--grey-light); }

@media (max-width: 800px) {
  .mv-grid { grid-template-columns: 1fr; }
  .pillars-row { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 28px; }
}
@media (max-width: 480px) {
  .pillars-row { grid-template-columns: 1fr; }
}

/* ---- product grid ---- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.product-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.product-icon { font-size: 30px; }
/* Products with a real cutout photo (all 36 in the seed catalog now) show it
   as a bigger banner across the top of the card instead of a small inline
   icon — a future item added with just an emoji still falls back to
   .product-icon above via iconHtml(). Photos are clean, professional cutouts
   with fully transparent backgrounds, so they sit directly on a plain white
   panel (no tinted backdrop needed) with a little padding for breathing
   room. */
.product-photo {
  height: 140px; margin: -18px -18px 4px -18px;
  border-radius: 16px 16px 0 0;
  background-color: #FFFFFF;
  background-size: contain; background-position: center; background-repeat: no-repeat;
  background-origin: content-box; padding: 14px;
}
.product-card h3 { font-size: 15.5px; margin: 0; }
.product-price { color: var(--accent-dark); font-weight: 800; font-size: 15px; }
.product-unit { color: var(--grey-light); font-size: 12.5px; font-weight: 500; }
.qty-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.qty-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--cream);
  font-size: 16px; font-weight: 700; cursor: pointer; color: var(--ink);
}
/* Widened from 22px to fit decimal values like "0.3" now that the stepper
   moves in 0.1kg steps instead of whole kilos. */
.qty-val { min-width: 34px; text-align: center; font-weight: 700; }
.add-btn {
  margin-top: 8px; background: var(--light-green); color: var(--accent-dark); border: none;
  padding: 9px; border-radius: 10px; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.add-btn:hover { background: #d3e9df; }
.add-btn.added { background: var(--accent); color: #fff; }

.product-card.out-of-stock { opacity: .6; }
.out-of-stock-badge {
  margin-top: 8px; display: inline-block; align-self: flex-start;
  background: var(--light-warn); color: var(--alert); font-weight: 700;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  padding: 5px 10px; border-radius: 8px;
}

/* Admin quick-toggle switch (Product availability) */
.stock-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.stock-toggle input { display: none; }
.stock-toggle .switch {
  width: 38px; height: 22px; border-radius: 11px; background: var(--border);
  position: relative; transition: background .15s; flex-shrink: 0;
}
.stock-toggle .switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.stock-toggle input:checked + .switch { background: var(--accent); }
.stock-toggle input:checked + .switch::after { left: 18px; }
.stock-toggle .switch-label { font-size: 12.5px; font-weight: 700; color: var(--grey); min-width: 88px; }

/* Admin quick-edit price field */
.price-edit { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink); }
.price-input {
  width: 74px; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px;
  font-size: 14px; font-weight: 700; font-family: inherit; color: var(--ink); background: transparent;
}
.price-input:hover { border-color: var(--border); background: var(--cream); }
.price-input:focus { outline: none; border-color: var(--accent); background: #fff; }
.price-input.just-saved { border-color: var(--accent); background: var(--light-green); transition: background .2s, border-color .2s; }

/* ---- cart drawer ---- */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 60; display: none;
}
.cart-overlay.open { display: block; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; background: #fff; z-index: 61;
  transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column;
  box-shadow: -12px 0 30px rgba(0,0,0,0.15);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cart-drawer-head h3 { margin: 0; }
.cart-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--grey); }
.cart-items { flex: 1; overflow-y: auto; padding: 14px 22px; }
.cart-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-line-name { font-size: 14px; font-weight: 700; }
.cart-line-meta { font-size: 12.5px; color: var(--grey-light); }
.cart-line-remove { background: none; border: none; color: var(--alert); font-size: 12.5px; cursor: pointer; padding: 0; }
.cart-empty { text-align: center; color: var(--grey-light); padding: 60px 20px; font-size: 14px; }
.cart-drawer-foot { padding: 18px 22px; border-top: 1px solid var(--border); }
.cart-total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 16px; margin-bottom: 14px; }

/* ---- shared modal (Change Password, injected by changePassword.js on
   admin.html / oversee.html / stock.html) — hidden until .open is added by
   the button click handler; without this block the injected markup has no
   layout rules at all and just renders inline in the page flow instead of
   as a popup, which is the bug this fixes. ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 70;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 18px; padding: 26px 28px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal-box-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-box-head h3 { margin: 0; }
.modal-close {
  border: none; background: none; font-size: 22px; line-height: 1; color: var(--grey-light); cursor: pointer;
  padding: 2px 6px; border-radius: 6px;
}
.modal-close:hover { background: var(--cream); color: var(--ink); }

/* ---- site footer (every page) — the anithuli.com link used to sit in the
   header next to the logo; moved down here, bottom-right, alongside the
   copyright line. ---- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer .wrap {
  display: flex; justify-content: flex-end; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 20px; padding-bottom: 20px;
}
.footer-copyright { font-size: 12.5px; color: var(--grey-light); }

/* ---- floating "Get the app" promo (see js/appPromo.js) ----
   Customer-facing pages only, injected by JS rather than baked into each
   page's markup so one script tag covers it instead of repeating the same
   HTML block on every page. z-index 45 sits above the sticky header (40)
   but below the cart drawer/overlay (60/61) and modal overlays (70), so it
   never blocks either of those when they're open. */
.app-promo {
  position: fixed; right: 18px; bottom: 18px; z-index: 45;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.25);
  padding: 14px 16px 14px 14px; width: 240px;
  display: flex; flex-direction: column; gap: 10px;
  animation: appPromoIn .25s ease-out;
}
@keyframes appPromoIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.app-promo-close {
  position: absolute; top: 6px; right: 8px; border: none; background: none;
  font-size: 18px; line-height: 1; color: var(--grey-light); cursor: pointer; padding: 4px;
}
.app-promo-close:hover { color: var(--ink); }
.app-promo-head { display: flex; align-items: center; gap: 10px; padding-right: 14px; }
.app-promo-icon { font-size: 22px; line-height: 1; }
.app-promo-head strong { display: block; font-size: 13.5px; color: var(--ink); }
.app-promo-head span { display: block; font-size: 12px; color: var(--grey-light); margin-top: 2px; }
.app-promo-links { display: flex; flex-direction: column; gap: 8px; }
.app-promo-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 9px 12px; border-radius: 999px; border: 1.5px solid var(--border);
  font-weight: 700; font-size: 12.5px; color: var(--ink); background: var(--cream);
}
.app-promo-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
@media (max-width: 480px) {
  .app-promo { left: 14px; right: 14px; width: auto; bottom: 14px; }
}

/* ---- checkout / confirmation / admin shared ---- */
.page-section { padding: 40px 0 80px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
input, textarea, select {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; font-size: 14.5px;
  font-family: inherit; background: var(--cream); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
.payment-options { display: flex; gap: 10px; }
.payment-option {
  flex: 1; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; background: var(--cream);
}
.payment-option.active { border-color: var(--accent); background: var(--light-green); }
.payment-option.disabled { opacity: 0.55; cursor: not-allowed; }
.payment-option strong { display: block; font-size: 14px; margin-bottom: 3px; }
.payment-option span { font-size: 12.5px; color: var(--grey-light); }
.summary-line { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.summary-line.total { font-weight: 800; font-size: 17px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; }
.notice {
  background: var(--light-warn); color: var(--warn); border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-bottom: 18px;
}
.error-notice {
  background: #FBE3E1; color: var(--alert); border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-top: 14px; display: none;
}

/* ---- Product Demand bar chart (Statistics / Oversee) ---- */
.demand-bar-row { display: grid; grid-template-columns: 170px 1fr 90px; align-items: center; gap: 12px; margin-bottom: 10px; }
.demand-bar-label { font-size: 12.5px; color: var(--grey); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demand-bar-track { background: var(--cream); border-radius: 6px; height: 20px; overflow: hidden; }
.demand-bar-fill { height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.demand-bar-value { font-size: 12.5px; font-weight: 700; color: var(--ink); }
@media (max-width: 640px) {
  .demand-bar-row { grid-template-columns: 100px 1fr 70px; }
  /* Tabs and the space below them (before the page's own heading/hero)
     use desktop-sized spacing (24px gap, 40px top padding) up above —
     comfortable on a wide screen, but on a phone that same 24px gap
     between six wrapped, stacked-into-two-rows tab pills reads as
     "too wide", and the 40px+14px stack of padding above the next
     heading reads as an oversized empty gap. Tighten both below 640px
     only; desktop keeps the wider, centered spacing as-is. */
  .site-tabs { gap: 8px; padding: 0 0 8px; }
  .page-section { padding: 20px 0 60px; }
}

/* ---- Bookkeeper "Oversee" summary cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.stat-card .stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--grey-light); font-weight: 700; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 25px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.stat-card .stat-sub { font-size: 12.5px; color: var(--grey-light); margin-top: 5px; }
.stat-card.accent { border-color: var(--accent); background: var(--light-green); }
.stat-card.accent .stat-value { color: var(--accent-dark); }

table.orders-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.orders-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--grey-light); padding: 10px 12px; border-bottom: 2px solid var(--border); }
table.orders-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-Pending { background: var(--light-warn); color: var(--warn); }
.status-Confirmed { background: var(--light-blue); color: var(--accent2-dark); }
.status-Delivered { background: var(--light-green); color: var(--accent-dark); }
.status-Cancelled { background: #FBE3E1; color: var(--alert); }

/* ---- Delivery status tracker on Track Your Order (Order Placed / Packing /
   In Transit / Delivered) — mirrors the customer app's DeliveryStatusSection
   stepper (see the comment above STATUS_STEPS in TrackOrderResultScreen.js).
   Packing vs. In Transit is a display-only split of the "Confirmed" status,
   based on whether a rider has claimed the order yet (riderAccountId) — kept
   in sync by hand with the app version since one's HTML/CSS, the other
   React Native. ---- */
.tracker-title {
  font-size: 11.5px; font-weight: 700; color: var(--grey-light); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 14px; text-align: left;
}
/* Sept 2026: paid/unpaid badge sharing the title's row — see paymentBadgeInfo
   in track.html and the matching badge on the customer app's Delivery Status
   box. gcash_online is the only method db.js tracks a real paymentStatus
   for; cod/manual-gcash just read as paid once Delivered. */
.tracker-head-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.tracker-head-row .tracker-title { margin-bottom: 0; }
.payment-badge { padding: 4px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.badge-paid { background: var(--light-green); color: var(--accent-dark); }
.badge-pending { background: var(--light-warn); color: var(--warn); }
.badge-neutral { background: var(--light-blue); color: var(--accent2-dark); }
.tracker-row { display: flex; align-items: flex-start; }
.tracker-step { display: flex; flex-direction: column; align-items: center; width: 25%; }
.tracker-circle {
  width: 34px; height: 34px; border-radius: 50%; background: var(--cream); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0;
}
.tracker-step.done .tracker-circle { background: var(--light-green); border-color: var(--accent); }
.tracker-label { font-size: 10.5px; color: var(--grey-light); margin-top: 6px; text-align: center; }
.tracker-step.done .tracker-label { color: var(--accent-dark); font-weight: 700; }
.tracker-line { flex: 1; height: 2px; background: var(--border); margin-top: 17px; }
.tracker-line.done { background: var(--accent); }
.tracker-cancelled-banner {
  background: #FBE3E1; border-radius: 10px; padding: 12px; text-align: center;
  color: var(--alert); font-weight: 700; font-size: 13.5px;
}

/* ---- packing-photo lightbox (track.html + confirmation.html) — tap a
   thumbnail to see it full-size. Shared by both pages since both link
   style.css already; see openLightbox()/wireLightbox() in each page's own
   inline script. ---- */
.photo-lightbox {
  display: none; position: fixed; inset: 0; background: rgba(20,20,18,0.88);
  align-items: center; justify-content: center; z-index: 999; padding: 28px; cursor: zoom-out;
}
.photo-lightbox.open { display: flex; }
.photo-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.photo-thumb-clickable { cursor: zoom-in; }

/* ---- editable item weights on the Incoming Orders table (Pending/Confirmed
   orders only) — the website's version of the staff app's tap-to-edit item
   row on Order Detail. ---- */
.order-item-edit-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.order-item-edit-row:last-child { margin-bottom: 0; }
.order-item-edit-name { flex: 1; }
.order-item-qty-input {
  width: 52px; padding: 3px 6px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 13px; text-align: right; font-family: inherit;
}
.order-item-qty-input:focus { border-color: var(--accent); outline: none; }
.order-item-edit-unit { font-size: 12px; color: var(--grey-light); }
.order-item-save-btn {
  border: none; background: var(--accent); color: #fff; width: 22px; height: 22px; border-radius: 50%;
  font-size: 11px; font-weight: 800; cursor: pointer; line-height: 1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.order-item-save-btn:hover { background: var(--accent-dark); }
.order-item-save-btn:disabled { opacity: .5; cursor: default; }

@media (max-width: 800px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
}
