: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;
  --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 {
  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 {
  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 .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;
}

.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;
}

.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;
}

.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.reserved {
  border-color: rgba(179, 92, 0, 0.3);
  background: linear-gradient(180deg, #fff8ed, #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.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;
}

.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,
  .console-grid {
    grid-template-columns: 1fr;
  }

  .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;
  }

  .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;
  }
}
