/* =========================================================
   记账APP 前端样式（纯静态，无外部资源）
   目标：Windows 桌面 Chrome/Edge + Android Chrome/微信内置浏览器
   ========================================================= */
:root {
  --primary: #1f6feb;
  --primary-dark: #1859c4;
  --bg: #f2f4f8;
  --panel: #ffffff;
  --border: #e2e7ef;
  --text: #1c2434;
  --muted: #68718a;
  --danger: #d93025;
  --ok: #188a4d;
  --warn: #b7791f;
  --info: #1f6feb;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
  --topbar-h: 52px;
  --sidebar-w: 212px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------- 布局 ---------------- */
.layout { min-height: 100vh; }
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 12px; z-index: 40;
}
.brand { font-weight: 700; font-size: 16px; color: var(--primary); margin-left: 4px; cursor: pointer; user-select: none; }
.brand:hover { opacity: .8; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-box { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.user-name { font-weight: 600; }
.user-role {
  font-size: 11px; color: var(--primary); background: #e8f0fe; border: 1px solid #c7dcfb;
  border-radius: 10px; padding: 1px 8px; white-space: nowrap;
}
.hamburger { display: none; }
.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--panel); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 10px 8px; z-index: 30;
}
.nav-item {
  display: block; padding: 9px 12px; border-radius: 6px; color: var(--text);
  margin-bottom: 2px; font-size: 14px;
}
.nav-item:hover { background: #f0f4fa; text-decoration: none; }
.nav-item.active { background: #e8f0fe; color: var(--primary); font-weight: 600; }
.view {
  margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 16px) 18px 40px;
  max-width: 1240px;
}
/* 登录/改密页：隐藏顶栏与侧栏，容器保持可见 */
.layout.login-mode .topbar,
.layout.login-mode .sidebar { display: none; }
.layout.login-mode .view { margin-left: 0; padding: 0; max-width: none; }
.overlay-open { overflow: hidden; }

/* ---------------- 通用 ---------------- */
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.page-head h1 { font-size: 20px; margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.card-title { font-weight: 600; font-size: 15px; margin: 0 0 10px; }
.card-title .muted { font-weight: 400; font-size: 12px; margin-left: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 6px; padding: 7px 14px; font-size: 14px; cursor: pointer;
  line-height: 1.2; transition: background .12s, border-color .12s;
}
.btn:hover { background: #f0f4fa; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn-ghost:hover { background: #eef3fb; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b3261e; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: 6px; padding: 6px 8px; display: inline-flex; align-items: center;
  position: relative; font-size: 16px; line-height: 1;
}
.icon-btn:hover { background: #f0f4fa; color: var(--text); }
.lang-btn { font-weight: 600; font-size: 13px; color: var(--primary); }

/* 铃铛 */
.bell-wrap { position: relative; }
.bell-badge {
  position: absolute; top: 0; right: 0; background: var(--danger); color: #fff;
  font-size: 10px; border-radius: 9px; min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; padding: 0 4px;
}
.bell-drop {
  position: absolute; right: 0; top: calc(100% + 6px); width: 340px; max-width: 88vw;
  max-height: 420px; overflow-y: auto; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16,24,40,.14); z-index: 60;
}
.bell-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.bell-empty { padding: 20px 12px; text-align: center; color: var(--muted); }
.bell-item { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.bell-item:hover { background: #f7f9fc; }
.bell-item.unread { background: #f2f7ff; }
.bell-item.unread .bell-item-title::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); margin-right: 6px; vertical-align: 1px;
}
.bell-item-title { font-weight: 600; }
.bell-item-body { color: var(--muted); margin-top: 2px; font-size: 13px; }
.bell-item-time { color: var(--muted); font-size: 11px; margin-top: 4px; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #e8f0fe 0%, #f6f8fc 55%, #eef2f8 100%);
  padding: 16px;
}
.login-card { width: 360px; max-width: 100%; padding: 28px 26px; }
.login-title { text-align: center; color: var(--primary); margin: 0 0 20px; font-size: 22px; }
.login-card .field { margin-bottom: 14px; }
/* 改密页（保留侧栏）：卡片在内容区内水平垂直居中，无全屏背景 */
.view .login-wrap { min-height: calc(100vh - var(--topbar-h) - 72px); background: none; padding: 12px; }

/* ---------------- 表单 ---------------- */
.field { display: block; margin-bottom: 10px; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 70px; }
input[type="checkbox"] { width: auto; margin-right: 6px; }
input[type="radio"] { width: auto; margin-right: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
/* 付款条件选择器 */
.pt-box { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; background: #fafbfd; }
.pt-row { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: flex-end; }
.pt-item { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.pt-item select, .pt-item input { min-width: 110px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); }
.pt-item .pt-custom-input { min-width: 90px; }
#pt-balance { background: #eef2f8; color: var(--text); }
.pt-box .inline-label { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.pt-box #pt-manual-text { display: block; width: 100%; margin-top: 8px; }
/* 发票明细行（卡片式） */
.inv-items { border: 1px solid var(--border); border-radius: 6px; padding: 10px; background: #fafbfd; }
.inv-items-head {
  display: grid;
  grid-template-columns: 132px 158px 84px 96px 90px 1fr 28px;
  gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; padding: 0 2px;
}
.inv-item-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 10px; margin-bottom: 8px;
}
.item-row1 {
  display: grid;
  grid-template-columns: 132px 158px 84px 96px 90px 1fr 28px;
  gap: 8px; align-items: center;
}
.inv-items input[type="text"], .inv-items input[type="number"] {
  width: 100%; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
}
.it-style-cell { display: flex; align-items: center; gap: 4px; }
.it-style-cell .it-style { flex: 1; min-width: 0; }
.it-dup {
  flex: 0 0 auto; width: 24px; height: 24px; line-height: 1; padding: 0;
  border: 1px solid var(--primary); color: var(--primary); background: #eaf2fe;
  border-radius: 6px; font-size: 14px; cursor: pointer;
}
.it-dup:hover { background: #d7e7fd; }
.it-size-cell { display: flex; gap: 4px; }
.it-size-cell select { padding: 7px 4px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; flex: 0 0 70px; max-width: 70px; }
.it-size-cell input { flex: 1; min-width: 60px; max-width: 84px; }
.it-sub-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.it-del {
  border: none; background: transparent; color: var(--danger); cursor: pointer;
  font-size: 15px; width: 26px; height: 26px; border-radius: 6px;
}
.it-del:hover { background: #fdecea; }
.item-row2 { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 8px; align-items: center; }
.item-row3 { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.item-row3 .rm-label { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.item-row3 .it-fabric { flex: 1 1 220px; min-width: 160px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.item-row3 .it-remark { flex: 2 1 300px; min-width: 180px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
/* 数量汇总 */
.inv-qty-summary {
  margin: 4px 0 10px; padding: 8px 12px; background: #eef4fd;
  border: 1px solid #d8e6fb; border-radius: 6px; font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center;
}
.inv-qty-summary .qs-total { font-weight: 700; color: var(--primary-dark); }
.inv-qty-summary .qs-style { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.inv-qty-summary .qs-style-no { font-weight: 600; }
.inv-qty-summary .qs-sizes { color: var(--muted); font-size: 12px; }
.img-pick { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.file-btn {
  display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; background: #fff; cursor: pointer; white-space: nowrap;
}
.file-btn:hover { background: #f0f4fa; }
.file-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.inv-items .img-link { cursor: pointer; color: var(--primary); text-decoration: underline; word-break: break-all; }
/* 附件缩略图（表单与详情通用） */
.thumb {
  max-width: 110px; max-height: 110px; width: auto; height: auto;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
  object-fit: contain; cursor: zoom-in; vertical-align: middle; display: inline-block;
}
.thumb:hover { border-color: var(--primary); }
.thumb-row { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* 款号图片分组（详情页） */
.style-img-group {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--border);
}
.style-img-group:last-child { border-bottom: none; }
.sig-style { font-weight: 600; min-width: 120px; }
.sig-kind { font-size: 13px; color: var(--text); }
.img-chip { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.img-del {
  border: none; background: transparent; color: var(--danger); cursor: pointer;
  font-size: 12px; width: 18px; height: 18px; border-radius: 4px; line-height: 1; padding: 0;
}
.img-del:hover { background: #fdecea; }
/* 审核详情（修改前 → 修改后） */
.apr-detail-row td { background: #f7f9fc; padding: 8px 12px; }
.apr-detail { font-size: 12.5px; line-height: 1.7; }
.apr-line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.apr-label { min-width: 110px; color: var(--muted); }
.apr-old { color: var(--muted); text-decoration: line-through; word-break: break-all; }
.apr-arrow { color: var(--primary); font-weight: 600; }
.apr-new { color: var(--danger); font-weight: 600; word-break: break-all; }
/* 导出弹窗：添加银行区 */
.bank-add-box { margin-top: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: 8px; background: #fafbfd; }
.bank-add-box .form-grid { margin-top: 8px; }
@media (max-width: 720px) {
  .inv-items-head { display: none; }
  .item-row1 { grid-template-columns: 1fr 1fr; }
  .item-row1 .it-style-cell { grid-column: 1 / -1; }
  .it-sub-cell { text-align: left; }
  .item-row1 .it-del { justify-self: end; }
}
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-error { color: var(--danger); font-size: 13px; margin: 4px 0 8px; }
.form-warn { color: var(--warn); font-size: 13px; margin: 4px 0 8px; }
.form-note { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.inline-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 14px; }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 14px;
}
.filter-bar .field { margin-bottom: 0; }
.filter-item { min-width: 140px; }
.filter-item.narrow { min-width: 110px; }
.filter-item.search { flex: 1; min-width: 200px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #f7f9fc; font-weight: 600; color: var(--muted); white-space: nowrap; font-size: 12.5px; }
tr:last-child td { border-bottom: none; }
tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover td { background: #f5f8fd; }
td.num, th.num { text-align: right; }
td.nowrap, th.nowrap { white-space: nowrap; }
tr.row-error td { background: #fdeeee; }

/* ---------------- 徽章/状态 ---------------- */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px;
  white-space: nowrap; border: 1px solid transparent;
}
.badge-ok { color: var(--ok); background: #e6f6ec; border-color: #c3e8d2; }
.badge-danger { color: var(--danger); background: #fdeeee; border-color: #f5c6c2; }
.badge-warn { color: var(--warn); background: #fdf4e3; border-color: #f0ddb8; }
.badge-info { color: var(--info); background: #e8f0fe; border-color: #c7dcfb; }
.badge-muted { color: var(--muted); background: #f0f2f6; border-color: #e2e7ef; }

/* ---------------- 工作台 ---------------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.dash-card { padding: 14px 16px; }
.dash-card.clickable { cursor: pointer; transition: box-shadow .12s; }
.dash-card.clickable:hover { box-shadow: 0 4px 12px rgba(16,24,40,.14); }
.dash-card .card-title { margin-bottom: 8px; }
.card-count { font-size: 26px; font-weight: 700; color: var(--primary); }
.card-count.danger { color: var(--danger); }
.card-count.warn { color: var(--warn); }
.card-money { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.card-list { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }
.card-list-item { font-size: 12.5px; color: var(--muted); padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-list-item .money { color: var(--text); }

/* ---------------- 页签 ---------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 14px; }
.tab {
  border: none; background: transparent; padding: 9px 16px; cursor: pointer;
  font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; justify-content: flex-end; }
.pager-info { color: var(--muted); font-size: 13px; }

/* ---------------- 空态/错误 ---------------- */
.empty-box { padding: 40px 16px; text-align: center; color: var(--muted); }
.error-box { color: var(--danger); }
.empty-page { padding: 60px 16px; text-align: center; color: var(--muted); }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; top: 62px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--info);
  border-radius: 6px; padding: 10px 16px; box-shadow: 0 6px 18px rgba(16,24,40,.16);
  max-width: 320px; font-size: 14px; transition: opacity .3s, transform .3s;
}
.toast-success { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--danger); }
.toast-warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(-6px); }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 48px 12px 24px;
  overflow-y: auto;
}
.modal {
  background: var(--panel); border-radius: 10px; width: 560px; max-width: 100%;
  box-shadow: 0 12px 40px rgba(16,24,40,.25); animation: modalIn .15s ease-out;
  max-height: 92vh; display: flex; flex-direction: column;
}
.modal.wide { width: min(1080px, 96vw); }
.modal-body { overflow-y: auto; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { font-size: 20px; }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.alert-msg { font-size: 14px; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }

/* ---------------- 详情 ---------------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.detail-item .field-label { margin-bottom: 2px; }
.detail-item .value { font-size: 14.5px; }
.stat-big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-big.danger { color: var(--danger); }

/* 阶段卡片 */
.stage-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: #fbfcfe; }
.stage-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stage-name { font-weight: 600; font-size: 14.5px; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 16px; }
.stage-grid .field-label { margin-bottom: 0; font-size: 12px; }
.stage-grid .value { font-weight: 600; font-variant-numeric: tabular-nums; }

/* 分配行 */
.alloc-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.alloc-row select { flex: 1.4; }
.alloc-row input { flex: 1; }
.alloc-remain { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------------- 导入 ---------------- */
.imp-table input.imp-cell { padding: 4px 6px; font-size: 12.5px; min-width: 90px; }
.imp-err { color: var(--danger); font-size: 12px; min-width: 120px; }
.imp-ok { color: var(--ok); font-size: 12px; }
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------------- 备忘录 ---------------- */
.memo-group-title { font-weight: 700; font-size: 14px; margin: 16px 0 8px; color: var(--primary); }
.memo-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--panel); }
.memo-item.done .memo-content { text-decoration: line-through; color: var(--muted); }
.memo-check { margin-top: 2px; width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.memo-main { flex: 1; min-width: 0; }
.memo-content { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.memo-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.memo-meta .memo-remind { color: var(--warn); }

/* 别名 */
.alias-chip { display: inline-flex; align-items: center; gap: 6px; background: #f0f4fa; border: 1px solid var(--border); border-radius: 14px; padding: 2px 10px; margin: 0 6px 6px 0; font-size: 13px; }
.alias-chip button { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.alias-chip button:hover { color: var(--danger); }
.alias-add { display: flex; gap: 8px; margin-top: 6px; max-width: 380px; }

/* ---------------- 同比 ---------------- */
.yoy-indicators { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.indicator-card { padding: 14px 16px; }
.indicator-card .ind-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.indicator-card .ind-current { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.indicator-card .ind-prior { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.indicator-card .ind-change { font-size: 12.5px; margin-top: 2px; }
.ind-change.up { color: var(--ok); }
.ind-change.down { color: var(--danger); }
.ind-change.flat { color: var(--muted); }

/* 对账单 */
.stmt-section-title { font-weight: 600; margin: 18px 0 8px; font-size: 15px; color: var(--primary); }
.stmt-total-row td { background: #f7f9fc; font-weight: 600; }
.sub-list { color: var(--muted); font-size: 12px; }

/* ---------------- 响应式（手机 ≤600px） ---------------- */
@media (max-width: 600px) {
  .hamburger { display: inline-flex; }
  .sidebar {
    transform: translateX(-100%); transition: transform .18s ease; width: 230px; z-index: 50;
    box-shadow: 4px 0 18px rgba(16,24,40,.18);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open::after {
    content: ""; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(16,24,40,.35); z-index: 45;
  }
  .view { margin-left: 0; padding: calc(var(--topbar-h) + 12px) 10px 32px; }
  .user-role { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
  .filter-bar { padding: 10px; }
  .filter-item { flex: 1 1 40%; min-width: 0; }
  .filter-item.search { flex-basis: 100%; }
  .toasts { right: 8px; left: 8px; }
  .toast { max-width: none; }
  .modal-overlay { padding: 16px 8px; }
  .bell-drop { position: fixed; right: 8px; left: 8px; top: var(--topbar-h); width: auto; max-width: none; }
}

/* Customer statement: consistent financial hierarchy on screen and in print. */
.export-template-note { padding: 12px 14px; margin: 0 0 16px; background: #eef5fa; color: #31546e; border-left: 3px solid #497994; border-radius: 6px; line-height: 1.65; }
.statement-caption { display: flex; align-items: center; justify-content: space-between; padding: 18px 2px 12px; font-size: 20px; font-weight: 700; color: #17324d; }
.statement-caption span { font-size: 13px; padding: 5px 12px; border-radius: 20px; background: #eaf2f8; }
#stmt-result .card { overflow: hidden; border-color: #dce6ef; }
#stmt-result .card-title { color: #17324d; border-bottom: 1px solid #dce6ef; padding-bottom: 12px; }
#stmt-result .detail-grid { gap: 20px; }
#stmt-result .stat-big { font-variant-numeric: tabular-nums; color: #17324d; }
#stmt-result th { background: #edf3f8; color: #31546e; }
#stmt-result tbody tr:nth-child(even) { background: #f8fafc; }
#stmt-result .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.statement-footnote { color: #65798c; font-size: 13px; line-height: 1.7; padding: 0 4px 14px; }
.statement-cur-banner { font-weight: 700; font-size: 14px; color: #17324d; margin: 16px 0 8px; padding: 6px 10px; background: #eaf2f8; border-radius: 6px; }
.statement .sub-head, .sub-head { font-weight: 600; font-size: 13px; color: #17324d; margin: 12px 0 6px; }
.subtotal-row td { font-weight: 700; background: #f5f8fb; }
.merge-check { display: block; padding: 4px 0; font-size: 13.5px; cursor: pointer; }
.merge-check input { margin-right: 6px; vertical-align: middle; }
/* 码单表单 */
.pl-row { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #fff; }
.pl-row-main { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; align-items: end; }
.pl-field { display: flex; flex-direction: column; gap: 3px; }
.pl-field > span { font-size: 11.5px; color: var(--muted); }
.pl-field input { width: 100%; box-sizing: border-box; }
.pl-field-del { flex-direction: column; justify-content: flex-end; }
.pl-field-del .btn { margin-bottom: 2px; }
.pl-colors { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pl-color-line { display: flex; flex-direction: column; gap: 8px; background: #f7f9fc; border-radius: 8px; padding: 10px 12px; }
.pl-color-head { display: flex; gap: 10px; align-items: flex-end; }
.pl-color-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 8px; }
.pl-size { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.pl-size input { width: 100%; box-sizing: border-box; }
.pl-merged { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.pl-merged-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef4fb; border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; font-size: 13px; }
.pl-merged-chip input { width: 70px; }
/* 拖入附件 */
.file-drop { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.file-drop.drag { outline: 2px dashed var(--primary); outline-offset: 3px; border-radius: 6px; }
.file-drop-hint { font-size: 11.5px; color: var(--muted); }
/* 对账单顶部页签：订金对账 | 尾款对账（独立运行） */
.stmt-tabs { display: flex; gap: 8px; margin: 14px 0 10px; border-bottom: 2px solid var(--border); }
.stmt-tab {
  border: none; background: transparent; cursor: pointer; padding: 8px 18px; font-size: 14px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.stmt-tab:hover { color: var(--primary); }
.stmt-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
@media print {
  #stmt-result .card { box-shadow: none; break-inside: avoid; }
  #stmt-result thead { display: table-header-group; }
}
