/* ════════════════════════════════════════════════
   金色传说 ERP · SPA Design System
   完整旧系统金色品牌主题 + 新系统SPA布局
   ════════════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #b8860b;
  --gold-2: #d4af37;
  --gold-soft: #f3e7c8;
  --gold-dark: #a1740a;
  --ink: #26211a;
  --bg: #f5f2ea;
  --card: #ffffff;
  --line: #e6ddca;
  --red: #d43a2f;
  --green: #2e7d32;
  --blue: #1565c0;
  --muted: #8a8172;
  --dark: #1d1812;
  --orange: #e65100;
  /* Aliases for backward compatibility with view code */
  --primary: var(--gold);
  --border: var(--line);
  --danger: var(--red);
  --text: var(--ink);
  --text-light: var(--muted);
  --text-dark: var(--ink);
  --accent: var(--gold-2);
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 4px rgba(60,50,30,.06);
  --shadow-md: 0 4px 12px rgba(60,50,30,.1);
  --shadow-lg: 0 10px 30px rgba(60,50,30,.15);
  --sidebar-bg: #fff;
  /* P1-10: Type Scale (4px基准) */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  /* P1-10: 统一圆角3档 */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
/* Base button reset — use .btn class for styled buttons */
button { cursor: pointer; font-family: inherit; }
input[type="text"], input[type="tel"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 13px; background: #fff; color: var(--ink);
  font-family: inherit; transition: all .15s;
}
input[type="checkbox"], input[type="radio"], input[type="file"] { width: auto; padding: 0; border: none; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(184,134,11,.35); border-color: var(--gold); }
table { border-collapse: collapse; width: 100%; }
.loading { text-align: center; padding: 48px; color: var(--muted); }

/* ── Utility ──────────────────────────────── */
.muted { color: var(--muted); font-size: 13px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.right-align, .num { text-align: center; }
.center-align { text-align: center; }
.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px; }

/* ── Layout: SPA ──────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: #fff; color: var(--ink);
  position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 100;
  box-shadow: 1px 0 4px rgba(0,0,0,.06);
  border-right: 1px solid var(--line);
}
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--topbar-h); background: var(--dark); color: #f3ead7;
  border-bottom: 1px solid rgba(184,134,11,.15);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.topbar-brand { font-weight: 700; color: var(--gold-2); letter-spacing: 1px; white-space: nowrap; font-size: 15px; }
.topbar-brand small { color: #b7a98c; font-weight: 400; margin-left: 6px; font-size: 11px; }
.topbar-title { font-weight: 700; font-size: 15px; color: var(--gold-2); letter-spacing: .5px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-name { font-size: 13px; color: #b7a98c; }
.btn-logout { background: transparent; color: #b7a98c; padding: 6px 14px; font-size: 13px; border: none; }
.btn-logout:hover { color: var(--red); }
.content { padding: 20px 24px; flex: 1; overflow-y: auto; width: 100%; }

/* ── Layout: Old system (container / grid / card) ──── */
.container { max-width: none; margin: 0; padding: 0 24px 48px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow);
}
.card + .card, .card + .grid, .grid + .card { margin-top: 12px; }
.card h2 { font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h2::before { content: ""; width: 5px; height: 16px; border-radius: 3px; background: var(--gold-2); }
.card h3 { font-size: 14px; margin: 12px 0 6px; color: #5a4f3c; }

/* ── Sidebar ──────────────────────────────── */
.sidebar-brand {
  padding: 16px 20px; font-size: 17px; font-weight: 700;
  color: var(--gold); letter-spacing: 1px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--gold-soft) 0%, #fff 100%);
}
.sidebar-brand small { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 11px; }
.nav-group { padding: 4px 0; }
.nav-group-title {
  padding: 12px 20px 4px; font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; font-size: 13px; color: var(--ink);
  transition: all .15s; cursor: pointer; position: relative;
}
.nav-item:hover { background: var(--gold-soft); color: var(--gold); }
.nav-item.active { background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); border-radius: 0 2px 2px 0; }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }

