:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #67748a;
  --line: #dde6f2;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --success: #12805c;
  --warning: #b35c00;
  --danger: #bd2c2c;
  --idle: #6a7484;
  --running: #0b7a59;
  --reserved: #9a5a00;
  --occupied: #2563eb;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 15px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

button:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

button:disabled {
  color: var(--muted);
  background: #eef2f7;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

button.secondary {
  color: var(--text);
  background: #eef2f7;
}

button.secondary:hover {
  background: #e0e7f0;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #9e2323;
}

button.ghost {
  padding: 6px 9px;
  color: var(--primary);
  background: transparent;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 32vw),
    var(--bg);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  background: #f7fafc;
}

.app-shell.dark {
  --bg: #0b1220;
  --panel: #111c2e;
  --text: #f3f7fb;
  --muted: #b6c2d3;
  --line: #334155;
  --primary-soft: rgba(20, 184, 166, 0.16);
  background: #0b1220;
}

.app-shell.collapsed {
  grid-template-columns: 92px minmax(0, 1fr);
}

.workspace {
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 16%, rgba(20, 184, 166, 0.12), transparent 28vw),
    linear-gradient(180deg, #f7fbfb 0%, #f8fafc 42%, #ffffff 100%);
}

.app-shell.dark .workspace {
  background:
    radial-gradient(circle at 18% 16%, rgba(20, 184, 166, 0.18), transparent 28vw),
    linear-gradient(180deg, #111c2e 0%, #0b1220 52%, #0d1628 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 88px;
  padding: 18px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.app-shell.dark .topbar,
.app-shell.dark .sidebar,
.app-shell.dark .panel,
.app-shell.dark .stat,
.app-shell.dark .frontdesk-seat,
.app-shell.dark .scan-card,
.app-shell.dark .pattern-card,
.app-shell.dark .submit-panel,
.app-shell.dark .pattern-admin-card,
.app-shell.dark .pattern-detail-info,
.app-shell.dark .pattern-large-image,
.app-shell.dark .frontdesk-floorplan {
  color: var(--text);
  border-color: var(--line);
  background: rgba(17, 28, 46, 0.96);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

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

.page-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.top-actions select {
  width: 220px;
  flex: 0 0 220px;
}

.top-button-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.top-button-group button {
  min-width: 84px;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #101827, #263244);
  box-shadow: 0 12px 28px rgba(16, 24, 39, 0.18);
  font-weight: 700;
}

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

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

.account-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 10%, rgba(37, 99, 235, 0.16), transparent 28vw),
    linear-gradient(135deg, #eef5ff 0%, #f8fbff 54%, #edf7f4 100%);
}

.auth-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 70px rgba(29, 47, 77, 0.14);
}

.auth-brand {
  margin-bottom: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f8fb;
}

.auth-tabs button {
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.auth-tabs button.active,
.auth-tabs button:hover {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-message {
  margin-bottom: 14px;
  border: 1px solid #ffd9a8;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--warning);
  background: #fff8ed;
}

.global-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 3000;
  transform: translateX(-50%);
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  padding: 10px 16px;
  color: #1e40af;
  background: #eff6ff;
  box-shadow: 0 16px 38px rgba(29, 47, 77, 0.16);
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-panel {
  width: min(620px, 100%);
  max-height: min(720px, 88vh);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.announcement-list {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow-y: auto;
  padding: 16px 18px 18px;
}

.announcement-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #f8fbff;
}

.announcement-item strong {
  font-size: 17px;
}

.announcement-item small {
  color: var(--muted);
}

.announcement-item p {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  height: 100vh;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.app-shell.collapsed .sidebar {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  padding: 22px 12px;
}

.app-shell.collapsed .sidebar .brand {
  justify-content: center;
  padding: 0 0 18px;
}

.app-shell.collapsed .sidebar .brand > div:not(.brand-mark) {
  display: none;
}

.app-shell.collapsed .nav-group {
  display: grid;
  justify-items: center;
  margin-bottom: 14px;
}

.app-shell.collapsed .nav-group h3 {
  width: 48px;
  margin: 0 0 8px;
  padding: 0;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  text-indent: -999px;
}

.app-shell.collapsed .nav-group h3::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin: 0 auto;
  background: var(--line);
}

.app-shell.collapsed .nav-button {
  position: relative;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-height: 48px;
  margin: 0 0 8px;
  padding: 0;
  color: transparent;
  overflow: hidden;
  text-indent: -999px;
  white-space: nowrap;
}

.app-shell.collapsed .nav-button::before {
  content: attr(data-short);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  text-indent: 0;
}

.app-shell.collapsed .nav-button.active::before,
.app-shell.collapsed .nav-button:hover::before {
  color: #0f9f8f;
}

.app-shell.collapsed .sidebar-footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-top: 12px;
}

.app-shell.collapsed .sidebar-footer .nav-button {
  margin-bottom: 0;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
}

.sidebar .brand {
  min-width: 0;
  min-height: 64px;
  padding: 0 10px 22px;
  border-bottom: 1px solid #edf2f7;
  margin-bottom: 18px;
}

.mobile-menu-button {
  display: none;
}

.side-nav {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding-right: 4px;
}

.sidebar-footer {
  border-top: 1px solid #edf2f7;
  padding-top: 14px;
  margin-top: 14px;
}

.nav-button {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  gap: 9px;
  min-height: 44px;
  margin-bottom: 6px;
  border-radius: 14px;
  padding: 11px 14px;
  color: #4b5563;
  background: transparent;
  text-align: left;
  box-shadow: none;
  font-weight: 800;
}

.nav-button:hover,
.nav-button.active {
  color: #0f9f8f;
  background: #ecfdf7;
  box-shadow: none;
  transform: none;
}

.app-shell.dark .nav-button {
  color: #cbd5e1;
}

.app-shell.dark .nav-button:hover,
.app-shell.dark .nav-button.active {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.14);
}

.app-shell.dark input,
.app-shell.dark select,
.app-shell.dark textarea,
.app-shell.dark table,
.app-shell.dark td,
.app-shell.dark th,
.app-shell.dark .table-wrap,
.app-shell.dark .account-pill,
.app-shell.dark .qr-box,
.app-shell.dark .client-rule,
.app-shell.dark .metric-list div,
.app-shell.dark .inventory-warning-list div,
.app-shell.dark .inventory-series,
.app-shell.dark .inventory-series-head,
.app-shell.dark .inventory-log-row,
.app-shell.dark .restock-row,
.app-shell.dark .shipment-card,
.app-shell.dark .shipment-items span,
.app-shell.dark .restock-copy-text,
.app-shell.dark .inventory-lookup,
.app-shell.dark .announcement-item,
.app-shell.dark .setting-toggle,
.app-shell.dark .bead-usage button,
.app-shell.dark .selected-bead,
.app-shell.dark .qr-logo-preview {
  color: var(--text);
  border-color: var(--line);
  background: #0b1220;
}

.app-shell.dark .sidebar-footer,
.app-shell.dark .sidebar .brand {
  border-color: var(--line);
}

.app-shell.dark th,
.app-shell.dark .panel-head {
  color: var(--text);
  background: #17233a;
}

.app-shell.dark .order-summary div,
.app-shell.dark .date-row td,
.app-shell.dark tbody tr.date-row:hover td {
  color: var(--text);
  border-color: var(--line);
  background: #13243b;
}

.app-shell.dark .date-row td span {
  color: var(--muted);
}

.app-shell.dark .color-rank-row .rank-meter {
  background: #253247;
}

.app-shell.dark .floorplan-fullscreen-bar {
  color: var(--text);
  border-color: var(--line);
  background: rgba(17, 28, 46, 0.88);
}

.app-shell.dark .floorplan-zoom-label {
  color: var(--text);
  background: #17233a;
}

.app-shell.dark .floor-rule-popover {
  color: var(--text);
  border-color: var(--line);
  background: #101827;
}

.app-shell.dark .inventory-action-toggle {
  border-color: var(--line);
  background: #17233a;
}

.app-shell.dark .section-head h2,
.app-shell.dark .page-title h2,
.app-shell.dark .seat-top h3,
.app-shell.dark .panel-head h3,
.app-shell.dark .stat strong,
.app-shell.dark .frontdesk-meter strong,
.app-shell.dark .money {
  color: #f8fafc;
}

.app-shell.dark .section-head p,
.app-shell.dark .page-title p,
.app-shell.dark .seat-meta,
.app-shell.dark .muted,
.app-shell.dark .stat span,
.app-shell.dark .frontdesk-summary span {
  color: #b6c2d3;
}

.app-shell.dark button.secondary {
  color: #e5e7eb;
  background: #263449;
}

.app-shell.dark button.secondary:hover {
  background: #334155;
}

.app-shell.dark .frontdesk-seat.idle,
.app-shell.dark .seat-card {
  border-color: var(--line);
  background: #111c2e;
}

.nav-group {
  margin-bottom: 16px;
}

.nav-group h3 {
  margin: 0 0 7px;
  padding: 0 12px;
  color: #9aa4b2;
  font-size: 12px;
  font-weight: 800;
}

.main {
  padding: 34px 44px 52px;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.section-actions button {
  min-height: 40px;
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.console-stats {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.stat::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.panel + .panel {
  margin-top: 16px;
}

.danger-zone {
  border-color: rgba(189, 44, 44, 0.28);
}

.danger-zone .panel-head {
  background: #fff7f7;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.panel-head h3 {
  margin: 0;
  font-size: 17px;
}

.panel-body {
  padding: 20px;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.panel-inline-title {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}

.settings-list {
  display: grid;
  gap: 12px;
}

.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #f8fbff;
}

.setting-toggle span,
.setting-toggle strong,
.setting-toggle small {
  display: block;
}

.setting-toggle strong {
  color: var(--text);
  font-size: 16px;
}

.setting-toggle small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.setting-toggle input {
  width: 48px;
  height: 26px;
  min-height: 26px;
  flex: 0 0 48px;
  accent-color: var(--primary);
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
  margin-bottom: 16px;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-row strong,
.rank-row span {
  display: block;
}

.rank-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.rank-row b {
  font-variant-numeric: tabular-nums;
}

.rank-meter {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e8eef7;
}

.rank-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
}

.metric-list {
  display: grid;
  gap: 12px;
}

.metric-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: #f8fbff;
}

.metric-list span {
  color: var(--muted);
}

.metric-list strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto minmax(420px, auto);
  gap: 12px;
  align-items: end;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.inventory-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  font-weight: 700;
}

.inventory-check input {
  width: 18px;
  min-height: 18px;
}

.inventory-bulk-form {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.inventory-bulk-form + .inventory-bulk-form {
  margin-top: -4px;
}

.inventory-action-field {
  display: grid;
  gap: 8px;
}

.inventory-action-field > span {
  color: var(--muted);
  font-weight: 700;
}

.inventory-action-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eef4fb;
}

.inventory-action-toggle label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.inventory-action-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.inventory-action-toggle label:has(input:checked) {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.inventory-lookup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #f8fbff;
}

.inventory-lookup.empty {
  color: var(--muted);
  font-weight: 700;
}

.inventory-lookup-main {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.inventory-lookup-main strong {
  font-size: 20px;
}

.inventory-lookup-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  color: var(--muted);
  font-weight: 700;
}

.inventory-lookup-stats b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.color-rank-panel {
  max-height: 430px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.color-rank-row {
  display: grid;
  grid-template-columns: 22px 52px minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.color-rank-row:last-child {
  border-bottom: 0;
}

.color-rank-row i,
.inventory-warning-list i,
.color-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 6px;
  vertical-align: middle;
}

.color-rank-row .rank-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eef7;
}

.color-rank-row .rank-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #2563eb);
}

.color-rank-row b {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.inventory-warning-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.inventory-warning-list h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.inventory-warning-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7ed;
}

.inventory-warning-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.inventory-table input {
  width: 120px;
  min-height: 36px;
  padding: 7px 9px;
}

.color-swatch {
  margin-right: 8px;
}

.color-swatch.large {
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 10px;
}

.inventory-series-list {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.inventory-series {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.inventory-series-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  color: var(--text);
  background: #f8fbff;
  box-shadow: none;
  border-radius: 0;
}

.inventory-series-head:hover {
  transform: none;
}

.inventory-series-head small {
  color: var(--muted);
  font-weight: 700;
}

.inventory-series.collapsed .inventory-color-list {
  display: none;
}

.inventory-color-list {
  display: grid;
}

.inventory-color-row {
  display: grid;
  grid-template-columns: 46px minmax(95px, 1fr) repeat(3, 112px) 72px;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}

.inventory-color-main {
  display: grid;
  gap: 3px;
}

.inventory-color-main strong {
  font-size: 16px;
}

.inventory-color-main span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-color-row label {
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-color-row input {
  min-height: 36px;
  padding: 7px 9px;
}

.inventory-log-list {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
}

.inventory-log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.inventory-log-row div {
  display: grid;
  gap: 4px;
}

.inventory-log-row strong {
  font-size: 15px;
}

.inventory-log-row span,
.inventory-log-row small {
  color: var(--muted);
  line-height: 1.4;
}

.inventory-log-row.reverted {
  opacity: 0.62;
}

.inventory-log-row button {
  min-width: 74px;
}

.restock-list,
.shipment-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px 18px 18px;
  min-height: 260px;
  max-height: 460px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.restock-row,
.shipment-card {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.restock-row {
  grid-template-columns: 24px 24px minmax(130px, 1fr) 110px 130px;
}

.restock-row.shipping {
  background: #f3f7fc;
}

.restock-row.shipping strong::after {
  content: "已在运输中";
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  border-radius: 999px;
  padding: 2px 8px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 700;
}

.restock-select {
  display: flex;
  align-items: center;
  justify-content: center;
}

.restock-select input {
  width: 18px;
  min-height: 18px;
}

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

.restock-head-actions button {
  min-height: 34px;
  padding: 8px 11px;
}

.restock-row div,
.shipment-card > div:first-child {
  display: grid;
  gap: 4px;
}

.restock-row small,
.shipment-card span {
  color: var(--muted);
}

.restock-row label {
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.restock-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.shipment-card {
  grid-template-columns: 1fr;
}

.shipment-card button {
  width: fit-content;
}

.shipment-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shipment-items span {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef4fb;
  font-size: 12px;
  font-weight: 700;
}

.shipment-card.received {
  opacity: 0.74;
}

.restock-copy-text {
  overflow-x: auto;
  max-height: 110px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  background: #ffffff;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.form-row button[type="submit"] {
  min-height: 42px;
}

.qr-export-tools {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto minmax(130px, auto) 1fr;
  gap: 14px;
  align-items: center;
}

.qr-logo-upload {
  display: grid;
  gap: 8px;
}

.qr-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border: 1px dashed #b7c7dd;
  border-radius: 16px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  overflow: hidden;
}

.qr-logo-preview img {
  max-width: 78px;
  max-height: 78px;
  object-fit: contain;
}

.brand-asset-field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.brand-asset-label {
  font-weight: 600;
}

.brand-asset-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.brand-asset-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border: 1px dashed #b7c7dd;
  border-radius: 14px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  overflow: hidden;
}

.brand-asset-preview img {
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
}

.brand-asset-upload {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.app-shell.dark .brand-asset-preview {
  border-color: #33507a;
  background: #16233b;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px 18px 6px;
}

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

.filter-actions button {
  min-height: 42px;
  white-space: nowrap;
}

.order-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 18px 18px;
}

.order-summary div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

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

.order-summary strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  background: #fff;
}

th {
  padding: 14px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: #f8fbff;
  border-bottom: 1px solid var(--line);
}

tbody tr:hover td {
  background: #fbfdff;
}

.date-row td,
tbody tr.date-row:hover td {
  padding: 12px 18px;
  color: #0f766e;
  background: #ecfdf7;
  border-bottom-color: #d5f5ea;
}

.date-row td {
  font-size: 14px;
}

.date-row td span {
  margin-left: 10px;
  color: #4b5563;
}

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

.inline-password {
  width: 150px;
  min-height: 36px;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.seat-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(29, 47, 77, 0.07);
}

.frontdesk-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.frontdesk-summary div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(29, 47, 77, 0.06);
}

.frontdesk-summary span,
.frontdesk-summary strong {
  display: block;
}

.frontdesk-summary span {
  color: var(--muted);
  font-size: 13px;
}

.frontdesk-summary strong {
  margin-top: 8px;
  font-size: 24px;
}

.voice-summary-card {
  display: grid;
  align-content: center;
  gap: 10px;
}

.voice-summary-card button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: #eaf0f8;
  color: var(--text);
  font-weight: 800;
}

