:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --primary: #c0392b;
  --primary-dark: #962d22;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #fff7f0 0%, #f4f6f8 45%, #eef2ff 100%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--primary); text-decoration: none; }

.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 36px 32px 28px;
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand-badge {
  display: inline-flex;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #e74c3c);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
}

.brand p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-remember-row {
  margin-top: 4px;
}

.login-remember-row label {
  font-weight: 500;
  color: var(--text);
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  box-sizing: border-box;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select {
  height: 44px;
  padding: 0 14px;
  -webkit-appearance: none;
  appearance: none;
}

.form-group textarea {
  min-height: 96px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-group label.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.5;
}

.form-group label.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 72px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  background: #f3f4f6;
  color: var(--text);
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-row input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.captcha-img {
  flex: 0 0 auto;
  width: 120px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  object-fit: cover;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal .alert {
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, background .2s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-primary:disabled {
  opacity: .7;
  cursor: not-allowed;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
}

.confirm-modal {
  z-index: 200;
}

.confirm-modal .modal-content {
  max-width: 400px;
  text-align: center;
  padding: 28px 24px 22px;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  background: #eff6ff;
  color: #2563eb;
}

.confirm-icon-danger {
  background: #fef2f2;
  color: var(--danger);
}

.confirm-title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
}

.confirm-message {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
  width: auto;
  height: 44px;
}

.pay-due-text {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--muted);
}

.pay-method-row {
  text-align: left;
  margin-bottom: 14px;
}

.pay-method-options {
  display: flex;
  gap: 10px;
}

.pay-method-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
}

.pay-method-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(61, 107, 79, 0.08);
  color: var(--primary);
  font-weight: 600;
}

.pay-method-option input {
  margin: 0;
}

.pay-input-readonly {
  color: var(--muted);
}

.pay-balance-phone-row {
  margin-bottom: 12px;
}

.pay-phone-wrap {
  height: 44px;
}

.pay-phone-input {
  font-size: 16px !important;
  font-weight: 600 !important;
  height: 44px !important;
}

.pay-balance-select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
}

.pay-input-row {
  text-align: left;
  margin-bottom: 10px;
}

.pay-input-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.pay-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
}

.pay-input-prefix {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-right: 6px;
}

.pay-input {
  flex: 1;
  border: none;
  outline: none;
  height: 48px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  background: transparent;
}

.pay-hint {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
}

.guest-pay-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: flex-end;
}

.alert {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}

