/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #7a8194;
  --border: #e5e8f0;
  --primary: #3b5bfd;
  --primary-weak: #eef1ff;
  --danger: #e5484d;
  --danger-weak: #fdecec;
  --ok: #18a058;
  --ok-weak: #e8f7ef;
  --warn: #d97706;
  --warn-weak: #fdf3e3;
  --ozon: #005bff;
  --wb: #cb11ab;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(23, 30, 60, .07), 0 6px 18px rgba(23, 30, 60, .05);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }

/* ============ 通用控件 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.btn:hover { border-color: #c9d0e0; background: #f8f9fc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #2f4ae0; border-color: #2f4ae0; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #cf3c41; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-link { border: none; background: none; color: var(--primary); padding: 4px 6px; cursor: pointer; font-size: 13px; }
.btn-link.danger { color: var(--danger); }
.btn-link:hover { text-decoration: underline; }

.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text); outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 91, 253, .12); }
textarea.input { resize: vertical; min-height: 64px; }
.label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.label .req { color: var(--danger); margin-left: 2px; }
.field { margin-bottom: 14px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; min-height: 0; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.6;
}
.badge-gray { background: #f0f2f7; color: #5b6472; }
.badge-blue { background: var(--primary-weak); color: var(--primary); }
.badge-green { background: var(--ok-weak); color: var(--ok); }
.badge-red { background: var(--danger-weak); color: var(--danger); }
.badge-orange { background: var(--warn-weak); color: var(--warn); }
.badge-ozon { background: #e6efff; color: var(--ozon); }
.badge-wb { background: #fbe6f7; color: var(--wb); }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2c3e8f 0%, #4b3f9e 45%, #7a2f8f 100%);
  padding: 24px;
}
.login-card {
  width: 380px; background: #fff; border-radius: 16px; padding: 36px 32px 28px;
  box-shadow: 0 18px 60px rgba(15, 20, 50, .35);
}
.login-logo { font-size: 24px; font-weight: 700; text-align: center; letter-spacing: 1px; }
.login-sub { text-align: center; color: var(--muted); margin: 8px 0 26px; font-size: 13px; }
.code-field { display: flex; gap: 10px; }
.code-field .input { flex: 1; }
.login-divider { display: flex; align-items: center; gap: 12px; color: #b6bcc9; margin: 18px 0; font-size: 12px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-error { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }
.btn-wechat { background: #07c160; border-color: #07c160; color: #fff; }
.btn-wechat:hover { background: #06ad56; border-color: #06ad56; }
.login-tip { text-align: center; color: #a8aeba; font-size: 12px; margin-top: 18px; }

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #171c2b; color: #d6dae6; display: flex; flex-direction: column;
  flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; font-weight: 700; font-size: 16px; color: #fff; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #3b5bfd, #8b3fd6);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff;
}
.nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 2px;
  border-radius: 8px; cursor: pointer; color: #aab2c5; font-size: 14px; transition: all .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 500; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #5b7cfa, #9b6cf0);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.user-meta { overflow: hidden; }
#user-name { color: #fff; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sub { color: #7d8598; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .btn-ghost { color: #aab2c5; border-color: rgba(255, 255, 255, .14); }
.sidebar-footer .btn-ghost:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.main { flex: 1; padding: 26px 30px 48px; max-width: 1280px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; font-weight: 700; }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* 订单页自动同步状态 */
.sync-state { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; }
.sync-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #98a2b3; flex: none; }
.sync-state.is-live { color: #067647; }
.sync-state.is-live::before { background: #12b76a; }
.sync-state.is-busy { color: #b54708; }
.sync-state.is-busy::before { background: #f79009; animation: sync-pulse 1.1s ease-in-out infinite; }
.sync-state.is-err { color: #b42318; }
.sync-state.is-err::before { background: #f04438; }
@keyframes sync-pulse { 50% { opacity: .25; } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* ============ KPI ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 24px; font-weight: 700; margin-top: 4px; word-break: break-all; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============ 今日订单 / 今日金额 ============ */
.today-orders { margin-bottom: 16px; }
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.today-head .card-title { margin-bottom: 0; }
.today-change { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.today-change::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #12b76a; flex: none; }
.today-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.today-tile { background: #fafbff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 15px; min-height: 112px; }
.tt-label { color: var(--muted); font-size: 13px; }
.tt-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.tt-sub { color: var(--muted); font-size: 12px; }
.today-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 12px; }

.money-card { background: #171c2b; color: #e9edf8; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 16px; }
.money-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.money-title { color: #fff; font-size: 15px; font-weight: 600; }
.money-live { display: inline-flex; align-items: center; gap: 6px; color: #aab4cc; font-size: 12.5px; }
.money-live i { width: 6px; height: 6px; border-radius: 50%; background: #31d07f; box-shadow: 0 0 0 3px rgba(49, 208, 127, .14); }
.money-live.is-off i { background: #8b93a7; box-shadow: none; }
.money-body { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; }
@media (max-width: 900px) { .money-body { grid-template-columns: 1fr; gap: 20px; } }
.m-label { color: #98a3bd; font-size: 12.5px; }
#dash-range-label { color: #e9edf8; font-size: 14px; }
.m-big { color: #fff; font-size: 36px; font-weight: 700; line-height: 1.25; margin-top: 2px; word-break: break-all; }
.m-fx { color: #aab4cc; font-size: 12.5px; margin-top: 2px; }
.money-line { height: 1px; background: rgba(255, 255, 255, .11); margin: 16px 0; }
.money-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.m-mid { color: #fff; font-size: 22px; font-weight: 650; margin: 4px 0 2px; word-break: break-all; }
.m-mid.is-neg { color: #ff8b8f; }
.m-sub { color: #98a3bd; font-size: 12px; line-height: 1.5; }
.money-side { border-left: 1px solid rgba(255, 255, 255, .1); padding-left: 26px; display: flex; flex-direction: column; }
@media (max-width: 900px) { .money-side { border-left: none; padding-left: 0; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; } }
.money-seg { display: flex; gap: 6px; margin: 10px 0 12px; }
.seg-btn { border: 1px solid rgba(255, 255, 255, .14); background: transparent; color: #aab4cc; padding: 4px 14px; border-radius: 7px; font-size: 12.5px; cursor: pointer; }
.seg-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.seg-btn.active { background: #3b5bfd; border-color: #3b5bfd; color: #fff; }
.mini-bars { display: flex; align-items: flex-end; gap: 5px; height: 74px; }
.mini-bar { flex: 1; min-width: 3px; border-radius: 3px 3px 1px 1px; background: #39415a; }
.mini-bar.has { background: linear-gradient(180deg, #6f8bff, #3b5bfd); }
.mini-axis { color: #7f8aa6; font-size: 11.5px; margin-top: 8px; text-align: right; }
.money-foot { color: #8b95ae; font-size: 11.5px; line-height: 1.6; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 16px; padding-top: 12px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px;
  padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 10px; border-bottom: 1px solid #eef0f6; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f8f9fc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }
.tbl .actions { white-space: nowrap; }
.tbl .sub { color: var(--muted); font-size: 12px; }

/* ============ 筛选栏 ============ */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar .input, .filter-bar select { width: auto; min-width: 130px; }
.filter-bar .grow { flex: 1; min-width: 160px; }

/* ============ 空状态 ============ */
.empty { text-align: center; color: var(--muted); padding: 42px 20px; }
.empty .empty-title { font-size: 15px; font-weight: 600; color: #4a5162; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ============ 图表 ============ */
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-note { color: var(--muted); font-size: 12px; margin-top: 6px; }
.empty-chart { color: var(--muted); text-align: center; padding: 40px 0; font-size: 13px; }

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(18, 22, 38, .48); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px 30px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 14px; width: 460px; max-width: 100%;
  box-shadow: 0 24px 70px rgba(10, 14, 35, .3); animation: pop .18s ease;
}
.modal.wide { width: 680px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close { border: none; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px; }
.modal-body { padding: 18px 20px; max-height: 62vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ============ Toast ============ */
#toast-root { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #232839; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(10, 14, 35, .25); animation: slidein .2s ease; max-width: 360px;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============ 导入 ============ */
.step-tag { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; margin-right: 8px; flex-shrink: 0; }
.step-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 16px; }
.progress { height: 8px; background: #edf0f6; border-radius: 99px; overflow: hidden; margin: 12px 0; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 99px; transition: width .2s; }
.import-result { font-size: 13.5px; }

/* ============ 进度/其他 ============ */
.mono { font-family: Consolas, Menlo, monospace; font-size: 12.5px; }
/* 订单号可点击：跳转物流查询 */
.order-link { color: var(--primary); text-decoration: none; border-bottom: 1px dashed rgba(46, 84, 229, .45); cursor: pointer; }
.order-link:hover { border-bottom-style: solid; }

/* 商品主图缩略图 + 大图预览 */
.prod-cell { display: flex; align-items: center; gap: 10px; }
.thumb {
  width: 42px; height: 42px; border-radius: 6px; object-fit: cover; flex: 0 0 auto;
  border: 1px solid var(--border); background: #f2f4f8; cursor: zoom-in; transition: transform .12s;
}
.thumb:hover { transform: scale(1.06); }
.thumb-empty { display: inline-block; cursor: default; position: relative; }
.thumb-empty::after { content: '无图'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #9ba3b2; }
.prod-meta { min-width: 0; }
.prod-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.lightbox {
  position: fixed; inset: 0; z-index: 9999; background: rgba(12, 16, 24, .84);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 24px;
}
.lightbox img {
  max-width: 88vw; max-height: 86vh; border-radius: 10px; background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.lightbox-hint { position: absolute; bottom: 22px; color: rgba(255, 255, 255, .72); font-size: 12px; }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.mt { margin-top: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- 订单标记 ---------- */
.mark-cell { width: 122px; }
.mark-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
  border: 1px solid transparent; border-radius: 999px; background: transparent;
  cursor: pointer; font-size: 12.5px; line-height: 1.4; white-space: nowrap; transition: background .12s, border-color .12s;
}
.mark-btn:hover { background: #f3f5f9; border-color: var(--border); }
.mark-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.mark-dot-empty { background: transparent; color: #9ba3b2; font-size: 13px; line-height: 10px; text-align: center; }
.mark-name { font-weight: 500; }
.mark-name-empty { color: #9ba3b2; font-weight: 400; }

.mark-menu {
  position: fixed; z-index: 10000; width: 176px; padding: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(18, 24, 38, .16);
}
.mark-menu-head {
  font-size: 12px; color: var(--muted); padding: 6px 8px 8px; letter-spacing: .3px;
}
.mark-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px;
  cursor: pointer; font-size: 13px; color: #2b3242;
}
.mark-menu-item:hover { background: #f4f6fb; }
.mark-menu-item.active { background: #eef2ff; color: var(--primary); }
.mark-label { flex: 1; }
.mark-check { color: var(--primary); font-weight: 700; }
.mark-menu-none { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 7px 7px; padding-top: 8px; }

/* 标记设置弹窗 */
.mark-set { display: flex; flex-direction: column; }
.mark-set-row {
  display: grid; grid-template-columns: 22px 1fr 62px; align-items: center;
  gap: 10px; padding: 5px 2px;
}
.mark-set-head { font-size: 12px; color: var(--muted); padding-bottom: 2px; }
.mark-set-head .ms-sw-head { text-align: center; letter-spacing: .5px; }
.mark-set-row .input { height: 34px; padding: 6px 10px; font-size: 13px; }
.mark-set-row .ms-name { min-width: 0; }
.ms-color {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; cursor: pointer; border-radius: 50%;
}
.ms-color .mark-dot { width: 14px; height: 14px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08); }
.ms-color input[type=color] {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0;
  border: none; opacity: 0; cursor: pointer; background: none;
}
.mark-set-none {
  display: flex; align-items: center; gap: 12px; margin-top: 3px; padding: 9px 2px 0;
  border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted);
}
.mark-set-none .mark-dot { width: 14px; height: 14px; }
.mark-set-tip { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* 开关（显示 / 隐藏） */
.switch {
  position: relative; width: 62px; height: 24px; border: none; border-radius: 999px;
  background: #e7eaf1; cursor: pointer; padding: 0; transition: background .18s ease; flex: 0 0 auto;
}
.switch .switch-knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: left .18s ease;
}
.switch .switch-txt {
  position: absolute; top: 0; right: 8px; line-height: 24px; font-size: 11px; color: #fff;
  transition: color .18s ease;
}
.switch.on { background: var(--primary); }
.switch.on .switch-knob { left: 41px; }
.switch.on .switch-txt { right: auto; left: 9px; }
.switch:not(.on) .switch-txt { color: #5b6478; }
.switch:hover { background: #dbe0ea; }
.switch.on:hover { background: #2f4ae0; }


/* ---------- 订单页：模式 Tab / 阶段 Tab / 日期快捷 ---------- */
/* 两排页签共用同一套外观：卡片式、圆角、白底细边框，选中态浅蓝底＋蓝边 */
.seg-tabs, .flow-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; overflow-x: auto; scrollbar-width: none;
}
.seg-tabs::-webkit-scrollbar, .flow-tabs::-webkit-scrollbar { display: none; }
.seg-tabs { margin-bottom: 8px; }
.seg-tab, .flow-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px;
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  font-size: 13.5px; line-height: 1.5; color: #4a5162; cursor: pointer;
  transition: all .14s ease; white-space: nowrap; text-align: left;
  /* 重置 <button> 的浏览器默认外观，否则会变成灰色立体按钮 */
  font-family: inherit;
}
.seg-tab:hover, .flow-tab:hover { border-color: #c9d0e0; background: #f8f9fc; }
.seg-tab.active, .flow-tab.active {
  border-color: var(--primary); color: var(--primary); background: #f4f6ff; font-weight: 600;
}
.seg-tab .cnt, .flow-tab .cnt {
  font-size: 11.5px; color: #8b93a4; background: #f0f2f7; border-radius: 999px;
  padding: 1px 7px; font-variant-numeric: tabular-nums;
}
.seg-tab.active .cnt, .flow-tab.active .cnt { background: #e3e8ff; color: var(--primary); }
.flow-tab .cnt.is-zero { color: #c3c9d6; }

.date-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.date-chip {
  padding: 7px 11px; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  font-size: 13px; color: #4a5162; cursor: pointer; transition: all .14s ease; white-space: nowrap;
}
.date-chip:hover { border-color: #c9d0e0; background: #f8f9fc; }
.date-chip.active { border-color: var(--primary); color: var(--primary); background: #f4f6ff; font-weight: 600; }
.date-range { display: inline-flex; align-items: center; gap: 6px; }
.date-range .input { width: auto; }
.date-range .dash { color: var(--muted); }

.scheme-chip {
  display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 10.5px;
  color: #4b5bdc; background: #eef1ff; letter-spacing: .3px;
}
.btn-mini {
  padding: 3px 10px; font-size: 12.5px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; transition: all .14s ease; margin-right: 6px;
}
.btn-mini:hover { border-color: #c9d0e0; background: #f8f9fc; }
.btn-mini.primary { color: var(--primary); border-color: #c7d2ff; background: #f2f5ff; font-weight: 500; }
.btn-mini.primary:hover { background: #e8edff; border-color: var(--primary); }
.btn-mini:disabled { opacity: .55; cursor: default; }

/* ---------- 订单页：取消原因 / 取消过失方 ---------- */
.cancel-party {
  display: inline-block; padding: 0 7px; border-radius: 4px; font-size: 11.5px;
  line-height: 19px; font-weight: 500; white-space: nowrap; vertical-align: middle;
}
.cp-seller { color: #b42318; background: #fee4e2; }
.cp-client { color: #b54708; background: #fef0c7; }
.cp-ozon { color: #344054; background: #eaecf0; }
.cp-unknown { color: #667085; background: #f4f3f8; }

.cancel-why { font-size: 12.5px; color: #475467; line-height: 1.45; }
.cancel-why-cell { min-width: 208px; max-width: 300px; }
.cancel-note { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 3px; }

.tbl-cancel th:nth-child(7), .tbl-cancel td:nth-child(7) { min-width: 84px; }
.cw-seller { color: #b42318; }
.cw-client { color: #b54708; }
.cw-ozon { color: #475467; }
.cw-unknown { color: #667085; }

/* ---------- 子账号 / 团队 ---------- */
.role-tag {
  display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 10.5px; line-height: 17px;
  color: #4b5bdc; background: #eef1ff; vertical-align: middle; margin-left: 4px; font-weight: 500;
}
.store-chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  color: #344054; background: #f2f4f7; margin: 1px 4px 1px 0; white-space: nowrap;
}
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.pick-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; transition: all .14s ease;
}
.pick-item:hover { border-color: #c9d0e0; background: #f8f9fc; }
.pick-item input { width: 16px; height: 16px; accent-color: var(--primary); flex: 0 0 auto; }
.pick-item.disabled { opacity: .6; cursor: default; background: #fafbfc; }
.pick-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick-main b { font-size: 13.5px; }
.pick-main .sub { font-size: 11.5px; color: var(--muted); }
.pick-taken { margin-left: auto; font-size: 11.5px; color: #b54708; background: #fef0c7; padding: 1px 7px; border-radius: 4px; }

/* ---------- 财务页：同步日志 / 扣费明细弹窗 ---------- */
.sync-log {
  background: #f5f6fa; border-radius: 8px; padding: 10px 12px;
  max-height: 240px; overflow-y: auto; font-size: 12px; line-height: 1.8;
  color: #4a5162; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-all; margin-top: 12px;
}
.fin-detail-grid { display: grid; grid-template-columns: 230px 1fr; gap: 16px; align-items: start; }
.fin-detail-grid h4 { margin: 0 0 8px; font-size: 13.5px; color: #333a4d; }
.fin-detail-scroll { max-height: 420px; overflow-y: auto; }
.fin-detail-scroll .tbl th { position: sticky; top: 0; background: #fff; z-index: 1; }
.fin-detail-side .tbl { font-size: 12.5px; }
.fin-detail-main .tbl { font-size: 12.5px; }
.fin-detail-main .mono { font-size: 12px; }
@media (max-width: 720px) { .fin-detail-grid { grid-template-columns: 1fr; } }
.modal.xwide { width: 1040px; max-width: calc(100vw - 48px); }
.fin-detail-main #fin-det-orders td.mono { white-space: nowrap; font-size: 11.5px; }
.fin-detail-scroll .tbl th, .fin-detail-scroll .tbl td { padding-left: 8px; padding-right: 8px; }
.fin-pkg { display: inline-block; margin-left: 6px; font-size: 10.5px; color: #8b93a4; background: #f0f2f7; border-radius: 999px; padding: 0 6px; white-space: nowrap; }

/* 财务月度表：金额/月份不换行，窄屏交给横向滚动，避免 ₽ 与数字被拆行 */
#fin-table .tbl td.num, #fin-table .tbl td.mono { white-space: nowrap; }
#fin-table .tbl td { white-space: nowrap; }
#fin-table .tbl td:nth-child(2) { white-space: normal; }

.login-links { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.login-links .btn-link { padding: 2px 0; font-size: 12.5px; }


.key-set { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #e8f5e9; color: #2e7d32; font-size: 12px; }
.key-warn { color: #b26a00; font-size: 11.5px; margin-top: 2px; }
.key-expired { color: var(--danger); font-size: 11.5px; margin-top: 2px; }