/* ── Login ────────────────────────────────── */
.login-wrap {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg,#1d1812 0%,#241d12 50%,#0f0b06 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ''; position: absolute; width: 500px; height: 500px;
  background: radial-gradient(circle,rgba(212,175,55,.12) 0%,transparent 70%);
  top: -150px; right: -80px; border-radius: 50%;
}
.login-card {
  background: #fff; padding: 44px; border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 380px;
  text-align: center; position: relative; z-index: 1;
}
.login-card h1 {
  font-size: 26px; background: linear-gradient(135deg,#1d1812,#b8860b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 6px; font-weight: 800;
}
.login-subtitle { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.btn-login {
  background: var(--gold); border: 1px solid var(--gold); color: #fff;
  padding: 12px; font-size: 15px; margin-top: 8px;
  border-radius: var(--radius-sm); font-weight: 600;
}
.btn-login:hover { background: var(--gold-dark); }
.login-hint { margin-top: 20px; font-size: 12px; color: var(--muted); }

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: var(--radius-sm); padding: 7px 14px;
  font-size: 13px; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn-primary, .btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-primary:hover, .btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-warning { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-warning:hover { opacity: .9; }
.btn-reverse { background: #fff3e0; color: var(--orange); border: 1px solid #ffcc80; }
.btn-reverse:hover { background: #ffe0b2; }
.btn-dark { background: var(--dark); border-color: var(--dark); color: #f3ead7; }
.btn-dark:hover { opacity: .88; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(197,162,99,0.05); }
.btn-outline.active { border-color: var(--gold); color: var(--gold); background: rgba(197,162,99,0.1); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ── Forms ────────────────────────────────── */
.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-label { font-size: 12px; color: #5a4f3c; font-weight: 600; }
.form-label .required { color: var(--red); }
.form-input input, .form-input select, .form-input textarea { width: 100%; }
.form-input textarea { resize: vertical; min-height: 60px; }
/* Old system forms */
.form-row { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.form-row label { font-size: 12px; color: #5a4f3c; font-weight: 600; }
.form-row label .req { color: var(--red); }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .form-2col { grid-template-columns: 1fr; } }

/* ── DataTable (new SPA, aligned with old .tbl) ──── */
.datatable-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.datatable { font-size: 13px; table-layout: auto; width: max-content; min-width: 100%; }
.datatable thead { background: #fafafa; }
.datatable thead th { position: sticky; top: 0; z-index: 10; background: #fafafa; }
.datatable th { padding: 10px 12px; text-align: center; font-weight: 600; color: #5a4f3c; border: none; border-bottom: 2px solid var(--line); white-space: nowrap; vertical-align: middle; }
.datatable th.sortable { cursor: pointer; user-select: none; }
.datatable th.sortable:hover { color: var(--gold); }
.datatable th.sorted-asc::after { content: ' ↑'; }
.datatable th.sorted-desc::after { content: ' ↓'; }
.datatable td { padding: 8px 12px; border: none; border-bottom: 1px solid #f5f0e8; white-space: nowrap; vertical-align: middle; text-align: center; }
.datatable td input[type="text"], .datatable td input[type="number"], .datatable td select { height: 28px; box-sizing: border-box; vertical-align: middle; }
.datatable td select.cell { padding: 2px 4px; }
.datatable tr[data-entry-id] { position: relative; }
.datatable tr[data-entry-id]:has(select.cell) { z-index: 20; position: relative; background: #fffbee !important; }
.datatable tr[data-entry-id]:has(select.cell) td { background: #fffbee !important; }
.datatable td:last-child, .tbl td:last-child { white-space: nowrap; }
.datatable tbody tr:nth-child(even) td { background: #fdfcf8; }
.datatable tbody tr:hover td { background: #fef8e8; box-shadow: inset 3px 0 0 var(--gold); }
.datatable tbody tr:hover td:first-child { border-radius: 0; }
.datatable tr.selected td { background: var(--gold-soft) !important; }
.datatable tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: none; background: #fafafa; color: var(--ink); }
.col-check { width: 44px; text-align: center; }
.col-action { text-align: center; white-space: nowrap; }
.empty-row { text-align: center; padding: 36px; color: var(--muted); }

/* ── Action Bar (filter left + actions right) ── */
.action-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.action-bar .filter-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex: 1; }
.action-bar .btn-group { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── Button Group (overflow actions) ─────── */
.btn-dropdown { position: relative; display: inline-block; }
.btn-dropdown-menu { position: absolute; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); min-width: 140px; z-index: 100; display: none; }
.btn-dropdown-menu.show { display: block; }
.btn-dropdown-menu button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--ink); }
.btn-dropdown-menu button:hover { background: var(--gold-soft); color: var(--gold); }

/* ── Read-only form field ─────────────────── */
.form-readonly input, .form-readonly select { background: #f5f3ed; color: var(--muted); }
.form-readonly { position: relative; }
.form-readonly::after { content: '自动'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--gold); background: var(--gold-soft); padding: 1px 6px; border-radius: 4px; pointer-events: none; }

/* ── Empty State ──────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state .es-icon { font-size: 42px; margin-bottom: 12px; opacity: .35; }
.empty-state .es-text { font-size: 14px; color: var(--muted); margin-bottom: 12px; }

/* ── Stat Trend ───────────────────────────── */
.stat-trend { font-size: 12px; margin-top: 4px; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }
.stat-trend.flat { color: var(--muted); }

/* ── Product Thumb Placeholder ────────────── */
.prod-thumb-auto { width: 36px; height: 36px; border-radius: 6px; background: linear-gradient(135deg, var(--gold-soft), var(--gold-2)); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #5a4f3c; flex-shrink: 0; }

/* ── Sub Tab (capsule style) ───────────────── */
.sub-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.sub-tab { padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; transition: all .15s; }
.sub-tab.active { background: var(--gold); color: #fff; border-color: var(--gold); font-weight: 600; }
.sub-tab:hover:not(.active) { border-color: var(--gold); color: var(--gold); }

/* ── Table (old system .tbl) ─────────────── */
.table-wrap { overflow-x: auto; }
table.tbl { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
.tbl th, .tbl td { border: none; border-bottom: 1px solid #f5f0e8; padding: 8px 12px; text-align: left; white-space: nowrap; vertical-align: middle; }
.tbl th { background: #fafafa; color: #5a4f3c; font-weight: 600; border-bottom: 2px solid var(--line); }
.tbl tr:nth-child(even) td { background: #fdfcf8; }
.tbl tr:hover td { background: var(--gold-soft); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .hl { background: #fff3bf !important; }
.tbl input.cell, .tbl select.cell { width: 100%; padding: 4px 6px; font-size: 13px; margin: 0; }

/* ── Pagination ───────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px; border-top: 1px solid var(--line); }
.page-btn { background: #fff; border: 1px solid var(--line); padding: 6px 18px; border-radius: 8px; font-size: 13px; color: var(--ink); }
.page-btn:hover:not(:disabled) { background: var(--gold); color: #fff; border-color: var(--gold); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-info { font-size: 13px; color: var(--muted); }

/* ── StatCards (new SPA) ──────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); border-left: 3px solid var(--gold-2);
  transition: all .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.stat-green { border-left-color: var(--green); }
.stat-card.stat-red { border-left-color: var(--red); }
.stat-card.stat-orange { border-left-color: var(--orange); }
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--gold); letter-spacing: -.5px; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── Stat (old system) ───────────────────── */
.stat { text-align: center; padding: 16px; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--gold); }
.stat-bar { display: flex; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat-bar .sb-item { flex: 1; min-width: 90px; padding: 12px 8px; text-align: center; border-right: 1px solid var(--line); text-decoration: none; color: inherit; transition: background .15s; display: block; }
.stat-bar .sb-item:last-child { border-right: none; }
.stat-bar .sb-item:hover { background: #fffbf0; }
.stat-bar .sb-num { font-size: 26px; font-weight: 800; color: var(--gold); line-height: 1.1; }
.stat-bar .sb-num.red { color: var(--red); }
.stat-bar .sb-num.green { color: var(--green); }
.stat-bar .sb-label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat-bar .sb-sub { font-size: 9px; color: var(--muted); margin-top: 1px; }

/* ── FilterBar ────────────────────────────── */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-search { min-width: 140px; width: auto !important; flex: 0 1 180px; }
.filter-select { min-width: 100px; width: auto !important; }
.filter-date { min-width: 130px; width: auto !important; max-width: 150px; }
.filter-number { min-width: 90px; width: auto !important; max-width: 120px; }
.filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="date"], .filter-bar input[type="number"] { width: auto !important; }
.filter-bar .btn { width: auto !important; padding: 6px 14px; white-space: nowrap; }

/* ── Modal ────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,16,10,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fadeIn .15s ease; }
.modal { background: #fff; border-radius: var(--radius); max-width: 90vw; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0,0,0,.3); animation: modalIn .2s ease; }
.modal-small { width: 420px; }
.modal-large { width: 760px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.modal-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-header h3::before { content: ''; width: 5px; height: 16px; border-radius: 3px; background: var(--gold-2); }
.modal-close { border: none; background: none; font-size: 24px; color: var(--muted); cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 10px 18px; border-top: 1px solid var(--line); }
/* Old system modal */
.modal-mask { position: fixed; inset: 0; background: rgba(20,16,10,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask .modal { width: min(880px, 96vw); max-height: 88vh; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 16px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
/* Header mapping row */
.map-row { display: grid; grid-template-columns: 1fr 28px 1fr; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.map-row .file-col { font-weight: 600; font-size: 14px; word-break: break-all; }
.map-row .map-arrow { text-align: center; color: var(--muted); }
.map-row select { width: 100%; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ── 动效体系 (参照抖店等现象级产品) ──────────── */
/* 页面切换：淡入 + 轻微上移 */
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-enter { animation: pageIn .3s ease; }

/* Tab 内容切换：淡入 */
@keyframes tabFadeIn { from { opacity: 0; } to { opacity: 1; } }
.tab-enter { animation: tabFadeIn .25s ease; }

/* Toast：从底部滑入 */
@keyframes toastIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(16px) scale(.96); } }
.toast { animation: toastIn .3s cubic-bezier(.22,1,.36,1); }
.toast.removing { animation: toastOut .25s ease forwards; }

/* 下拉菜单：滑入展开 */
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px) scaleY(.96); } to { opacity: 1; transform: translateY(0) scaleY(1); } }
.btn-dropdown-menu.show { display: block; animation: dropIn .18s ease; transform-origin: top right; }

/* 表格行：逐行渐入 */
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.datatable tbody tr { animation: rowIn .3s ease backwards; }
.datatable tbody tr:nth-child(1) { animation-delay: .02s; }
.datatable tbody tr:nth-child(2) { animation-delay: .04s; }
.datatable tbody tr:nth-child(3) { animation-delay: .06s; }
.datatable tbody tr:nth-child(4) { animation-delay: .08s; }
.datatable tbody tr:nth-child(5) { animation-delay: .10s; }
.datatable tbody tr:nth-child(6) { animation-delay: .12s; }
.datatable tbody tr:nth-child(7) { animation-delay: .14s; }
.datatable tbody tr:nth-child(8) { animation-delay: .16s; }
.datatable tbody tr:nth-child(9) { animation-delay: .18s; }
.datatable tbody tr:nth-child(10) { animation-delay: .20s; }
.datatable tbody tr:nth-child(n+11) { animation-delay: .22s; }

/* 骨架屏 Shimmer */
@keyframes shimmer { 0% { background-position: -468px 0; } 100% { background-position: 468px 0; } }
.skel-cell {
  height: 16px; border-radius: 6px;
  background: linear-gradient(90deg, #f0ece0 8%, #faf8f2 18%, #f0ece0 33%);
  background-size: 800px 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel-row td { padding: 12px; }
.skel-cell.w-60 { width: 60%; } .skel-cell.w-40 { width: 40%; } .skel-cell.w-30 { width: 30%; } .skel-cell.w-20 { width: 20%; }

/* Spinner 旋转加载圈 */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--gold-soft);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px; }
.spinner-text { color: var(--muted); font-size: 13px; }

/* 按钮按压反馈 */
.btn:active, .btn-login:active, .page-btn:active, .nav-item:active { transform: scale(.97); }
.btn { transition: all .15s, transform .08s; }

/* 卡片悬停增强 */
.stat-card, .quick-link, .mod-card, .card { transition: all .2s cubic-bezier(.22,1,.36,1); }
.stat-card:hover, .quick-link:hover, .mod-card:hover { transition: all .2s cubic-bezier(.22,1,.36,1); }

/* 数字滚动动画容器 */
.count-up { display: inline-block; transition: opacity .3s; }

/* 增强空状态：图标 + 文字 + CTA */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state .es-icon { font-size: 40px; margin-bottom: 12px; opacity: .3; filter: grayscale(.6); }
.empty-state .es-text { font-size: 15px; color: var(--muted); margin-bottom: 16px; }
.empty-state .es-action { display: inline-flex; gap: 8px; }
.empty-row { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-row .es-icon { font-size: 40px; opacity: .25; display: block; margin-bottom: 8px; }

/* 加载态增强：带 spinner */
.loading { text-align: center; padding: 48px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ── TabSwitcher (new SPA) ────────────────── */
.tab-switcher { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: nowrap; overflow-x: auto; }
.tab-item { padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 600; transition: all .15s; white-space: nowrap; }
.tab-item.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-item:hover { color: var(--gold); }
/* Old system tabs */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: none; background: none; padding: 9px 16px; font-size: 14px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; font-family: inherit; }
.tabs button.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 700; }
/* Dashboard tab-bar */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--line); background: #fff; border-radius: 12px 12px 0 0; padding: 0 8px; }
.tab-bar .tab { padding: 12px 20px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .12s; user-select: none; }
.tab-bar .tab:hover { color: var(--ink); }
.tab-bar .tab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
/* Dimension tabs */
.dim-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.dim-tab { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; transition: all .15s; }
.dim-tab.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.dim-tab:hover:not(.active) { border-color: var(--gold); color: var(--gold); }
/* Series tabs */
.series-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.series-tab { padding: 5px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; }
.series-tab.active { background: var(--gold-soft); border-color: var(--gold-2); color: var(--gold); font-weight: 600; }
.series-bulk-btn { margin-left: auto; padding: 5px 12px; border-radius: 8px; background: var(--gold); color: #fff; border: none; cursor: pointer; font-size: 13px; }
.series-bulk-btn:hover { opacity: .9; }

/* ── ProgressBar ──────────────────────────── */
.progress-bar-wrap { position: relative; width: 100%; height: 28px; background: var(--line); border-radius: 14px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 14px; transition: width .4s; }
.progress-bar.progress-achieved { background: linear-gradient(90deg,#2e7d32,#4caf50); }
.progress-bar.progress-on_track { background: linear-gradient(90deg,#b8860b,#d4af37); }
.progress-bar.progress-behind { background: linear-gradient(90deg,#e65100,#f57c00); }
.progress-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ink); }
.no-target { color: var(--muted); font-size: 13px; }

/* ── Toast ────────────────────────────────── */
.toast-container { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(20,16,10,.92); color: #fff; padding: 10px 22px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px; }
.toast::before { font-size: 16px; }
.toast-info::before { content: 'ℹ️'; }
.toast-success::before { content: '✅'; }
.toast-error::before { content: '❌'; }
.toast-warning::before { content: '⚠️'; }

/* ── Tags & Badges ────────────────────────── */
.tag { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; min-width: 36px; text-align: center; }
.tag-achieved { background: #e8f4e9; color: var(--green); }
.tag-on_track { background: var(--gold-soft); color: #7a5b06; }
.tag-behind { background: #fff3e0; color: var(--orange); }
.tag-missed { background: #fdecea; color: var(--red); }
.tag-no_target { background: #f0f0f0; color: #888; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; min-width: 36px; text-align: center; }
.badge-red { background: #fdecea; color: var(--red); }
.badge-green { background: #e8f4e9; color: var(--green); }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.dot-red { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(212,58,47,.15); }
/* Status badge */
.status-badge { padding: 2px 10px; border-radius: 999px; font-size: 12px; cursor: pointer; border: none; }
.status-badge.draft { background: #eee; color: #888; }
.status-badge.confirmed { background: #e8f5e9; color: var(--green); border: 1px solid #c8e6c9; }

/* ── Notes ────────────────────────────────── */
.note { background: #fffbe8; border: 1px solid #efe0a0; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #6b5d2a; }
.note b { color: #57480f; }
.note-src { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Hero ─────────────────────────────────── */
.hero { background: linear-gradient(120deg,#241d12,#4a3a17); color: #f6efdd; border-radius: var(--radius); padding: 20px 28px; border: none; }
.hero h1 { font-size: 20px; margin-bottom: 6px; }
.hero p { color: #d8cba9; font-size: 13px; max-width: 760px; }
.hero .tag { display: inline-block; background: rgba(212,175,55,.18); color: var(--gold-2); border: 1px solid rgba(212,175,55,.45); border-radius: 999px; padding: 2px 10px; font-size: 11px; margin: 6px 6px 0 0; }

/* ── Module Entry Card ────────────────────── */
.mod-card { display: block; transition: transform .15s, box-shadow .15s; }
.mod-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(60,50,30,.14); }
.mod-card .icon { width: 42px; height: 42px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.mod-card h3 { font-size: 16px; color: var(--ink); margin: 0 0 6px; }
.mod-card p { font-size: 13px; color: var(--muted); }

/* ── Quick Link (new SPA) ─────────────────── */
.quick-link { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); color: var(--ink); transition: all .15s; }
.quick-link:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(60,50,30,.12); color: var(--gold); border-color: var(--gold-2); }
.quick-link .icon { width: 32px; height: 32px; border-radius: 8px; background: var(--gold-soft); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }

/* ── Section Title ────────────────────────── */
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--line); display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 5px; height: 16px; border-radius: 3px; background: var(--gold-2); }

/* ── Link ─────────────────────────────────── */
.link { color: var(--blue); cursor: pointer; font-weight: 600; white-space: nowrap; }
.link:hover { text-decoration: underline; }

/* ── Toolbar ─────────────────────────────── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.code-box { background: linear-gradient(135deg, var(--dark), #3a2f1a); color: var(--gold-2); padding: 8px 14px; border-radius: 8px; font-family: "Courier New", monospace; font-size: 14px; display: inline-block; font-weight: 700; border: 1px solid rgba(184,134,11,.2); box-shadow: 0 2px 6px rgba(20,16,10,.15); }

/* ── Placeholder & Error ──────────────────── */
.placeholder { text-align: center; padding: 60px; color: var(--muted); }
.placeholder h2 { font-size: 18px; margin-bottom: 8px; color: #5a4f3c; }
.error { padding: 20px; background: #fdecea; color: var(--red); border-radius: var(--radius); border: 1px solid #e6c4c0; font-weight: 600; }

/* ── Product Management ───────────────────── */
.prod-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--bg); flex-shrink: 0; }
.prod-thumb-upload { cursor: pointer; position: relative; display: inline-flex; align-items: center; justify-content: center; }
.prod-thumb-upload:hover::after { content: '📷'; position: absolute; bottom: -2px; right: -2px; font-size: 11px; background: var(--gold); border-radius: 50%; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; }
.prod-thumb-placeholder { width: 48px; height: 48px; border-radius: 8px; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
.img-upload { display: flex; gap: 12px; align-items: flex-start; }
.img-preview-box { width: 100px; height: 100px; border-radius: 10px; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; background: var(--bg); flex-shrink: 0; }
.img-preview-box img { width: 100%; height: 100%; object-fit: cover; }
.img-preview-box:hover { border-color: var(--gold-2); }

/* ── Role Bar ─────────────────────────────── */
.role-bar { display: flex; gap: 8px; align-items: center; padding: 8px 0; }
.role-bar select { width: auto; min-width: 120px; }
.role-bar .role-desc { font-size: 12px; color: var(--muted); }
.role-bar .role-btn { padding: 6px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #5a4f3c; cursor: pointer; font-size: 13px; font-family: inherit; transition: all .15s; }
.role-bar .role-btn:hover { border-color: var(--gold); color: var(--gold); }
.role-bar .role-btn.active { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }

/* ── Message List ─────────────────────────── */
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-item { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold-2); border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: background .15s; }
.msg-item:hover { background: #fdfaf2; }
.msg-item.unread { border-left-color: var(--red); background: #fff5f5; }
.msg-item .msg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.msg-item .msg-head b { font-size: 14px; }
.msg-item .msg-time { font-size: 11px; color: var(--muted); }
.msg-item .msg-body { font-size: 13px; color: #5a4f3c; }

/* ── Store Stat Card ──────────────────────── */
.store-stat-card h3 { margin: 0 0 2px; }
.store-stat-card .ss-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.store-stat-card .ss-item { text-align: center; padding: 8px 4px; background: var(--bg); border-radius: 8px; }
.store-stat-card .ss-item b { display: block; font-size: 22px; color: var(--gold); font-weight: 800; line-height: 1.3; }
.store-stat-card .ss-item span { font-size: 11px; color: var(--muted); }

/* ── Category Management ──────────────────── */
.cat-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; background: var(--gold-soft); color: #7a5b06; font-size: 13px; margin: 0 8px 10px 0; border: 1px solid #e5d5ab; }
.cat-chip small { color: var(--muted); }
.cat-chip button { border: none; background: none; cursor: pointer; color: inherit; font-size: 12px; padding: 0 2px; opacity: .65; }
.cat-chip button:hover { opacity: 1; }
.cat-tag { display: inline-block; padding: 2px 11px; border-radius: 999px; background: var(--gold-soft); color: #7a5b06; font-size: 12px; white-space: nowrap; }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; box-shadow: 0 1px 4px rgba(60,50,30,.06); margin-bottom: 14px; }
.cat-card .cat-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cat-card .cat-title::before { content: ''; width: 6px; height: 18px; border-radius: 3px; background: var(--gold-2); }
.cat-card .cat-meta { color: var(--muted); font-size: 13px; margin: 6px 0; }
.cat-card .field-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.cat-card .field-tag { padding: 3px 10px; border-radius: 6px; font-size: 12px; background: var(--bg); border: 1px solid var(--line); color: #5a4f3c; }
.cat-card .field-tag.req { border-color: var(--gold-2); color: var(--gold); font-weight: 600; }
.cat-card .field-tag.off { opacity: .4; text-decoration: line-through; }
.cat-card .cat-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.cat-card .share-link { font-size: 12px; color: var(--blue); background: #f0f4fa; padding: 3px 10px; border-radius: 6px; cursor: pointer; border: 1px solid #d0dfee; flex: 1; min-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-card .qr-img { width: 72px; height: 72px; border-radius: 6px; border: 1px solid var(--line); }

/* ── Order Card ───────────────────────────── */
.order-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.order-card .oc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-card .oc-head b { font-size: 15px; }
.order-card .oc-body { font-size: 13px; color: #5a4f3c; line-height: 1.8; }

/* ── Operations Center Layout ─────────────── */
.oc-layout { display: flex; gap: 0; min-height: calc(100vh - 40px); }
.oc-side { width: 130px; min-width: 130px; background: #fff; border-right: 1px solid var(--line); position: sticky; top: 0; align-self: flex-start; }
.oc-side .oc-tab { display: block; padding: 12px 14px; text-decoration: none; color: var(--ink); font-size: 13px; cursor: pointer; border-left: 3px solid transparent; transition: all .12s; }
.oc-side .oc-tab:hover { background: #fffbf0; color: var(--gold); }
.oc-side .oc-tab.active { background: #fffbf0; border-left-color: var(--gold); color: var(--gold); font-weight: 600; }
.oc-content { flex: 1; padding: 0 16px; min-width: 0; }
.oc-panel { display: none; }
.oc-panel.active { display: block; }

/* ── Phone Mockup (mini-program demo) ─────── */
.phone-stage { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; }
.phone { width: 375px; flex: 0 0 375px; background: #111; border-radius: 40px; padding: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.phone-screen { background: #f7f5f0; border-radius: 30px; overflow: hidden; height: 700px; display: flex; flex-direction: column; }
.phone-status { background: var(--dark); color: #f3ead7; font-size: 12px; padding: 8px 16px; display: flex; justify-content: space-between; align-items: center; }
.phone-body { flex: 1; overflow-y: auto; padding: 14px; }
.phone-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.phone-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.phone-footer { background: #fff; border-top: 1px solid var(--line); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; }
.phone-footer .total { font-size: 13px; color: #5a4f3c; }
.phone-footer .total b { color: var(--red); font-size: 16px; }
.m-card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.m-banner { border-radius: 12px; padding: 18px 14px; margin-bottom: 12px; color: #fff; background: linear-gradient(120deg,#8a6410,#d4af37); }
.m-banner b { font-size: 16px; }
.m-banner p { font-size: 12px; opacity: .92; margin-top: 4px; }
.sku-img { width: 64px; height: 64px; border-radius: 10px; flex: 0 0 64px; background: linear-gradient(135deg,#f0dfae,#caa64b); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #6b5410; font-size: 13px; }

/* ── Replenish Item ───────────────────────── */
.rep-item { display: flex; gap: 12px; }
.rep-item .info { flex: 1; }
.rep-item .name { font-weight: 700; font-size: 14px; }
.rep-item .metrics { font-size: 12.5px; color: #5a4f3c; margin-top: 4px; line-height: 1.9; }
.rep-item .metrics b { color: var(--ink); }
.rep-item .warn { color: var(--red); font-weight: 700; }
.rep-item .ok { color: var(--green); font-weight: 700; }
.qty-ctl { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qty-ctl button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--gold); background: #fff; color: var(--gold); font-size: 17px; cursor: pointer; line-height: 1; }
.qty-ctl button:hover { background: var(--gold); color: #fff; }
.qty-ctl .qty { min-width: 34px; text-align: center; font-weight: 700; font-size: 15px; }
.qty-ctl input.qty-input { width: 46px; text-align: center; font-weight: 700; font-size: 15px; border: 1px solid var(--gold); border-radius: 6px; padding: 2px 4px; margin: 0 4px; }

/* ── Replenish Card (large layout) ─────────── */
.replenish-card { display: flex; gap: 20px; background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.08); align-items: stretch; }
.rc-img { width: 400px; height: 500px; border-radius: 12px; flex: 0 0 400px; background: linear-gradient(135deg,#f0dfae,#caa64b); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.rc-img img { width: 100%; height: 100%; object-fit: cover; }
.rc-img .rc-ph { font-weight: 700; color: #6b5410; font-size: 22px; }
.rc-info { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 0 8px; }
.rc-name { font-size: 22px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rc-line { font-size: 18px; color: #5a4f3c; line-height: 1.6; }
.rc-line b { color: var(--gold); font-weight: 700; }
.rc-line .warn { color: var(--red); font-weight: 700; }
.rc-line .ok { color: var(--green); font-weight: 700; }
.rc-qty { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px; flex: 0 0 160px; }
.rc-qty button { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--gold); background: #fff; color: var(--gold); font-size: 22px; cursor: pointer; line-height: 1; transition: all .15s; }
.rc-qty button:hover { background: var(--gold); color: #fff; }
.rc-qty input { width: 56px; height: 44px; text-align: center; font-weight: 700; font-size: 18px; border: 2px solid var(--gold); border-radius: 10px; padding: 0; }
.rep-confirm-bar { position: sticky; bottom: 0; background: #fff; border-top: 2px solid var(--line); padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; border-radius: 0 0 14px 14px; box-shadow: 0 -2px 10px rgba(0,0,0,.08); z-index: 10; }
.rep-confirm-bar .rep-total { font-size: 15px; color: #5a4f3c; }
.rep-confirm-bar .rep-total b { color: var(--red); font-size: 22px; }
/* ── Replenish Card inside phone ───────────── */
.phone-body .replenish-card { gap: 8px; padding: 10px; margin-bottom: 10px; border-radius: 10px; }
.phone-body .rc-img { width: 80px; height: 100px; flex: 0 0 80px; border-radius: 8px; }
.phone-body .rc-img .rc-ph { font-size: 13px; }
.phone-body .rc-info { gap: 5px; padding: 0; }
.phone-body .rc-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.phone-body .rc-line { font-size: 12px; line-height: 1.5; }
.phone-body .rc-qty { flex: 0 0 auto; gap: 4px; }
.phone-body .rc-qty button { width: 28px; height: 28px; font-size: 16px; border-radius: 6px; border-width: 1px; }
.phone-body .rc-qty input { width: 36px; height: 28px; font-size: 14px; border-radius: 6px; border-width: 1px; }

/* ── Chat / AI WeChat ─────────────────────── */
.chat { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .avatar { width: 38px; height: 38px; border-radius: 8px; background: linear-gradient(135deg,#8a6410,#d4af37); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 38px; }
.msg .bubble { background: #fff; border-radius: 10px; padding: 9px 12px; max-width: 250px; font-size: 13.5px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.msg .who b { color: var(--blue); }
.msg.ai .avatar { background: linear-gradient(135deg,#37474f,#78909c); }
.msg.ai .bubble { background: #eef4ff; }
.msg .photo { width: 180px; height: 120px; border-radius: 8px; margin-top: 6px; background: linear-gradient(135deg,#f0dfae,#caa64b); display: flex; align-items: center; justify-content: center; color: #6b5410; font-weight: 700; font-size: 13px; }
.hongbao { display: flex; align-items: center; gap: 10px; background: #fa9d3b; color: #fff; border-radius: 10px; padding: 10px 12px; width: 210px; }
.hongbao .hb-icon { width: 34px; height: 44px; background: var(--red); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.hongbao small { opacity: .85; }
.ai-steps { font-size: 13px; }
.ai-steps li { margin: 6px 0 6px 18px; }
.ai-steps .done { color: var(--green); }
.ai-steps .doing { color: var(--blue); }

/* ── Example Highlight (order mini-program) ─ */
.example-hl { position: relative; }
.example-hl input, .example-hl select { border: 2px solid var(--red) !important; }
.example-tag { position: absolute; right: -6px; top: -30px; background: var(--red); color: #fff; font-size: 11px; border-radius: 6px; padding: 2px 8px; white-space: nowrap; z-index: 5; }
.example-tag::after { content: ""; position: absolute; left: 16px; bottom: -5px; border: 5px solid transparent; border-top-color: var(--red); border-bottom: 0; }

/* ── Entry Status ─────────────────────────── */
.entry-status-sale { background: #e8f5e9; color: var(--green); padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.entry-status-return { background: #fdecea; color: var(--red); padding: 2px 8px; border-radius: 999px; font-size: 12px; }

/* ── Flow Mini ────────────────────────────── */
.flow-mini .fm-gap { color: var(--red); font-weight: 700; }
.flow-mini .fm-ok { color: var(--green); }

/* ── Sort Icon (DataTable) ─────────────────── */
.sort-icon { font-size: 11px; color: var(--muted); margin-left: 4px; }

/* ── Timeline (replenish tracking) ─────────── */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item::before { content: ''; position: absolute; left: -28px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold-2); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--gold-2); }
.timeline-item .tl-date { font-size: 12px; color: var(--muted); }
.timeline-item .tl-content { font-size: 14px; color: var(--ink); margin-top: 4px; }

/* ── Count Input (inventory) ───────────────── */
.count-input { width: 80px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; text-align: center; font-weight: 700; font-size: 15px; }
.count-input:focus { border-color: var(--gold); outline: 2px solid rgba(184,134,11,.35); }

/* ── Row-level status colors ────────────────── */
.datatable tr.row-danger { background: #ffebee !important; }
.datatable tr.row-danger:hover { background: #ffcdd2 !important; }
.datatable tr.row-warning { background: #fff8e1 !important; }
.datatable tr.row-warning:hover { background: #ffecb3 !important; }
.datatable tr.row-success { background: #e8f5e9 !important; }
.datatable tr.row-success:hover { background: #c8e6c9 !important; }
.datatable tr.row-muted { opacity: 0.5; }

/* ── Button hierarchy ──────────────────────── */
.btn-text {
  background: none; border: none; color: var(--gold); cursor: pointer;
  font-size: 13px; padding: 2px 4px; text-decoration: underline;
}
.btn-text:hover { color: var(--gold-dark); }

/* ── Empty state action ────────────────────── */
.empty-row .es-action {
  display: inline-block; margin-top: 8px;
  padding: 4px 14px; border-radius: 6px;
  background: var(--gold-soft); color: var(--gold-dark);
  text-decoration: none; font-size: 13px; font-weight: 600;
}
.empty-row .es-action:hover { background: var(--gold); color: #fff; }

/* ── Breadcrumb bar ─────────────────────────── */
#breadcrumb-bar {
  padding: 8px 20px; background: var(--card); border-bottom: 1px solid var(--line);
}
#breadcrumb-bar:empty { display: none; }
.breadcrumb {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 10px;
}
.breadcrumb .bc-link { color: var(--gold); text-decoration: none; }
.breadcrumb .bc-link:hover { text-decoration: underline; }
.breadcrumb .bc-sep { color: var(--text-light, #ccc); }
.breadcrumb .bc-current { color: var(--ink); font-weight: 600; }

/* ── Quick actions bar ─────────────────────── */
.quick-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ── Reward mode badge ─────────────────────── */
.reward-mode-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; margin-left: 6px;
  background: var(--gold-soft); color: var(--gold-dark);
}

/* ── Global search ───────────────────────────── */
.global-search-wrap { position: relative; flex: 0 1 240px; }
.global-search-input {
  width: 100%; padding: 6px 12px 6px 32px;
  border: 1px solid rgba(255,255,255,.2); border-radius: 999px;
  background: rgba(255,255,255,.08); color: #f3ead7; font-size: 13px;
  outline: none; transition: all .2s;
}
.global-search-input::placeholder { color: rgba(243,234,215,.4); }
.global-search-input:focus { background: rgba(255,255,255,.12); border-color: var(--gold-2); }
.global-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .5; pointer-events: none; }
.global-search-results {
  position: absolute; top: calc(100% + 4px); right: 0; width: 360px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 400px; overflow-y: auto; z-index: 200;
  display: none;
}
.global-search-results.show { display: block; }
.gsr-section { font-size: 11px; font-weight: 700; color: var(--muted); padding: 8px 14px 4px; text-transform: uppercase; }
.gsr-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer; transition: background .1s; text-decoration: none; color: var(--ink); }
.gsr-item:hover { background: var(--gold-soft); }

/* ── 消息提醒铃铛 ── */
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  position: relative; background: none; border: none; cursor: pointer;
  padding: 6px 8px; border-radius: 8px; transition: background .15s;
  display: flex; align-items: center; gap: 4px;
}
.notif-bell-btn:hover { background: rgba(255,255,255,.12); }
.notif-bell-icon { font-size: 20px; line-height: 1; }
.notif-badge {
  position: absolute; top: 0; right: 0;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--red, #e53935); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px;
  border-radius: 9px; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; width: 380px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,.18); z-index: 300;
  max-height: 500px; overflow-y: auto;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.notif-header-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.notif-header-count { font-size: 12px; color: var(--muted); }
.notif-list { padding: 4px 0; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px; cursor: pointer; transition: background .1s;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid #f5f5f5;
}
.notif-item:hover { background: var(--gold-soft); }
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 18px; line-height: 1.4; flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-desc { font-size: 12px; color: var(--muted); line-height: 1.4; word-break: break-all; }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px; color: var(--muted); }
.notif-empty-icon { font-size: 32px; }
/* 折叠通知组 */
.notif-group { border-bottom: 1px solid #f5f5f5; }
.notif-group-header { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; cursor: pointer; transition: background .1s; }
.notif-group-header:hover { background: var(--gold-soft); }
.notif-group-arrow { font-size: 14px; color: var(--muted); flex-shrink: 0; margin-top: 2px; transition: transform .2s; }
.notif-group-count { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--orange); border-radius: 8px; padding: 0 6px; line-height: 16px; margin-left: 4px; vertical-align: middle; }
.notif-group-items { background: #fafafa; }
.notif-item.notif-sub { padding: 6px 16px 6px 42px; border-bottom: 1px solid #f0f0f0; }
.notif-item.notif-sub:last-child { border-bottom: none; }
.notif-item.notif-sub .notif-icon { font-size: 14px; color: var(--muted); }
.gsr-item .gsr-icon { font-size: 16px; }
.gsr-item .gsr-text { flex: 1; min-width: 0; }
.gsr-item .gsr-text b { font-size: 13px; }
.gsr-item .gsr-text small { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Tooltip ────────────────────────────────── */
.tip { position: relative; display: inline-block; cursor: help; }
.tip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  background: rgba(20,16,10,.92); color: #fff;
  padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 400;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 300;
}
.tip:hover::after { opacity: 1; }
.tip-icon { display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--gold-soft);
  color: var(--gold-dark); font-size: 11px; font-weight: 700; margin-left: 4px; }

/* ── Combobox (autocomplete) ──────────────────── */
.combo-wrap { position: relative; }
.combo-input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 13px; outline: none; transition: border-color .15s;
}
.combo-input:focus { border-color: var(--gold); }
.combo-dropdown {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto;
  z-index: 100; display: none;
}
.combo-dropdown.show { display: block; }
.combo-item { padding: 8px 12px; cursor: pointer; font-size: 13px; transition: background .1s; }
.combo-item:hover, .combo-item.active { background: var(--gold-soft); }

/* ── Pagination page numbers ─────────────────── */
.page-numbers { display: flex; gap: 4px; align-items: center; }
.page-num { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; cursor: pointer; transition: all .15s; }
.page-num:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.page-num.active { background: var(--gold); color: #fff; border-color: var(--gold); font-weight: 700; }
.page-num:disabled { opacity: .4; cursor: not-allowed; }
.page-ellipsis { padding: 0 4px; color: var(--muted); font-size: 13px; }

/* ── Table cell text truncation ──────────────── */
.datatable td { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datatable td[title] { cursor: help; }
.datatable th { white-space: nowrap; }

/* ── Row alternating colors (斑马纹) ────────── */
.datatable tbody tr:nth-child(even) { background: #faf7f0; }
.datatable tbody tr:hover { background: var(--gold-soft); }

/* ── Undo Toast ─────────────────────────── */
.toast-undo {
  display: flex; align-items: center; gap: 12px; min-width: 320px;
}
.toast-undo-btn {
  background: var(--gold); color: #fff; border: none; padding: 4px 12px;
  border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.toast-undo-btn:hover { background: var(--gold-dark); }

/* ── Skeleton loading ─────────────────────── */
.skeleton { background: linear-gradient(90deg, #f0ebe0 25%, #e8e1d0 50%, #f0ebe0 75%);
  background-size: 200% 100%; animation: skeleton-shimmer 1.5s infinite; border-radius: 6px; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 40px; margin-bottom: 8px; }
.skeleton-card { height: 80px; border-radius: 12px; }

/* ── Status tag icons ────────────────────── */
.tag-achieved::before { content: '✓ '; }
.tag-missed::before { content: '✗ '; }
.tag-on_track::before { content: '→ '; }
.tag-tier { background: var(--gold-soft); color: #7a5b06; }
.tag-behind::before { content: '! '; }
.tag-no_target::before { content: '○ '; }
.badge-green::before { content: '✓ '; }
.badge-red::before { content: '✗ '; }
.badge-gold::before { content: '★ '; }

/* ── Frozen columns (settlement table) ──── */
.datatable-frozen th:nth-child(-n+2), .datatable-frozen td:nth-child(-n+2) {
  position: sticky; left: 0; z-index: 10; background: var(--card);
  box-shadow: 2px 0 0 var(--line);
}
.datatable-frozen th:nth-child(1) { left: 0; }
.datatable-frozen th:nth-child(2) { left: 60px; }
.datatable-frozen td:nth-child(1) { left: 0; }
.datatable-frozen td:nth-child(2) { left: 60px; }
.datatable-frozen .col-check { background: var(--card) !important; }

/* ── Onboarding overlay ──────────────────── */
.onboarding-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6); z-index: 9999; display: flex;
  align-items: center; justify-content: center;
}
.onboarding-card {
  background: #fff; border-radius: 16px; padding: 32px; max-width: 480px;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: onboarding-in .3s ease;
}
@keyframes onboarding-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.onboarding-step { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.onboarding-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; color: var(--ink); }
.onboarding-desc { font-size: 14px; color: var(--muted); line-height: 1.8; margin-bottom: 20px; }
.onboarding-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.onboarding-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: all .2s; }
.onboarding-dot.active { background: var(--gold); width: 24px; border-radius: 4px; }
.onboarding-actions { display: flex; gap: 12px; justify-content: center; }

/* ── Context hint bar ────────────────────── */
.context-hint {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--gold-soft), transparent);
  border-left: 4px solid var(--gold); border-radius: 6px;
  font-size: 13px; color: var(--ink);
}
.context-hint .ch-icon { font-size: 16px; }
.context-hint .ch-count { font-weight: 700; color: var(--gold-dark); }

/* ── Sales trend chart (SVG) ─────────────── */
.trend-chart { width: 100%; height: 180px; position: relative; }
.trend-chart svg { width: 100%; height: 100%; }
.trend-chart .chart-line { fill: none; stroke: var(--gold); stroke-width: 2; }
.trend-chart .chart-area { fill: var(--gold-soft); opacity: .5; }
.trend-chart .chart-dot { fill: var(--gold); }
.trend-chart .chart-label { font-size: 10px; fill: var(--muted); text-anchor: middle; }

/* ── Flow visualization ──────────────────── */
.flow-viz {
  display: flex; align-items: stretch; gap: 0; margin: 12px 0;
  overflow-x: auto; padding-bottom: 4px;
}
.flow-step {
  flex: 1; min-width: 120px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; text-align: center; position: relative;
  transition: all .2s; cursor: pointer;
}
.flow-step:hover { border-color: var(--gold); box-shadow: 0 2px 8px rgba(184,134,11,.12); }
.flow-step-num {
  font-size: 22px; font-weight: 700; line-height: 1.2;
}
.flow-step-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.flow-step-icon { font-size: 20px; margin-bottom: 4px; }
.flow-arrow {
  display: flex; align-items: center; padding: 0 8px; color: var(--gold); font-size: 20px;
}
.flow-step.pending { border-color: var(--orange); }
.flow-step.pending .flow-step-num { color: var(--orange); }
.flow-step.done { border-color: var(--green); }
.flow-step.done .flow-step-num { color: var(--green); }

/* ── Configurable columns ───────────────── */
.col-config-btn {
  font-size: 11px; padding: 3px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; cursor: pointer; color: var(--muted);
}
.col-config-btn:hover { border-color: var(--gold); color: var(--gold); }
.col-config-dropdown {
  position: absolute; right: 0; top: 100%; min-width: 180px; z-index: 200;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px; display: none;
}
.col-config-dropdown.show { display: block; }
.col-config-item { display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 13px; cursor: pointer; }
.col-config-item:hover { background: var(--gold-soft); border-radius: 4px; }

/* ── Form validation ─────────────────────── */
.form-error { border-color: var(--red) !important; }
.form-error-msg { color: var(--red); font-size: 12px; margin-top: 2px; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .replenish-card { flex-direction: column; }
  .rc-img { width: 100%; flex: 0 0 auto; height: auto; aspect-ratio: 400/500; }
  .nav-sidebar { width: 56px !important; }
  .nav-sidebar .nav-label { display: none; }
  .nav-sidebar .nav-group-label { display: none; }
  .nav-sidebar .nav-item { justify-content: center; padding: 10px 0; }
  .nav-sidebar .nav-item .nav-icon { font-size: 18px; }
  .datatable { font-size: 12px; }
  .datatable th, .datatable td { padding: 4px 6px; }
  .action-bar { flex-direction: column; }
  .filter-group { flex-wrap: wrap; }
  .breadcrumb { font-size: 12px; }
  .quick-actions .btn { padding: 4px 10px; font-size: 12px; }
}

/* ════════════════════════════════════════════════
   v44 UI Enhancement — P0/P1 改进
   ════════════════════════════════════════════════ */

/* P0-2: 负数红色高亮 */
.num-negative { color: var(--red); font-weight: 600; }

/* P0-3: 表格固定表头 (scrollable wrapper) */
.datatable-scroll { max-height: 580px; overflow: auto; }
.datatable-scroll .datatable thead th { position: sticky; top: 0; z-index: 10; background: #fafafa; box-shadow: 0 1px 0 var(--line); }

/* P1-8: 按钮状态完善 */
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 1px; }
.btn-primary:focus-visible, .btn-danger:focus-visible, .btn-success:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 1px; }
.btn.loading { position: relative; pointer-events: none; opacity: 0.7; }
.btn.loading::after {
  content: ''; display: inline-block; width: 14px; height: 14px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: btn-spin 0.6s linear infinite; margin-left: 6px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* P1-9: 表格横向滚动渐变提示 + 美化滚动条 */
.datatable-wrap { position: relative; }
.datatable-wrap::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 32px;
  background: linear-gradient(to right, transparent, rgba(245,242,234,.9));
  pointer-events: none; z-index: 5;
}
.datatable-wrap::-webkit-scrollbar { height: 6px; width: 6px; }
.datatable-wrap::-webkit-scrollbar-track { background: transparent; }
.datatable-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.datatable-wrap::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* 全局滚动条美化 */
*::-webkit-scrollbar { height: 6px; width: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #d4cbb8; border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* P1-10: Type Scale 应用 */
.stat-label { font-size: var(--text-xs); }
.stat-value { font-size: var(--text-xl); }
.form-label { font-size: var(--text-sm); }
.breadcrumb { font-size: var(--text-sm); }

/* P1-7: SVG图标在侧边栏的样式 */
.nav-icon svg { display: block; }
.nav-item { display: flex; align-items: center; gap: 8px; }

/* 搜索结果下拉美化 */
.global-search-results { 
  position: absolute; top: 100%; left: 0; right: 0; min-width: 320px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); max-height: 400px; overflow-y: auto; z-index: 200;
  display: none;
}
.global-search-results.show { display: block; }
.global-search-results .gsr-section { padding: 6px 12px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; border-bottom: 1px solid var(--line); background: #fafafa; }
.global-search-results .gsr-item { padding: 8px 12px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); border-bottom: 1px solid #f5f0e8; }
.global-search-results .gsr-item:hover { background: var(--gold-soft); }
.global-search-results .gsr-item:last-child { border-bottom: none; }
.global-search-results .gsr-icon { font-size: 16px; flex-shrink: 0; }
.global-search-results .gsr-text { display: flex; flex-direction: column; }
.global-search-results .gsr-text small { font-size: 11px; color: var(--muted); }
