/* Stall orders — extends festival look with desk/menu utilities */
.stall-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
  position: relative;
  z-index: 1;
}

.stall-wrap.wide {
  max-width: 980px;
}

.stall-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
  margin-bottom: 14px;
}

.stall-panel h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.stall-muted {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 12px;
}

.stall-error {
  background: rgba(226, 59, 47, 0.12);
  color: #8a1c14;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 0.9rem;
}

.stall-ok {
  background: rgba(158, 196, 26, 0.18);
  color: #3d5208;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 0.9rem;
}

.stall-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.stall-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.stall-field input,
.stall-field select,
.stall-field textarea {
  font: inherit;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(76, 16, 22, 0.16);
  background: #fff;
  color: var(--ink);
  width: 100%;
}

.stall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.stall-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--lime);
  color: var(--maroon-ink);
}

.stall-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stall-btn.secondary {
  background: rgba(76, 16, 22, 0.08);
  color: var(--maroon);
}

.stall-btn.danger {
  background: rgba(226, 59, 47, 0.16);
  color: #8a1c14;
}

.stall-btn.saffron {
  background: var(--saffron);
  color: #1c0408;
}

.stall-btn.ghost {
  background: transparent;
  border: 1px solid rgba(76, 16, 22, 0.2);
  color: var(--maroon);
}

.product-list,
.order-list {
  display: grid;
  gap: 10px;
}

.product-row {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 246, 232, 0.7);
  border: 1px solid rgba(76, 16, 22, 0.08);
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .product-row {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.product-row .meta,
.order-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
}

.product-row .name,
.order-card .name {
  font-weight: 700;
}

.product-row .price {
  font-weight: 700;
  color: var(--maroon-mid);
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty-controls button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--maroon);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.qty-controls span {
  min-width: 1.5ch;
  text-align: center;
  font-weight: 700;
}

.cart-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  max-width: 560px;
  margin: 0 auto;
  background: var(--maroon);
  color: #fff;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(28, 4, 8, 0.35);
  /* Keep above iOS browser chrome / scroll bounce */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.cart-bar[hidden] {
  display: none !important;
}

.cart-bar button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  background: var(--lime);
  color: var(--maroon-ink);
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}

/* Space so last products are not hidden under the fixed bar */
body.stall-phone.has-cart-bar .stall-wrap {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(76, 16, 22, 0.1);
  color: var(--maroon);
}

