/* ==========================================================================
   OTea / GreyOne - Navy & Slate Glassmorphism Theme (Mobile-First)

   Palette is taken from the shop's own menus: the deep indigo of the OTea
   board and the cool grey ink wash of the GreyOne coffee/matcha card.
   Every colour below is a variable - recolouring the whole app means editing
   this block and nothing else.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Surfaces - clean commerce white, in the style of Malaysian ordering
     platforms (white cards on a faint grey ground). The deep-navy theme this
     replaced lives on only in the OTea brand ink below. */
  --bg-color: #f7f7fa;
  --bg-gradient: none;
  --panel-bg: #ffffff;
  --panel-border: #ebedf2;
  --surface-sheet: #ffffff;   /* opaque bottom sheets */
  --surface-modal: #ffffff;   /* full-screen checkout */
  --surface-sunken: #f2f3f7;  /* inset wells, map canvas */

  /* Accent - OTea navy-blue, now sitting on white */
  --accent-color: #3163cf;
  --accent-rgb: 49, 99, 207;
  --accent-gradient: linear-gradient(135deg, #4a7ae0 0%, #2c56b8 100%);
  --accent-glow: 0 4px 14px rgba(49, 99, 207, 0.25);
  --on-accent: #ffffff;

  /* Text - ink and slate greys */
  --text-primary: #1d2333;
  --text-secondary: #626c80;
  --text-muted: #9aa2b1;

  --success: #158a5c;
  --success-gradient: linear-gradient(135deg, #1ea06e 0%, #157a52 100%);
  --danger: #d6455e;
  --danger-gradient: linear-gradient(135deg, #e0566f 0%, #c23751 100%);
  --warning: #ad7423;
  --warning-rgb: 173, 116, 35;

  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --shadow-sm: 0 1px 3px rgba(29, 35, 51, 0.07);
  --shadow-lg: 0 8px 24px rgba(29, 35, 51, 0.09);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  gap: 0.5rem;
  min-height: 48px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--on-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--accent-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: var(--danger-gradient);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success-gradient);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.input-field {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  width: 100%;
  transition: var(--transition);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.2);
}

/* No app header: the bottom nav navigates and the admin-managed hero card
   carries the store identity, so the shell stays brand-free. */

.bottom-nav-badge.bounce-anim {
  animation: cartBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Categories and search */
.nav-and-search {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  padding: 0.65rem 1.1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.category-tab.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--on-accent);
  font-weight: 600;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  padding-left: 2.5rem;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ==========================================================================
   Gourmet Menu Grid (Two-in-a-row on mobile)
   ========================================================================== */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 5rem;
}

.menu-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
  border-radius: 12px;
}

.menu-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
}

.menu-image-container {
  height: 110px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #1a2340, #101728);
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-image {
  width: 85%;
  height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6));
  transition: var(--transition);
}

.menu-card:hover .menu-image {
  transform: scale(1.06) translateY(-4px);
}

.drink-fallback-icon {
  font-size: 3rem;
  opacity: 0.25;
}

.menu-content {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.menu-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.4em; /* Fixed height for line alignment */
}

.menu-desc {
  display: none; /* Hide on mobile to save vertical space */
}

.menu-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 0.4rem;
}

/* The 44px touch target leaves little room beside it on a narrow card, so the
   price stays on one line and shrinks slightly rather than wrapping. */
.menu-price {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-color);
  font-size: 0.9rem;
  white-space: nowrap;
  min-width: 0;
}

.add-btn-round {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--on-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  box-shadow: 0 2px 6px rgba(var(--accent-rgb), 0.3);
  transition: var(--transition);
}

.add-btn-round:hover {
  transform: scale(1.1);
}

/* ==========================================================================
   Slide-Up Modifiers Drawer / Sheet
   ========================================================================== */
.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 250;
  display: none;
  justify-content: center;
  align-items: flex-end; /* Align bottom for slide-up */
}

.sheet-overlay.open {
  display: flex;
}

.bottom-sheet {
  width: 100%;
  max-width: 500px;
  background: var(--surface-sheet);
  border-top: 1px solid var(--panel-border);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.5);
  padding: 1.5rem;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 0.75rem;
}

.sheet-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.sheet-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: -0.5rem -0.5rem -0.5rem 0;
}

.modifier-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modifier-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.modifier-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.modifier-pill {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.modifier-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.modifier-pill.active {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
  font-weight: 600;
}

/* Checkbox toggle option */
.addon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  cursor: pointer;
}

.addon-row.active {
  border-color: var(--accent-color);
  background: rgba(var(--accent-rgb), 0.04);
}

/* ==========================================================================
   Cart Slide-in/up Drawer
   ========================================================================== */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  z-index: 200;
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--panel-border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  right: 0;
}

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

.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cart-item-options {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.cart-item-price {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.qty-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.qty-val {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 15px;
  text-align: center;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: auto;
  opacity: 0.7;
}

.cart-footer {
  padding: 1rem;
  border-top: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.2);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-family: var(--font-heading);
}

.cart-summary-total {
  font-weight: 700;
  color: var(--accent-color);
}

/* ==========================================================================
   Checkout Modal & Steps
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 9, 20, 0.82);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.checkout-modal {
  width: 100%;
  height: 100%;
  max-width: 500px;
  background: var(--surface-modal);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Steps Progress bar */
.checkout-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  position: relative;
  padding: 0 0.5rem;
}

.checkout-steps::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 10px;
  right: 10px;
  height: 2px;
  background: rgba(255,255,255,0.06);
  z-index: 1;
}

.step-line-progress {
  position: absolute;
  top: 12px;
  left: 10px;
  height: 2px;
  background: var(--accent-gradient);
  z-index: 1;
  transition: var(--transition);
}

.step-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #101728;
  border: 2px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.step-node.active .step-circle {
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.3);
}

.step-node.active {
  color: var(--text-primary);
}

.step-node.completed .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: var(--on-accent);
}

.checkout-step-panel {
  display: none;
}

.checkout-step-panel.active {
  display: block;
}

.location-verification-card {
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  text-align: center;
  margin-bottom: 1rem;
}