.voice-summary-card button.active {
  background: #12b886;
  color: #fff;
}

.frontdesk-layout-panel .panel-head {
  align-items: flex-start;
}

.frontdesk-layout-panel .panel-head p {
  margin: 4px 0 0;
}

.frontdesk-floorplan {
  position: relative;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, #fbfdff, #f3f7fb);
  cursor: grab;
}

.frontdesk-floorplan.panning {
  cursor: grabbing;
}

.floorplan-canvas {
  position: relative;
  min-width: max(100%, calc(var(--floor-cols, 8) * var(--floor-cell, 132px)));
  min-height: max(620px, calc(var(--floor-rows, 6) * var(--floor-cell, 132px)));
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(251, 253, 255, 0.92), rgba(243, 247, 251, 0.92));
  background-size: 36px 36px, 36px 36px, auto;
}

.frontdesk-floorplan:fullscreen,
.frontdesk-floorplan.fullscreen-fallback {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

.frontdesk-floorplan.fullscreen-fallback {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.floorplan-fullscreen-open {
  overflow: hidden;
}

.floorplan-fullscreen-bar {
  display: none;
  position: absolute;
  left: 18px;
  right: 18px;
  top: 14px;
  z-index: 12;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
}

.floorplan-fullscreen-bar > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.floorplan-zoom-label {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 10px;
  padding: 0 10px;
  color: var(--text);
  background: #eef3f8;
  font-size: 13px;
  font-weight: 900;
}

.frontdesk-floorplan:fullscreen .floorplan-fullscreen-bar,
.frontdesk-floorplan.fullscreen-fallback .floorplan-fullscreen-bar {
  display: flex;
}

.frontdesk-floorplan:fullscreen .floorplan-label,
.frontdesk-floorplan.fullscreen-fallback .floorplan-label {
  top: 78px;
}

.frontdesk-floorplan:fullscreen .floor-seat,
.frontdesk-floorplan.fullscreen-fallback .floor-seat {
  width: var(--floor-seat-size, 96px);
}

.frontdesk-floorplan:fullscreen .floorplan-canvas,
.frontdesk-floorplan.fullscreen-fallback .floorplan-canvas {
  min-width: max(100vw, calc(var(--floor-cols, 8) * var(--floor-full-cell, 150px)));
  min-height: max(100vh, calc(var(--floor-rows, 6) * var(--floor-full-cell, 150px)));
  background-size: 44px 44px, 44px 44px, auto;
}

.frontdesk-floorplan.editing {
  border-color: rgba(15, 159, 143, 0.5);
  box-shadow: inset 0 0 0 2px rgba(15, 159, 143, 0.12);
  cursor: grab;
}

.floorplan-label {
  position: absolute;
  left: 18px;
  top: 16px;
  z-index: 1;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.floor-seat {
  position: absolute;
  z-index: 2;
  width: var(--floor-seat-size, 96px);
  height: var(--floor-seat-size, 96px);
  cursor: default;
  touch-action: none;
}

.frontdesk-floorplan.editing .floor-seat {
  cursor: grab;
}

.frontdesk-floorplan.editing .floor-seat::before {
  content: "";
  position: absolute;
  inset: calc(var(--floor-seat-size, 96px) * -0.08);
  border: 1px dashed rgba(15, 159, 143, 0.46);
  border-radius: calc(var(--floor-seat-size, 96px) * 0.18);
  pointer-events: none;
}

.floor-seat.dragging {
  z-index: 8;
  cursor: grabbing;
}

.floor-seat-card {
  display: grid;
  place-items: center;
  width: var(--floor-seat-size, 96px);
  height: var(--floor-seat-size, 96px);
  padding: calc(var(--floor-seat-size, 96px) * 0.08);
  border: 2px solid #dbe5f0;
  border-radius: calc(var(--floor-seat-size, 96px) * 0.15);
  color: #111827;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  text-align: center;
}

.floor-seat-card strong {
  font-size: var(--floor-seat-font-size, 24px);
  line-height: 1;
}

.floor-seat-card span {
  margin-top: calc(var(--floor-seat-size, 96px) * 0.06);
  font-size: var(--floor-seat-subfont-size, 12px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.floor-seat-card.running {
  border-color: rgba(18, 184, 134, 0.72);
  color: #fff;
  background: linear-gradient(145deg, #0ca678, #12b886);
  box-shadow: 0 14px 28px rgba(18, 184, 134, 0.24);
}

.floor-seat-card.occupied {
  border-color: rgba(37, 99, 235, 0.72);
  color: #fff;
  background: linear-gradient(145deg, #1d4ed8, #3b82f6);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.floor-seat-card.reserved {
  border-color: rgba(245, 158, 11, 0.62);
  background: #fff7ed;
}

.floor-seat-card.running.due-soon,
.floor-seat.due-soon .floor-seat-card.running {
  border-color: rgba(220, 38, 38, 0.86);
  color: #fff;
  background: linear-gradient(145deg, #b91c1c, #ef4444);
  box-shadow: 0 16px 34px rgba(220, 38, 38, 0.28);
}

.floor-rule-popover {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  z-index: 20;
  width: 230px;
  transform: translateX(-50%);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.floor-seat.show-rules {
  z-index: 18;
}

.floor-seat.show-rules .floor-rule-popover {
  display: grid;
}

.floor-rule-popover strong {
  padding: 2px 4px 4px;
  font-size: 13px;
}

.floor-rule-popover button {
  display: grid;
  gap: 4px;
  width: 100%;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
}

.floor-rule-popover button span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 600;
}

.floor-rule-popover .occupied-toggle {
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
  background: #eff6ff;
}

.frontdesk-grid,
.scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.frontdesk-seat,
.scan-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(29, 47, 77, 0.08);
}

.frontdesk-seat.running {
  border-color: rgba(18, 128, 92, 0.32);
  background: linear-gradient(180deg, #f1fbf7, #fff);
}

.frontdesk-seat.occupied {
  border-color: rgba(37, 99, 235, 0.34);
  background: linear-gradient(180deg, #eff6ff, #fff);
}

.frontdesk-seat.reserved {
  border-color: rgba(179, 92, 0, 0.3);
  background: linear-gradient(180deg, #fff8ed, #fff);
}

.frontdesk-seat.running.due-soon {
  border-color: rgba(220, 38, 38, 0.42);
  background: linear-gradient(180deg, #fff1f2, #fff);
}

.frontdesk-meter {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(145deg, #111827, #2563eb);
}

.frontdesk-meter strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.frontdesk-meter span {
  color: #dbeafe;
  font-weight: 700;
}

.frontdesk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scan-qr {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px dashed #b7c7dd;
  border-radius: 14px;
  padding: 14px;
  background: #f8fbff;
}

.scan-qr strong,
.scan-qr small {
  display: block;
}

.scan-qr small {
  margin-top: 6px;
  color: var(--muted);
  word-break: break-all;
}

.seat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.seat-top h3 {
  margin: 0;
  font-size: 22px;
}

.seat-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.badge.idle {
  background: var(--idle);
}

.badge.running {
  background: var(--running);
}

.badge.reserved {
  background: var(--reserved);
}

.badge.occupied {
  background: var(--occupied);
}

.badge.due-soon {
  background: var(--danger);
}

.badge.done {
  background: var(--primary);
}

.money {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.timer {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

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

.qr-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed #b7c7dd;
  border-radius: 12px;
  background: #f8fbff;
  word-break: break-all;
}

.qr-code {
  width: 156px;
  height: 156px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  image-rendering: pixelated;
}

.client-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 20% 10%, rgba(37, 99, 235, 0.2), transparent 32vw),
    linear-gradient(145deg, #eef5ff 0%, #f8fbff 52%, #eefaf5 100%);
}

.client-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 76px rgba(29, 47, 77, 0.18);
}

.client-panel h1 {
  margin: 0;
  font-size: 34px;
}

.client-panel .timer {
  margin: 0;
  font-size: 44px;
}

.client-rule {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  background: #f8fbff;
}

.client-meter {
  display: grid;
  gap: 8px;
  margin: 20px 0 14px;
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  background: linear-gradient(145deg, #1e40af, #2563eb);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.26);
}

.client-meter .money {
  margin: 0;
  color: #dbeafe;
  font-size: 22px;
}

.client-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.feedback-panel {
  width: min(560px, 100%);
}

.privacy-note {
  margin: 18px 0;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 14px 16px;
  color: #1e3a8a;
  line-height: 1.7;
  background: #eff6ff;
}

.feedback-form {
  display: grid;
  gap: 14px;
}

.feedback-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.feedback-form textarea {
  min-height: 132px;
  resize: vertical;
}

.feedback-success {
  display: grid;
  gap: 12px;
  text-align: center;
}

.feedback-success strong {
  font-size: 24px;
}

.feedback-list {
  display: grid;
  gap: 12px;
}

.feedback-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.feedback-card.handled {
  background: #f8fafc;
  opacity: 0.82;
}

.feedback-card strong,
.feedback-card span,
.feedback-card p,
.feedback-card small {
  display: block;
}

.feedback-card span,
.feedback-card small {
  color: var(--muted);
}

.feedback-card p {
  margin: 10px 0;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.market-page {
  min-height: 100vh;
  padding: 34px;
  background:
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.16), transparent 30vw),
    linear-gradient(145deg, #eef5ff 0%, #fbfdff 48%, #eefaf5 100%);
}

.market-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 24px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto 24px;
}

.market-hero h1 {
  margin: 18px 0 8px;
  font-size: 42px;
}

.market-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.market-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 42px rgba(29, 47, 77, 0.09);
}

.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  max-width: 1180px;
  margin: 0 auto;
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.pattern-card,
.submit-panel,
.pattern-admin-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(29, 47, 77, 0.08);
  overflow: hidden;
}

.pattern-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.pattern-image-button:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.pattern-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.pattern-image-button:hover img {
  transform: scale(1.03);
}

.pattern-card > div,
.submit-panel,
.pattern-admin-card > div {
  padding: 18px;
}

.pattern-card h3,
.submit-panel h2,
.pattern-admin-card h3 {
  margin: 10px 0 8px;
}

.pattern-card p,
.pattern-admin-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.pattern-meta,
.pattern-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pattern-meta span,
.pattern-info span {
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: #eef4fb;
  font-size: 12px;
  font-weight: 700;
}

.pattern-info span {
  color: #334155;
  background: #f8fafc;
}

.pattern-detail-button {
  width: 100%;
  margin-top: 14px;
}

.pattern-admin-grid {
  display: grid;
  gap: 14px;
}

.pattern-admin-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
}

.pattern-admin-card .pattern-image-button {
  height: 100%;
}

.pattern-admin-card img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
}

.pattern-detail-page {
  min-height: 100vh;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.14), transparent 30vw),
    linear-gradient(145deg, #eef5ff 0%, #fbfdff 52%, #eefaf5 100%);
}

.pattern-detail-shell {
  max-width: 1220px;
  margin: 0 auto;
}

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

.pattern-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
}

.pattern-large-image,
.pattern-detail-info {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 56px rgba(29, 47, 77, 0.12);
  overflow: hidden;
}

.pattern-large-image {
  display: grid;
  place-items: center;
  min-height: 640px;
  padding: 18px;
}

.pattern-large-image img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 14px;
  object-fit: contain;
}

.pattern-detail-info {
  padding: 22px;
  height: fit-content;
}

.pattern-detail-info h1 {
  margin: 14px 0 10px;
  font-size: 32px;
}

.pattern-detail-info p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.converter-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.mirror-layout {
  grid-template-columns: 380px minmax(0, 1fr);
}

.converter-canvas {
  display: block;
  width: 100%;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
}

.converter-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.selected-bead {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}

.selected-bead i {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 999px;
}

.selected-bead strong,
.selected-bead span {
  display: block;
}

.selected-bead strong {
  font-size: 18px;
}

.selected-bead span {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.5;
}

.selected-bead.empty {
  display: block;
  color: var(--muted);
  text-align: center;
}

.led-debug {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
}

.app-shell.dark .led-debug {
  background: rgba(15, 23, 42, 0.72);
}

.led-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.led-debug-head span,
.led-debug-meta {
  color: var(--muted);
  font-size: 12px;
}

.led-debug-meta {
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.led-debug pre {
  max-height: 180px;
  overflow: auto;
  margin: 10px 0 0;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.08);
  padding: 10px;
  color: var(--text);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
}

.bead-usage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.bead-usage button {
  display: grid;
  grid-template-columns: 22px minmax(44px, 1fr) minmax(56px, auto);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--text);
  background: #f8fbff;
  box-shadow: none;
  text-align: left;
}

.bead-usage button:hover,
.bead-usage button.active {
  border-color: var(--primary);
  background: #eaf1ff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.12);
  transform: none;
}

.bead-usage i {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}

.bead-usage strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bead-usage span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .app-shell.collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 12px;
    overflow: visible;
  }

  .app-shell.collapsed .sidebar {
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 14px 12px;
  }

  .sidebar .brand {
    min-height: auto;
    padding: 0 4px 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
  }

  .app-shell.collapsed .sidebar .brand > div:not(.brand-mark) {
    display: block;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text);
    background: #eef2f7;
    box-shadow: none;
  }

  .app-shell.dark .mobile-menu-button {
    color: var(--text);
    background: #263449;
  }

  .side-nav,
  .sidebar-footer {
    display: none;
  }

  .app-shell.mobile-open .side-nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .nav-group {
    min-width: 160px;
    margin-bottom: 0;
    scroll-snap-align: start;
  }

  .app-shell.collapsed .nav-group {
    display: block;
  }

  .app-shell.collapsed .nav-group h3,
  .app-shell.collapsed .nav-button {
    color: inherit;
    font-size: inherit;
    text-indent: 0;
  }

  .app-shell.collapsed .nav-button::before,
  .app-shell.collapsed .nav-group h3::before {
    content: none;
  }

  .app-shell.mobile-open .sidebar-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
    padding-top: 10px;
  }

  .nav-button {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .workspace {
    min-height: auto;
  }

  .topbar {
    position: static;
    min-height: auto;
    padding: 14px 16px;
  }

  .page-title h2 {
    font-size: 20px;
  }

  .page-title p {
    font-size: 13px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .top-actions select,
  .account-pill,
  .top-button-group {
    width: 100%;
    flex: auto;
  }

  .top-button-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .top-button-group button {
    min-width: 0;
    padding: 10px 8px;
    white-space: normal;
  }

  .stats,
  .frontdesk-summary,
  .grid.two,
  .grid.three,
  .form-row,
  .qr-export-tools,
  .console-grid {
    grid-template-columns: 1fr;
  }

  .qr-logo-preview {
    width: 100%;
    height: 112px;
  }

  .stats,
  .frontdesk-summary,
  .seat-grid,
  .frontdesk-grid,
  .scan-grid,
  .pattern-grid {
    gap: 12px;
  }

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

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

  .section-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .market-page {
    padding: 14px;
  }

  .market-hero,
  .market-layout,
  .inventory-layout,
  .pattern-admin-card,
  .pattern-detail-layout,
  .converter-layout {
    grid-template-columns: 1fr;
  }

  .market-hero {
    gap: 14px;
    align-items: stretch;
  }

  .market-hero h1 {
    font-size: 30px;
  }

  .market-layout {
    gap: 14px;
  }

  .pattern-detail-page {
    padding: 14px;
  }

  .pattern-large-image {
    min-height: 320px;
    padding: 10px;
  }

  .market-search {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .inventory-toolbar {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .order-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 14px 14px;
  }

  .color-rank-row {
    grid-template-columns: 22px 48px minmax(90px, 1fr);
  }

  .color-rank-row b {
    grid-column: 3;
    justify-self: end;
    margin-top: -4px;
  }

  .inventory-table input {
    width: 96px;
  }

  .inventory-series-list {
    padding: 14px;
  }

  .inventory-series-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .inventory-color-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .inventory-color-row label {
    grid-column: span 3;
  }

  .inventory-color-row .badge {
    justify-self: end;
  }

  .inventory-lookup {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-lookup-stats {
    justify-content: flex-start;
  }

  .inventory-log-row {
    grid-template-columns: 1fr;
  }

  .inventory-log-row button {
    width: 100%;
  }

  .restock-row {
    grid-template-columns: 24px 24px minmax(0, 1fr);
  }

  .restock-row > div {
    grid-column: 3;
  }

  .restock-row label:not(.restock-select) {
    grid-column: span 3;
  }

  .restock-head-actions {
    justify-content: flex-start;
  }

  .restock-actions button,
  .shipment-card button {
    width: 100%;
  }

  .main {
    padding: 16px;
  }

  .section-head h2 {
    font-size: 24px;
  }

  .panel-body,
  .panel-head {
    padding: 14px;
  }

  .table-wrap {
    margin: 0 -14px;
    border-radius: 0;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 12px;
  }

  .client-page,
  .auth-page {
    align-items: start;
    padding: 14px;
  }

  .client-panel,
  .auth-panel {
    padding: 18px;
    border-radius: 16px;
  }

  .client-panel h1 {
    font-size: 28px;
  }

  .client-panel .timer {
    font-size: 34px;
  }

  .client-actions,
  .frontdesk-actions,
  .converter-actions {
    grid-template-columns: 1fr;
  }

  .feedback-card {
    grid-template-columns: 1fr;
  }

  .feedback-actions {
    justify-content: stretch;
  }

  .feedback-actions button {
    width: 100%;
  }

  .frontdesk-floorplan {
    min-height: 720px;
  }

  .floorplan-canvas {
    min-width: max(100%, calc(var(--floor-cols, 8) * var(--floor-mobile-cell, 116px)));
    min-height: max(720px, calc(var(--floor-rows, 6) * var(--floor-mobile-cell, 116px)));
    background-size: 28px 28px, 28px 28px, auto;
  }

  .floor-seat {
    width: var(--floor-mobile-seat-size, 84px);
    height: var(--floor-mobile-seat-size, 84px);
  }

  .floor-seat-card {
    width: var(--floor-mobile-seat-size, 84px);
    height: var(--floor-mobile-seat-size, 84px);
    padding: calc(var(--floor-mobile-seat-size, 84px) * 0.08);
  }

  .floor-seat-card strong {
    font-size: var(--floor-mobile-seat-font-size, 20px);
  }

  .floor-seat-card span {
    font-size: var(--floor-mobile-seat-subfont-size, 11px);
  }

  .floor-rule-popover {
    width: 210px;
  }

  .converter-canvas {
    max-height: 58vh;
  }

  .bead-usage {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .selected-bead {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
  }

  .selected-bead i {
    width: 28px;
    height: 28px;
  }

  .pattern-admin-card img {
    min-height: 220px;
  }
}

@media (max-width: 420px) {
  .brand h1 {
    font-size: 17px;
  }

  .brand p {
    font-size: 11px;
  }

  .nav-group {
    min-width: 145px;
  }

  .stat strong,
  .frontdesk-summary strong {
    font-size: 24px;
  }

  .frontdesk-meter {
    display: grid;
    align-items: start;
  }

  .frontdesk-meter strong {
    font-size: 25px;
  }

  .scan-qr {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .qr-code {
    width: 132px;
    height: 132px;
  }
}

/* ===== 统一 Toast 与 确认/输入弹窗 ===== */
.toast-layer {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.app-toast {
  max-width: min(92vw, 440px);
  border-radius: 999px;
  padding: 11px 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(-12px);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
  pointer-events: auto;
}

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

.app-toast.info {
  background: #1e293b;
}

.app-toast.success {
  background: var(--success);
}

.app-toast.error {
  background: var(--danger);
}

.app-dialog-backdrop {
  z-index: 4100;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.app-dialog-backdrop.show {
  opacity: 1;
}

.app-dialog {
  width: min(420px, 100%);
  max-height: none;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.18s ease;
}

.app-dialog-backdrop.show .app-dialog {
  transform: translateY(0) scale(1);
}

.app-dialog-body {
  padding: 22px 22px 4px;
}

.app-dialog-body h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
}

.app-dialog-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
  word-break: break-word;
}

.app-dialog-input {
  margin-top: 14px;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px 20px;
}

.app-dialog-actions button {
  min-width: 88px;
}

@media (max-width: 420px) {
  .app-dialog-actions {
    flex-direction: column-reverse;
  }

  .app-dialog-actions button {
    width: 100%;
  }
}


/* ===== 可访问性：键盘焦点环 ===== */
button:focus-visible,
.nav-button:focus-visible,
a:focus-visible,
[data-view]:focus-visible,
.auth-tabs button:focus-visible,
.app-dialog-actions button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

.app-shell.dark button:focus-visible,
.app-shell.dark .nav-button:focus-visible,
.app-shell.dark a:focus-visible {
  outline-color: rgba(94, 234, 212, 0.6);
}

/* ===== 更丰富的空状态（不影响 .inventory-lookup.empty / .selected-bead.empty） ===== */
.empty:not(.inventory-lookup):not(.selected-bead) {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 44px 24px;
  line-height: 1.6;
}

.empty:not(.inventory-lookup):not(.selected-bead)::before {
  content: "";
  width: 46px;
  height: 46px;
  opacity: 0.6;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%2394a3b8'%20stroke-width%3D'1.5'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M4%207h16M4%207l1.5%2012a2%202%200%200%200%202%201.8h9a2%202%200%200%200%202-1.8L20%207M4%207l2-3h12l2%203M9.5%2012h5'%2F%3E%3C%2Fsvg%3E");
}

/* ============================================================
   侧栏导航重做（图标化 + 更精致的层次）
   ============================================================ */
.sidebar {
  padding: 20px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 62%, #f5f9fd 100%);
}

.app-shell.dark .sidebar {
  background: linear-gradient(180deg, #131f33 0%, #0f1a2b 100%);
}

.nav-group h3 {
  margin: 0 0 8px;
  padding: 0 12px;
  color: #9aa7b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-shell.dark .nav-group h3 {
  color: #7d8da3;
}

.nav-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  margin-bottom: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #4a5568;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  box-shadow: none;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease;
}

.nav-button .nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: #94a3b8;
  transition: color 0.16s ease;
}

.nav-button .nav-icon svg {
  width: 19px;
  height: 19px;
}

.nav-button .nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav-button:hover {
  color: #0f9f8f;
  background: #f1f7f6;
  box-shadow: none;
  transform: none;
}

.nav-button:hover .nav-icon {
  color: #0f9f8f;
}

.nav-button.active {
  color: #0b7d70;
  background: linear-gradient(90deg, #e7faf4, #f2fbf8);
  box-shadow: none;
  transform: none;
}

.nav-button.active .nav-icon {
  color: #0f9f8f;
}

/* 选中态左侧强调条 */
.nav-button.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #14b8a6, #0f9f8f);
  transform: translateY(-50%);
}

.app-shell.dark .nav-button {
  color: #c3d0e0;
}

.app-shell.dark .nav-button .nav-icon {
  color: #8b9cb3;
}

.app-shell.dark .nav-button:hover,
.app-shell.dark .nav-button.active {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.13);
}

.app-shell.dark .nav-button:hover .nav-icon,
.app-shell.dark .nav-button.active .nav-icon {
  color: #5eead4;
}

/* 侧栏 VIP 标记 */
.nav-tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 7px;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.nav-tag.locked {
  color: #94a3b8;
  background: #e8edf4;
}

.app-shell.dark .nav-tag.locked {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.18);
}

.nav-button.locked .nav-label {
  color: inherit;
  opacity: 0.72;
}

.nav-button.locked .nav-icon {
  opacity: 0.6;
}

.sidebar .brand {
  min-height: 60px;
  padding: 0 8px 18px;
  margin-bottom: 16px;
}

.sidebar-footer {
  display: grid;
  gap: 4px;
  padding-top: 12px;
  margin-top: 12px;
}

/* 收起态：只显示图标（替代原先首字文本方案） */
@media (min-width: 761px) {
  .app-shell.collapsed .nav-button {
    justify-content: center;
    width: 48px;
    height: 46px;
    min-height: 46px;
    margin: 0 auto 6px;
    padding: 0;
    color: #4a5568;
    overflow: visible;
    text-indent: 0;
  }

  .app-shell.collapsed .nav-button::before {
    content: none;
  }

  .app-shell.collapsed .nav-button .nav-label,
  .app-shell.collapsed .nav-tag {
    display: none;
  }

  .app-shell.collapsed .nav-button .nav-icon {
    width: 22px;
    flex: 0 0 22px;
  }

  .app-shell.collapsed .nav-button.active::after {
    left: -6px;
  }

  /* 收起态 VIP 专属项右上角小圆点提示 */
  .app-shell.collapsed .nav-button:has(.nav-tag)::before {
    content: "";
    position: absolute;
    top: 7px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #f59e0b;
  }

  .app-shell.collapsed .nav-button.locked:has(.nav-tag)::before {
    background: #cbd5e1;
  }

  .app-shell.collapsed .sidebar-footer .nav-button {
    border: 1px solid var(--line);
    background: rgba(148, 163, 184, 0.07);
  }

  .app-shell.dark .app-shell.collapsed .nav-button {
    color: #c3d0e0;
  }
}

/* ============================================================
   会员（VIP）相关组件
   ============================================================ */
.vip-pill {
  border-color: rgba(245, 158, 11, 0.4);
  color: #b45309;
  background: #fff8ec;
  font-weight: 800;
}

.vip-pill.on {
  border-color: rgba(15, 159, 143, 0.36);
  color: #0b7d70;
  background: #ecfdf7;
}

.vip-pill.soon {
  border-color: rgba(245, 158, 11, 0.5);
  color: #b45309;
  background: #fff7ed;
}

.vip-pill.expired {
  border-color: rgba(189, 44, 44, 0.36);
  color: #bd2c2c;
  background: #fff1f1;
}

.vip-pill.off {
  color: var(--muted);
  background: #f4f7fb;
}

.app-shell.dark .vip-pill {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}

.app-shell.dark .vip-pill.on {
  background: rgba(20, 184, 166, 0.16);
  color: #5eead4;
}

.app-shell.dark .vip-pill.expired {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.vip-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 6px;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
}

.voice-summary-card button.locked {
  color: var(--muted);
  background: #eef2f7;
  cursor: not-allowed;
}

/* 会员专属功能锁定页 */
.vip-lock {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 560px;
  margin: 26px auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 32px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.09);
  text-align: center;
}

.app-shell.dark .vip-lock {
  background: rgba(17, 28, 46, 0.96);
}

.vip-lock-badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #f59e0b, #d97706);
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.3);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.vip-lock h2 {
  margin: 0;
  font-size: 22px;
}