.alert.error {
  display: block;
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert.success {
  display: block;
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.tips {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* admin layout */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.mobile-header {
  display: none;
}

.mobile-nav {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: #111827;
  color: #fff;
  padding: 24px 18px;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar h2 {
  margin: 0 0 24px;
  font-size: 20px;
}

.sidebar .nav {
  flex: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 10px;
  word-break: break-all;
}

.sidebar-logout {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: #d1d5db;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background .15s, color .15s, border-color .15s;
}

.sidebar-logout:hover {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.35);
  color: #fca5a5;
}

.nav a {
  display: block;
  color: #d1d5db;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.nav a.active,
.nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.main {
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.topbar-user {
  color: var(--muted);
  font-size: 14px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-title {
  margin: 0;
  font-size: 24px;
}

.page-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.search-input {
  flex: 1 1 200px;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

select.search-input {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}

th { color: var(--muted); font-weight: 600; }

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .btn {
  flex: 0 0 auto;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.ok { background: #dcfce7; color: #166534; }
.badge.off { background: #fee2e2; color: #991b1b; }
.badge.warn { background: #fef3c7; color: #92400e; }

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-ghost {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-table-toggle {
  background: #fff7f0;
  border: 1px solid #fed7aa;
  color: #c2410c;
}

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

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

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

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.status-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #f9fafb;
}

.status-switch-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}

.status-switch-btn.active.open {
  background: #dcfce7;
  color: #166534;
}

.status-switch-btn.active.rest {
  background: #fef3c7;
  color: #92400e;
}

.responsive-table tr.row-active {
  background: #fff7f0;
}

.table-settings-panel {
  margin-top: 20px;
}

.status-tabs {
  margin-bottom: 16px;
}

.table-status-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-pill {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}

.status-pill:hover {
  border-color: #d1d5db;
}

.status-pill.active.idle {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.status-pill.active.busy {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.status-pill.active.disabled {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}

.table-panel {
  margin-top: 20px;
  background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
  border: 1px solid #fde8d8;
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
}

.table-panel.open {
  opacity: 1;
  transform: translateY(0);
}

.table-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.table-panel-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.table-panel-icon {
  font-size: 28px;
  line-height: 1;
  margin-top: 2px;
}

.table-panel-header h3 {
  margin: 0 0 4px;
}

.table-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  padding: 10px 16px;
  border-radius: 12px;
  background: #f3f4f6;
}

.stat-chip.stat-idle { background: #ecfdf5; }
.stat-chip.stat-busy { background: #fef3c7; }
.stat-chip.stat-off { background: #f3f4f6; }

.stat-num {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.table-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  transition: box-shadow .2s, transform .2s;
}

.table-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.table-card--idle { border-top: 3px solid #22c55e; }
.table-card--busy { border-top: 3px solid #f59e0b; }
.table-card--disabled { border-top: 3px solid #9ca3af; opacity: .75; }

.table-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.table-card-no {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.table-card-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.table-card-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.table-card-badge.idle { background: #dcfce7; color: #166534; }
.table-card-badge.busy { background: #fef3c7; color: #92400e; }
.table-card-badge.disabled { background: #f3f4f6; color: #6b7280; }

.table-card-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.table-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.table-card-btn {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.table-card-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.table-card-btn-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.table-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.table-empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

/* ---- 开台桌台看板 ---- */
.floor-board-card {
  padding: 0;
  overflow: hidden;
}

.floor-board {
  display: flex;
  min-height: 560px;
}

.floor-area-nav {
  width: 132px;
  flex-shrink: 0;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.floor-area-item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}

.floor-area-item:hover {
  background: #fff;
}

.floor-area-item.active {
  background: #fff;
  border-left-color: #f97316;
  color: #ea580c;
  font-weight: 700;
}

.floor-main {
  flex: 1;
  min-width: 0;
  padding: 16px 18px 18px;
}

.floor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.floor-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.floor-stat {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 12px;
  background: #f3f4f6;
  border-radius: 999px;
}

.floor-stat-idle { background: #dcfce7; color: #15803d; }
.floor-stat-dining { background: #ffedd5; color: #c2410c; }
.floor-stat-paid { background: #dbeafe; color: #1d4ed8; }

.floor-toolbar-actions {
  display: flex;
  gap: 8px;
}

.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.floor-card {
  border-radius: 14px;
  padding: 14px 14px 12px;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.floor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.floor-card--idle {
  background: linear-gradient(160deg, #4ade80 0%, #16a34a 100%);
}

.floor-card--dining {
  background: linear-gradient(160deg, #fdba74 0%, #ea580c 100%);
}

.floor-card--paid {
  background: linear-gradient(160deg, #60a5fa 0%, #2563eb 100%);
}

.floor-card--disabled {
  background: linear-gradient(160deg, #d1d5db 0%, #9ca3af 100%);
  opacity: .85;
}

.floor-card--pickup-completed {
  background: linear-gradient(160deg, #cbd5e1 0%, #64748b 100%);
}

.datetime-split {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.datetime-date,
.datetime-time {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.datetime-time {
  flex: 0 0 110px;
  max-width: 110px;
}

@media (max-width: 640px) {
  .datetime-split {
    flex-direction: column;
    align-items: stretch;
  }

  .datetime-time {
    flex: 1;
    max-width: none;
  }
}

.scope-picker {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.scope-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.scope-filter-row label {
  flex-shrink: 0;
  font-size: 14px;
  color: #374151;
}

.scope-filter-select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.scope-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.floor-card--pickup-active {
  background: linear-gradient(160deg, #5eead4 0%, #0d9488 100%);
}

.floor-card--pickup-unpaid {
  background: linear-gradient(160deg, #c4b5fd 0%, #7c3aed 100%);
}

.floor-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.floor-card-no {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.floor-card-unit {
  font-size: 12px;
  font-weight: 500;
  margin-left: 2px;
  opacity: .9;
}

.floor-card-icon {
  font-size: 34px;
  text-align: center;
  margin: 10px 0 6px;
  line-height: 1;
}

.floor-card-body {
  flex: 1;
  text-align: center;
}

.floor-card-duration {
  font-size: 12px;
  opacity: .95;
  line-height: 1.4;
}

.floor-card-amount {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.floor-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  opacity: .95;
}

.floor-card-status {
  font-weight: 600;
}

.floor-card-seats {
  white-space: nowrap;
}

.modal-content.modal-narrow {
  max-width: 520px;
}

.table-guest-list {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.table-guest-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fafafa;
}

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

.table-guest-name {
  font-size: 14px;
  font-weight: 700;
}

.table-guest-phone {
  font-size: 12px;
  color: var(--muted);
}

.table-guest-pay {
  font-size: 12px;
  font-weight: 600;
}

.table-guest-pay.unpaid { color: #ea580c; }
.table-guest-pay.paid { color: #2563eb; }
.table-guest-pay.refunded { color: #999; }

.guest-unpaid-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
}

.guest-summary-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.guest-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.guest-summary-row span:last-child {
  color: var(--text);
  font-weight: 600;
}

.guest-summary-discount span:last-child {
  color: #3D6B4F;
}

.guest-summary-coupon {
  align-items: flex-start;
}

.guest-summary-coupon span:first-child {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
  padding-top: 1px;
}

.guest-summary-coupon span:last-child {
  flex: 1;
  min-width: 0;
  margin-left: 12px;
  text-align: right;
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.guest-summary-final {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 14px;
}

.guest-summary-final span:last-child {
  font-size: 16px;
  font-weight: 700;
  color: #C4553A;
}

.guest-all-paid {
  text-align: center;
  border-top-style: dashed;
}

.guest-all-paid-text {
  font-size: 13px;
  font-weight: 600;
  color: #3D6B4F;
}

.table-guest-order {
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 8px;
}

.table-guest-order:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.table-guest-order-title {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.table-guest-order-addon {
  margin-top: 10px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}

.table-guest-order-addon .table-guest-order-title {
  color: var(--primary);
  font-weight: 600;
}

.table-guest-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 2px 0;
}

.table-action-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.table-action-btns .btn {
  width: 100%;
}

.table-action-btns-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 520px) {
  .table-action-btns-3 {
    grid-template-columns: 1fr 1fr;
  }

  .table-action-btns-3 .btn:last-child {
    grid-column: span 2;
  }
}

.table-checkout-summary {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.checkout-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.checkout-summary-item {
  text-align: center;
}

.checkout-summary-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.checkout-summary-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.checkout-summary-paid .checkout-summary-value { color: #2563eb; }
.checkout-summary-discount .checkout-summary-value { color: #3D6B4F; }
.checkout-summary-coupon .checkout-summary-value {
  color: #64748b;
  font-weight: 400;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.checkout-summary-unpaid .checkout-summary-value { color: #ea580c; }

.checkout-summary-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.table-order-pay-btn {
  margin-top: 8px;
}

.checkout-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.checkout-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.checkout-stat-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.checkout-stat-value {
  display: block;
  font-size: clamp(16px, 4.5vw, 24px);
  font-weight: 700;
  margin-top: 6px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.checkout-stat-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.checkout-stat-paid .checkout-stat-value { color: #2563eb; }
.checkout-stat-unpaid .checkout-stat-value { color: #ea580c; }

@media (max-width: 768px) {
  .checkout-stats {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .checkout-stat-card {
    padding: 12px 14px;
  }

  .checkout-stat-value {
    font-size: clamp(18px, 5.5vw, 22px);
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .checkout-summary-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .checkout-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
  }

  .checkout-summary-coupon {
    align-items: flex-start;
  }

  .checkout-summary-coupon .checkout-summary-value {
    flex: 1;
    min-width: 0;
    text-align: right;
  }

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

  .checkout-summary-value {
    margin-top: 0;
    font-size: clamp(16px, 4.5vw, 18px);
    text-align: right;
    flex-shrink: 0;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .checkout-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .checkout-view-tabs {
    width: 100%;
  }

  .checkout-view-tab {
    flex: 1;
    text-align: center;
  }

  .checkout-filters,
  .order-filters {
    flex-wrap: wrap;
    width: 100%;
    align-items: stretch;
  }

  .checkout-filters .search-input,
  .checkout-filters .search-input-sm,
  .order-filters .search-input,
  .order-filters .search-input-sm {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    width: auto;
  }

  .order-filters input[type="search"] {
    flex: 1 1 100%;
  }

  .checkout-filters .btn,
  .order-filters .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .checkout-order-head,
  .checkout-session-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .checkout-order-no {
    font-size: 13px;
    word-break: break-all;
    line-height: 1.35;
  }

  .checkout-order-meta {
    word-break: break-word;
  }

  .checkout-order-side {
    width: 100%;
    align-items: stretch;
  }

  .checkout-order-side .btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
    height: auto;
    min-height: 36px;
    padding: 8px 12px;
    line-height: 1.3;
  }

  .checkout-session-amounts {
    text-align: left;
  }

  .order-store-bar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .order-store-bar .menu-store-select {
    width: 100%;
    max-width: none;
  }

  .order-store-bar .menu-store-hint {
    width: 100%;
    font-size: 11px;
    line-height: 1.4;
  }

  .order-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .order-pagination-btns {
    justify-content: stretch;
  }

  .order-pagination-btns .btn {
    flex: 1;
  }
}

.checkout-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.checkout-view-tabs {
  display: inline-flex;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px;
}

.checkout-view-tab {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.checkout-view-tab.active {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.checkout-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input-sm {
  min-width: 120px;
}

.checkout-session-card,
.checkout-order-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fafafa;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.checkout-session-card {
  margin-bottom: 14px;
}

.checkout-session-head,
.checkout-order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.checkout-session-title,
.checkout-order-no {
  font-size: 15px;
  font-weight: 700;
}

.checkout-session-meta,
.checkout-order-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.checkout-session-amounts {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}

.checkout-session-amounts .unpaid {
  color: #ea580c;
  margin-top: 4px;
}

.checkout-session-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}

.checkout-session-orders,
.order-single-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-order-card-compact {
  background: #fff;
}

.checkout-order-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.checkout-order-items {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.checkout-all-paid,
.checkout-paid-tag {
  font-size: 12px;
  color: #2563eb;
  font-weight: 600;
}

.order-store-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-filters {
  flex-wrap: wrap;
}

.order-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

.order-pagination-info {
  font-size: 13px;
  color: var(--muted);
}

.order-pagination-btns {
  display: flex;
  gap: 8px;
}

.checkout-order-card-full .table-guest-order {
  margin-top: 0;
  border: none;
  padding: 0;
}

.order-single-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.member-stats .checkout-stat-value {
  font-size: clamp(18px, 5vw, 24px);
}

.member-toolbar {
  align-items: stretch;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.member-avatar,
.member-detail-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.member-avatar-empty,
.member-detail-avatar.member-avatar-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  font-size: 14px;
}

.member-detail-avatar {
  width: 48px;
  height: 48px;
}

.badge.level {
  background: #eef2ff;
  color: #4338ca;
}

.modal-content-wide {
  max-width: 920px;
}

.member-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.member-detail-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #fafafa;
}

.member-detail-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
}

.member-adjust-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.member-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.member-detail-name {
  font-size: 16px;
  font-weight: 700;
}

.member-detail-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

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

.member-detail-stats div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.member-detail-stats span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.member-detail-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.member-log-section {
  margin-top: 16px;
}

.member-log-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.member-log-table th,
.member-log-table td {
  font-size: 12px;
  padding: 8px 6px;
}

.text-plus { color: #16a34a; font-weight: 600; }
.text-minus { color: #dc2626; font-weight: 600; }

.member-level-tip {
  margin: 0 0 12px;
  font-size: 13px;
}

.level-settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-bottom: 10px;
}

.level-settings-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.level-settings-item label {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.level-store-select,
.level-points-input {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.level-store-select {
  width: 148px;
  max-width: 100%;
  padding-right: 28px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.level-points-input {
  width: 80px;
}

.level-add-btn {
  width: auto;
  flex: 0 0 auto;
}

.level-settings-actions {
  margin-left: auto;
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .level-settings-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .level-settings-item {
    flex-wrap: wrap;
  }

  .level-store-select {
    flex: 1 1 auto;
    width: auto;
    min-width: 120px;
  }

  .level-settings-actions {
    margin-left: 0;
  }

  .member-detail-grid {
    grid-template-columns: 1fr;
  }

  .member-toolbar .search-input,
  .member-toolbar .search-input-sm,
  .member-toolbar .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .member-toolbar input[type="search"] {
    flex: 1 1 100%;
  }
}

.item-cancelled {
  text-decoration: line-through;
  color: #9ca3af;
}

.order-item-row {
  align-items: center;
}

.order-category-header {
  margin-top: 10px;
  margin-bottom: 4px;
  padding: 6px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-top: 1px dashed var(--border);
}

.order-category-header:first-child {
  margin-top: 0;
  border-top: none;
}

.order-item-row-cancelled .order-item-price {
  color: #9ca3af;
}

.order-item-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.order-item-flavor {
  font-size: 12px;
  color: #8b7355;
  line-height: 1.4;
}

.order-remark-block {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8f6f2;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.order-remark-block-empty {
  color: var(--muted);
}

.guest-remark-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.guest-remark-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
}

.guest-remark-row + .guest-remark-row {
  border-top: 1px solid #f3f0ea;
}

.guest-remark-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.guest-remark-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.guest-remark-text-empty {
  color: var(--muted);
}

.order-item-actions {
  display: inline-flex;
  gap: 4px;
}

.order-item-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.order-item-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.order-add-item-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-refund-item {
  color: #b45309;
  border-color: #fbbf24;
}

.modal-content-refund-item {
  max-width: 480px;
}

.refund-item-tip {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.refund-item-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.refund-item-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}

.refund-item-order {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.modal-content-add-item {
  max-width: 520px;
}

.add-item-body {
  display: flex;
  min-height: 360px;
  max-height: 420px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.add-item-body.is-searching .add-item-side {
  display: none;
}

.add-item-side {
  width: 96px;
  flex-shrink: 0;
  overflow-y: auto;
  background: #f3f4f6;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.add-item-cat-tab {
  flex-shrink: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 14px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: normal;
  line-height: 1.35;
  text-align: center;
  transition: all .15s;
  position: relative;
}

.add-item-cat-tab:hover {
  background: #e5e7eb;
}

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

.add-item-cat-tab.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.add-item-list {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-item-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.add-item-option:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.add-item-price {
  color: var(--primary);
  font-weight: 600;
}

.add-item-confirm-modal {
  z-index: 210;
}

.add-item-confirm-name {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.add-item-confirm-price {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
}

.add-item-flavor-groups {
  max-height: 240px;
  overflow-y: auto;
  margin: 0 0 16px;
  text-align: left;
}

.add-item-flavor-group + .add-item-flavor-group {
  margin-top: 14px;
}

.add-item-flavor-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.add-item-flavor-group-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.add-item-flavor-group-tip {
  font-size: 12px;
  color: var(--muted);
}

.add-item-flavor-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-item-flavor-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.add-item-flavor-option.active {
  border-color: var(--primary);
  background: #fff7ed;
  color: var(--primary);
  font-weight: 600;
}

.add-item-flavor-option-price {
  font-size: 12px;
  color: var(--muted);
}

.add-item-flavor-option.active .add-item-flavor-option-price {
  color: var(--primary);
}

.add-item-remark-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  text-align: left;
}

.add-item-remark-input {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
}

.add-item-remark-input:focus {
  outline: none;
  border-color: var(--primary);
}

.add-item-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  text-align: left;
}

.add-item-qty-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.add-item-qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.add-item-qty-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.add-item-qty-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.add-item-qty-input {
  width: 56px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  -moz-appearance: textfield;
}

.add-item-qty-input::-webkit-outer-spin-button,
.add-item-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-success {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
}

.btn-warning {
  background: #f97316;
  border-color: #f97316;
  color: #fff;
}

.btn-warning:hover {
  background: #ea580c;
  border-color: #ea580c;
}

.bind-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.bind-user-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.bind-user-item:hover {
  border-color: #fed7aa;
  background: #fffaf5;
}

.bind-user-item input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.bind-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.bind-user-info strong {
  font-size: 14px;
}

.bind-user-info span {
  color: var(--muted);
}

.bind-other {
  color: #c2410c !important;
  font-size: 12px !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  z-index: 100;
  overflow-y: auto;
}

.modal.show { display: flex; }

.modal-content {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 { margin: 0; }

.close-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
}

.placeholder-card {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.placeholder-card h3 {
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 20px;
}

.placeholder-card p {
  margin: 0;
  font-size: 14px;
}

.placeholder-icon {
  font-size: 40px;
  line-height: 1;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

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

.tab-panel {
  margin-top: 0;
}

/* ---- 菜单管理：门店选择 ---- */
.menu-store-bar {
  padding: 0;
  overflow: hidden;
  margin-bottom: 14px;
}

.menu-store-bar + .tabs {
  margin-top: 0;
}

.menu-store-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.menu-store-label {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.menu-store-select {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
}

.menu-store-hint {
  flex: 0 1 auto;
  font-size: 12px;
  color: var(--muted);
}

.menu-refresh-btn {
  flex: 0 0 auto;
}

.image-upload-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.image-preview {
  width: 120px;
  height: 120px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-placeholder {
  display: none;
  font-size: 13px;
  color: var(--muted);
}

.image-preview.empty .image-preview-placeholder {
  display: block;
}

.image-upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.image-upload-btn {
  cursor: pointer;
  margin: 0;
}

.icon-picker {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  padding: 12px;
}

.icon-picker-current {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.icon-picker-current-emoji {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
}

.icon-picker-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.icon-picker-tab {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.icon-picker-tab.active {
  background: var(--primary, #3D6B4F);
  border-color: var(--primary, #3D6B4F);
  color: #fff;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.icon-picker-item {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-picker-item:hover {
  border-color: var(--primary, #3D6B4F);
}

.icon-picker-item.selected {
  border-color: var(--primary, #3D6B4F);
  box-shadow: 0 0 0 2px rgba(61, 107, 79, 0.2);
  background: #f3f7f4;
}

.icon-picker-emoji {
  font-size: 22px;
  line-height: 1;
}

.form-hint {
  margin: 0;
  font-size: 12px;
}

.product-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f9fafb;
  display: block;
}

.product-thumb-empty {
  color: var(--muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.modal-wide .modal-content,
.modal-content.modal-wide {
  max-width: 640px;
}

.modal-narrow .modal-content,
.modal-content.modal-narrow {
  max-width: 380px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-header h3 {
  margin: 0 0 6px;
}

.section-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.section-desc code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.toolbar-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qr-preview {
  text-align: center;
}

.qr-preview img {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.qr-meta {
  margin: 10px 0 0;
  font-size: 13px;
}

.qr-meta.muted {
  color: var(--muted);
}

.qr-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.muted {
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.flavor-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flavor-check-group strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.flavor-check-group .checkbox-row {
  gap: 6px 12px;
}

.flavor-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-inner {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: #fafafa;
}

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

.flavor-group-header h4 {
  margin: 0 0 4px;
}

.flavor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px dashed var(--border);
}

.account-wrap {
  max-width: 480px;
}

.account-card {
  margin-bottom: 12px;
  padding: 16px 18px;
}

.account-card:last-child {
  margin-bottom: 0;
}

.account-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.account-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #e74c3c);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-details {
  flex: 1;
  min-width: 0;
}

.info-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.info-value {
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  word-break: break-all;
}

.account-form .form-group {
  margin-bottom: 12px;
}

.account-form .form-group label {
  margin-bottom: 5px;
  font-size: 13px;
}

.account-form .btn-primary {
  width: 100%;
  margin-top: 4px;
}

.toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .25s ease, transform .25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: #16a34a;
  color: #fff;
}

.toast-error {
  background: #dc2626;
  color: #fff;
}

.modal-force {
  background: rgba(15, 23, 42, 0.72);
}

.modal-force .modal-content {
  max-width: 440px;
}

.modal-tip {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.form-hint {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.reset-password-box {
  margin-bottom: 16px;
}

.reset-password-box .btn {
  width: 100%;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "header"
      "nav"
      "main";
  }

  .mobile-header {
    grid-area: header;
  }

  .mobile-nav {
    grid-area: nav;
  }

  .main {
    grid-area: main;
    min-width: 0;
  }

  .sidebar { display: none; }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
    background: #111827;
    color: #fff;
  }

  .mobile-header h2 {
    margin: 0;
    font-size: 18px;
  }

  .mobile-header .btn-secondary {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-color: rgba(255,255,255,.2);
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .mobile-nav {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex-shrink: 0;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    padding: 8px 12px;
    background: #1f2937;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: auto;
    line-height: 1.3;
    color: #d1d5db;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
    background: rgba(255,255,255,.06);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

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

  .main {
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .topbar-user {
    width: 100%;
    max-width: none;
    margin-right: 0 !important;
  }

  .page-title { font-size: 18px; }
  .page-desc { font-size: 12px; margin-top: 4px; }

  .card { padding: 12px; border-radius: 12px; }

  .btn {
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 10px;
  }

  .btn-sm {
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .search-input {
    height: 36px;
    font-size: 14px;
    padding: 0 10px;
    border-radius: 10px;
  }

  select.search-input {
    background-position: right 10px center;
    padding-right: 28px;
  }

  .form-group input:not([type="checkbox"]):not([type="radio"]),
  .form-group select {
    height: 36px;
    font-size: 14px;
    padding: 0 10px;
    border-radius: 10px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .form-group label {
    margin-bottom: 6px;
    font-size: 13px;
  }

  .tabs {
    gap: 6px;
    margin-bottom: 10px;
  }

  .tab {
    padding: 7px 14px;
    font-size: 13px;
  }

  .menu-store-bar {
    margin-bottom: 12px;
  }

  .menu-store-row {
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .menu-store-label {
    width: 100%;
  }

  .menu-store-select {
    flex: 1 1 auto;
  }

  .topbar {
    margin-bottom: 10px;
    gap: 8px;
  }

  .topbar-user {
    font-size: 12px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .toolbar > :only-child {
    grid-column: 1 / -1;
  }

  .toolbar .search-input,
  .toolbar .btn {
    width: 100%;
    min-width: 0;
  }

  .modal-content {
    padding: 18px 16px;
  }

  .modal-header {
    margin-bottom: 12px;
  }

  .modal-header h3 {
    font-size: 17px;
  }

  .table-wrap {
    overflow: visible;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tr {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
  }

  .responsive-table tr:last-child {
    margin-bottom: 0;
  }

  .responsive-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #f0f0f0;
    text-align: right;
  }

  .responsive-table td:last-child {
    border-bottom: none;
    padding-top: 12px;
    justify-content: flex-end;
  }

  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
    text-align: left;
    flex-shrink: 0;
  }

  .responsive-table td[colspan] {
    display: block;
    text-align: center;
  }

  .responsive-table td[colspan]::before {
    display: none;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    max-width: none;
    border-radius: 16px 16px 0 0;
    max-height: 92dvh;
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }

  .table-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .floor-board {
    flex-direction: column;
    min-height: 0;
  }

  .floor-area-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
  }

  .floor-area-item {
    flex: 0 0 auto;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 10px 14px;
    white-space: nowrap;
  }

  .floor-area-item.active {
    border-left-color: transparent;
    border-bottom-color: #f97316;
  }

  .floor-main {
    padding: 12px;
  }

  .floor-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .table-panel {
    padding: 16px;
  }

  .action-group {
    width: 100%;
  }

  .action-group .btn-sm {
    flex: 1 1 calc(50% - 3px);
  }
}

@media (max-width: 480px) {
  .main {
    padding: 10px;
  }

  .page-title { font-size: 17px; }
  .page-desc { display: none; }

  .card { padding: 10px; }

  .btn {
    height: 34px;
    font-size: 13px;
  }

  .search-input,
  .form-group input:not([type="checkbox"]):not([type="radio"]),
  .form-group select {
    height: 34px;
    font-size: 14px;
  }

  .tab {
    padding: 6px 12px;
    font-size: 12px;
  }

  .responsive-table tr {
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .responsive-table td {
    padding: 8px 0;
    font-size: 14px;
  }

  .page-center {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    align-items: flex-start;
    padding-top: max(10vh, env(safe-area-inset-top));
  }

  .login-card {
    padding: 28px 20px 22px;
    border-radius: 16px;
  }

  .brand h1 { font-size: 22px; }

  .tips { font-size: 11px; }

  .account-wrap {
    max-width: none;
  }

  .account-card {
    padding: 12px 14px;
  }

  .info-row {
    padding: 4px 0;
  }
}

.printer-config-hint {
  margin-bottom: 16px;
}

.printer-config-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.printer-register-form {
  max-width: 640px;
}

.order-status-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: rgba(22, 119, 255, 0.08);
  border-radius: 999px;
}

.order-status-label {
  color: var(--primary);
  font-weight: 600;
}

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

.promotion-cell {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.promotion-cell-icon {
  font-size: 24px;
  line-height: 1.2;
}

.promotion-cell-desc {
  font-size: 12px;
  margin-top: 4px;
}