.status-badge.at_cashier,
.status-badge.awaiting_payment { background: rgba(240, 140, 43, 0.22); color: #8a3d00; }
.status-badge.paid { background: rgba(158, 196, 26, 0.25); color: #3d5208; }
.status-badge.ready { background: rgba(200, 238, 58, 0.55); color: #1c0408; }
.status-badge.browsing { background: rgba(76, 16, 22, 0.08); }
.status-badge.completed,
.status-badge.cancelled { opacity: 0.7; }

.order-code {
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 2.8rem);
  letter-spacing: 0.06em;
  color: var(--maroon);
  margin: 4px 0 8px;
}

.pickup-otp-box {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(240, 140, 43, 0.16);
  border: 1px solid rgba(213, 106, 18, 0.35);
  text-align: center;
}

.pickup-otp-box.desk {
  background: rgba(200, 238, 58, 0.28);
  border-color: rgba(158, 196, 26, 0.5);
}

.pickup-otp-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pickup-otp-value {
  margin: 6px 0 4px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 10vw, 3rem);
  letter-spacing: 0.28em;
  color: var(--maroon-ink);
}

.desk-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 800px) {
  .desk-grid.split {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

.qr-box {
  display: grid;
  place-items: center;
  padding: 12px;
  background: #fff;
  border-radius: 16px;
}

.qr-box canvas,
.qr-box img {
  max-width: 100%;
}

.table-like {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table-like th,
.table-like td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(76, 16, 22, 0.1);
  vertical-align: top;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero.hero-compact .lede {
  max-width: 36ch;
}

.pay-choice {
  display: grid;
  gap: 10px;
}

.pay-choice label {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(76, 16, 22, 0.14);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.pay-choice input {
  width: 18px;
  height: 18px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 24px 12px;
}

/* Manage + shared phone-first chrome */
.manage-body,
.admin-body {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  background: var(--maroon-deep);
}

.manage-body .hero-desk .lede,
.admin-body .hero-desk .lede {
  display: none;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-row {
  grid-template-columns: 1fr;
  gap: 10px;
}

.product-row .stall-actions {
  justify-content: stretch;
}

.product-row .stall-actions .stall-btn {
  flex: 1;
}

@media (min-width: 560px) {
  .product-row {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .product-row .stall-actions {
    flex-wrap: nowrap;
  }
}

@media (max-width: 559px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* Desk — phone-first */
.desk-body {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  background: var(--maroon-deep);
}

.desk-body .hero-desk {
  padding-top: 14px;
  padding-bottom: 8px;
}

.desk-body .hero-desk .lede {
  display: none;
}

.desk-body .logo-badge-sm {
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
}

.desk-body .hero-desk h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 6vw, 1.9rem);
}

.desk-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 12px 28px;
}

.desk-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.desk-panel-head h2 {
  margin: 0;
}

.desk-panel-head .stall-muted {
  margin: 0;
  font-size: 0.8rem;
}

.desk-back {
  flex: 0 0 auto !important;
  padding: 8px 12px !important;
  min-height: 36px !important;
  font-size: 0.85rem;
}

.desk-empty {
  text-align: center;
  padding: 28px 12px 18px;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.desk-empty p {
  margin: 0;
  color: var(--muted);
}

.desk-empty .stall-btn {
  width: 100%;
  max-width: 280px;
}

.desk-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 800px) {
  .desk-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }

  .desk-main {
    max-width: 980px;
  }
}

/* Desk tabs + mobile-first */
.hero-desk .lede {
  max-width: 34ch;
}

.desk-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 6;
  background: rgba(42, 7, 12, 0.94);
  backdrop-filter: blur(8px);
  padding: 8px 0;
  border-radius: 0;
}

.desk-tab {
  appearance: none;
  border: 1px solid rgba(255, 246, 232, 0.2);
  background: transparent;
  color: #fff6e8;
  font: inherit;
  font-weight: 700;
  padding: 12px 8px;
  border-radius: 999px;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.desk-tab.is-on {
  background: var(--lime);
  color: var(--maroon-ink);
  border-color: transparent;
}

.order-card {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 246, 232, 0.7);
  border: 1px solid rgba(76, 16, 22, 0.08);
}

.order-card.is-selected {
  outline: 2px solid var(--saffron);
}

.order-card-actions {
  margin-top: 4px;
}

.order-card-actions .stall-btn {
  width: 100%;
}

.order-code-sm {
  font-size: 1.35rem !important;
  margin: 0 !important;
}

.focus-item-list {
  padding-left: 18px;
  margin: 8px 0;
}

@media (max-width: 799px) {
  .hero.hero-compact {
    padding-top: 18px;
    padding-bottom: 10px;
  }

  .hero.hero-compact h1 {
    font-size: clamp(1.45rem, 7vw, 1.85rem);
  }

  .logo-badge-sm {
    width: 56px;
    height: 56px;
  }

  .stall-wrap {
    padding: 0 12px 28px;
  }

  .stall-panel {
    padding: 14px 14px 16px;
    border-radius: 18px;
  }

  .stall-btn {
    min-height: 44px;
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }

  .stall-actions {
    gap: 8px;
  }

  .qty-controls button {
    width: 42px;
    height: 42px;
  }

  .pickup-otp-value {
    letter-spacing: 0.2em;
  }

  .desk-grid.split {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 800px) {
  .desk-tabs {
    max-width: 420px;
  }

  .admin-tabs {
    max-width: 360px;
  }
}

.report-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 700px) {
  .report-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.report-kpi {
  background: rgba(255, 246, 232, 0.85);
  border: 1px solid rgba(76, 16, 22, 0.1);
  border-radius: 16px;
  padding: 12px 14px;
}

.report-kpi .label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.report-kpi .value {
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--maroon);
}

.report-kpi .sub {
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.report-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.report-table {
  min-width: 480px;
}


body.stall-phone,
body.desk-body {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* Avoid cultural bottom-nav gap on stall pages */
body:has(.stall-wrap) {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