.vip-lock p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.vip-lock-meta {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px 18px;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 20px;
  background: #f8fbff;
  text-align: left;
}

.app-shell.dark .vip-lock-meta {
  background: rgba(11, 18, 32, 0.7);
}

.vip-lock-meta span {
  color: var(--muted);
  font-size: 13px;
}

.vip-lock-meta strong {
  font-size: 14px;
}

.vip-lock-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

/* 会员设置弹窗 */
.vip-dialog {
  width: min(460px, 100%);
}

.vip-dialog-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eef4fb;
}

.app-shell.dark .vip-dialog-toggle {
  background: rgba(11, 18, 32, 0.6);
}

.vip-dialog-toggle button {
  min-height: 40px;
  border-radius: 10px;
  box-shadow: none;
}

.vip-dialog-toggle button.active {
  color: #fff;
  background: var(--primary);
}

.vip-dialog-expiry {
  margin-top: 16px;
  transition: opacity 0.16s ease;
}

.vip-dialog-expiry.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.vip-dialog-expiry label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.vip-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.vip-quick button {
  min-height: 36px;
  padding: 8px 6px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: none;
}

/* ===== 侧栏收起态修正 ===== */
@media (min-width: 761px) {
  /* 分组标题在收起态收缩为一条细分隔线（原 text-indent 方案与 text-align:center 冲突） */
  .app-shell.collapsed .nav-group h3 {
    width: 30px;
    height: 1px;
    margin: 16px auto 12px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    background: var(--line);
    border-radius: 1px;
    font-size: 0;
    line-height: 0;
    text-indent: 0;
  }

  .app-shell.collapsed .nav-group h3::before {
    content: none;
  }

  /* 修正 VIP 圆点位置：清除旧规则 inset:0 残留的 left/bottom */
  .app-shell.collapsed .nav-button:has(.nav-tag)::before {
    left: auto;
    bottom: auto;
    top: 6px;
    right: 7px;
  }
}