.location-icon-status {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.location-icon-status.scanning {
  animation: pulseScan 1.5s infinite ease-in-out;
  color: var(--warning);
}

.location-icon-status.success {
  color: var(--success);
}

.location-icon-status.denied {
  color: var(--danger);
}

.mock-gps-selector {
  margin-top: 1rem;
  text-align: left;
}

.mock-gps-selector label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.payment-card {
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.01);
  padding: 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.payment-card.selected {
  border-color: var(--accent-color);
  background: rgba(var(--accent-rgb), 0.05);
}

.payment-card.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.payment-card-icon {
  font-size: 1.8rem;
}

.payment-card-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.payment-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.payment-alert {
  font-size: 0.75rem;
  color: var(--warning);
  background: rgba(var(--warning-rgb), 0.08);
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(var(--warning-rgb), 0.15);
  margin-top: 0.75rem;
}

/* ==========================================================================
   DuitNow QR Pre-Payment Graphic
   ========================================================================== */
.qr-pay-card {
  background: linear-gradient(135deg, #e6005c 0%, #99003d 100%); /* DuitNow Pink/Magenta Theme */
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  color: white;
  max-width: 320px;
  margin: 1rem auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
}

.qr-header {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.qr-frame {
  background: white;
  padding: 0.75rem;
  border-radius: 12px;
  display: inline-block;
  margin: 0.5rem 0;
  position: relative;
}

.qr-image-mock {
  width: 170px;
  height: 170px;
  background-color: #eee;
  background-image: radial-gradient(#000 25%, transparent 25%),
                    radial-gradient(#000 25%, transparent 25%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-center-logo {
  width: 40px;
  height: 40px;
  background: #e6005c;
  color: white;
  font-weight: 800;
  font-size: 0.65rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.qr-timer {
  font-family: monospace;
  font-size: 0.85rem;
  background: rgba(0,0,0,0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.5rem;
}

.qr-amount-pill {
  font-size: 1.2rem;
  font-weight: 700;
  background: white;
  color: #99003d;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-heading);
}

/* ==========================================================================
   Order Tracking & Timelines
   ========================================================================== */
.tracking-wrapper {
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.tracking-header-status {
  text-align: center;
  margin-bottom: 1.25rem;
}

.tracking-id-tag {
  background: rgba(255,255,255,0.04);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 1.5rem 0;
}

.status-timeline::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 15px;
  right: 15px;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 1;
}

.timeline-progress-bar {
  position: absolute;
  top: 16px;
  left: 15px;
  height: 3px;
  background: var(--accent-gradient);
  z-index: 1;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
}

.timeline-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #141d33;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.timeline-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.timeline-node.active .timeline-icon-box {
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: var(--accent-glow);
  transform: scale(1.1);
  animation: pulseNodeGlow 2s infinite;
}

.timeline-node.active .timeline-label {
  color: var(--text-primary);
  font-weight: 600;
}

.timeline-node.completed .timeline-icon-box {
  background: var(--success);
  border-color: var(--success);
  color: var(--on-accent);
}

.map-frame-container {
  height: 250px;
  border-radius: 12px;
}

/* ==========================================================================
   Animations Keyframes
   ========================================================================== */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cartBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

@keyframes pulseScan {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 8px rgba(var(--warning-rgb), 0.5)); }
  100% { transform: scale(1); opacity: 0.8; }
}

@keyframes pulseNodeGlow {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

/* ==========================================================================
   Kiosk and Responsive Queries (Desktop Enhancements)
   ========================================================================== */
@media (min-width: 601px) {
  .container {
    padding: 0 1.5rem;
  }
  
  .nav-and-search {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .search-box {
    max-width: 320px;
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
  }

  .menu-image-container {
    height: 150px;
  }

  .menu-title {
    font-size: 1.05rem;
    height: auto;
    display: block;
    margin-bottom: 0.5rem;
  }

  .menu-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
  }

  .add-btn-round {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }

  /* Centered Modal on larger monitors */
  .sheet-overlay {
    align-items: center;
  }

  .bottom-sheet {
    border-radius: 16px;
    max-height: 90vh;
    animation: fadeIn 0.3s ease-out;
  }

  .checkout-modal {
    height: auto;
    max-height: 90vh;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    animation: fadeIn 0.3s ease-out;
  }

  .payment-methods-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tracking-wrapper {
    padding: 2rem;
  }

  .map-frame-container {
    height: 320px;
  }

  .status-timeline::before {
    top: 24px;
    left: 20px;
    right: 20px;
  }

  .timeline-progress-bar {
    top: 24px;
    left: 20px;
  }

  .timeline-icon-box {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }

  .timeline-label {
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Admin Dashboard Custom Styles
   ========================================================================== */
.admin-body {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  overflow: hidden;
  font-family: var(--font-body);
}

/* Sidebar navigation */
.admin-sidebar {
  width: 280px;
  background: rgba(9, 14, 28, 0.95);
  border-right: 1px solid var(--panel-border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
}

.admin-logo h1 {
  font-size: 1.3rem;
  font-family: var(--font-heading);
  background: linear-gradient(to right, #ffffff, var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 500;
  border-radius: 12px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.admin-nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
}

.admin-nav-item.active {
  color: var(--on-accent);
  background: var(--accent-gradient);
  font-weight: 600;
  box-shadow: var(--accent-glow);
}

.admin-nav-item.active:hover {
  color: var(--on-accent);
  transform: none;
}

/* Main workspace */
.admin-main {
  flex-grow: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  height: 100vh;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 1.25rem;
}

.admin-header h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #e5e7eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Stats board metrics */
.admin-metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 16px;
  transition: var(--transition);
  border-left: 4px solid transparent;
}

.metric-card:hover {
  transform: translateY(-4px);
}

.metric-card.accented {
  border-left-color: var(--accent-color);
}

.metric-card.danger {
  border-left-color: var(--danger);
}

.metric-card.safe {
  border-left-color: var(--success);
}

.metric-icon-box {
  font-size: 1.8rem;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
}

.metric-val {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
}

/* Split-screen panels */
.admin-content-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  flex-grow: 1;
  min-height: 0; /* Enable internal scrolling on grid items */
}

.admin-orders-list-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 1.5rem;
  min-height: 0;
  box-shadow: var(--shadow-lg);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 1rem;
}

.panel-title-row h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

.admin-orders-scroll {
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-right: 0.5rem;
}

/* Order ticket cards */
.admin-order-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
}

.admin-order-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.order-card-id {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-color);
  letter-spacing: 0.5px;
}

.spam-risk-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* Dynamic risk classes matching server.js outputs */
.spam-risk-badge.safe-zone,
.spam-risk-badge.low-risk {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.spam-risk-badge.medium-risk,
.spam-risk-badge.suspicious-pattern {
  background: rgba(var(--warning-rgb), 0.12);
  color: var(--warning);
  border: 1px solid rgba(var(--warning-rgb), 0.25);
}

.spam-risk-badge.high-risk,
.spam-risk-badge.critical-risk {
  background: rgba(244, 63, 94, 0.12);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.order-card-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Staff remark row on an order card */
.staff-note-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  flex-wrap: wrap; margin-top: 0.5rem; padding-top: 0.4rem; font-size: 0.8rem;
}
.staff-note-text { color: var(--text-secondary, #5b6579); }
.staff-note-empty { color: var(--text-muted, #8a93a6); font-style: italic; }
.staff-note-edit {
  background: none; border: none; cursor: pointer; font-weight: 600; font-size: 0.8rem;
  color: var(--accent-color); white-space: nowrap; padding: 0.1rem 0.2rem;
}

/* Pause-online-orders bar above the admin queue */
.online-pause-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  flex-wrap: wrap; padding: 0.6rem 0.9rem; margin-bottom: 0.9rem; border-radius: 10px;
  background: rgba(63, 191, 149, 0.12); border: 1px solid rgba(63, 191, 149, 0.35);
}
.online-pause-bar.paused {
  background: rgba(239, 95, 120, 0.12); border-color: rgba(239, 95, 120, 0.45);
}
.online-pause-bar strong { font-size: 0.9rem; }
.online-pause-hint { font-size: 0.78rem; color: var(--text-secondary, #5b6579); margin-left: 0.4rem; }

/* Delivery order: header badge + a can't-miss details block for staff */
.delivery-badge {
  display: inline-block; margin-left: 0.5rem; padding: 0.1rem 0.5rem;
  border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.03em;
  background: var(--accent-color); color: #fff; vertical-align: middle;
}
.admin-delivery-block {
  margin: 0.6rem 0; padding: 0.7rem 0.9rem; border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.12); border: 1px solid rgba(var(--accent-rgb), 0.35);
  display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem;
}
.admin-delivery-head { font-weight: 800; color: var(--accent-color); letter-spacing: 0.02em; }

.meta-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-order-item-row {
  display: flex;
}

.order-card-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.order-card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.order-card-actions .btn {
  flex: 1;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  border-radius: 10px;
}

/* Map panel styling */
.admin-map-panel {
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 1.5rem;
  min-height: 0;
  box-shadow: var(--shadow-lg);
}

.admin-map-panel h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 1rem;
}

.admin-map-frame {
  flex-grow: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  position: relative;
  margin-top: 1rem;
  min-height: 350px;
}

#adminLiveMap {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  background-color: #1a1a24;
}

/* Custom scrollbars inside admin panel */
.admin-orders-scroll::-webkit-scrollbar,
.admin-main::-webkit-scrollbar {
  width: 6px;
}

.admin-orders-scroll::-webkit-scrollbar-track,
.admin-main::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

.admin-orders-scroll::-webkit-scrollbar-thumb,
.admin-main::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.admin-orders-scroll::-webkit-scrollbar-thumb:hover,
.admin-main::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Leaflet Dark Theme Map Overrides */
.leaflet-container {
  background: var(--surface-sunken) !important;
  font-family: var(--font-body) !important;
}

.leaflet-bar {
  border: 1px solid var(--panel-border) !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.leaflet-bar a {
  background-color: #1c1c24 !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--panel-border) !important;
  transition: var(--transition);
}

.leaflet-bar a:hover {
  background-color: #2e2e3a !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(20, 20, 28, 0.95) !important;
  border: 1px solid var(--panel-border) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip {
  background: rgba(20, 20, 28, 0.95) !important;
  border: 1px solid var(--panel-border) !important;
}

/* Responsive grid layout adjustments */
@media (max-width: 991px) {
  .admin-body {
    flex-direction: column;
    overflow-y: auto;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    padding: 1.25rem 1.5rem;
    gap: 1.25rem;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }

  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .admin-nav-item {
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
  }

  .admin-main {
    height: auto;
    overflow-y: visible;
    padding: 1.25rem;
  }

  .admin-content-split {
    grid-template-columns: 1fr;
  }

  .admin-map-frame {
    min-height: 380px;
  }
}

/* ==========================================================================
   Mobile-Dedicated Bottom Navigation Bar & Layout Tuning
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(9, 14, 28, 0.88);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 150;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  flex-grow: 1;
  height: 100%;
  position: relative;
}

.bottom-nav-icon {
  font-size: 1.35rem;
  margin-bottom: 0.1rem;
  transition: var(--transition);
}

.bottom-nav-item.active {
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.25);
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: translateY(-2px) scale(1.05);
}

.bottom-nav-badge {
  position: absolute;
  top: -2px;
  right: -8px;
  background: var(--accent-gradient);
  color: var(--on-accent);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.65rem;
  min-width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--accent-glow);
}

/* The bottom nav is the only navigation on every screen size. */
body {
  padding-bottom: 80px; /* Safe padding for bottom nav */
}

@media (max-width: 600px) {
  .menu-image-container {
    height: 120px;
  }
}


/* -------------------------------------------------------------
   Admin sign-in gate
   ------------------------------------------------------------- */
#adminWorkspace {
  display: flex;
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
}

.admin-login-gate {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.admin-login-card {
  width: 100%;
  max-width: 360px;
  padding: 2rem;
  border-radius: 18px;
  text-align: left;
}

.admin-login-error {
  margin-top: 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--danger);
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.28);
}

@media (max-width: 991px) {
  #adminWorkspace {
    flex-direction: column;
    overflow-y: auto;
  }
}

/* -------------------------------------------------------------
   Customer tracking map + receipt
   ------------------------------------------------------------- */

/* The map div had no height rule, so it collapsed to 0 and left a dead
   250-320px hole on the tracking screen. */
.map-frame-container {
  position: relative;
  overflow: hidden;
  background: var(--surface-sunken);
}

#customerMap {
  width: 100%;
  height: 100%;
  /* Leaflet's internal panes use z-index up to 1000; without a stacking
     context here they'd paint over the sticky header (z-index 100). */
  position: relative;
  z-index: 0;
}

/* Long drink names ran flush into the price on narrow phones. */
.receipt-card .receipt-row > div {
  gap: 0.75rem;
}

.receipt-card .receipt-row > div > span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}

.receipt-card .receipt-row > div > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Admin status filter was a 28px-tall select - awkward on a phone. */
.panel-title-row .input-field {
  min-height: 44px;
}

/* -------------------------------------------------------------
   Admin order cards on narrow screens
   ------------------------------------------------------------- */

/* Drink name ran flush into its price the same way the receipt did. */
.admin-order-item-row > div {
  gap: 0.75rem;
}

.admin-order-item-row > div > span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-order-item-row > div > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Keep the order total on one line instead of wrapping mid-amount. */
.order-card-total-row {
  gap: 0.75rem;
}

.order-card-total-row > div:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Safety net: never let a long price run under the add button. */
.menu-price {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------------------------------------------
   Sold-out menu items
   ------------------------------------------------------------- */
.menu-card.sold-out .menu-image-container {
  filter: grayscale(1);
  opacity: 0.45;
}

.menu-card.sold-out .menu-title,
.menu-card.sold-out .menu-price {
  opacity: 0.5;
}

.sold-out-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  background: rgba(239, 95, 120, 0.92);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}

.add-btn-round:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.add-btn-round:disabled:hover {
  transform: none;
}

.cart-item.sold-out-line {
  border-left: 3px solid var(--danger);
  padding-left: 0.6rem;
}

.cart-sold-out-tag {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--danger);
  text-transform: uppercase;
}

/* -------------------------------------------------------------
   Admin: menu stock + order history
   ------------------------------------------------------------- */
.stock-group { margin-bottom: 1.25rem; }

.stock-group-title {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  margin-bottom: 0.4rem;
  background: rgba(255, 255, 255, 0.02);
}

.stock-row.is-out { border-color: rgba(239, 95, 120, 0.4); }

.stock-name {
  font-size: 0.88rem;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stock-state {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.stock-row.is-out .stock-state { color: var(--danger); }

.stock-btn {
  flex-shrink: 0;
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}

.history-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.history-filters .input-field {
  min-height: 44px;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
}

.history-summary {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 0.75rem;
}

/* Wide tables scroll inside their own box rather than the page. */
.history-table-wrap { overflow-x: auto; }

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 720px;
}

.history-table th {
  text-align: left;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  background: var(--surface-sheet);
}

.history-table td {
  padding: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}

.hist-zone { font-size: 0.72rem; color: var(--text-muted); }

/* Attach-screenshot row on the checkout QR screen */
.qr-proof-attach {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* Partner-settlement box under the admin receipt dialog */
.adjust-box {
  margin-top: 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px dashed var(--panel-border);
  border-radius: 10px;
  background: var(--surface-sunken, rgba(0, 0, 0, 0.02));
}

/* Order id opens the customer's receipt in a dialog */
.hist-order-link {
  color: var(--accent-color);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hist-items { max-width: 260px; }

.hist-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(255, 255, 255, 0.07);
}

.hist-completed { background: rgba(63, 191, 149, 0.16); color: var(--success); }
.hist-cancelled { background: rgba(239, 95, 120, 0.16); color: var(--danger); }
.hist-pending, .hist-preparing, .hist-ready {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-color);
}

.history-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.history-pager .btn { padding: 0.5rem 1rem; font-size: 0.82rem; }
.history-pager .btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Modifier groups are now injected into one container, so they no longer
   inherit the sheet's flex gap. */
#modGroupsContainer .modifier-section {
  margin-top: 1.1rem;
}

#modGroupsContainer .addon-row + .addon-row {
  margin-top: 0.4rem;
}

/* -------------------------------------------------------------
   Menu editor
   ------------------------------------------------------------- */
.stock-row.is-hidden { opacity: 0.55; }

.stock-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.modifier-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.4rem 0.1rem 0;
}

/* Editor dialog */
.admin-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(5, 9, 20, 0.82);
  backdrop-filter: blur(8px);
}

