/* ============ 基础 ============ */
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --ink: #15181d;
  --ink-2: #3d4450;
  --muted: #7a828f;
  --line: #e5e8ed;
  --line-2: #eef1f4;
  --brand: #0d6b63;
  --brand-ink: #0a544e;
  --brand-soft: #e7f2f0;
  --ok: #0f7b4f;
  --ok-soft: #e8f5ee;
  --warn: #a8620a;
  --warn-soft: #fdf3e3;
  --danger: #b02a20;
  --danger-soft: #fceceb;
  --info: #1f4fa3;
  --info-soft: #eaf0fb;
  --radius: 13px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 6px 20px -8px rgba(16, 24, 40, .16), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 60px -20px rgba(16, 24, 40, .3);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.num { font-variant-numeric: tabular-nums; }

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 226px;
  flex: 0 0 226px;
  background: #101c1b;
  color: #dfe9e7;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px 14px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 20px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(150deg, #17857a, #0c5b54);
  color: #fff; font-weight: 700; font-size: 17px;
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .3px; color: #fff; }
.brand-text span { font-size: 11px; color: #7d918e; letter-spacing: .5px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 11px;
  background: none; border: 0; border-radius: 9px;
  color: #a9bcb9; font-size: 13.5px; text-align: left;
  transition: background .14s, color .14s;
}
.nav-item svg { width: 17px; height: 17px; opacity: .85; }
.nav-item span { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #eef6f4; }
.nav-item.active { background: rgba(23,133,122,.22); color: #fff; box-shadow: inset 0 0 0 1px rgba(35,166,152,.32); }
.nav-item.active svg { opacity: 1; color: #4fc3b4; }
.nav-badge {
  font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 20px;
  background: rgba(255,255,255,.1); color: #c3d6d3; font-variant-numeric: tabular-nums;
}
.nav-badge.warn { background: rgba(224,142,42,.2); color: #f0b264; }
.nav-badge:empty, .nav-badge[data-zero="1"] { display: none; }

.sidebar-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid rgba(255,255,255,.07); }
.store-state { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #8fa5a1; }
.store-state .dot { width: 6px; height: 6px; border-radius: 50%; background: #35c08f; box-shadow: 0 0 0 3px rgba(53,192,143,.14); }
.sidebar-foot p { margin-top: 6px; font-size: 11px; color: #5f736f; line-height: 1.5; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 22px 30px 18px;
  background: rgba(244,246,248,.86);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line-2);
}
.topbar-title h1 { font-size: 21px; font-weight: 650; letter-spacing: -.2px; }
.topbar-title p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }

.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search input {
  width: 232px; padding: 8px 11px 8px 32px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-size: 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: #a3aab5; }
.search input:focus { border-color: #8dc3bc; box-shadow: 0 0 0 3px rgba(13,107,99,.1); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 550; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: background .14s, border-color .14s, transform .06s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--panel-2); border-color: #d6dbe2; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: #fff; }
.btn.danger { color: var(--danger); border-color: #f0cdc9; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }

.view { padding: 22px 30px 60px; display: flex; flex-direction: column; gap: 18px; }

/* ============ 卡片 ============ */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.card-head h2 { font-size: 14.5px; font-weight: 620; }
.card-head .hint { font-size: 12px; color: var(--muted); }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }

/* ============ 指标卡 ============ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 13px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px 14px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 7px; position: relative; overflow: hidden;
}
.kpi::after {
  content: ''; position: absolute; right: -22px; top: -22px;
  width: 66px; height: 66px; border-radius: 50%;
  background: var(--brand-soft); opacity: .55;
}
.kpi-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; z-index: 1; }
.kpi-value { font-size: 25px; font-weight: 660; letter-spacing: -.6px; z-index: 1; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi-foot { font-size: 11.5px; color: var(--muted); z-index: 1; }
.kpi.alert { border-color: #f3dcc0; background: linear-gradient(180deg, #fffdf9, #fff); }
.kpi.alert::after { background: var(--warn-soft); }
.kpi.alert .kpi-value { color: var(--warn); }
.kpi.bad { border-color: #f2d3cf; }
.kpi.bad::after { background: var(--danger-soft); }
.kpi.bad .kpi-value { color: var(--danger); }
.kpi.info { border-color: #cfdcf3; background: linear-gradient(180deg, #fbfcff, #fff); }
.kpi.info::after { background: var(--info-soft); }
.kpi.info .kpi-value { color: var(--info); }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid { min-width: 940px; }
td.nowrap, th.nowrap { white-space: nowrap; }
.cell-clip { max-width: 172px; }
.cell-clip > .strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-clip > .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
thead th {
  text-align: left; font-weight: 560; font-size: 11.5px; letter-spacing: .4px;
  color: var(--muted); text-transform: uppercase;
  padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--ink-2); }
thead th .arrow { opacity: .35; font-size: 10px; margin-left: 2px; }
thead th.sorted .arrow { opacity: 1; color: var(--brand); }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }
tbody tr.clickable { cursor: pointer; }
td.right, th.right { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.strong { font-weight: 560; }
.ip { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--ink-2); }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .12s; }
tr:hover .row-actions { opacity: 1; }
.icon-btn {
  border: 1px solid transparent; background: none; border-radius: 6px;
  width: 26px; height: 26px; display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.del:hover { background: var(--danger-soft); color: var(--danger); }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 550; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--line-2); color: var(--muted); }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ============ 空状态 ============ */
.empty { padding: 52px 20px; text-align: center; color: var(--muted); }
.empty .empty-icon {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 13px;
  background: var(--line-2); display: grid; place-items: center; color: #9aa3af;
}
.empty .empty-icon svg { width: 22px; height: 22px; }
.empty h3 { font-size: 14px; color: var(--ink-2); font-weight: 600; margin-bottom: 5px; }
.empty p { font-size: 12.5px; max-width: 380px; margin: 0 auto 14px; line-height: 1.6; }

/* ============ 图表 ============ */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 152px; padding: 16px 2px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar {
  width: 60%; max-width: 42px; min-height: 3px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #2a9a8d, #0d6b63);
  transition: height .4s cubic-bezier(.3,.8,.3,1); position: relative;
}
.chart-bar.dim { background: linear-gradient(180deg, #c7d4d2, #b3c3c1); }
.chart-bar:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #101c1b; color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 5px; white-space: nowrap;
}
.chart-label { font-size: 11px; color: var(--muted); }
.chart-val {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--ink-2); font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ============ 进度条（销售排行） ============ */
.rank-list { display: flex; flex-direction: column; gap: 13px; }
.rank-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; }
.rank-no { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.rank-main { min-width: 0; }
.rank-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 5px; }
.rank-top .name { font-weight: 550; }
.rank-top .val { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rank-bar { height: 6px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2a9a8d, #0d6b63); transition: width .5s; }
.rank-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ============ 到期列表 ============ */
.due-list { display: flex; flex-direction: column; }
.due-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 18px;
  border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.due-item:last-child { border-bottom: 0; }
.due-item:hover { background: #fbfcfd; }
.due-days {
  width: 44px; flex: 0 0 44px; text-align: center; border-radius: 8px;
  padding: 5px 0; font-size: 11px; font-weight: 600; line-height: 1.2;
  background: var(--line-2); color: var(--ink-2);
}
.due-days b { display: block; font-size: 16px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.due-days.danger { background: var(--danger-soft); color: var(--danger); }
.due-days.warn { background: var(--warn-soft); color: var(--warn); }
.due-days.ok { background: var(--ok-soft); color: var(--ok); }
.due-main { flex: 1; min-width: 0; }
.due-main .t { font-size: 13px; font-weight: 550; }
.due-main .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.due-amount { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ============ 表单 ============ */
.form { display: flex; flex-direction: column; gap: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 550; color: var(--ink-2); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .tip { font-size: 11px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  outline: none; transition: border-color .14s, box-shadow .14s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #8dc3bc; box-shadow: 0 0 0 3px rgba(13,107,99,.09);
}
.field textarea { resize: vertical; min-height: 62px; line-height: 1.55; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none' stroke='%237a828f' stroke-width='1.8'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.field .err { font-size: 11px; color: var(--danger); display: none; }
.field.invalid input, .field.invalid select { border-color: #e2a8a1; box-shadow: 0 0 0 3px rgba(176,42,32,.07); }
.field.invalid .err { display: block; }
.form-section { font-size: 11.5px; font-weight: 600; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; padding-top: 2px; border-top: 1px solid var(--line-2); margin-top: 2px; }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.checkline input { width: auto; }

/* ============ 弹窗 ============ */
.modal-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal-layer[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(16,24,32,.42); backdrop-filter: blur(2px); animation: fade .16s ease; }
.modal {
  position: relative; width: 100%; max-width: 620px; max-height: calc(100vh - 60px);
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.2,.8,.3,1);
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px 13px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 16px; font-weight: 640; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 20px; border-top: 1px solid var(--line-2); background: var(--panel-2); border-radius: 0 0 16px 16px; }
.modal-foot .left { margin-right: auto; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ============ 详情 ============ */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 4px 0 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 16px; }
.detail-head h3 { font-size: 18px; font-weight: 640; letter-spacing: -.2px; }
.detail-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; }
.detail-grid .full { grid-column: 1 / -1; }
.detail-item .k { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.detail-item .v { font-size: 13.5px; }
.money-lg { font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }

/* ============ 提示 ============ */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #101c1b; color: #fff; font-size: 13px; padding: 9px 15px; border-radius: 9px;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.4); animation: toastIn .2s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: #0b5348; }
.toast.err { background: #8e2318; }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ============ 工具条 ============ */
.dash-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.dash-grid.equal { grid-template-columns: 1fr 1fr; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.chip {
  padding: 5px 11px; border-radius: 20px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; color: var(--ink-2);
  transition: all .13s;
}
.chip:hover { border-color: #cfd6de; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .count { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }

.note {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px;
  background: var(--info-soft); color: #24406e; font-size: 12.5px; line-height: 1.6;
}
.note.warn-box { background: var(--warn-soft); color: #6d4308; }
.note svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; }

.data-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.data-card { border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: var(--panel-2); }
.data-card h3 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.data-card p { font-size: 12px; color: var(--muted); line-height: 1.55; margin-bottom: 11px; }

/* ============ 交付信息 ============ */
.sec-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.dlv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.qr-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px 8px;
  background: #fff; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.qr-item img { width: 86px; height: 86px; image-rendering: pixelated; }
.qr-fail {
  width: 86px; height: 86px; display: grid; place-items: center; text-align: center;
  font-size: 11px; color: var(--muted); background: var(--line-2); border-radius: 6px; line-height: 1.4;
}
.qr-label { font-size: 11px; color: var(--muted); }
.dlv-empty {
  padding: 14px; border: 1px dashed var(--line); border-radius: 10px;
  font-size: 12.5px; color: var(--muted); background: var(--panel-2); line-height: 1.6;
}
.dlv-note { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.dlv-links { margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.dlv-links summary {
  padding: 9px 12px; font-size: 12.5px; cursor: pointer;
  background: var(--panel-2); color: var(--ink-2); user-select: none;
}
.dlv-links summary:hover { background: var(--line-2); }
.link-row { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line-2); align-items: flex-start; }
.link-idx {
  flex: 0 0 18px; height: 18px; border-radius: 5px; background: var(--line-2);
  color: var(--muted); font-size: 11px; display: grid; place-items: center;
}
.link-row code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
  color: var(--ink-2); word-break: break-all; line-height: 1.6;
}
.dlv-warn {
  margin-top: 10px; font-size: 11.5px; color: var(--warn);
  background: var(--warn-soft); padding: 8px 11px; border-radius: 8px; line-height: 1.55;
}
.pay-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pay-amount { font-size: 20px; font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.pay-meta { font-size: 12px; color: var(--muted); }
.field textarea.mono, .field input.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; }

@media (max-width: 1240px) {
  .dash-grid, .dash-grid.equal { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .sidebar { width: 62px; flex: 0 0 62px; padding: 16px 8px; }
  .brand-text, .nav-item span, .nav-badge, .sidebar-foot p { display: none; }
  .brand { justify-content: center; padding-bottom: 16px; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .store-state span:last-child { display: none; }
  .store-state { justify-content: center; }
  .topbar { padding: 16px 18px; }
  .view { padding: 16px 18px 50px; }
  .search input { width: 150px; }
  .form-row, .form-row.three, .detail-grid { grid-template-columns: 1fr; }
}

/* ============ 身份切换 ============ */
[hidden] { display: none !important; }

.role-box {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 10px 11px;
  margin-bottom: 12px;
}
.role-now { display: flex; flex-direction: column; gap: 1px; margin-bottom: 7px; }
.role-title { font-size: 10.5px; font-weight: 600; color: var(--brand); letter-spacing: .3px; }
.role-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.role-box select {
  width: 100%; font-size: 12px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel);
  color: var(--ink-2); cursor: pointer;
}
.role-tip { margin: 7px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.5; }

/* ============ 报价区 ============ */
.quote-box {
  background: var(--brand-soft);
  border: 1px solid #cfe4e0;
  border-radius: 10px;
  padding: 11px 13px;
  margin: 2px 0 14px;
}
.quote-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.quote-row span { font-size: 12px; color: var(--brand-ink); font-weight: 550; }
.quote-row b { font-size: 20px; font-weight: 650; color: var(--brand-ink); font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.quote-row b small { font-size: 11.5px; font-weight: 500; margin-left: 2px; opacity: .75; }
.quote-hint { font-size: 11.5px; color: var(--brand-ink); opacity: .78; margin-top: 3px; line-height: 1.5; }

/* ============ 价格卡片 ============ */
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.price-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  background: var(--panel-2);
}
.pc-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.pc-price {
  font-size: 28px; font-weight: 650; color: var(--brand); letter-spacing: -.8px;
  font-variant-numeric: tabular-nums; margin: 3px 0 10px;
}
.pc-price small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.pc-spec { display: flex; flex-direction: column; gap: 6px; }
.pc-spec > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.pc-spec span { color: var(--muted); }
.pc-spec b { font-weight: 550; color: var(--ink-2); }
.pc-foot {
  margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--muted);
}

.price-table .region-cell {
  font-weight: 600; color: var(--ink-2); background: var(--panel-2);
  vertical-align: top; white-space: nowrap; font-size: 12.5px;
}

@media (max-width: 900px) {
  .price-grid { grid-template-columns: 1fr; }
}

.quote-total {
  display: inline-block; margin-left: 8px; padding: 1px 7px;
  background: #ffffff; border: 1px solid #cfe4e0; border-radius: 6px;
  font-size: 11.5px; font-weight: 550; color: var(--brand-ink); vertical-align: 3px;
}

.kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) {
  .kpis.kpis-4, .kpis.kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .kpis.kpis-4, .kpis.kpis-3 { grid-template-columns: 1fr; }
}

/* ============ 备注与跟进 ============ */
.note-tag {
  display: inline-block; margin-left: 6px; padding: 0 5px; height: 16px; line-height: 16px;
  border-radius: 4px; background: var(--brand-soft); color: var(--brand-ink);
  font-size: 10.5px; font-weight: 600; vertical-align: 1px;
}
.note-list { display: flex; flex-direction: column; gap: 8px; }
.note-empty {
  padding: 13px 14px; border: 1px dashed var(--line); border-radius: 9px;
  font-size: 12.5px; color: var(--muted); background: var(--panel-2); line-height: 1.6;
}
.note-item { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: var(--panel-2); }
.note-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.note-by { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.note-at { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.note-del {
  margin-left: auto; border: 0; background: none; color: var(--muted);
  font-size: 11px; cursor: pointer; padding: 2px 5px; border-radius: 4px;
}
.note-del:hover { color: var(--danger); background: var(--danger-soft); }
.note-text { font-size: 12.5px; color: var(--ink); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.note-form { display: flex; gap: 9px; align-items: flex-end; margin-top: 10px; }
.note-form textarea {
  flex: 1; min-height: 46px; resize: vertical; font-family: inherit; font-size: 12.5px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink); line-height: 1.6;
}
.note-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ============ 提成结算 ============ */
.comm-rule {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 13px; border: 1px solid #cfe4e0; background: var(--brand-soft); border-radius: 10px;
}
.comm-rule-k { font-size: 10.5px; color: var(--brand-ink); opacity: .75; font-weight: 600; letter-spacing: .2px; }
.comm-rule-v { font-size: 13px; color: var(--brand-ink); font-weight: 600; margin-top: 2px; }
.comm-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 12px 0; }
.comm-kpi {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  background: var(--panel-2); display: flex; flex-direction: column; gap: 2px;
}
.comm-kpi span { font-size: 11.5px; color: var(--muted); }
.comm-kpi b { font-size: 19px; font-weight: 650; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.comm-kpi b.sm { font-size: 13px; letter-spacing: 0; }
.comm-kpi i { font-size: 11px; color: var(--muted); font-style: normal; }
.comm-table { font-size: 12.5px; }
.comm-foot { margin-top: 11px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.comm-empty {
  padding: 14px; border: 1px dashed var(--line); border-radius: 9px;
  font-size: 12.5px; color: var(--muted); background: var(--panel-2);
}
.comm-preview {
  display: flex; align-items: baseline; gap: 8px; margin-top: 16px;
  padding: 11px 13px; border-radius: 10px; background: var(--brand-soft); border: 1px solid #cfe4e0;
}
.comm-preview span { font-size: 12px; color: var(--brand-ink); }
.comm-preview b { font-size: 18px; font-weight: 650; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.comm-preview i { font-size: 11.5px; color: var(--brand-ink); opacity: .75; font-style: normal; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.mini-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 8px 6px; }
.mini-table td { padding: 5px 8px; border-top: 1px solid var(--line-2); }
.mini-table td input {
  width: 100%; max-width: 150px; font-family: inherit; font-size: 12.5px;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel); color: var(--ink);
}
.mini-table td input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.mini-muted { font-size: 11.5px; color: var(--muted); line-height: 1.55; }

.link-row code { flex: 1; }
.link-row .btn { flex: 0 0 auto; align-self: center; }

@media (max-width: 720px) {
  .comm-kpis { grid-template-columns: 1fr; }
}

/* ============ 登录门 ============ */
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; }

.gate {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 34px 20px;
  background:
    radial-gradient(900px 520px at 10% -5%, #12332e 0%, rgba(18, 51, 46, 0) 62%),
    radial-gradient(820px 520px at 95% 105%, #e3f0ee 0%, rgba(227, 240, 238, 0) 60%),
    var(--bg);
}
.gate-panel {
  width: 100%; max-width: 886px;
  display: grid; grid-template-columns: 1fr 376px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.gate-hero {
  padding: 42px 38px 34px;
  background: linear-gradient(158deg, #10241f 0%, #0d3b35 52%, #0a5249 100%);
  color: #dfe9e7; display: flex; flex-direction: column;
}
.gate-mark {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  font-size: 20px; font-weight: 700; color: #fff;
}
.gate-hero h1 { font-size: 26px; font-weight: 660; letter-spacing: -.5px; color: #fff; margin-top: 20px; }
.gate-slogan { font-size: 12.5px; color: #93ada9; margin-top: 5px; letter-spacing: .2px; }
.gate-points { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 13px; }
.gate-points li { position: relative; padding-left: 23px; font-size: 12.5px; line-height: 1.65; color: #b5c9c5; }
.gate-points li::before {
  content: ''; position: absolute; left: 0; top: 5px;
  width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid #4f9e94;
}
.gate-points li b { color: #fff; font-weight: 600; }

.gate-card { padding: 26px 26px 24px; display: flex; flex-direction: column; }
.gate-tabs { display: flex; gap: 3px; padding: 3px; background: var(--line-2); border-radius: 9px; margin-bottom: 18px; }
.gate-tab {
  flex: 1; border: 0; background: transparent; padding: 7px 0; border-radius: 7px;
  font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer;
}
.gate-tab.active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-field { display: flex; flex-direction: column; gap: 4px; }
.gate-field label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .1px; }
.gate-field .req { color: var(--danger); margin-left: 2px; }
.gate-field input {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; background: var(--panel); color: var(--ink);
}
.gate-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.gate-err { font-size: 11.5px; color: var(--danger); line-height: 1.5; }
.gate-err:empty { display: none; }
.gate-tip { font-size: 11px; color: var(--muted); line-height: 1.65; margin-top: 4px; }
.gate-tip code { background: var(--line-2); padding: 1px 4px; border-radius: 4px; font-size: 10.5px; }
.gate-foot { max-width: 640px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.6; }

@media (max-width: 860px) {
  .gate-panel { grid-template-columns: 1fr; max-width: 420px; }
  .gate-hero { padding: 26px 24px 22px; }
  .gate-hero h1 { font-size: 21px; margin-top: 14px; }
  .gate-points { display: none; }
}

/* ============ 预览提示条 ============ */
.preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 16px 30px 0; padding: 9px 14px;
  background: var(--warn-soft); border: 1px solid #f0dcbb; border-radius: 10px;
  font-size: 12px; color: var(--warn);
}
.preview-bar b { font-weight: 650; }

/* ============ 正式 / 测试 切换 ============ */
.seg {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  padding: 4px; background: var(--line-2); border-radius: 10px; margin-bottom: 15px;
}
.seg-btn {
  border: 0; background: transparent; padding: 7px 15px; border-radius: 7px;
  font-size: 12.5px; font-weight: 550; color: var(--muted); cursor: pointer;
}
.seg-btn.active { background: var(--panel); color: var(--brand); box-shadow: var(--shadow-sm); }
.seg-hint { margin-left: auto; padding-right: 9px; font-size: 11px; color: var(--muted); }

.trial-only { display: none; }
.form.trial-mode .trial-only { display: grid; }
.form.trial-mode .hide-in-trial { display: none !important; }
.trial-note {
  font-size: 11.5px; color: var(--info); background: var(--info-soft);
  border-radius: 8px; padding: 9px 11px; line-height: 1.65;
}
.badge.trial-tag { margin-left: 5px; }
.trial-mode .quote-box { background: var(--info-soft); border-color: #cfdcf5; }
.trial-mode .quote-row span, .trial-mode .quote-row b,
.trial-mode .quote-hint, .trial-mode .quote-total { color: var(--info); }
.trial-mode .quote-total { background: #fff; border-color: #cfdcf5; }

/* ============ 提成发放 ============ */
.rest-due { color: var(--warn); font-weight: 620; }
.temp-pass {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 26px; font-weight: 650; letter-spacing: 4px; text-align: center;
  padding: 16px; margin: 10px 0 6px;
  background: var(--brand-soft); border: 1px dashed #bfdcd7; border-radius: 10px; color: var(--brand-ink);
}

.row-actions.always { opacity: 1; }

/* ============ 销售管理：名册 ============ */
.sales-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 12px; }
.sales-card {
  border: 1px solid var(--line); border-radius: 11px; background: var(--panel);
  padding: 13px 14px 11px; cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.sales-card:hover { border-color: #c9d6d4; box-shadow: var(--shadow); transform: translateY(-1px); }
.sales-card.is-off { background: var(--panel-2); }
.sales-card.is-off .sales-ava { filter: grayscale(1); opacity: .7; }
.sales-top { display: flex; gap: 10px; align-items: center; }
.sales-ava {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff;
  font-size: 15px; font-weight: 650; letter-spacing: 0;
  background: linear-gradient(140deg, #0d6b63, #159b8d);
}
.sales-ava.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 20px; }
.ava-c1 { background: linear-gradient(140deg, #0d6b63, #159b8d); }
.ava-c2 { background: linear-gradient(140deg, #1f4fa3, #3d78d8); }
.ava-c3 { background: linear-gradient(140deg, #8a5a12, #c08a34); }
.ava-c4 { background: linear-gradient(140deg, #563f8c, #8368c4); }
.ava-c5 { background: linear-gradient(140deg, #96503a, #c4745a); }
.sales-id { min-width: 0; flex: 1; }
.sales-name { font-size: 13.5px; font-weight: 620; display: flex; align-items: center; gap: 6px; }
.sales-acc {
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sales-mini {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  margin: 11px 0 9px; padding: 9px 0;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.sales-mini > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sales-mini b { font-size: 13px; font-weight: 640; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sales-mini span { font-size: 10.5px; color: var(--muted); }
.sales-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sales-foot .mini-muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-acts { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }

/* ============ 销售档案 ============ */
.profile-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: -4px; }
.profile-bar .spacer { flex: 1; }
.profile-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.profile-meta { flex: 1; min-width: 190px; }
.profile-meta h2 { font-size: 19px; font-weight: 650; letter-spacing: -.3px; display: flex; align-items: center; gap: 8px; }
.profile-meta p { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.profile-rest { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.profile-rest span { font-size: 11px; color: var(--muted); }
.profile-rest b { font-size: 20px; font-weight: 650; color: var(--warn); font-variant-numeric: tabular-nums; }
.profile-rest i { font-size: 10.5px; color: var(--muted); font-style: normal; }

textarea.note-input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; font-family: inherit; line-height: 1.6; resize: vertical;
  background: var(--panel); color: var(--ink);
}
textarea.note-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 账号凭据 */
.cred-box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.cred-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 13px; border-bottom: 1px solid var(--line-2);
}
.cred-row:last-child { border-bottom: 0; }
.cred-row span { font-size: 11.5px; color: var(--muted); flex: 0 0 auto; }
.cred-row b { font-size: 13.5px; font-weight: 600; text-align: right; word-break: break-all; }

/* ============ 入口标识 ============ */
.gate-entry {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  padding: 4px 10px; margin-bottom: 14px;
  border-radius: 999px; background: var(--brand-soft);
  color: var(--brand-ink); font-size: 11.5px; font-weight: 620; letter-spacing: .2px;
}
.gate-entry::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}

/* ============ 入口地址条 ============ */
.entry-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.entry-link {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px 9px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); min-width: 0;
}
.entry-link span { font-size: 11.5px; font-weight: 600; color: var(--muted); flex: 0 0 auto; }
.entry-link b {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 500; color: var(--ink-2);
}
.entry-link .btn { flex: 0 0 auto; }