/* ===== 深色模式补漏：前台统计卡与语音播报按钮 ===== */
.app-shell.dark .frontdesk-summary div {
  border-color: var(--line);
  background: rgba(17, 28, 46, 0.96);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.voice-summary-card button {
  color: #1f2937;
}

.app-shell.dark .voice-summary-card button {
  color: #e5e7eb;
  background: #263449;
}

.app-shell.dark .voice-summary-card button.active {
  color: #04241c;
  background: #34d399;
}

.app-shell.dark .voice-summary-card button.locked {
  color: #8b9cb3;
  background: rgba(148, 163, 184, 0.16);
}

/* 深色模式下前台统计卡数值（卡片改为深色后需要浅色文字） */
.app-shell.dark .frontdesk-summary strong {
  color: #f8fafc;
}

/* 修正：.frontdesk-summary span{display:block} 会命中嵌套的 VIP 小标签 */
.frontdesk-summary span.vip-tag,
.voice-summary-card span.vip-tag {
  display: inline-flex;
  width: auto;
  margin-left: 6px;
}

/* 保证 hidden 属性对按钮生效（自动排列按钮在非编辑态需隐藏） */
[hidden] {
  display: none !important;
}

/* ============================================================
   座位区域（平面图翻页）
   ============================================================ */
.area-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.app-shell.dark .area-bar {
  background: rgba(11, 18, 32, 0.62);
}

.area-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.area-page-button {
  min-width: 34px;
  padding: 8px 10px;
  font-size: 17px;
  line-height: 1;
}

.area-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--panel);
  font-weight: 800;
  white-space: nowrap;
}