.admin-dialog {
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.25rem;
  border-radius: 16px;
}

.admin-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.admin-dialog-head h3 { font-size: 1.05rem; }

.admin-dialog-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.admin-dialog-actions .btn { flex: 1; }

.dialog-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.dialog-field .input-field,
.admin-dialog .input-field {
  min-height: 44px;
  font-size: 0.9rem;
  padding: 0.5rem 0.7rem;
  border-radius: 9px;
  width: 100%;
}

.dialog-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  margin: 0.35rem 0;
  min-height: 32px;
  cursor: pointer;
}

.dialog-check input { width: 18px; height: 18px; flex-shrink: 0; }

.variant-row {
  display: grid;
  grid-template-columns: 1fr 110px 44px;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  align-items: center;
}

.variant-row .stock-btn { padding: 0.45rem; }

.assign-block {
  margin-top: 0.8rem;
  font-size: 0.8rem;
}

.assign-block strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.assign-scroll {
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
}

/* -------------------------------------------------------------
   Image picker and seasonal fields
   ------------------------------------------------------------- */
.stock-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface-sunken);
  flex-shrink: 0;
  margin-right: 0.7rem;
}

.stock-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0.5;
}

.image-picker {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.image-preview {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface-sunken);
  border: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.image-picker-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.image-status {
  width: 100%;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.season-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.dialog-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: -0.2rem 0 0.6rem;
  line-height: 1.4;
}

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

/* -------------------------------------------------------------
   Counter till
   ------------------------------------------------------------- */
.till-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
  align-items: start;
}

