:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 20px 40px rgba(16,24,40,.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
svg { width: 20px; height: 20px; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 28px;
  height: 68px; display: flex; align-items: center; gap: 40px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(79,70,229,.3);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text h1 { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 9px; text-decoration: none;
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: all .15s;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.topbar-tag {
  font-size: 12px; color: var(--primary); background: var(--primary-light);
  padding: 5px 11px; border-radius: 20px; font-weight: 600;
}

.container { max-width: 1240px; margin: 0 auto; padding: 32px 28px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.page-head h2 { font-size: 24px; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 9px; padding: 10px 18px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(79,70,229,.25); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow);
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue { background: #eef2ff; color: #6366f1; }
.stat-icon.green { background: #ecfdf5; color: var(--green); }
.stat-icon.orange { background: #fffbeb; color: var(--orange); }
.stat-icon.purple { background: #faf5ff; color: #a855f7; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 3px; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; justify-content: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.toolbar { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; max-width: 360px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #9ca3af; }
.search-wrap input {
  width: 100%; padding: 10px 12px 10px 38px; border: 1px solid var(--border);
  border-radius: 9px; font-size: 14px; font-family: inherit; outline: none; transition: all .15s;
}
.search-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.filters { display: flex; gap: 6px; }
.chip {
  padding: 7px 15px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; transition: all .15s;
}
.chip:hover { background: var(--bg); }
.chip.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 13px 20px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
tbody td { padding: 15px 20px; font-size: 14px; border-bottom: 1px solid #f0f1f3; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }
.right { text-align: right; }

.prod-cell { display: flex; align-items: center; gap: 12px; }
.prod-avatar {
  width: 38px; height: 38px; border-radius: 9px; background: var(--primary-light); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.prod-name { font-weight: 600; font-size: 14px; }
.prod-code { font-size: 12px; color: var(--muted); margin-top: 2px; font-family: ui-monospace, monospace; }
.promo-tag { display: inline-block; background: #fff1e6; color: #e2551a; border: 1px solid #ffd0ae; border-radius: 4px; font-size: 11px; font-weight: 700; padding: 0 5px; line-height: 17px; vertical-align: middle; margin-left: 4px; }
.proxy-tag { display: inline-block; background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; border-radius: 4px; font-size: 11px; font-weight: 700; padding: 0 5px; line-height: 17px; vertical-align: middle; margin-left: 6px; }
.price { font-weight: 600; color: var(--text); }
.price small { color: var(--muted); font-weight: 400; }
.price-old { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: 12px; margin-right: 7px; }
.price-promo { color: #e2551a; font-weight: 700; }
.stock-num { font-weight: 600; }
.stock-num.low { color: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.on { background: #ecfdf5; color: #059669; }
.badge.off { background: #f3f4f6; color: #6b7280; }
.time { color: var(--muted); font-size: 13px; }
.act-btn {
  border: none; background: transparent; color: var(--primary); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 7px; font-family: inherit;
}
.act-btn:hover { background: var(--primary-light); }

.empty { text-align: center; padding: 64px 20px; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; background: var(--bg); color: #cbd5e1; border-radius: 50%; display: grid; place-items: center; }
.empty-icon svg { width: 30px; height: 30px; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 14px; }

.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; width: 100%; max-width: 580px; border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; max-height: 92vh; overflow-y: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 18px; }
.icon-btn { border: none; background: transparent; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.form-body { padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.req { color: var(--red); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; transition: all .15s; color: var(--text); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field textarea { resize: vertical; }
.field input.invalid { border-color: var(--red); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.level-dropdown { position: relative; }
.level-dropdown-trigger {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff; color: var(--text); font-size: 14px; font-family: inherit; cursor: pointer; outline: none; text-align: left;
}
.level-dropdown-trigger:hover { border-color: var(--primary); }
.level-dropdown.open .level-dropdown-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.level-dropdown-trigger svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; transition: transform .15s; }
.level-dropdown.open .level-dropdown-trigger svg { transform: rotate(180deg); }
.level-dropdown-panel {
  display: none; position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow); padding: 6px;
}
.level-dropdown.open .level-dropdown-panel { display: block; }
.level-opt { display: flex !important; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px !important; font-weight: 400 !important; margin: 0 !important; }
.level-opt:hover { background: var(--primary-light); }
.level-opt.all { border-bottom: 1px solid var(--border); border-radius: 0 0 6px 6px; margin-bottom: 4px !important; padding-bottom: 9px; }
.level-opt input { width: 15px !important; height: 15px; padding: 0 !important; margin: 0; cursor: pointer; accent-color: var(--primary); }
.level-opt.all b { font-weight: 600; }
.err { color: var(--red); font-size: 12px; margin-top: 5px; min-height: 0; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: #fafbfc; border-radius: 0 0 16px 16px; }

.toast-wrap { position: fixed; top: 82px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border);
  border-left: 4px solid var(--green); padding: 13px 18px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; min-width: 240px;
  animation: slide .2s ease-out;
}
.toast.error { border-left-color: var(--red); }
.toast svg { width: 20px; height: 20px; color: var(--green); }
.toast.error svg { color: var(--red); }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar-inner { gap: 16px; padding: 0 16px; }
  .nav { display: none; }
  .container { padding: 24px 16px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-value { font-size: 20px; }
  .form-body { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
}

.level-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.level-badge.base { background: #f3f4f6; color: #4b5563; }
.level-badge.normal { background: #f3f4f6; color: #4b5563; }
.level-badge.vip { background: #faf5ff; color: #9333ea; }
.level-badge.strategic { background: #fffbeb; color: #d97706; }
.addr-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.account-cell { font-family: ui-monospace, monospace; font-size: 13px; color: var(--primary); font-weight: 600; }
.act-btn.danger { color: var(--red); }
.act-btn.danger:hover { background: #fef2f2; }
.no-del-tip { display: inline-block; font-size: 12px; color: var(--muted); padding: 5px 8px; background: var(--bg); border-radius: 6px; white-space: nowrap; }
.level-hint { padding: 10px 12px; background: var(--bg); border-radius: 8px; font-size: 13px; color: var(--muted); height: 39px; display: flex; align-items: center; }
.form-tip { font-size: 12px; color: var(--muted); background: #f8fafc; border-left: 3px solid var(--primary); padding: 9px 12px; border-radius: 0 6px 6px 0; }
.customer-bank-section { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fafbfc; }
.bank-section-title { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.bank-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.view { animation: fadein .2s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 1000px) {
  .table-wrap table { min-width: 980px; }
}

.settings-layout { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; }
.settings-side { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.setting-nav, .report-nav { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; transition: all .15s; }
.setting-nav svg, .report-nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.setting-nav:hover, .report-nav:hover { background: var(--bg); color: var(--text); }
.setting-nav.active, .report-nav.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.settings-content { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); min-height: 460px; overflow: hidden; }
.setting-panel-head { padding: 22px 24px; border-bottom: 1px solid var(--border); }
.setting-panel-head h3 { font-size: 17px; margin-bottom: 4px; }
.setting-panel-head p { font-size: 13px; color: var(--muted); }
.report-filter { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.report-filter-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-quick { gap: 4px; }
.report-summary { display: flex; gap: 14px; flex-wrap: wrap; padding: 18px 24px 6px; }
.report-summary-card { flex: 1; min-width: 150px; background: #fafbfc; border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.report-summary-card span { font-size: 12px; color: var(--muted); }
.report-summary-card b { font-size: 22px; color: var(--text); }
.report-summary-card b.accent { color: var(--primary); }
.report-table-wrap { padding: 14px 24px 24px; }
.report-empty { text-align: center; color: var(--muted); padding: 36px 0 !important; }
.refund-amount { color: #ea580c; }
.actual-amount { color: #059669; font-weight: 700; }

/* ---------- 总账号：登录 / 账号信息 ---------- */
.admin-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.admin-role-tip { font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 5px; padding: 3px 8px; }
.sub-tabs { display: flex; gap: 4px; margin: 20px 24px 0; border-bottom: 1px solid var(--border); }
.sub-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.sub-panel { padding: 0 0 24px; }
.sub-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px 12px; gap: 16px; }
.sub-panel-head p { font-size: 13px; color: var(--muted); margin: 0; }
.role-form-body { padding: 20px 24px; max-height: 68vh; overflow-y: auto; }
.role-basic { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.perm-head { display: flex; justify-content: space-between; align-items: center; background: var(--bg); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.perm-head b { font-size: 13px; }
.perm-head span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.perm-bulk { display: flex; gap: 12px; }
.perm-table-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td { padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 13px; text-align: left; }
.perm-table th { background: #fafbfc; font-weight: 600; }
.perm-table tr:last-child td { border-bottom: none; }
.perm-table .perm-group td { background: #f8f9fc; }
.perm-table .perm-child td { color: #4b5563; }
.perm-table .perm-act-col { text-align: center; width: 88px; }
.perm-table td:nth-child(2), .perm-table td:nth-child(3) { text-align: center; }
.perm-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.perm-table .perm-na { text-align: center; color: #c9ced6; }
.admin-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.admin-name { font-size: 13px; font-weight: 600; color: var(--text); }
.admin-logout { background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 12px; padding: 4px 10px; cursor: pointer; font-family: inherit; }
.admin-logout:hover { color: var(--red); border-color: var(--red); }
.login-screen { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); }
.login-screen.show { display: flex; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 36px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .brand-mark { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; }
.login-brand h2 { font-size: 20px; margin-bottom: 4px; color: var(--text); }
.login-brand p { font-size: 13px; color: var(--muted); }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.login-field input { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; }
.login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.login-error { min-height: 18px; color: var(--red); font-size: 12px; margin-bottom: 4px; }
.login-submit { width: 100%; padding: 12px; font-size: 15px; }
.login-foot { text-align: center; margin-top: 14px; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 13px; cursor: pointer; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.login-tip { margin-top: 18px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.6; }
.account-info-card { margin: 24px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 26px; max-width: 720px; }
.account-info-head { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.account-big-avatar { width: 56px; height: 56px; border-radius: 14px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.account-big-name { font-size: 18px; font-weight: 700; }
.account-role { font-size: 12px; color: var(--muted); margin-top: 4px; }
.account-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px 0; }
.account-info-item { background: #fafbfc; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.account-info-label { font-size: 12px; color: var(--muted); }
.account-info-value { font-size: 16px; font-weight: 600; }
.supplier-section { border-top: 1px solid var(--border); padding-top: 20px; margin-bottom: 20px; }
.supplier-head { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.supplier-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.supplier-fields input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--text); outline: none; }
.supplier-fields input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.account-info-actions { display: flex; gap: 10px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-btn { flex-shrink: 0; white-space: nowrap; }
.code-demo-tip { margin-top: 8px; font-size: 12px; color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 8px 10px; }
.code-demo-tip b { font-size: 15px; letter-spacing: 1px; }
.report-picker { position: relative; }
.report-picker-input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; color: var(--text); width: 230px; }
.report-picker-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.report-picker-list { display: none; position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: 300px; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.report-picker-list.show { display: block; }
.rpt-pick-opt { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #f1f2f4; font-size: 13px; cursor: pointer; }
.rpt-pick-opt:last-child { border-bottom: none; }
.rpt-pick-opt:hover { background: var(--primary-light); color: var(--primary); }
.rpt-pick-name { font-weight: 600; }
.rpt-pick-extra { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.rpt-pick-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.category-add { display: flex; gap: 10px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.category-add input { flex: 1; max-width: 380px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; }
.category-add input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.category-list { padding: 20px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.category-item { border: 1px solid var(--border); border-radius: 11px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; transition: all .15s; }
.category-item:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(79,70,229,.08); }
.category-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.category-meta { font-size: 12px; color: var(--muted); }
.category-item-ops { display: flex; gap: 4px; flex-shrink: 0; }
.category-empty { grid-column: 1/-1; text-align: center; padding: 48px 20px; color: var(--muted); font-size: 14px; }
.level-grid { padding: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.level-card { border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.level-card-head { margin-bottom: 12px; }
.level-card p { font-size: 13px; color: var(--muted); min-height: 38px; }
.level-count { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--primary); background: var(--primary-light); padding: 4px 10px; border-radius: 20px; font-weight: 600; }
.proxy-modal { max-width: 1000px; width: 94vw; }
.proxy-body { padding: 20px 24px; max-height: 72vh; overflow-y: auto; }
.proxy-customer-row { display: flex; align-items: center; gap: 12px; }
.proxy-label { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.proxy-customer-picker { position: relative; display: flex; align-items: center; width: 320px; }
.proxy-customer-picker input { flex: 1; padding: 8px 10px; border: 1px solid var(--red); border-radius: 6px 0 0 6px; font-size: 13px; font-family: inherit; outline: none; color: var(--text); }
.proxy-customer-picker input:focus { box-shadow: 0 0 0 3px #fee2e2; }
.proxy-dots, .proxy-row-dots { padding: 7px 10px; border: 1px solid var(--border); background: #fff; color: var(--muted); cursor: pointer; font-weight: 700; letter-spacing: 1px; }
.proxy-dots { border-left: none; border-radius: 0 6px 6px 0; }
.proxy-dots:hover, .proxy-row-dots:hover { color: var(--primary); border-color: var(--primary); }
.proxy-customer-list { display: none; position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: 100%; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.proxy-cust-opt { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.proxy-cust-opt:last-child { border-bottom: none; }
.proxy-cust-opt:hover { background: var(--primary-light); }
.proxy-cust-name { font-size: 13px; font-weight: 600; color: var(--text); }
.proxy-cust-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.proxy-cust-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.proxy-error { color: var(--red); font-size: 12px; margin: 5px 0 12px; }
.proxy-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.proxy-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.proxy-table th, .proxy-table td { padding: 9px 10px; border: 1px solid var(--border); text-align: left; white-space: nowrap; }
.proxy-table th { background: #fafbfc; color: var(--muted); font-weight: 600; }
.proxy-table .col-idx { width: 40px; text-align: center; }
.proxy-table .col-img { width: 54px; text-align: center; }
.proxy-table .prod-avatar { width: 28px; height: 28px; border-radius: 6px; margin: 0 auto; }
.proxy-table .col-qty { width: 90px; }
.proxy-table .col-unit { width: 56px; }
.proxy-table .col-price, .proxy-table .col-subtotal { width: 86px; text-align: right; }
.proxy-table .col-subtotal { color: var(--text); font-weight: 600; }
.proxy-prod-name { display: flex; align-items: center; gap: 6px; }
.proxy-row-dots { padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.proxy-qty, .proxy-remark { width: 100%; padding: 5px 7px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; font-family: inherit; outline: none; }
.proxy-qty:focus, .proxy-remark:focus { border-color: var(--primary); }
.proxy-empty-row td { text-align: left !important; }
.proxy-add { width: 26px; height: 26px; border: 1px dashed var(--primary); color: var(--primary); background: var(--primary-light); border-radius: 5px; font-size: 18px; line-height: 1; cursor: pointer; vertical-align: middle; }
.proxy-add:hover { background: var(--primary); color: #fff; }
.proxy-empty-row span { margin-left: 8px; color: var(--muted); font-size: 12px; }
.proxy-add-row td { text-align: left !important; }
.proxy-product-dropdown { display: none; position: fixed; z-index: 60; width: 330px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.16); overflow: hidden; }
.ppd-search { display: flex; align-items: stretch; padding: 8px; border-bottom: 1px solid var(--border); }
.ppd-search input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px 0 0 6px; font-size: 13px; font-family: inherit; outline: none; }
.ppd-search input:focus { border-color: var(--primary); }
.ppd-search .proxy-dots { border-radius: 0 6px 6px 0; border-left: none; }
.ppd-list { max-height: 260px; overflow-y: auto; }
.ppd-opt { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #f1f2f4; font-size: 13px; cursor: pointer; color: var(--text); }
.ppd-opt:last-child { border-bottom: none; }
.ppd-opt:hover { background: var(--primary-light); color: var(--primary); }
.ppd-code { color: var(--muted); flex-shrink: 0; font-size: 12px; }
.ppd-opt:hover .ppd-code { color: var(--primary); }
.ppd-name { flex: 1; }
.ppd-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.proxy-summary { display: flex; align-items: center; justify-content: flex-end; gap: 40px; padding: 12px 10px; border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; font-size: 13px; color: var(--muted); }
.proxy-sum-qty { width: 80px; text-align: right; color: var(--text); }
.proxy-sum-amount { width: 90px; text-align: right; color: var(--text); }
.proxy-payable { text-align: right; padding: 14px 10px 6px; font-size: 14px; color: var(--muted); }
.proxy-payable b { color: var(--red); font-size: 20px; margin-left: 6px; }
.proxy-ship { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; }
.proxy-ship h4 { font-size: 14px; margin-bottom: 8px; }
.proxy-ship div { color: var(--muted); line-height: 1.8; }
.promo-form { padding: 20px 24px; max-width: 900px; }
.promo-field { margin-bottom: 16px; }
.promo-field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.promo-field > label .req { color: var(--red); }
.promo-field input[type="text"] { width: 220px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; outline: none; }
.promo-field input[type="text"]:focus { border-color: var(--primary); }
.promo-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 16px; }
.promo-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.promo-table th, .promo-table td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; white-space: nowrap; }
.promo-table th { background: #fafbfc; color: var(--muted); font-weight: 600; }
.promo-table .col-idx { width: 40px; text-align: center; }
.promo-table .col-promo-price { width: 120px; }
.promo-table .col-op { width: 70px; }
.promo-price-input { width: 100px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; font-family: inherit; outline: none; }
.promo-price-input:focus { border-color: var(--primary); }
.promo-empty-row td, .promo-add-row td { text-align: left !important; }
.promo-empty-row span { margin-left: 8px; color: var(--muted); font-size: 12px; }
.promo-time-range { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.promo-time-range input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; outline: none; color: var(--text); cursor: pointer; }
.promo-time-range input:focus { border-color: var(--primary); }
.promo-target { display: flex; gap: 20px; margin-bottom: 10px; }
.promo-radio { display: flex !important; align-items: center; gap: 6px; font-size: 13px !important; font-weight: 400 !important; margin: 0 !important; cursor: pointer; }
.promo-radio input { accent-color: var(--primary); cursor: pointer; }
.promo-selectors { display: flex; gap: 10px; flex-wrap: wrap; }
.promo-multiselect { position: relative; width: 260px; }
.promo-multiselect.open .level-dropdown-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.promo-multiselect.open .level-dropdown-panel { display: block; }
.promo-region-group { display: flex; gap: 10px; flex-wrap: wrap; }
.promo-region-group .filter-select { min-width: 180px; }
.promo-region-hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.promo-actions { display: flex; gap: 10px; margin-top: 8px; }
.promo-list-block { padding: 0 24px 24px; max-width: 900px; }
.promo-list-block h4 { font-size: 14px; margin-bottom: 10px; }
.promo-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.promo-item-main b { font-size: 14px; }
.promo-item-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.promo-item-goods { font-size: 12px; color: var(--text); margin-top: 4px; }
.promo-item-op { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.order-setting-body { padding: 24px; max-width: 760px; }
.order-setting-block { border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; }
.order-setting-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.order-setting-title h4 { font-size: 15px; }
.check-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.weekday-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.weekday-grid label { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; transition: .15s; }
.weekday-grid label:hover { border-color: var(--primary); }
.weekday-grid label:has(input:checked) { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.weekday-grid input, .check-all input { cursor: pointer; accent-color: var(--primary); }
.order-time-range { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.order-time-range input[type="time"] { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--text); outline: none; cursor: pointer; }
.order-time-range input[type="time"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.order-time-range .field-hint { margin: 0; }
.order-time-range input[type="number"] { width: 90px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--text); outline: none; }
.order-time-range input[type="number"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.order-time-range input[type="number"]:disabled { background: var(--bg); color: #b6bcc6; cursor: not-allowed; }
.switch-wrap { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; width: 42px; height: 24px; background: #cbd0d8; border-radius: 24px; transition: background .2s; flex-shrink: 0; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch-wrap input:checked + .switch-track { background: var(--primary); }
.switch-wrap input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch-wrap input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--primary-light); }
.switch-text { font-size: 13px; color: var(--muted); }
.autovoid-levels { padding: 12px 0 2px; }
.autovoid-levels.disabled { opacity: .5; }
.autovoid-levels-head { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.autovoid-levels-head .field-hint { font-weight: 400; margin-left: 8px; }
.autovoid-levels-list { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 4px 0; }
.autovoid-level-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.autovoid-level-opt input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }
.autovoid-levels.disabled .autovoid-level-opt { cursor: not-allowed; }
.order-setting-foot { padding-top: 4px; }
.placeholder-box { margin: 40px auto; max-width: 460px; text-align: center; padding: 44px 30px; border: 2px dashed var(--border); border-radius: 14px; color: var(--muted); }
.placeholder-box svg { width: 44px; height: 44px; color: #cbd5e1; margin-bottom: 14px; }
.placeholder-box h4 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.placeholder-box p { font-size: 13px; line-height: 1.7; }
@media (max-width: 820px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-side { flex-direction: row; overflow-x: auto; }
  .setting-nav, .report-nav { white-space: nowrap; width: auto; }
}

.level-add { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.level-add-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.level-add-row input, .level-desc-input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; transition: all .15s; }
#new-level-name { flex: 1; min-width: 200px; max-width: 280px; }
#new-level-coef { width: 200px; }
.level-desc-input { font-size: 13px; max-width: 592px; }
.level-add-row input:focus, .level-desc-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.level-list { padding: 20px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.level-item { border: 1px solid var(--border); border-radius: 11px; padding: 16px; display: flex; justify-content: space-between; gap: 12px; transition: all .15s; }
.level-item:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(79,70,229,.08); }
.level-item-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.coef-tag { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.level-item-desc { font-size: 12px; color: var(--muted); min-height: 32px; }
.level-item-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; flex-shrink: 0; }
.level-item-ops { display: flex; gap: 4px; }
.level-item-count { font-size: 12px; color: var(--muted); }
.readonly-input { background: #f3f4f6 !important; color: var(--muted) !important; cursor: not-allowed; }
.level-badge.custom { background: #eff6ff; color: #2563eb; }
.level-coef-mini { font-size: 11px; color: var(--muted); margin-top: 4px; }
.address-group { display: flex; gap: 8px; }
.address-group select { flex: 0 0 140px; min-width: 0; }
.address-group input { flex: 1; min-width: 0; }
@media (max-width: 560px) {
  .address-group { flex-wrap: wrap; }
  .address-group select { flex: 1 1 45%; }
  .address-group input { flex: 1 1 100%; }
}

#order-stats { grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1180px) { #order-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { #order-stats { grid-template-columns: 1fr; } }
#stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1180px) { #stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { #stats { grid-template-columns: 1fr; } }
.filter-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; background: #fff; color: var(--text); cursor: pointer; }
.filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.order-row { cursor: pointer; }
.order-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.order-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.order-status.unpaid { background: #fffbeb; color: #d97706; }
.order-status.paid { background: #eff6ff; color: #2563eb; }
.order-status.shipped { background: #faf5ff; color: #9333ea; }
.order-status.completed { background: #ecfdf5; color: #059669; }
.order-status.voided { background: #f3f4f6; color: #6b7280; }
.voided-row { color: #b0b4bb !important; }
.voided-row td, .voided-row td * { color: #b0b4bb !important; }
.voided-row .level-badge { opacity: .6; }
.voided-row .order-status.voided { background: #f3f4f6; color: #9ca3af !important; }
#btn-order-void { margin-right: auto; }
.btn-danger { background: #dc2626; color: #fff; border: 1px solid #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.op-tag.void { background: #f3f4f6; color: #6b7280; }
.op-tag.refund { background: #fff7ed; color: #ea580c; }
.order-status.refunded { background: #fff7ed; color: #ea580c; }
.voided-row .order-status.refunded { background: #f3f4f6; color: #9ca3af !important; }
.btn-warn { background: #ea580c; color: #fff; border: 1px solid #ea580c; }
.btn-warn:hover { background: #c2410c; }
#btn-order-refund { margin-right: 8px; }
.amount-row.refund { color: #ea580c; }
.refund-summary { margin: 14px 0 0 auto; width: 420px; max-width: 100%; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 12px 16px; }
.refund-summary-head { font-size: 13px; font-weight: 700; color: #c2410c; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.refund-summary-head span { font-size: 12px; font-weight: 400; color: #9a7b62; }
.refund-summary-line, .refund-summary-total { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: #7c4a20; }
.refund-summary-line b { color: #c2410c; }
.refund-summary-total { border-top: 1px solid #fed7aa; margin-top: 6px; padding-top: 8px; font-weight: 700; color: #9a3412; font-size: 15px; }
.refund-summary-total b { color: #c2410c; }
.refund-body { padding: 20px 24px; max-height: 68vh; overflow-y: auto; }
.refund-order-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.refund-order-info label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.refund-order-info .detail-item div { font-size: 14px; font-weight: 600; }
.refund-tip { font-size: 13px; color: var(--muted); background: #fafbfc; border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.refund-prev-tip { color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; }
.refund-table { margin-bottom: 4px; }
.refund-qty-input { width: 84px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; outline: none; color: var(--text); }
.refund-qty-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.refund-row-amount { font-weight: 600; color: #c2410c; }
.refund-total-box { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding: 14px 16px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; font-size: 14px; font-weight: 600; }
.refund-total-box b { font-size: 22px; color: #c2410c; }
.modal-lg { max-width: 780px; }
.order-detail { max-height: 68vh; overflow-y: auto; }
.detail-section { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.detail-section:last-child { border-bottom: none; }
.detail-section h4 { font-size: 14px; margin-bottom: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.detail-item div { font-size: 14px; font-weight: 500; }
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th, .detail-table td { padding: 9px 10px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.detail-table th { background: #fafbfc; color: var(--muted); font-weight: 600; }
.detail-table td.right, .detail-table th.right { text-align: right; }
.qty-cell .qty-val { white-space: nowrap; }
.qty-edit, .qty-save, .qty-cancel { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; vertical-align: middle; transition: .15s; }
.qty-edit svg, .qty-save svg, .qty-cancel svg { width: 14px; height: 14px; }
.qty-edit:hover { color: var(--primary); background: var(--primary-light); }
.qty-edit-wrap { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.qty-input { width: 72px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; outline: none; color: var(--text); }
.qty-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.qty-unit { font-size: 12px; color: var(--muted); }
.qty-save { color: var(--primary); background: var(--primary-light); }
.qty-save:hover { background: var(--primary); color: #fff; }
.qty-cancel:hover { color: #dc2626; background: #fef2f2; }
.amount-box { margin: 14px 0 0 auto; width: 300px; background: #fafbfc; border-radius: 10px; padding: 14px 16px; }
.amount-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; color: var(--muted); }
.amount-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 700; color: var(--primary); }
.timeline-item { font-size: 12px; color: var(--muted); padding: 4px 0; }
.op-table { width: 100%; border-collapse: collapse; }
.op-table th, .op-table td { padding: 9px 10px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.op-table th { background: #fafbfc; color: var(--muted); font-weight: 600; }
.op-table td.time { color: var(--muted); white-space: nowrap; }
.op-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.op-tag.create { background: #eef2ff; color: #4f46e5; }
.op-tag.review { background: #ecfdf5; color: #059669; }
.op-tag.quantity { background: #fffbeb; color: #d97706; }
.date-range { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.date-range input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; color: var(--text); cursor: pointer; }
.date-range input::-webkit-calendar-picker-indicator { cursor: pointer; width: 100%; height: 100%; position: absolute; left: 0; top: 0; opacity: 0; }
.date-range input { position: relative; }
.date-range input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.act-btn:disabled { opacity: .45; cursor: not-allowed; }
.act-btn.danger:disabled:hover { background: transparent; }

/* 自定义重命名 / 确认弹窗 */
.modal-sm { max-width: 440px; }
.rename-cat-body { grid-template-columns: 1fr; }
.confirm-body { padding: 24px; font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 1180px) {
  .toolbar { flex-wrap: wrap; }
  .search-wrap { max-width: none; }
}
