:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e3e8ef;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #ea580c;
  --amber: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.hidden { display: none !important; }

/* 首屏加载占位 */
.boot { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 14px; z-index: 300; }
.boot-spinner { width: 34px; height: 34px; border: 3px solid #dbe3ec; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--red); font-size: 13px; margin: 6px 0; }
.hint { color: var(--muted); font-size: 12px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 56px; background: radial-gradient(circle at 12% 18%, #3b82f6 0%, transparent 46%), radial-gradient(circle at 88% 82%, #60a5fa 0%, transparent 42%), linear-gradient(135deg, #152a63 0%, #1e3a8a 45%, #2563eb 100%); padding: 32px 20px; flex-wrap: wrap; }
/* 左侧介绍区（宽屏显示，窄屏自动隐藏） */
.login-hero { color: #fff; max-width: 420px; }
.hero-brand { font-size: 15px; font-weight: 700; letter-spacing: .02em; opacity: .95; display: flex; align-items: center; gap: 8px; }
.hero-title { font-size: 34px; line-height: 1.25; margin: 18px 0 12px; font-weight: 800; letter-spacing: -.01em; }
.hero-lead { font-size: 14px; line-height: 1.75; color: rgba(255,255,255,.82); margin-bottom: 22px; }
.hero-points { list-style: none; display: grid; gap: 10px; }
.hero-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,.92); }
.hp-dot { width: 7px; height: 7px; border-radius: 50%; background: #93c5fd; box-shadow: 0 0 0 4px rgba(147,197,253,.22); flex-shrink: 0; }
/* 右侧登录卡 */
.login-card { background: #fff; border-radius: 18px; padding: 38px 34px 30px; width: 380px; max-width: 100%; box-shadow: 0 24px 60px rgba(8, 20, 55, .32); text-align: center; }
.login-logo { font-size: 42px; line-height: 1; }
.login-card h1 { font-size: 20px; margin: 10px 0 2px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
/* 登录页语言行：细分隔线，居中 */
.lang-row { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; justify-content: center; }
.lang-switch-small { margin-top: 16px; }
.linklike { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; margin: 0 8px; }

/* ---------- 顶栏（第一行：导航 + 用户；品牌已去掉） ---------- */
.topbar { display: flex; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--border); padding: 0 12px; height: 52px; position: sticky; top: 0; z-index: 50; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: thin; }
.tabs button { border: none; background: none; padding: 8px 13px; cursor: pointer; border-radius: 8px; color: var(--muted); font-size: 13.5px; line-height: 1.25; white-space: nowrap; }
.tabs button:hover { background: #f1f5f9; color: var(--text); }
.tabs button.active { background: #eff6ff; color: var(--primary); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* 用户信息只在首页显示：其他页签把顶栏空间全部让给类目导航（退出按钮保留） */
#app-view:not(.on-home) .whoami { display: none; }
/* 顶栏用户信息：小号单行（姓名 + 角色），和退出按钮同一排，尽量不占宽度 */
.whoami { display: inline-flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 11px; line-height: 1; text-align: right; white-space: nowrap; }
.whoami .who-name { color: var(--text); font-weight: 600; font-size: 12px; }
.whoami .who-role { font-size: 10px; color: var(--muted); }
/* 顶栏内按钮不换行 */
.topbar .btn { white-space: nowrap; }

/* ---------- 语言栏（第二行：紧凑细条，只占一点点高度） ---------- */
.langbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fbfcfe; border-bottom: 1px solid var(--border); padding: 3px 12px; position: sticky; top: 52px; z-index: 49; }
.lang-switch.login-lang { justify-content: center; }

/* ---------- 语言切换（小尺寸，省空间） ---------- */
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; flex-shrink: 0; }
.lang-switch button { border: none; background: transparent; padding: 2px 9px; font-size: 11px; line-height: 1.45; cursor: pointer; color: var(--muted); white-space: nowrap; }
.lang-switch button + button { border-left: 1px solid var(--border); }
.lang-switch button:hover { background: #f1f5f9; color: var(--text); }
.lang-switch button.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 布局 ---------- */
/* 通栏布局：内容撑满视口左右两侧（原来限制 1280px，导致宽表格被截断/出现横向滚动条） */
.content { width: 100%; max-width: none; margin: 0; padding: 16px 20px 28px; }
.tabpane { animation: fadein .15s ease; }
@keyframes fadein { from { opacity: .4; } to { opacity: 1; } }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 16px; }
.panel h2 { font-size: 14px; margin-bottom: 14px; color: var(--text); }

/* ---------- 卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stat-card .label { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat-card .value { font-size: 22px; font-weight: 700; }
.stat-card .count { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- 账龄条 ---------- */
.aging-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.aging-bar-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.aging-bar-item .a-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.aging-bar-item .a-value { font-weight: 700; font-size: 17px; }
.aging-track { height: 6px; background: #eef2f7; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.aging-fill { height: 100%; border-radius: 4px; }

/* ---------- 类别网格 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cat-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; border-left: 4px solid color-mix(in srgb, var(--c, var(--primary)) 40%, #fff); }
.cat-item .c-name { font-size: 13px; font-weight: 600; }
.cat-item .c-amount { font-size: 16px; font-weight: 700; margin-top: 2px; }
.cat-item .c-count { font-size: 11px; color: var(--muted); }

/* ---------- 表格 ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
thead th { background: #f8fafc; text-align: left; padding: 10px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
tbody td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-row td { text-align: center; color: var(--muted); padding: 30px; }

/* 客户名称：两行（客户名 + 大区 · 地区小字），列宽也因此收窄 */
/* 上限必须给：长客户名（如 DISSANAYAKA HARDWARE - LUNUGAMWEHERA）不加就会被撑成一条长行 */
td.cn2-cell { max-width: 190px; }
.cn2 { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; overflow-wrap: break-word; }
.cn2-sub { font-size: 10px; color: var(--muted); }

/* ---------- 模块页：货款明细自动归入的发票行（20261016f） ---------- */
/* 分组小标题条：横跨整表，说明下面这组记录从哪来 */
tr.fr-grp td { background: #eef2f7; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 12px; }
.fr-grp-t { font-size: 12px; font-weight: 700; color: #475569; letter-spacing: .02em; }
.fr-grp-n { margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--primary); background: #eff6ff; border-radius: 999px; padding: 1px 8px; }
/* 发票行：淡蓝底 + 左侧一条竖条，和模块自有记录一眼分开 */
tr.fr-tr { background: #fbfdff; }
tr.fr-tr td:first-child { box-shadow: inset 3px 0 0 #bfdbfe; }
/* 「货款」小标签（挂在客户名下面）+ 发票号下面一行的发票日期 */
.fr-tag { display: inline-block; width: fit-content; margin-top: 2px; padding: 0 4px; font-size: 9px; font-weight: 700; color: #1e40af; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 4px; }
.fr-sub { display: block; font-size: 10px; color: var(--muted); }
/* 日期单元格不折行：英文副行放大后列宽变紧，2022-09-22 会在连字符处断成两行（20261029c） */
td.dt { white-space: nowrap; }
/* 分期付款页「同意分期金额」格内输入框（20261029a）：窄一点、右对齐，别把表格撑宽 */
.inp-agreed { width: 92px; padding: 3px 6px; text-align: right; font-size: 12px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: inherit; }
.inp-agreed:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px #dbeafe; }
/* 阶段选择弹窗（20261029b）：一行一个阶段，当前阶段高亮 */
.stage-list { display: grid; gap: 6px; margin: 4px 0 12px; max-height: 52vh; overflow: auto; }
.stage-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 13px; }
.stage-opt:hover { background: #f8fafc; }
.stage-opt.cur { border-color: var(--primary); background: #eff6ff; }
.stage-opt input { margin: 0; flex: none; }
.stage-opt-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.stage-opt-t { flex: 1; }
.stage-opt-cur { font-size: 10px; font-weight: 700; color: var(--primary); background: #dbeafe; border-radius: 999px; padding: 1px 6px; }

/* ---------- 拜访计划 / 收款任务：发票明细列（20261030e） ---------- */
/* 发票号 / 发票日期 / 发票金额 三列，每张发票一行；三列行高必须一致，同一张发票才不会错行 */
.inv-col { vertical-align: top; padding-top: 9px !important; }
.inv-l { height: 16px; line-height: 16px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-l.muted { color: var(--muted); }
.inv-no { font-family: ui-monospace, Consolas, monospace; color: #334155; }
.inv-amt { text-align: right; font-weight: 700; color: var(--red); }
.inv-toggle { padding: 0 6px; font-size: 10px; font-weight: 700; color: var(--primary); background: #eff6ff; border: 1px solid #dbeafe; border-radius: 999px; cursor: pointer; }
.inv-toggle:hover { background: #dbeafe; }
/* 时间列：第一行短日期 26-11-02，第二行时间 19:27 —— 两行竖着放，省横向空间 */
td.dt2 { white-space: nowrap; padding: 5px 7px !important; line-height: 1.25; }
.d2 { display: block; font-size: 12px; color: inherit; }
.t2 { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
th.dt2 { padding: 8px 7px; }

/* ---------- 列宽拖拽（所有表格通用） ---------- */
/* 表头是 sticky（本身就是定位元素），手柄用 absolute 挂在它的右内边缘。
   注意必须整个落在列内（不能骑到列边界外）—— 骑出去的话鼠标落点会被后一列的 th 抢走，拖不动 */
.colgrip { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; z-index: 3; }
.colgrip::after { content: ''; position: absolute; top: 18%; right: 4px; width: 1px; height: 64%; background: transparent; }
thead th:hover .colgrip::after { background: rgba(100, 116, 139, .35); }
.colgrip:hover::after, body.col-dragging .colgrip::after { background: var(--primary); width: 2px; }
body.col-dragging { cursor: col-resize; user-select: none; }
/* 拖过列宽之后：表格切固定布局，宽窄完全听用户的（列内容自动折行，不再把列撑开） */
table.cols-fixed { table-layout: fixed; }
table.cols-fixed thead th { white-space: normal; overflow-wrap: break-word; }
table.cols-fixed tbody td { overflow-wrap: anywhere; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.b-30 { background: #f0fdf4; color: #166534; }
.b-90 { background: #fefce8; color: #854d0e; }
.b-120 { background: #fff7ed; color: #9a3412; }
.b-180 { background: #fef2f2; color: #991b1b; }
.cat-self { background: #eff6ff; color: #1e40af; }
.cat-installment { background: #f5f3ff; color: #5b21b6; }
.cat-company { background: #f0fdfa; color: #115e59; }
.cat-legal { background: #fef2f2; color: #991b1b; }
.cat-thirdparty { background: #fffbeb; color: #92400e; }
.cat-theft { background: #faf5ff; color: #6b21a8; }
/* 付款类别徽章：两行（中文在上、英文小字在下）—— 单行双语会把这一列撑到 200px+ */
.badge.cat-2l { display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.15; }
.badge.cat-2l .en { font-size: 10.5px; }
/* 付款类别行内改（财务主管 / 管理员）：徽章外观 + 右上角小箭头，点击弹类别菜单 */
button.badge.cat-edit {
  font-family: inherit; cursor: pointer; position: relative;
  border: 1px dashed rgba(0, 0, 0, .10); padding-right: 13px;
}
button.badge.cat-edit:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
button.badge.cat-edit:focus { outline: none; border-color: var(--primary); }
button.badge.cat-edit:disabled { opacity: .55; cursor: progress; }
.cat-caret { position: absolute; right: 4px; top: 4px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid currentColor; opacity: .5; }
/* 类别选择菜单：挂 body + fixed，避免被 .table-wrap 的 overflow 裁掉 */
.cat-menu { position: fixed; z-index: 999; min-width: 148px; padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
.cat-mi { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 12px; line-height: 1.15; }
.cat-mi:hover { background: #f1f5f9; }
.cat-mi.on { background: #eff6ff; font-weight: 600; }
.cat-mi-t { white-space: nowrap; }
.cat-mi-t .en { font-size: 11.5px; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
/* 操作下拉按钮：紧凑两行（操作/Actions）+ 小箭头；菜单复用 .cat-menu 规格挂 body */
button.act-dd { position: relative; display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.15; padding: 3px 15px 3px 9px; font-size: 11px; }
button.act-dd .en { font-size: 10.5px; margin-top: 0; }
.act-menu .cat-mi.pri { color: var(--primary); font-weight: 600; }
.act-menu .cat-mi.danger { color: var(--red); }
.act-menu .cat-mi.pri .en, .act-menu .cat-mi.danger .en { color: inherit; opacity: .75; }
.st-promise30 { background: #eff6ff; color: #1e40af; }
.st-promise60 { background: #eef2ff; color: #3730a3; }
.st-installment_req { background: #f5f3ff; color: #5b21b6; }
.st-refuse { background: #fef2f2; color: #991b1b; }
.t-pending { background: #fffbeb; color: #92400e; }
.t-visited { background: #eff6ff; color: #1e40af; }
.t-completed { background: #f0fdf4; color: #166534; }
.res-cheque_received, .res-cash_received, .res-cheque_cleared { background: #f0fdf4; color: #166534; }

/* ---------- 按钮 / 表单 ---------- */
.btn { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 13px; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: #f1f5f9; }
.btn.block { width: 100%; margin-top: 6px; }
select, input[type="text"], input[type="password"], input[type="number"], input[type="search"], textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; background: #fff; color: var(--text); font-family: inherit;
}
textarea { width: 100%; resize: vertical; min-height: 64px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-grid input, .form-grid select { width: 100%; }

/* ---------- 模态框 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 16px; overflow: auto; }
.modal { background: #fff; border-radius: 14px; width: 640px; max-width: 100%; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
/* 宽弹窗：导入预览等列数很多的表格用，避免横向滚动 */
.modal.modal-wide { width: 1180px; }
.modal h3 { margin-bottom: 16px; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
/* 批量删除客户确认框：待删名单预览 */
.del-preview { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fafafa; }
.del-preview-item { font-size: 13px; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.del-preview-item:last-child { border-bottom: 0; }

/* ---------- 任务卡片 ---------- */
.task-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.task-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-head .t-customer { font-weight: 700; font-size: 14px; }
.task-head .t-invoice { color: var(--muted); font-size: 12px; }
.task-body { margin-top: 8px; font-size: 13px; color: var(--text); line-height: 1.6; }
.task-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-history { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 8px; font-size: 12px; color: var(--muted); }
.task-history .h-item { margin-bottom: 3px; }

/* ---------- 业务员任务卡片：收款任务页签按业务员分组，卡头可导出 PDF / JPG ---------- */
.sales-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.sales-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: #eef4fb; border-bottom: 1px solid var(--border); }
.sales-head b { font-size: 15px; }
.sales-head .spacer { flex: 1; }
.sales-stats { color: var(--muted); font-size: 12px; }
.sales-body { padding: 12px 12px 2px; }
.sales-body .task-card { box-shadow: none; background: #fcfdff; }

/* ---------- 拜访计划表格（15 列，嵌在分组卡里，紧凑无外框） ---------- */
.plan-wrap { margin: 0; border: none; border-radius: 0; box-shadow: none; }
.plan-table { min-width: 1420px; }
.plan-table thead th { padding: 8px 7px; }
.plan-table tbody td { padding: 7px 8px; font-size: 12.5px; vertical-align: middle; }
.plan-table .cell-wrap { max-width: 190px; white-space: normal; word-break: break-word; }
.plan-table .col-ovd { white-space: nowrap; }
.plan-table .row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.plan-table .row-actions .btn { padding: 3px 7px; font-size: 11px; }

/* 导出弹窗：业务员勾选列表 */
.card-pickbar { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; font-size: 13px; }
.card-pickbar a { color: var(--primary); font-size: 12px; text-decoration: none; }
.card-pickbar a:hover { text-decoration: underline; }
.card-users { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.card-users label { display: block; padding: 4px 0; font-size: 13px; cursor: pointer; }
.card-users input { margin-right: 6px; }

/* ---------- 生成拜访计划：按大区/地区/欠款状态挑客户的勾选面板 ---------- */
.plan-picker { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; margin: 10px 0; }
.plan-pick-head, .plan-pick-row { display: grid; grid-template-columns: 24px 1.7fr 1fr 130px 80px 130px; gap: 10px; align-items: center; padding: 6px 10px; }
.plan-pick-head { position: sticky; top: 0; z-index: 1; font-size: 12px; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--border); }
.plan-pick-head .num, .plan-pick-row .num { text-align: right; }
.plan-pick-row { font-size: 12.5px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.plan-pick-row:hover { background: #f8fafc; }
.plan-pick-row.on { background: #f2f8ff; }
.plan-pick-name { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.plan-pick-name .muted, .plan-pick-sales, .plan-pick-aging { font-size: 11.5px; }
.plan-pick-aging .en, .plan-pick-sales .en { display: none; }
.plan-pick-amt { font-weight: 700; color: var(--red); }
.plan-pick-empty { padding: 14px 10px; font-size: 12.5px; }

/* ---------- 导入预览 ---------- */
.preview-summary { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
/* 导入弹窗：文件选择 + 下载模板 一行排布 */
.imp-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.imp-actions input[type="file"] { flex: 1 1 260px; min-width: 0; font-size: 12.5px; }
.imp-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 12.5px; }
.imp-skip { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 12.5px; line-height: 1.7; }
.imp-skip-line { margin-top: 4px; word-break: break-word; }
.muted { color: var(--muted); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

@media (max-width: 900px) {
  .login-hero { display: none; }
  .hh-right { min-width: 0; width: 100%; }
}
@media (max-width: 1080px) {
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .debtor-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 10px; }
  .langbar { position: static; padding: 8px 12px; gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 12px; }
  .home-hero { padding: 20px; gap: 16px; }
  .hh-title { font-size: 18px; }
  .hh-money-value { font-size: 26px; }
  .quick-grid { grid-template-columns: 1fr; gap: 12px; }
  .quick-tile { padding: 15px 16px 15px 19px; }
  .qt-icon { width: 40px; height: 40px; font-size: 20px; }
  .debtor-list { grid-template-columns: 1fr; }
}

/* ================= 首页 · 工作台 ================= */
.home-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap;
  background: radial-gradient(circle at 90% 10%, #3b82f6 0%, transparent 50%), linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff; border-radius: 16px; padding: 28px 30px; box-shadow: 0 12px 30px rgba(30, 58, 138, .22);
}
.hh-left { flex: 1; min-width: 260px; }
.hh-hi { font-size: 13px; color: rgba(255,255,255,.82); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hh-name { font-weight: 700; color: #fff; }
.hh-title { font-size: 20px; margin: 8px 0 8px; font-weight: 800; letter-spacing: -.01em; }
.hh-lead { font-size: 13px; line-height: 1.7; color: rgba(255,255,255,.8); max-width: 520px; }
.hh-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.hh-actions .btn { border-color: rgba(255,255,255,.35); }
.hh-actions .btn.primary { background: #fff; border-color: #fff; color: #1d4ed8; font-weight: 700; }
.hh-actions .btn.primary:hover { background: #eff6ff; }
.hh-right { text-align: right; min-width: 220px; }
.hh-money-label { font-size: 12px; color: rgba(255,255,255,.78); }
.hh-money-value { font-size: 32px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hh-money-sub { font-size: 12px; color: rgba(255,255,255,.72); margin-top: 6px; }

.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; padding-bottom: 8px; }
.hs-card { background: var(--card); border: 1px solid var(--border); border-left: 4px solid color-mix(in srgb, var(--hc, var(--primary)) 40%, #fff); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.hs-card .hs-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hs-card .hs-value { font-size: 21px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* 首页：快捷入口 与 主要欠款客户 上下排列（原来是左右两栏）—— 取消 940px 宽度上限，跟随通栏 */
.home-quick-panel { width: 100%; max-width: none; }
.home-debtor-panel { width: 100%; max-width: none; margin-top: 14px; }
/* 快捷入口：宽屏自动铺满（每块最小 268px，越宽排得越多），窄屏回落到 2 列 / 1 列 */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 14px; width: 100%; max-width: none; }
.quick-tile { position: relative; display: flex; gap: 14px; align-items: center; text-align: left; background: #fff; border: 1px solid #e3e8ef; border-radius: 14px; padding: 16px 16px 16px 19px; cursor: pointer; font-family: inherit; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; overflow: hidden; }
.quick-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--qc, var(--primary)); }
.quick-tile:hover { transform: translateY(-2px); border-color: #bfdbfe; background: #fbfdff; box-shadow: 0 8px 20px rgba(16, 24, 40, .11); }
.quick-tile:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(16, 24, 40, .08); }
.qt-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; background: linear-gradient(135deg, color-mix(in srgb, var(--qc, var(--primary)) 16%, #fff), color-mix(in srgb, var(--qc, var(--primary)) 7%, #fff)); }
.qt-body { min-width: 0; overflow-wrap: break-word; }
.qt-title { display: block; font-size: 15.5px; font-weight: 700; color: var(--text); }
.qt-title .en { font-size: 13px; font-weight: 500; opacity: 0.75; margin-top: 1px; }
.qt-desc { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.qt-desc .en { font-size: 12.5px; margin-top: 0; }

/* 主要欠款客户：宽屏自动铺满（原来固定 3 列） */
.debtor-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.debtor-item { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.debtor-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.debtor-name { font-size: 13px; font-weight: 600; overflow-wrap: break-word; }
.debtor-amt { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.debtor-track { height: 6px; background: #eef2f7; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.debtor-fill { height: 100%; border-radius: 4px; background: var(--primary); }
.debtor-meta { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ===== 中英上下对照样式：英文为第二行小字 ===== */
/* 20261029c：英文副行整体放大一档（原 0.72em/9–11px 太小，看不太清） */
/* 双语兜底：只要 html[data-lang="both"]，任何 .en 都必须可见 —— 防止被外部样式/浏览器翻译隐藏 */
html[data-lang="both"] .en { display: block; visibility: visible !important; opacity: 0.7; }
html[data-lang="both"] span.en, html[data-lang="both"] .whoami .en { display: inline; }
.en {
  display: block;
  font-size: 0.85em;
  font-weight: 400;
  opacity: 0.7;
  letter-spacing: 0.01em;
  margin-top: 1px;
}
span.en { display: inline; }
/* 表头 */
th .en { font-size: 11.5px; font-weight: 400; }
/* 按钮 */
.btn .en { display: block; font-size: 11.5px; margin-top: 0; }
.btn.small .en { font-size: 11px; }
/* 徽章 */
.badge .en { font-size: 10.5px; margin-top: 0; line-height: 1.25; }
.badge { line-height: 1.3; }
/* 卡片与统计 */
.stat-card .label .en, .a-label .en, .c-name .en { font-size: 12px; }
/* 顶部标签 */
.tabs button .en { font-size: 10.5px; }
/* 登录页标题 */
h1 .en, .sub .en { font-size: 0.66em; opacity: 0.72; }
/* 弹窗标题与表单标签 */
.modal h3 .en { font-size: 13px; }
label .en { font-size: 11.5px; }
.panel h2 .en { font-size: 13px; }
/* 顶栏用户信息 */
.whoami .en { display: inline; }
/* 客户管理：批量勾选 */
.sel-bar { background: #eef6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 3px 10px; font-size: 12.5px; color: #1e40af; white-space: nowrap; }
.sel-bar a { color: #1e40af; text-decoration: underline; margin-left: 4px; }
th.chk, td.chk { width: 34px; text-align: center; padding-left: 8px; padding-right: 8px; }
td.chk input { cursor: pointer; margin: 0; }
tr.row-sel td { background: #f2f8ff; }