.till-categories,
.till-type-picker,
.till-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.till-categories { margin-bottom: 0.8rem; }

.type-pill {
  padding: 0.5rem 0.85rem;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.type-pill.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--on-accent);
  font-weight: 600;
}

.till-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.till-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.7rem;
  min-height: 68px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.till-item:hover { border-color: var(--accent-color); }
.till-item-name { font-size: 0.8rem; font-weight: 500; line-height: 1.25; }
.till-item-price { font-size: 0.78rem; font-weight: 700; color: var(--accent-color); }

.till-bill { position: sticky; top: 1rem; }

.till-lines {
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 0.6rem;
}

.till-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-size: 0.85rem;
}

.till-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.till-line-main { min-width: 0; }
.till-line-name { display: block; font-size: 0.85rem; font-weight: 500; }
.till-line-opts { display: block; font-size: 0.7rem; color: var(--text-muted); overflow-wrap: anywhere; }
.till-line-qty { display: flex; align-items: center; gap: 0.3rem; }
.till-line-price { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

.till-total-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  padding: 0.3rem 0;
}

.till-total-row.discount { color: var(--warning); }

.till-total-row.grand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-color);
  border-top: 1px solid var(--panel-border);
  margin-top: 0.35rem;
  padding-top: 0.5rem;
}

.till-summary { margin-bottom: 0.8rem; }

.pay-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.pay-buttons .btn { padding: 0.7rem 0.3rem; font-size: 0.8rem; }

.till-group { margin-bottom: 0.8rem; }

.pay-due {
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.1);
  margin-bottom: 0.8rem;
}

.pay-due strong { color: var(--accent-color); font-size: 1.05rem; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }

.pay-change {
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 0.7rem;
}

/* -------------------------------------------------------------
   Cash drawer
   ------------------------------------------------------------- */
.drawer-head {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-bottom: 0.7rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--panel-border);
}

.drawer-side,
.drawer-movements {
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--panel-border);
}

.drawer-movements strong,
.drawer-side strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.drawer-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 1rem;
}

.drawer-actions .btn { padding: 0.6rem 0.4rem; font-size: 0.8rem; }
.drawer-closed { text-align: center; padding: 1rem 0; }
.drawer-closed p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; }

@media (max-width: 900px) {
  .till-layout { grid-template-columns: 1fr; }
  .till-bill { position: static; }
}

/* -------------------------------------------------------------
   Icons
   ------------------------------------------------------------- */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  vertical-align: -0.18em;
  fill: none;
  stroke: currentColor;
}

.icon-lg { width: 1.5em; height: 1.5em; }
.icon-xl { width: 2em; height: 2em; }

/* Buttons that pair an icon with a label */
.btn .icon { margin-right: 0.1rem; }

/* Icon-only button: square, no text crowding */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover { color: var(--danger); background: rgba(239, 95, 120, 0.1); }
.icon-btn.subtle:hover { color: var(--accent-color); background: rgba(var(--accent-rgb), 0.1); }

/* -------------------------------------------------------------
   Sales reports
   ------------------------------------------------------------- */
