:root {
  --primary: #ff6b00;
  --primary-light: rgba(255, 107, 0, 0.1);
  --bg: #fff3e8;
  --card: #ffffff;
  --text: #333333;
  --muted: #666666;
  --border: #e8d5c4;
  --danger: #e53935;
  --success: #2e7d32;
  --shadow: 0 4px 20px rgba(255, 107, 0, 0.12);
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --mobile-gutter: 10px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  height: 100%;
  overflow-x: hidden;
}

#app {
  min-height: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.order-panel {
  min-width: 0;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

#app.booting:not(.ready) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--muted);
}

#app.ready {
  display: block;
}

/* ── Layout ── */
.app-shell {
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-bottom));
  max-width: 100vw;
  overflow-x: hidden;
}

.app-header {
  background: linear-gradient(135deg, #ff6b00 0%, #ff8c33 100%);
  color: #fff;
  padding: 16px 20px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px rgba(255, 107, 0, 0.3);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.device-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

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

.admin-link {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}

.admin-link:active {
  background: rgba(255, 255, 255, 0.15);
}

.version-badge {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.75);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-variant-numeric: tabular-nums;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.nav-tab {
  flex: 1;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-tab.active {
  background: #fff;
  color: var(--primary);
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 10px;
}

.session-hint {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.3;
  flex: 1;
}

.session-live {
  font-size: 0.85rem;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.session-btn.start {
  background: #fff;
  color: var(--primary);
}

.session-btn.end {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.session-btn:disabled {
  opacity: 0.55;
}

.main-grid {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* iPad / 横屏收银台 */
@media (min-width: 768px) {
  .app-shell.tablet-mode {
    padding-bottom: 24px;
  }

  .app-shell.tablet-mode .main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    align-items: start;
    gap: 20px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 20px 24px;
  }

  .app-shell.tablet-mode .side-panel {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell.tablet-mode .preview-card .pickup-number {
    font-size: 3.2rem;
  }

  .app-shell.tablet-mode .cashier-rail {
    position: static;
    margin: 0 0 12px;
    padding: 0;
    box-shadow: none;
  }

  .app-shell.tablet-mode .quick-controls {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
  }

  .app-shell.tablet-mode .dine-block {
    flex: 0 0 168px;
  }

  .app-shell.tablet-mode .spice-block {
    flex: 1;
  }

  .mobile-only-bar {
    display: none !important;
  }
}

@media (min-width: 1100px) {
  .app-shell.tablet-mode .main-grid {
    grid-template-columns: minmax(0, 1fr) 440px;
    max-width: 1400px;
    gap: 24px;
  }

  .app-shell.tablet-mode .preview-card .pickup-number {
    font-size: 3.6rem;
  }
}

@media (max-width: 767px) {
  .side-panel.desktop-inline {
    display: none;
  }

  body {
    background: #f3f4f6;
    font-size: 17px;
  }

  .app-shell {
    padding-bottom: calc(92px + var(--safe-bottom));
  }

  .app-header {
    padding: 10px max(var(--mobile-gutter), var(--safe-right)) 12px max(var(--mobile-gutter), var(--safe-left));
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  }

  .brand {
    font-size: 1.2rem;
  }

  .device-badge {
    display: none;
  }

  .nav-tabs {
    margin-top: 10px;
    gap: 8px;
  }

  .nav-tab {
    padding: 12px 8px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .mode-banner {
    padding: 10px max(var(--mobile-gutter), var(--safe-right)) 10px max(var(--mobile-gutter), var(--safe-left));
    font-size: 0.95rem;
  }

  .main-grid.cashier-page {
    padding: 0;
    gap: 0;
  }

  .main-grid.stats-page {
    padding: 8px;
    gap: 10px;
  }

  .cashier-sheet {
    background: #fff;
    border-bottom: 1px solid #ececec;
    padding-top: 10px;
    padding-left: max(var(--mobile-gutter), var(--safe-left));
    padding-right: max(var(--mobile-gutter), var(--safe-right));
  }

  .cashier-rail {
    position: sticky;
    top: 0;
    z-index: 18;
    margin: 0;
    padding: 8px 0 4px;
    background: #fff;
    overflow: visible;
    border-bottom: 1px solid #f0f0f0;
  }

  .bowl-editor {
    padding: 4px 0 12px;
    background: #fff;
    overflow: visible;
  }

  .bowl-editor > .bowl-option-block.dine-block {
    margin-bottom: 6px;
  }

  .bowl-editor .base-row {
    margin-bottom: 10px;
  }

  .bowl-editor .base-compact {
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .base-noodle-chips {
    grid-template-columns: repeat(2, 38px);
    gap: 3px;
  }

  .base-noodle-chips .quick-chip.noodle {
    font-size: 0.68rem;
  }

  .base-compact-text {
    font-size: 1rem;
  }

  .addon-section-head {
    margin-bottom: 2px;
    padding: 0;
  }

  .addon-section-head .addon-title.compact-title {
    margin: 6px 0 0;
  }

  .addon-mode-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .addon-mode-icon {
    font-size: 1.15rem;
  }

  .compact-title,
  .section-title.compact-title {
    margin: 6px 0 8px;
    font-size: 1rem;
  }

  .title-hint {
    font-size: 0.8rem;
  }

  .compact-title::before,
  .section-title.compact-title::before {
    display: none;
  }

  .mobile-addon-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding-top: 0;
  }

  .mobile-addon-grid .chip {
    min-height: 44px;
    padding: 8px 4px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 10px;
    line-height: 1.2;
    overflow: visible;
  }

  .mobile-addon-grid .chip em {
    font-size: 0.72rem;
  }

  .addon-pick .chip-badge {
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    font-size: 0.72rem;
    line-height: 16px;
  }

  .quick-controls {
    gap: 8px;
  }

  .quick-block {
    gap: 6px;
  }

  .quick-chip {
    min-height: 44px;
    padding: 8px 4px;
    font-size: 0.88rem;
    border-radius: 10px;
  }

  .spice-block {
    gap: 6px;
  }

  .diet-block .quick-chip {
    flex: 1 1 0;
    min-width: 0;
    min-height: 34px;
    padding: 4px 2px;
    font-size: 0.72rem;
    border-radius: 8px;
  }

  .diet-block .bowl-option-chips {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .dine-block {
    gap: 6px;
  }

  .bowl-strip-row {
    gap: 4px;
    padding: 0;
  }

  .bowl-tab {
    min-width: 50px;
    min-height: 50px;
    padding: 8px 10px 10px;
    font-size: 1.1rem;
    border-radius: 10px;
  }

  .bowl-tab-badge {
    min-width: 32px;
    height: 24px;
    font-size: 0.68rem;
    line-height: 20px;
    top: -10px;
    right: -6px;
  }

  .bowl-tab.minus,
  .bowl-tab.add {
    min-width: 52px;
    padding: 10px 10px;
    font-size: 0.92rem;
  }

  .mobile-pickup-pill {
    display: none;
  }

  .mobile-checkout {
    gap: 8px;
    padding: 8px max(var(--mobile-gutter), var(--safe-right)) calc(8px + var(--safe-bottom)) max(var(--mobile-gutter), var(--safe-left));
    border-top: 1px solid #ececec;
    box-shadow: none;
  }

  .mc-left {
    padding: 0;
  }

  .mc-pickup {
    font-size: 1.35rem;
  }

  .mc-btn {
    min-width: 120px;
    min-height: 56px;
    border-radius: 12px;
  }

  .mc-btn-price {
    font-size: 1.4rem;
  }

  .mc-pay-btn {
    min-height: 26px;
    font-size: 0.78rem;
  }

  .card {
    padding: 12px 10px;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  }
}

/* 平板：分区卡片 */
@media (min-width: 768px) {
  .cashier-sheet {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
  }

  .bowl-editor {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
  }
}

/* ── 基础套餐（紧凑可关） ── */
.base-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
  margin-bottom: 10px;
}

.base-row .base-compact {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.base-noodle-chips {
  display: grid;
  grid-template-columns: repeat(2, 40px);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  flex-shrink: 0;
}

.base-noodle-chips .quick-chip.noodle {
  min-height: 0;
  height: 100%;
  min-width: 0;
  padding: 2px;
  font-size: 0.72rem;
  border-radius: 8px;
  line-height: 1.1;
}

.base-noodle-chips .quick-chip.noodle:disabled {
  opacity: 0.4;
}

.quick-chip.noodle.on {
  background: #e8f5e9;
  border-color: #43a047;
  color: #2e7d32;
}

.base-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #f5f5f5;
  color: var(--muted);
  text-align: left;
}

.base-compact.on {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--text);
}

.base-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  background: #fff;
}

.base-compact.on .base-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.base-compact-text {
  font-size: 0.9rem;
  font-weight: 700;
  flex: 1;
}

.base-compact-hint {
  font-size: 0.7rem;
  color: var(--muted);
}

.title-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

.chip-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 3;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 12px;
  border: 2px solid #fff;
  background: #e53935;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  font-variant-numeric: tabular-nums;
}

.chip.addon-pick.on {
  background: #fff5f5;
  border-color: var(--danger);
  color: var(--danger);
}

.chip.addon-pick.on em {
  color: rgba(229, 57, 53, 0.88);
}

.addon-pick-grid .chip {
  min-height: 44px;
  padding: 8px 6px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 10px;
  line-height: 1.2;
}

.addon-pick-grid .chip em {
  font-size: 0.72rem;
}

.addon-pick .chip-badge,
.addon-pick.on .chip-badge,
.addon-pick-grid.subtract-mode .chip.subtractable .chip-badge {
  background: #e53935;
  color: #fff;
  border-color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.addon-pick {
  position: relative;
}

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

.addon-section-head .addon-title.compact-title {
  margin-bottom: 0;
}

.addon-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.addon-mode-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.addon-mode-icon {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.addon-mode-btn.on {
  border-color: var(--danger);
  background: #ffebee;
  color: var(--danger);
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.15);
}

.addon-pick-grid.subtract-mode .chip.subtractable {
  border-color: var(--danger);
  background: #fff5f5;
  color: var(--danger);
}

.addon-pick-grid.subtract-mode .chip.subtractable.on em {
  color: rgba(229, 57, 53, 0.85);
}

.addon-pick-grid.subtract-mode .chip.dim {
  opacity: 0.38;
}

.selected-addons {
  margin-top: 14px;
  padding: 12px;
  background: #faf8f5;
  border-radius: 12px;
  border: 1px dashed var(--border);
}

.selected-title {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.sel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.sel-row:last-child {
  border-bottom: none;
}

.sel-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.sel-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 2px;
}

.sel-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.sel-qty {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
}

.sel-sub {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

/* legacy base-hero hidden */
.base-hero {
  display: none;
}

/* ── 碗切换 + 快捷操作条（摆摊一手操作） ── */
.cashier-rail {
  position: sticky;
  top: 0;
  z-index: 18;
  margin: -6px -6px 8px;
  padding: 6px 6px 8px;
  background: linear-gradient(180deg, var(--bg) 85%, rgba(255, 243, 232, 0));
  max-width: 100%;
  overflow: hidden;
}

@media (min-width: 768px) {
  .app-shell.tablet-mode .cashier-rail {
    position: static;
    margin: 0;
    padding: 0;
    background: transparent;
  }
}

.bowl-strip-wrap {
  margin-bottom: 6px;
  min-width: 0;
}

.bowl-strip-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.bowl-strip {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.bowl-strip::-webkit-scrollbar {
  display: none;
}

.bowl-tab {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  padding: 8px 12px 10px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 800;
  overflow: visible;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.bowl-tab.active {
  font-weight: 900;
}

.bowl-tab.active::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  height: 3px;
  border-radius: 2px;
  background: var(--spice-dot, var(--primary));
  pointer-events: none;
}

.bowl-tab-num {
  line-height: 1;
}

.bowl-tab-badge {
  position: absolute;
  top: -9px;
  right: -8px;
  z-index: 2;
  min-width: 30px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  border: 2px solid #fff;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #333;
  background: #fff;
  box-shadow: 0 0 0 1px var(--spice-dot, #d0d0d0);
}

.bowl-tab-badge.takeaway {
  color: #fff;
  background: #5d4037;
  box-shadow: 0 1px 4px rgba(93, 64, 55, 0.35);
}

.bowl-tab.add {
  color: var(--primary);
  border-style: dashed;
  font-size: 0.9rem;
  font-weight: 700;
}

.bowl-option-block {
  margin-bottom: 10px;
}

.bowl-option-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.bowl-option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bowl-option-chips .quick-chip {
  flex: 1 1 calc(25% - 6px);
  min-width: 64px;
}

.dine-block .bowl-option-chips .quick-chip {
  flex: 1 1 calc(50% - 6px);
}

.bowl-option-block.dine-block .quick-chip.dine {
  background: #fff8f0;
  border-color: #ffcc80;
  color: #e65100;
}

.bowl-option-block.dine-block .quick-chip.dine.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.bowl-option-block.dine-block .quick-chip.pack {
  background: #f5f0ee;
  border-color: #bcaaa4;
  color: #5d4037;
}

.bowl-option-block.dine-block .quick-chip.pack.on {
  background: #5d4037;
  border-color: #5d4037;
  color: #fff;
}

.bowl-actions {
  display: flex;
  flex: 0 0 auto;
  flex-shrink: 0;
  gap: 6px;
}

.bowl-tab.minus {
  min-width: 56px;
  color: var(--danger);
  border-color: #ef9a9a;
  background: #fff5f5;
  font-size: 0.88rem;
  font-weight: 800;
}

.bowl-tab.minus:disabled,
.bowl-tab.add:disabled {
  opacity: 0.35;
  color: var(--muted);
  border-color: var(--border);
  background: #f5f5f5;
  cursor: not-allowed;
}

.bowl-tab.minus:not(:disabled):active {
  background: #ffcdd2;
  border-color: var(--danger);
}

@media (max-width: 767px) {
  .bowl-strip-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
  }

  .bowl-strip {
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: wrap;
    overflow: visible;
    padding: 6px 0 0;
    gap: 8px;
  }

  .bowl-actions {
    flex: 0 0 auto;
    align-self: flex-start;
  }
}

.remove-bowl {
  display: none;
}

.quick-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.quick-block {
  display: flex;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.dine-block .quick-chip {
  flex: 1;
}

.quick-controls .spice-block {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.bowl-option-block .bowl-option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bowl-option-block.spice-block .bowl-option-chips .quick-chip {
  flex: 1 1 calc(25% - 6px);
  min-width: 64px;
}

.quick-chip {
  min-height: 44px;
  padding: 8px 6px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.quick-chip em {
  font-style: normal;
  font-size: 0.72rem;
  margin-left: 2px;
  color: var(--primary);
}

.quick-chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.quick-chip.pack.on {
  background: #5d4037;
  border-color: #5d4037;
}

.quick-chip.pack.on em {
  color: rgba(255, 255, 255, 0.9);
}

.quick-chip.spice {
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.quick-chip.spice.on {
  transform: translateY(-1px);
}

.quick-chip.diet {
  font-size: 0.8rem;
  border-color: #ddd;
  color: #888;
}

.quick-chip.diet.on {
  background: #fce4ec;
  border-color: #e57373;
  color: #c62828;
  font-weight: 800;
}

.diet-block .bowl-option-chips {
  flex-wrap: nowrap;
  gap: 4px;
}

.diet-block .quick-chip {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  padding: 4px 2px;
  font-size: 0.75rem;
  border-radius: 8px;
}

.mobile-pickup-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: var(--shadow);
}

.mpp-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.mpp-no {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.mpp-meta {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

@media (min-width: 768px) {
  .mobile-pickup-pill {
    display: none;
  }
}

/* ── 大芯片（替代数字步进） ── */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  min-height: 48px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.chip em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--primary);
  margin-left: 4px;
  font-weight: 700;
}

.chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip.on em {
  color: rgba(255, 255, 255, 0.9);
}

.chip.note.on {
  background: var(--danger);
  border-color: var(--danger);
}

.chip.pack.on {
  background: #5d4037;
  border-color: #5d4037;
  color: #fff;
}

.chip.spice.on {
  background: #fff3e6;
  border-color: var(--primary);
  color: var(--primary);
}

.dine-grid,
.spice-grid {
  grid-template-columns: repeat(2, 1fr);
}

.pack-simple .chip em {
  font-style: normal;
  font-size: 11px;
  opacity: 0.85;
  margin-left: 4px;
}

.chip.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.bowl-note-input {
  width: 100%;
  height: 48px;
  margin-top: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 0.95rem;
}

.pack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pack-quick {
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.bowl-count {
  font-size: 0.7rem;
  background: #eee;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 600;
}

/* ── 手机底栏 ── */
.mobile-checkout {
  display: flex;
  align-items: stretch;
  gap: 8px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  padding: 8px max(var(--mobile-gutter), var(--safe-right)) calc(8px + var(--safe-bottom)) max(var(--mobile-gutter), var(--safe-left));
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  z-index: 30;
}

.mc-left {
  flex: 0 0 auto;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
}

.mc-pickup {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: 0.03em;
}

.mc-bowls {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
}

.mc-pay {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 52px;
}

.mc-pay-btn {
  flex: 1;
  min-height: 22px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0 4px;
}

.mc-pay-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.mc-btn {
  flex: 1;
  flex-shrink: 0;
  min-width: 120px;
  min-height: 58px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-radius: 14px;
  font-size: 1.05rem;
}

.mc-btn-price {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.mc-btn-label {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  opacity: 1;
}

.mc-info {
  flex: 1;
  min-width: 0;
}

.mc-total {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
}

@media (min-width: 768px) {
  .mobile-checkout {
    display: none;
  }

  .app-shell.tablet-mode {
    padding-bottom: 24px;
  }
}

.bowl-detail-list {
  text-align: left;
  margin: 12px 0 16px;
  padding: 12px;
  background: #fafafa;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.8;
}

.bowl-detail-item.pack-line {
  color: #5d4037;
  font-weight: 700;
}

.text-left {
  text-align: left;
}

.preview-card .submit-btn {
  margin-top: 8px;
}

/* hide legacy mobile bar */
.mobile-only-bar {
  display: none !important;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

/* ── Menu options ── */
.dish-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dish-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 1.05rem;
  text-align: left;
  transition: all 0.15s ease;
}

.dish-btn:active {
  transform: scale(0.98);
}

.dish-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dish-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  min-height: 48px;
  padding: 12px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.tag:active {
  transform: scale(0.97);
}

.tag.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tag.note.selected {
  background: var(--danger);
  border-color: var(--danger);
}

.custom-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0f0f0;
}

.custom-note input {
  flex: 1;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.95rem;
}

/* ── Side panel: label preview ── */
.pickup-hero {
  text-align: center;
  padding: 8px 0 16px;
}

.pickup-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.pickup-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: 0.05em;
}

.label-preview {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #fafafa;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  min-height: 180px;
}

.label-preview .lp-pickup {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.label-preview .lp-note {
  color: var(--danger);
  font-weight: 700;
}

.label-preview.empty {
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pay-methods {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

.pay-btn {
  flex: 1;
  min-height: 48px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

.pay-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.total-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.total-amount {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
}

.submit-btn {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.4);
}

.submit-btn-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  min-height: 58px;
}

.submit-btn-text {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.submit-btn-amount {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.submit-btn:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.submit-btn:not(:disabled):active {
  transform: scale(0.98);
}

/* Mobile fixed bottom */
.mobile-only-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 30;
}

.mobile-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-total {
  flex-shrink: 0;
}

.mobile-total .amt {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.mobile-total .sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.mobile-only-bar .submit-btn {
  flex: 1;
  min-height: 52px;
}

/* ── Orders / stats view ── */
.stats-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: none;
  width: 100%;
  padding: 8px 12px 16px;
}

.stats-summary-card {
  padding: 0;
  overflow: hidden;
}

.stats-session-head {
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #fff3e8 0%, #fff 100%);
  border-bottom: 1px solid #f0ebe6;
}

.stats-session-head--day {
  background: linear-gradient(135deg, #f5f7fa 0%, #fff 100%);
}

.stats-session-title {
  font-size: 1rem;
  font-weight: 800;
  color: #222;
  margin-bottom: 6px;
}

.stats-session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.8rem;
  color: #666;
}

.stats-elapsed {
  color: var(--primary);
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #ececec;
}

.stat-cell {
  text-align: center;
  padding: 16px 6px 14px;
  background: #fff;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-cell.highlight {
  background: #fffaf5;
}

.stat-cell .stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-cell.highlight .stat-val {
  font-size: 1.5rem;
}

.stat-cell .stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.stats-footnote {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.72rem;
  color: #999;
  text-align: center;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

.stats-orders-card {
  padding-top: 12px;
}

.stats-orders-title {
  margin: 0 0 8px;
  padding: 0 4px;
  font-size: 0.95rem;
}

.stats-back-top {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
  line-height: 34px;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.stats-back-top:active {
  transform: scale(0.92);
  background: rgba(0, 0, 0, 0.42);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-box {
  text-align: center;
  padding: 14px 8px;
  background: var(--primary-light);
  border-radius: 12px;
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-val.green {
  color: var(--success);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.order-item:last-child {
  border-bottom: none;
}

.order-pickup {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

.order-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.order-right {
  text-align: right;
}

.order-price {
  font-weight: 700;
  font-size: 1.05rem;
}

.empty-hint {
  text-align: center;
  color: #aaa;
  padding: 32px 16px;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 20px 28px;
  border-radius: 14px;
  font-size: 1rem;
  z-index: 100;
  text-align: center;
  max-width: 85vw;
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

.demo-banner {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #795548;
  padding: 10px 16px;
  font-size: 0.8rem;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.modal h2 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 2rem;
}

.modal p {
  color: var(--muted);
  margin: 0 0 20px;
}

.modal .ok-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.modal .ok-btn.secondary {
  background: #f5f5f5;
  color: var(--text);
  margin-top: 10px;
}

.modal-wide {
  max-width: 420px;
  text-align: left;
}

.mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff3e0;
  border-bottom: 2px solid var(--primary);
  padding: 12px 16px;
  font-weight: 600;
  color: #e65100;
}

.mode-cancel {
  border: none;
  background: #fff;
  color: var(--primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.field-hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.dish-btn.disabled {
  opacity: 0.85;
}

.order-item.clickable {
  cursor: pointer;
}

.order-item.clickable:active {
  background: var(--primary-light);
}

.order-item.refunded {
  opacity: 0.55;
}

.order-item.refunded .order-price {
  text-decoration: line-through;
}

.status-chip {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 600;
  background: #eee;
  color: #666;
}

.status-chip.pending {
  background: #fff3e0;
  color: #e65100;
}

.status-chip.cooking {
  background: #e3f2fd;
  color: #1565c0;
}

.status-chip.completed {
  background: #e8f5e9;
  color: var(--success);
}

.status-chip.refunded {
  background: #ffebee;
  color: var(--danger);
}

.addon-chip {
  font-size: 0.65rem;
  background: var(--primary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.note-line {
  color: var(--danger) !important;
}

.refund-summary {
  text-align: center;
  font-size: 0.85rem;
  color: var(--danger);
  margin-bottom: 12px;
}

.detail-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.detail-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: left;
}

.detail-addons,
.detail-note {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.detail-note {
  color: var(--danger);
  font-weight: 600;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.action-btn {
  min-height: 48px;
  border-radius: 10px;
  border: 2px solid var(--primary);
  background: #fff;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
}

.action-btn.primary {
  background: var(--primary);
  color: #fff;
}

.action-btn.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.detail-refund {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 12px 0;
}

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

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  min-height: 56px;
}

.qty-row.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.pack-card {
  background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
}

.qty-info {
  flex: 1;
  min-width: 0;
}

.qty-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

.qty-price {
  font-size: 0.8rem;
  color: var(--muted);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.step-btn {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.step-btn:disabled {
  opacity: 0.35;
}

.qty-num {
  min-width: 36px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
}

.refund-reason-block {
  margin-bottom: 12px;
  text-align: left;
}

.refund-reason-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.refund-reason-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.refund-reason-chip {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  padding: 8px 10px;
}

.refund-reason-chip.active {
  border-color: var(--danger, #c0392b);
  background: #fff5f4;
  color: var(--danger, #c0392b);
}

.refund-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  box-sizing: border-box;
}

/* ── 后台管理 admin.html ── */
.admin-shell {
  min-height: 100vh;
  background: var(--bg);
  padding: 12px max(var(--mobile-gutter), var(--safe-right)) calc(80px + var(--safe-bottom)) max(var(--mobile-gutter), var(--safe-left));
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-header h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text);
}

.admin-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-back {
  flex-shrink: 0;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 0;
}

.admin-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.admin-gate {
  max-width: 360px;
  margin: 40px auto 0;
}

.admin-gate h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.admin-gate .hint {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-section-title {
  margin: 0 0 12px;
  font-size: 1rem;
}

.admin-section-title em {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

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

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

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-input {
  width: 100%;
  min-height: 42px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 0.95rem;
  box-sizing: border-box;
  background: #fff;
}

.admin-input.compact {
  min-height: 38px;
  font-size: 0.88rem;
}

.admin-input.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 8px 0 0;
}

.admin-btn {
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 14px;
}

.admin-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-btn.ghost {
  background: #fafafa;
}

.admin-btn.danger {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-refund-modal {
  width: min(420px, 100%);
  margin: 0;
}

.admin-refund-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.admin-btn:disabled {
  opacity: 0.45;
}

.admin-addon-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-addon-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.admin-addon-row.off {
  opacity: 0.55;
  background: #fafafa;
}

.admin-addon-main {
  display: grid;
  grid-template-columns: 1fr 72px 72px;
  gap: 6px;
}

.admin-addon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-icon-btn {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.admin-icon-btn.danger {
  color: var(--danger);
  border-color: #ffcdd2;
}

.admin-icon-btn:disabled {
  opacity: 0.35;
}

.admin-add-row {
  display: grid;
  grid-template-columns: 1fr 72px 72px auto;
  gap: 6px;
  align-items: center;
}

.admin-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px max(var(--mobile-gutter), var(--safe-right)) calc(10px + var(--safe-bottom)) max(var(--mobile-gutter), var(--safe-left));
  background: #fff;
  border-top: 1px solid #ececec;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.admin-footer .admin-btn {
  flex: 1;
}

.admin-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  pointer-events: none;
}

.admin-errors {
  border: 1px solid #ffcdd2;
  background: #fff5f5;
  color: var(--danger);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .admin-addon-main,
  .admin-add-row {
    grid-template-columns: 1fr 64px 64px;
  }

  .admin-add-row {
    grid-template-columns: 1fr 1fr;
  }

  .admin-add-row .admin-btn {
    grid-column: 1 / -1;
  }
}

.boot-error-banner {
  margin: 8px 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff3e0;
  color: #e65100;
  font-size: 14px;
  text-align: center;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
}

.admin-tabs button {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: #f0f0f0;
  font-size: 14px;
  font-weight: 600;
}

.admin-tabs button.on {
  background: #ff6b00;
  color: #fff;
}

.admin-stall-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-stall-chip {
  text-align: left;
  padding: 12px 14px;
  border: 2px solid #eee;
  border-radius: 12px;
  background: #fff;
}

.admin-stall-chip.on {
  border-color: #ff6b00;
  background: #fff8f3;
}

.admin-stall-chip.off {
  opacity: 0.65;
}

.admin-stall-chip strong {
  display: block;
  font-size: 16px;
}

.admin-stall-chip small {
  color: #888;
  font-size: 12px;
}

.admin-subtitle {
  font-size: 15px;
  margin: 16px 0 8px;
  font-weight: 700;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.admin-toolbar .danger-text {
  color: #e53935;
}

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

.admin-order-row {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  background: #fafafa;
}

.admin-order-row.refunded {
  opacity: 0.55;
}

.admin-order-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-order-note {
  margin: 6px 0 8px;
  font-size: 13px;
  color: #555;
}

.admin-order-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eee;
}

.admin-order-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.admin-stat-card {
  background: #fff8f3;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-stat-card span {
  font-size: 12px;
  color: #888;
}

.admin-stat-card strong {
  font-size: 20px;
  color: #ff6b00;
}

.admin-addon-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-addon-stat-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.operator-chip {
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
}

.operator-chip.unset {
  border-color: #f0c36d;
  background: #fff8e8;
  color: #8a5a00;
  font-weight: 600;
}

.staff-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin: 16px 0 20px;
}

.staff-picker-btn {
  min-height: 48px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.staff-picker-btn.active {
  border-color: var(--brand, #c45c26);
  background: #fff5ef;
  color: var(--brand, #c45c26);
}

.staff-picker-modal h2 {
  margin-bottom: 4px;
}

.admin-staff-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.admin-staff-name {
  font-size: 16px;
  font-weight: 600;
}

.admin-staff-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
  white-space: nowrap;
}

.admin-staff-check.inline {
  align-self: end;
  padding-bottom: 10px;
}

.admin-staff-add {
  align-items: end;
  margin-bottom: 16px;
}

.admin-empty {
  color: #888;
  font-size: 14px;
  margin-bottom: 12px;
}

.stats-hint {
  margin: 0 0 8px;
  padding: 0 4px;
  font-size: 12px;
  color: #888;
}

.admin-session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.admin-session-row {
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
}

.admin-session-row.open {
  border-color: #ff6b00;
  background: #fff8f2;
}

.admin-session-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.admin-session-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eee;
  color: #666;
}

.admin-session-status.open {
  background: #ffe8d6;
  color: #c44e00;
  font-weight: 600;
}

.admin-session-time {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}

.admin-session-meta,
.admin-session-geo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12px;
  color: #666;
}

.admin-audit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.admin-audit-row {
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
}

.admin-audit-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  margin-bottom: 4px;
}

.admin-audit-time {
  color: #666;
  font-variant-numeric: tabular-nums;
}

.admin-audit-action {
  font-weight: 600;
  color: #1a5fb4;
}

.admin-audit-operator {
  color: #333;
  background: #eef3ff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.admin-audit-summary {
  font-size: 14px;
  color: #222;
}

.admin-audit-meta {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.admin-empty {
  padding: 24px;
  text-align: center;
  color: #999;
}
