:root {
  --bg: #eef1f6;
  --bg-subtle: #f7f8fb;
  --surface: #ffffff;
  --text: #141820;
  --text-secondary: #4b5563;
  --muted: #8b93a1;
  --line: #e6e9ef;
  --line-strong: #d4d9e2;
  --primary: #3b6cf4;
  --primary-hover: #2f5de0;
  --primary-soft: #edf2ff;
  --primary-ring: rgba(59, 108, 244, 0.18);
  --danger: #e5484d;
  --danger-soft: #fff0f0;
  --ok: #30a46c;
  --ok-soft: #e9f9ef;
  --warn: #f76b15;
  --warn-soft: #fff4e8;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(20, 24, 32, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 24, 32, 0.05);
  --shadow: 0 8px 24px rgba(20, 24, 32, 0.07);
  --shadow-lg: 0 16px 40px rgba(20, 24, 32, 0.12);
  --nav-h: 52px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --sheet-w: 520px;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--nav-h);
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-brand {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f7df7 0%, #3b6cf4 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--primary-ring);
}

.topbar-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title-site {
  font-size: 13px;
  line-height: 1.25;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topbar-user {
  font-size: 12px;
  color: var(--muted);
  max-width: 36vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Layout ── */
.main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 12px calc(var(--tab-h) + var(--safe-b) + 12px);
}

.main.admin-main {
  padding-bottom: 16px;
}

.page-section {
  margin-bottom: 20px;
}

.page-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow-xs);
}

.btn:hover {
  background: var(--bg-subtle);
  border-color: var(--line-strong);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, #4a7af6 0%, var(--primary) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-ring);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #5a86f7 0%, var(--primary-hover) 100%);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--bg-subtle);
}

.btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.login-actions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.orders-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.orders-agent-field {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}

.orders-day-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.order-pick-row {
  padding: 0;
  border: 0;
  cursor: pointer;
}

.text-danger {
  color: var(--danger);
}

/* ── Agent layout ── */
.agent-l1-tabs {
  margin-bottom: 12px;
}

.agent-l2-tabs {
  margin-bottom: 12px;
}

.agent-desktop-only {
  display: none;
}

.list-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.row-card-main {
  flex: 1;
  min-width: 0;
  cursor: default;
}

.day-row .row-card-main {
  cursor: pointer;
}

.day-row .row-card-main:active {
  opacity: 0.85;
}

.row-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.row-card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-card-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.payable-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--danger-soft);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.payable-total strong {
  color: var(--danger);
  font-size: 16px;
}

.day-pick-check,
.order-card-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.orders-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.orders-actions-bar .payable-summary {
  flex: 1;
  margin-bottom: 0;
}

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
}

.btn-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs.pill-tabs {
  background: transparent;
  border: 0;
  padding: 0;
  gap: 8px;
}

.tab {
  flex: 1;
  min-height: 34px;
  padding: 0 12px;
  border-radius: calc(var(--radius) - 3px);
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.pill-tabs .tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.tab.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.pill-tabs .tab.active {
  background: var(--primary-soft);
  border-color: #b8ccff;
  box-shadow: none;
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  min-height: var(--tab-h);
  padding: 6px 12px calc(6px + var(--safe-b));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-soft);
}

.bottom-nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-subtle);
  transition: background 0.15s, color 0.15s;
}

.bottom-nav-item.active .bottom-nav-icon {
  background: var(--primary);
  color: #fff;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.card-compact {
  padding: 14px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.sku-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sku-grid .empty {
  grid-column: 1 / -1;
}

.sku-product-card {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}

.sku-product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, #7aa2ff 100%);
  opacity: 0.85;
}

.sku-product-card:hover {
  box-shadow: var(--shadow);
}

.card-compact-head {
  flex: 1;
}

.card-compact .list-row-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.card-compact .list-row-sub {
  font-size: 12px;
  margin-top: 3px;
}

.card-compact-remain {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
}

.card-compact-remain strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.card-compact-btn {
  margin-top: 12px;
  min-height: 36px;
}

.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.agent-admin-card .list-row-title {
  font-size: 16px;
}

.agent-admin-card .list-row-sub {
  margin-top: 4px;
}