.area-current small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.app-shell.dark .area-current {
  background: #17233a;
}

.area-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 260px;
  min-width: 0;
}

.area-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--text);
  background: var(--panel);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

.area-tab small {
  border-radius: 999px;
  padding: 1px 7px;
  color: var(--muted);
  background: #eef4fb;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.area-tab:hover {
  border-color: rgba(15, 159, 143, 0.5);
  color: #0b7d70;
  background: #f1f7f6;
  box-shadow: none;
  transform: none;
}

.area-tab.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #14b8a6, #0f9f8f);
  box-shadow: 0 8px 18px rgba(15, 159, 143, 0.24);
}

.area-tab.active small {
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
}

.app-shell.dark .area-tab {
  background: #17233a;
}

.app-shell.dark .area-tab small {
  background: rgba(148, 163, 184, 0.18);
}

.area-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.area-bar-actions button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

/* 区域内无座位时的画布提示 */
.floorplan-area-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(340px, 82%);
  transform: translate(-50%, -50%);
  border: 1px dashed #b7c7dd;
  border-radius: 16px;
  padding: 22px 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  line-height: 1.6;
}

.app-shell.dark .floorplan-area-empty {
  border-color: var(--line);
  background: rgba(17, 28, 46, 0.92);
}

/* 座位管理：按区域分组 */
.seat-area-group + .seat-area-group {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.seat-area-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.seat-area-head h4 {
  margin: 0;
  font-size: 16px;
}

.seat-card .seat-area-select {
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .area-bar {
    padding: 12px 14px;
  }

  .area-bar-actions {
    margin-left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .area-tabs {
    flex: 1 1 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .area-tab {
    white-space: nowrap;
  }
}

/* 表单字段级错误提示 */
.field-error {
  display: block;
  margin-top: 2px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

input.invalid,
select.invalid {
  border-color: var(--danger);
}

input.invalid:focus,
select.invalid:focus {
  border-color: var(--danger);
  outline: 3px solid rgba(189, 44, 44, 0.16);
}

.app-shell.dark .field-error,
.auth-panel .field-error {
  color: #e2544f;
}

/* ============================================================
   会员卡密
   ============================================================ */
.vip-card-code,
.vip-card-codes code {
  font: 700 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.04em;
}

.vip-card-fresh {
  border-color: rgba(245, 158, 11, 0.42);
}

.vip-card-fresh .panel-head {
  background: #fff8ec;
}

.app-shell.dark .vip-card-fresh .panel-head {
  background: rgba(245, 158, 11, 0.12);
}

.vip-card-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vip-card-codes code {
  border: 1px dashed #d8b273;
  border-radius: 10px;
  padding: 9px 13px;
  color: #b45309;
  background: #fffbf3;
  user-select: all;
}

.app-shell.dark .vip-card-codes code {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
}

tbody tr.vip-card-used td {
  color: var(--muted);
}

tbody tr.vip-card-used .vip-card-code {
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.8);
}

/* 兑换表单 */
.vip-redeem-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.vip-redeem-form input {
  font: 700 15px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vip-redeem-form button {
  min-height: 42px;
  white-space: nowrap;
}

.vip-redeem-form + .muted {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

/* 会员到期页里的紧凑版兑换框 */
.vip-redeem-inline {
  width: 100%;
  max-width: 420px;
  margin: 4px auto 0;
  text-align: left;
}

.vip-redeem-inline .muted {
  text-align: center;
}

@media (max-width: 760px) {
  .vip-redeem-form {
    grid-template-columns: 1fr;
  }

  .vip-redeem-form button {
    width: 100%;
  }
}

/* 面板头部里的下拉不应占满整行（否则会把同排按钮挤到下一行） */
.panel-actions select {
  width: auto;
  min-width: 118px;
}

/* ===== 授权警告横幅 ===== */
.license-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 24px 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 14px;
  line-height: 1.5;
}

.license-banner-icon {
  flex-shrink: 0;
  font-size: 16px;
}

.app-shell.dark .license-banner {
  background: rgba(154, 52, 18, 0.18);
  border-color: rgba(253, 186, 116, 0.5);
  color: #fdba74;
}

/* ===== 软件更新面板 ===== */
.update-result {
  font-size: 14px;
  line-height: 1.6;
}

.update-result.ok {
  color: #15803d;
}

.update-result.error {
  color: #b91c1c;
}

.update-result.has-update {
  color: inherit;
}

.update-result .update-head {
  font-size: 15px;
  margin-bottom: 6px;
}

.update-result .update-notes {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  white-space: normal;
}

.app-shell.dark .update-result .update-notes {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
}

#applyUpdateBtn {
  margin-top: 4px;
}