.report-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.report-card {
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--panel-border);
}

.report-card.accent { border-left-color: var(--accent-color); }
.report-card.warn { border-left-color: var(--warning); }
.report-card.danger { border-left-color: var(--danger); }

.report-card-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.report-card-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.report-card.accent .report-card-value { color: var(--accent-color); }
.report-card.warn .report-card-value { color: var(--warning); }
.report-card.danger .report-card-value { color: var(--danger); }

.report-block { margin-bottom: 1.4rem; }

.report-block h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.report-empty { font-size: 0.82rem; color: var(--text-muted); }

.report-foot {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--panel-border);
}

/* Hourly bars: the shape of the trading day at a glance */
.hour-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 130px;
  padding: 0.5rem 0.25rem 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow-x: auto;
}

.hour-col {
  /* Capped so a short trading day clusters instead of two lonely bars
     stretching across the whole panel. */
  flex: 1 1 20px;
  max-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
}

.hour-bar {
  width: 100%;
  max-width: 22px;
  border-radius: 3px 3px 0 0;
  background: var(--accent-gradient);
  min-height: 3px;
}

.hour-bar.empty {
  background: rgba(120, 130, 150, 0.25);
  border-radius: 2px;
}

.hour-label { font-size: 0.6rem; color: var(--text-muted); }

.hour-value {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.login-help {
  margin-top: 0.9rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.login-help code {
  font-size: 0.7rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
}

/* -------------------------------------------------------------
   Customer accounts and the refer-a-friend programme
   ------------------------------------------------------------- */
.account-wrapper {
  max-width: 520px;
  margin: 1.5rem auto 2rem;
  padding: 1.5rem;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-tabs .type-pill { flex: 1; justify-content: center; text-align: center; }

.auth-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.auth-field {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.auth-field .input-field { margin-top: 0.3rem; }

/* The auth error box doubles as an info notice ("sign in to check out"). */
.admin-login-error.is-info {
  color: var(--accent-color);
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--panel-border);
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.referral-card {
  padding: 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.05);
  margin-bottom: 1.25rem;
}

.referral-code-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.referral-code {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-color);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  flex-grow: 1;
  text-align: center;
}

.referral-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
}

.voucher-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  margin-bottom: 0.45rem;
  background: rgba(255, 255, 255, 0.02);
}

.voucher-row.pickable { cursor: pointer; transition: var(--transition); }

.voucher-row.pickable:hover { border-color: rgba(var(--accent-rgb), 0.5); }

.voucher-row.selected {
  border-color: var(--accent-color);
  background: rgba(var(--accent-rgb), 0.08);
}

.voucher-label { font-size: 0.85rem; font-weight: 600; }

.voucher-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }

.voucher-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--success);
  white-space: nowrap;
  flex-shrink: 0;
}

.voucher-empty { font-size: 0.8rem; color: var(--text-muted); }

.checkout-account-card {
  font-size: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
}

/* Receipt rows never had a base layout rule; spans sat side by side only by
   accident of inline styles. Make the two-column row explicit. */
.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

/* -------------------------------------------------------------
   Membership card (tier, cups, points)
   ------------------------------------------------------------- */
.member-card {
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0.04));
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  margin-bottom: 1.25rem;
}

.member-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.member-tier {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-color);
}

.member-points {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--success);
}

.member-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.member-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-gradient);
  transition: width 0.4s ease;
}

.member-progress-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

.member-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* -------------------------------------------------------------
   Receipt business head + printing
   ------------------------------------------------------------- */