@media (min-width: 768px) {
  .sku-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ── Stats ── */
.stat {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.stat-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.badge-ok {
  background: var(--ok-soft);
  color: #18794e;
}

.badge-warn {
  background: var(--warn-soft);
  color: #bd4b00;
}

.badge-muted {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--line);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-ore {
  background: #e8f2ff;
  color: #1d5fd8;
}

.badge-blueprint {
  background: #e9f9ef;
  color: #18794e;
}

.badge-other {
  background: var(--warn-soft);
  color: #b45309;
}

.agent-l3-tabs {
  margin-top: -4px;
  margin-bottom: 8px;
}

.sku-sheet-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border-radius: 8px;
}

.denom-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.denom-stepper-row:last-child {
  border-bottom: 0;
}

.denom-label {
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

/* ── Lists ── */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.list-row-main {
  flex: 1;
  min-width: 0;
}

.list-row-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.list-row-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.list-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* ── Forms ── */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.field input:disabled {
  background: var(--bg-subtle);
  color: var(--muted);
}

.field textarea {
  min-height: 72px;
  resize: vertical;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th,
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

table.data th {
  background: var(--bg-subtle);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
}

table.data tr:last-child td {
  border-bottom: 0;
}

.empty {
  text-align: center;
  padding: 20px 12px;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}

/* ── Login ── */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59, 108, 244, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(59, 108, 244, 0.08) 0%, transparent 50%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f7df7 0%, #3b6cf4 100%);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--primary-ring);
}

.login-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-brand p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

/* ── Chips ── */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-xs);
}

.chip.active {
  border-color: #b8ccff;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.denoms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.denom-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}

.denom-row input {
  width: 100%;
  min-height: 36px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.code-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.code-text {
  flex: 1;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  letter-spacing: 0.02em;
}

/* ── Overlay / Sheet ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 24, 32, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.2s ease;
}

.overlay.center {
  align-items: center;
  padding: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet {
  width: 100%;
  max-width: var(--sheet-w);
  max-height: 92dvh;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 8px 18px calc(18px + var(--safe-b));
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

.overlay.center .sheet {
  border-radius: var(--radius-xl);
  width: min(100%, var(--sheet-w));
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  margin: 6px auto 12px;
}

.overlay.center .sheet-handle {
  display: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sheet-body {
  font-size: 14px;
}

.sheet-foot {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sheet-foot .btn {
  flex: 1;
}

/* ── Toast ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  transform: translateX(-50%);
  z-index: 200;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 24, 32, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
}

/* ── Admin ── */
.admin-nav {
  margin-bottom: 18px;
}

.payable-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 8px 0;
}

.payable-line strong {
  color: var(--danger);
  font-size: 15px;
}

.payable-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--danger-soft);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}

.payable-summary.compact {
  margin-bottom: 8px;
}

.payable-summary strong {
  color: var(--danger);
  font-size: 16px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.check-row-main {
  flex: 1;
  min-width: 0;
}

.check-row-qty {
  width: 64px;
  min-height: 36px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.price-input {
  width: 88px;
  min-height: 36px;
  text-align: right;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 8px;
}

.sku-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.sku-stat-item {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.sku-stat-item strong {
  display: block;
  font-size: 16px;
  color: var(--text);
  margin: 2px 0;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.limit-input {
  width: 64px;
  min-height: 34px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.limit-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* ── Stepper ── */
.stepper-row {
  margin-bottom: 0;
}

.stepper-row .stepper {
  flex-shrink: 0;
}

.recharge-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.recharge-panel .orders-agent-field {
  margin-bottom: 8px;
}

.recharge-panel .chip-group {
  margin-top: 4px;
}

.stepper-main {
  flex: 1;
  min-width: 0;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s, transform 0.1s;
}

.stepper-btn:hover:not(:disabled) {
  background: var(--primary-soft);
  color: var(--primary);
}

.stepper-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.stepper-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

.stepper-val {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

/* ── Day groups ── */
.day-group {
  margin-bottom: 8px;
}

.day-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-xs);
}

.day-group-head:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.day-group-head:active {
  transform: scale(0.99);
}

.day-group-head::after {
  content: "›";
  font-size: 20px;
  color: var(--muted);
  line-height: 1;
}

.day-group-head strong {
  color: var(--danger);
  font-size: 15px;
}

/* ── Product price row ── */
.price-row-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.price-row-card .price-display {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

/* ── Order card ── */
.order-card {
  transition: box-shadow 0.15s;
}

.order-card:hover {
  box-shadow: var(--shadow);
}

.order-card-check {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ── Recharge panel ── */
.recharge-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

/* ── Responsive ── */
@media (min-width: 768px) {
  .main {
    padding-top: 24px;
  }

  .bottom-nav {
    display: none;
  }

  .main.has-agent-tabs {
    padding-bottom: 24px;
  }

  .agent-desktop-only {
    display: flex !important;
  }

  .agent-l1-bottom {
    display: none;
  }

  .overlay {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    border-radius: var(--radius-xl);
  }

  .denoms {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .toast {
    bottom: 24px;
  }
}

@media (max-width: 767px) {
  .agent-desktop-only {
    display: none !important;
  }

  .hide-mobile {
    display: none !important;
  }

  table.data .col-hide-sm {
    display: none;
  }

  .admin-nav .tab {
    font-size: 12px;
    padding: 0 8px;
  }
}

@media (min-width: 768px) {
  .admin-layout .main {
    max-width: 1100px;
  }
}