.receipt-business {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.receipt-business strong { font-size: 0.95rem; }

.receipt-business span { font-size: 0.72rem; color: var(--text-secondary); }

/* Company + SSM number on one line, the stall address on its own line */
.receipt-biz-line {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.receipt-order-meta {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.receipt-footer-note {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Print: only the receipt, in plain black-on-white. */
@media print {
  /* Zero page margins clip the browser's URL/date header and footer on
     Chrome and Android; Safari always prints them (user setting only). */
  @page { margin: 0; }

  /* Everything except the receipt leaves the layout entirely. The old
     visibility:hidden approach kept ghost heights (a 2-page printout) and
     the blue timeline-progress bar still painted through on some browsers. */
  body > *:not(#trackingView) { display: none !important; }
  #trackingView > *:not(#trackingContent) { display: none !important; }
  #trackingContent > *:not(#printableReceipt) { display: none !important; }
  .barcode-mock { display: none !important; }

  html, body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #trackingView { display: block !important; margin: 0 !important; padding: 0 !important; }

  #trackingContent {
    display: block !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* A narrow centred column reads like a real till receipt. */
  #printableReceipt {
    max-width: 420px;
    margin: 0 auto !important;
    padding: 12mm 8mm;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
  }

  #printableReceipt * {
    color: #000000 !important;
    background: transparent !important;
    border-color: #dddddd !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }

  /* Compact rows so even a long order fits one page. */
  #printableReceipt .receipt-item { padding: 0.3rem 0; }
  #printableReceipt .receipt-item-name,
  #printableReceipt .receipt-item-price { font-size: 0.78rem; }
  #printableReceipt .receipt-item-sub,
  #printableReceipt .receipt-item-qty { font-size: 0.64rem; }
  #printableReceipt .receipt-summary .sum-row { padding: 0.08rem 0; font-size: 0.76rem; }
  #printableReceipt .receipt-grand-row { margin-top: 0.35rem; padding-top: 0.4rem; }
}

/* Allergen declaration in the customisation sheet */
.allergen-note {
  font-size: 0.75rem;
  color: var(--warning);
  background: rgba(var(--warning-rgb), 0.09);
  border: 1px solid rgba(var(--warning-rgb), 0.25);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  margin-top: 0.4rem;
}

/* ==========================================================================
   Light commerce re-skin (customer app)

   The palette flip in :root does most of the work; the rules here repaint
   every component that had a hardcoded dark-theme colour. The staff console
   is unaffected: admin.css loads after this file and keeps its own skin.
   ========================================================================== */
/* Category tabs read as text tabs with an active underline, not pills. */
.category-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.55rem 0.25rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.category-tab.active {
  background: transparent;
  border-bottom-color: var(--accent-color);
  color: var(--accent-color);
}

.glass-panel {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid #dfe3ea;
}

.btn-secondary:hover { background: #f4f5f8; }

.btn-danger, .btn-success { color: #ffffff; }

.input-field {
  background: #ffffff;
  border: 1px solid #dfe3ea;
  color: var(--text-primary);
}

.input-field:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }

/* ---- menu cards ---- */
.menu-image-container { background: #f4f5f8; }

.menu-image { filter: drop-shadow(0 4px 10px rgba(29, 35, 51, 0.15)); }

/* ---- customisation sheet ---- */
.sheet-overlay { background: rgba(24, 28, 38, 0.45); }

.bottom-sheet { box-shadow: 0 -8px 24px rgba(29, 35, 51, 0.15); }

.sheet-header { border-bottom: 1px solid var(--panel-border); }

.modifier-pill {
  background: #ffffff;
  border: 1px solid #dfe3ea;
}

.modifier-pill:hover { background: #f4f5f8; }

.modifier-pill.active {
  background: rgba(var(--accent-rgb), 0.07);
  border-color: var(--accent-color);
}

.modifier-pick-hint {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

.option-rows { display: flex; flex-direction: column; gap: 0.4rem; }

.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  min-height: 46px;
  background: #ffffff;
  border: 1px solid #e4e7ee;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.option-row:hover { border-color: #c6cede; }

.option-row.active {
  border-color: var(--accent-color);
  background: rgba(var(--accent-rgb), 0.06);
  box-shadow: inset 0 0 0 1px var(--accent-color);
}

.option-name { font-size: 0.85rem; font-weight: 500; min-width: 0; }

.option-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-color);
  white-space: nowrap;
  flex-shrink: 0;
}

.option-row.active .option-name { color: var(--accent-color); font-weight: 600; }

/* legacy addon rows (still used by the till preview) */
.addon-row { background: #ffffff; border-color: #e4e7ee; }
.addon-row.active { background: rgba(var(--accent-rgb), 0.06); }

/* Sticky action bar: quantity stepper + "Add For RM X" */
.sheet-add-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
  margin: 0 -1.5rem -1.5rem;
  padding: 0.75rem 1.5rem calc(1rem + env(safe-area-inset-bottom));
  background: #ffffff;
  border-top: 1px solid var(--panel-border);
}

.sheet-qty {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.sheet-qty .qty-btn { border-radius: 50%; }

.sheet-qty .qty-val { font-size: 0.95rem; min-width: 18px; }

.sheet-add-btn { flex: 1; }

.qty-btn {
  background: #ffffff;
  border: 1px solid #dfe3ea;
  color: var(--text-primary);
}

/* ---- cart ---- */
.cart-item { border-bottom: 1px solid var(--panel-border); }

.cart-item-note { font-size: 0.72rem; color: var(--warning); margin-top: 0.15rem; }

/* ---- checkout ---- */
.modal-overlay { background: rgba(24, 28, 38, 0.45); }

.checkout-steps::before { background: #e6e9ef; }

.step-circle {
  background: #ffffff;
  border: 2px solid #dfe3ea;
}

.location-verification-card {
  background: #f8f9fb;
  border: 1px dashed #d8dde6;
}

.payment-card {
  background: #ffffff;
  border: 1px solid #e4e7ee;
}

.payment-card.selected { background: rgba(var(--accent-rgb), 0.05); }

/* ---- tracking ---- */
.tracking-id-tag { background: #f2f3f7; }

.status-timeline::before { background: #e6e9ef; }

.timeline-icon-box {
  background: #ffffff;
  border: 1px solid #dfe3ea;
}

.timeline-node.completed .timeline-icon-box { color: #ffffff; }

/* ---- bottom navigation ---- */
.bottom-nav {
  background: #ffffff;
  border-top: 1px solid var(--panel-border);
  box-shadow: 0 -2px 12px rgba(29, 35, 51, 0.06);
}

.bottom-nav-item.active { text-shadow: none; }

/* ---- account / loyalty ---- */
.referral-code { background: #f2f4f9; }

.member-progress-track { background: #e6e9ef; }

.voucher-row { background: #ffffff; }

.checkout-account-card { background: #f8f9fb; }

.admin-login-error.is-info { background: rgba(var(--accent-rgb), 0.06); }

/* Sold-out badge keeps its red; the card ground behind it is now light. */
.menu-card.sold-out .menu-image-container { opacity: 0.55; }

/* Note line on staff tickets */
.item-note-line {
  font-size: 0.75rem;
  color: var(--warning);
  background: rgba(var(--warning-rgb), 0.08);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  margin-top: 0.25rem;
}

/* Light map chrome for the customer tracking map (admin.css restyles its own) */
.leaflet-container { background: var(--surface-sunken) !important; }

.leaflet-bar a {
  background-color: #ffffff !important;
  color: #33415c !important;
  border-bottom: 1px solid var(--panel-border) !important;
}

.leaflet-bar a:hover { background-color: #f4f5f8 !important; }

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--panel-border) !important;
}

/* -------------------------------------------------------------
   Sheet layout fix: scrollable body + fixed action bar
   The earlier sticky bar floated over mid-sheet content and let options
   render underneath it. The sheet is now a flex column: .sheet-scroll owns
   all scrolling, the add bar sits statically below it, always visible,
   never covering anything.
   ------------------------------------------------------------- */
.bottom-sheet {
  padding: 0;
  gap: 0;
  overflow: hidden; /* the inner wrapper scrolls instead */
}

.sheet-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sheet-add-bar {
  position: static;
  margin: 0;
  padding: 0.75rem 1.5rem calc(0.9rem + env(safe-area-inset-bottom));
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(29, 35, 51, 0.06);
}

/* Passwordless sign-in */
.otp-input {
  letter-spacing: 0.4em;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
}

.auth-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: -0.25rem 0 0.5rem;
  line-height: 1.45;
}

/* Guest checkout nudge */
.guest-upsell {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(var(--accent-rgb), 0.05);
  border: 1px dashed rgba(var(--accent-rgb), 0.35);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  margin-top: 0.75rem;
  line-height: 1.5;
}

.guest-upsell-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-color);
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}

/* Storefront hero: banner with the store card overlapping its bottom edge */
.store-hero { margin-top: 1rem; }

.store-hero-banner {
  height: 170px;
  border-radius: 16px;
  overflow: hidden;
  background: #eef0f5;
}

.store-hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-hero-card {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 0.9rem 1.1rem;
  margin: 0 0.75rem;
}

.store-hero-banner + .store-hero-card { margin-top: -34px; position: relative; }

.store-hero-card h2 { font-size: 1.2rem; }

.store-hero-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

@media (min-width: 601px) {
  .store-hero-banner { height: 220px; }
  .store-hero-card { margin: 0 1.25rem; }
  .store-hero-banner + .store-hero-card { margin-top: -38px; }
}

/* -------------------------------------------------------------
   Real-phone viewport fixes
   100vh includes the strip behind a mobile browser's URL/toolbar, so
   bottom-anchored UI (the sheet's add bar, checkout buttons) rendered
   underneath the browser chrome on some phones. Dynamic viewport units size
   to what is actually visible; the vh lines stay as fallback for old
   browsers. viewport-fit=cover in the meta tag switches on the
   env(safe-area-inset-bottom) padding these bars already carry.
   ------------------------------------------------------------- */
.sheet-overlay {
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.bottom-sheet {
  max-height: 85vh;
  max-height: 88dvh;
}

.modal-overlay {
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

@media (min-width: 601px) {
  .checkout-modal {
    max-height: 90vh;
    max-height: 90dvh;
  }

  .bottom-sheet {
    max-height: 90vh;
    max-height: 90dvh;
  }
}

/* Open/Closed line on the store card */
.store-hours-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.store-open-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.store-open-dot.is-open { background: var(--success); box-shadow: 0 0 0 3px rgba(21, 138, 92, 0.15); }
.store-open-dot.is-closed { background: var(--danger); box-shadow: 0 0 0 3px rgba(214, 69, 94, 0.15); }

/* Closed-hours banner + weekly hours list */
.closed-banner {
  background: rgba(var(--warning-rgb), 0.1);
  border-bottom: 1px solid rgba(var(--warning-rgb), 0.25);
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 0.55rem 1rem;
}

.store-hours-line { cursor: pointer; user-select: none; }

.store-hours-caret { color: var(--text-muted); font-size: 0.65rem; }

.week-hours {
  margin-top: 0.5rem;
  border-top: 1px solid var(--panel-border);
  padding-top: 0.45rem;
}

.week-hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
  padding: 0.15rem 0;
}

.week-hours-row span:last-child { font-weight: 600; color: var(--text-primary); }

/* -------------------------------------------------------------
   Banner aspect fix: the fixed-height banner cropped differently on every
   screen width, shifting the artwork. The frame now keeps a constant 2:1
   ratio (matching the uploaded design), and on tablets/desktops the whole
   hero is centred at a fixed width instead of stretching - the image always
   shows exactly as designed.
   ------------------------------------------------------------- */
.store-hero-banner {
  height: auto;
  aspect-ratio: 2 / 1;
}

@media (min-width: 601px) {
  .store-hero {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }

  .store-hero-banner { height: auto; }
}

/* -------------------------------------------------------------
   Banner ratios follow the uploaded image exactly (no forced crop): the
   phone banner keeps its own aspect, and when a wide variant exists, big
   screens show it and the hero stretches wider to suit it.
   ------------------------------------------------------------- */
.store-hero-banner {
  aspect-ratio: auto;
  height: auto;
}

.store-hero-banner img {
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 601px) {
  .store-hero.has-wide { max-width: 980px; }
}

/* -------------------------------------------------------------
   Bigger, better-looking product images
   ------------------------------------------------------------- */
.menu-image-container {
  height: 160px;
  /* a soft radial spotlight behind the cup instead of a flat grey slab */
  background: radial-gradient(ellipse at 50% 62%, #ffffff 0%, #f1f3f8 68%, #e9ecf3 100%);
}

.menu-image {
  width: 92%;
  height: 92%;
  filter: drop-shadow(0 8px 14px rgba(29, 35, 51, 0.18));
}

@media (min-width: 601px) {
  .menu-image-container { height: 200px; }
}

@media (max-width: 600px) {
  .menu-image-container { height: 160px; }
}

/* Product photo at the top of the customisation sheet */
.sheet-product-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  margin: -1.5rem -1.5rem 0;
  background: radial-gradient(ellipse at 50% 62%, #ffffff 0%, #f1f3f8 68%, #e9ecf3 100%);
  border-bottom: 1px solid var(--panel-border);
}

.sheet-product-photo img {
  max-width: 82%;
  max-height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(29, 35, 51, 0.2));
}

/* -------------------------------------------------------------
   My Orders list, payment proof, QR download
   ------------------------------------------------------------- */
.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  background: #ffffff;
}

.order-row:hover { border-color: rgba(var(--accent-rgb), 0.5); }

.order-row-main { min-width: 0; }

.order-row-title { font-size: 0.88rem; }

.order-row-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

.order-row-cancel { font-size: 0.72rem; color: var(--danger); margin-top: 0.15rem; }

.order-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.order-row-total { font-weight: 700; font-size: 0.88rem; color: var(--accent-color); }

.my-orders-back {
  padding: 0.4rem 0.8rem;
  min-height: 40px;
  font-size: 0.8rem;
  margin-bottom: 0.9rem;
}

.proof-box {
  margin-top: 1.25rem;
  padding: 0.85rem;
  border: 1px dashed rgba(var(--accent-rgb), 0.4);
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.04);
}

.qr-download-link {
  display: inline-block;
  margin-top: 0.6rem;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
}

/* First-visit tips banner */
.welcome-tips {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(var(--accent-rgb), 0.06);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
  padding: 0.6rem 1rem;
}

.welcome-tips-text {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.welcome-tips-text strong { color: var(--text-primary); }

.welcome-tips-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
}

/* The cart, status and account pages sat flush against the header - only the
   menu page had breathing room (via the store hero). Give every top-level
   card the same gap. */
.cart-wrapper,
.tracking-wrapper {
  margin-top: 1rem;
}

/* -------------------------------------------------------------
   Notion-style storefront cover
   The banner is a full-bleed strip stuck to the top of the page at a fixed
   short height (cropped like a page cover, never shown at its raw ratio),
   with the store card overlapping it. Overrides the exact-ratio banner
   rules above; body { overflow-x: hidden } absorbs the 100vw scrollbar gap.
   ------------------------------------------------------------- */
.store-hero { margin-top: 0; }

.store-hero-banner {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: clamp(160px, 24vw, 260px);
  border-radius: 0;
}

.store-hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-hero-banner + .store-hero-card { margin-top: -40px; }

@media (min-width: 601px) {
  .store-hero,
  .store-hero.has-wide {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Pick-up / Delivery tabs on the store card */
.store-order-tabs {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.store-order-tab {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
}

.store-order-tab.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--on-accent);
}

.store-order-tab.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* -------------------------------------------------------------
   Commerce-style receipt: product-photo item rows and a summary
   block (subtotal / fee / discount / total) under them.
   ------------------------------------------------------------- */
.receipt-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--panel-border);
}

.receipt-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: #eef0f5;
  flex-shrink: 0;
}

.receipt-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.receipt-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.receipt-item-name { font-weight: 600; font-size: 0.85rem; }

.receipt-item-sub { font-size: 0.72rem; color: var(--text-secondary); }

.receipt-item-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  flex-shrink: 0;
}

.receipt-item-price { font-weight: 600; font-size: 0.85rem; }

.receipt-item-qty { font-size: 0.72rem; color: var(--text-muted); }

.receipt-summary { margin-top: 0.75rem; }

.receipt-summary .sum-row {
  border: none;
  font-size: 0.82rem;
  padding: 0.18rem 0;
}

.receipt-summary .sum-row > span:first-child { color: var(--text-secondary); }

.receipt-grand-row {
  border: none;
  border-top: 1px solid var(--panel-border);
  margin-top: 0.5rem;
  padding-top: 0.6rem;
}

.receipt-grand-row .receipt-total { font-size: 1.1rem; }

/* Customer remarks block at the foot of every receipt (customer + admin) */
.receipt-remarks {
  margin-top: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  background: rgba(var(--warning-rgb), 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.receipt-remarks strong {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warning);
}
.receipt-remarks span {
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Promotion pop-up (admin-uploaded 3:2 picture) */
.promo-popup {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.promo-popup.show { opacity: 1; }
.promo-card {
  position: relative;
  /* Always 3:2, never taller than the screen: width is capped by the
     viewport width, a comfortable desktop maximum, and the height. */
  width: min(92vw, 560px, calc((100dvh - 6rem) * 1.5));
  aspect-ratio: 3 / 2;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}
.promo-popup.show .promo-card { transform: scale(1); }
.promo-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.promo-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Per-drink discount rows in the till discount popup */
.disc-lines { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.7rem; }
.disc-line {
  display: grid; grid-template-columns: 1fr 96px; gap: 0.6rem; align-items: center;
  padding: 0.45rem 0.6rem; border: 1px solid var(--panel-border); border-radius: 9px;
}
.disc-line-name { font-size: 0.82rem; min-width: 0; overflow-wrap: anywhere; }
.disc-line-name .hist-zone { display: block; }
.disc-line-input { min-height: 40px; text-align: right; }
.line-discount { font-size: 0.72rem; font-weight: 600; color: var(--warning); }

/* Value-first discount popup */
.disc-entry { display: grid; grid-template-columns: 120px 1fr; gap: 0.6rem; }
.disc-targets { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.2rem; }
.disc-targets .type-pill { text-align: left; }
.disc-split { margin-top: 0.6rem; padding: 0.6rem 0.7rem; border-radius: 10px; background: rgba(var(--accent-rgb), 0.08); }
.disc-split-head { font-size: 0.78rem; font-weight: 700; margin-bottom: 0.4rem; }
.disc-split-modes { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; }
.disc-split-manual { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.disc-split-manual label { font-size: 0.8rem; display: flex; align-items: center; gap: 0.3rem; }
.disc-split-manual input { width: 90px; padding: 0.3rem 0.4rem; border-radius: 8px; border: 1px solid var(--panel-border, #d4dbea); }
.disc-split-check { flex-basis: 100%; font-size: 0.72rem; color: var(--text-muted, #8a93a6); }
.disc-advanced { margin-top: 0.7rem; }
.disc-advanced > summary { cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--accent-color); list-style: revert; }
.disc-advanced[open] > summary { margin-bottom: 0.5rem; }
.disc-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.disc-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.35rem 0.3rem 0.7rem; border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12); color: var(--ink, currentColor);
  font-size: 0.8rem; font-weight: 500;
}
.disc-chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: transparent; color: var(--danger); cursor: pointer;
}
.disc-running {
  margin-top: 0.5rem; font-size: 0.82rem; font-weight: 600;
  color: var(--accent-color);
}

/* -------------------------------------------------------------
   Delivery
   ------------------------------------------------------------- */
.store-order-tab { cursor: pointer; }
.store-order-tab.disabled { cursor: not-allowed; opacity: 0.5; }

.delivery-banner {
  background: rgba(63, 191, 149, 0.1);
  border: 1px solid rgba(63, 191, 149, 0.3);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.delivery-banner-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; }
.delivery-banner-msg { font-size: 0.85rem; color: var(--text-secondary, #5b6579); }
.delivery-driver { font-size: 0.82rem; margin-top: 0.3rem; }
.delivery-track-link {
  display: inline-block; margin-top: 0.5rem; font-weight: 600;
  color: var(--accent-color, #3d6ec9); text-decoration: none;
}
#deliveryMap { border: 1px solid var(--panel-border, #d4dbea); }

/* Delivery address search + autocomplete */
.delivery-search { position: relative; }
.addr-suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1200;
  background: var(--card-bg, #fff); border: 1px solid var(--panel-border, #d4dbea);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); overflow: hidden; max-height: 260px; overflow-y: auto;
}
.addr-suggestion {
  display: flex; flex-direction: column; gap: 0.1rem; width: 100%; text-align: left;
  padding: 0.6rem 0.8rem; background: none; border: none; cursor: pointer; border-bottom: 1px solid var(--panel-border, #eef1f7);
}
.addr-suggestion:last-child { border-bottom: none; }
.addr-suggestion:hover { background: rgba(var(--accent-rgb), 0.08); }
.addr-line { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.addr-main { font-size: 0.85rem; font-weight: 600; }
.addr-dist { font-size: 0.7rem; font-weight: 600; color: var(--accent-color); white-space: nowrap; flex-shrink: 0; }
.addr-sub { font-size: 0.72rem; color: var(--text-muted, #8a93a6); }

/* Delivery scheduler (Step 3) */
#deliverySchedulerBox { margin-top: 1rem; }
.sched-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.5rem; }
.sched-modes { display: flex; gap: 0.5rem; }
.sched-mode {
  flex: 1; display: flex; flex-direction: column; gap: 0.15rem; text-align: left;
  padding: 0.6rem 0.7rem; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--panel-border, #d4dbea); background: var(--card-bg, #fff);
}
.sched-mode strong { font-size: 0.82rem; }
.sched-mode span { font-size: 0.7rem; color: var(--text-muted, #8a93a6); }
.sched-mode.selected { border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15); }
.sched-mode:disabled { opacity: 0.5; cursor: not-allowed; }
.sched-slots { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.sched-slot {
  padding: 0.4rem 0.7rem; border-radius: 999px; cursor: pointer; font-size: 0.8rem;
  border: 1.5px solid var(--panel-border, #d4dbea); background: var(--card-bg, #fff);
}
.sched-slot.selected { background: var(--accent-color); border-color: var(--accent-color); color: #fff; }
.sched-empty { font-size: 0.78rem; color: var(--text-muted, #8a93a6); }

/* Delivery tracking timeline (status page) */
.delivery-banner-when { font-size: 0.8rem; font-weight: 600; color: var(--accent-color); margin-bottom: 0.3rem; }
.delivery-timeline { margin-top: 0.9rem; }
.dtl-step { display: flex; gap: 0.7rem; position: relative; padding-bottom: 1rem; }
.dtl-step:not(:last-child) .dtl-marker::after {
  content: ''; position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  width: 2px; height: calc(100% + 0.2rem); background: var(--panel-border, #d4dbea);
}
.dtl-marker {
  position: relative; width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  border: 2px solid var(--panel-border, #cbd3e2); background: var(--card-bg, #fff);
}
.dtl-done .dtl-marker { background: var(--accent-color); border-color: var(--accent-color); }
.dtl-done .dtl-marker::after { background: var(--accent-color); }
.dtl-active .dtl-marker { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); }
.dtl-name { font-size: 0.82rem; font-weight: 600; }
.dtl-pending .dtl-name { color: var(--text-muted, #8a93a6); font-weight: 500; }
.dtl-time { font-size: 0.72rem; color: var(--text-muted, #8a93a6); }
