/* 物业收费台账 —— 样式表 */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warn: #d97706;
  --warn-light: #fffbeb;
  --text: #1f2937;
  --text-soft: #6b7280;
  --text-mute: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --side-bg: #1e293b;
  --side-bg2: #172033;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
[hidden] { display: none !important; }
.muted { color: var(--text-soft); }
.mono { font-family: "SF Mono", Consolas, Monaco, monospace; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #334155 55%, #1e40af 100%);
  padding: 20px;
}
.login-card {
  width: 380px; max-width: 100%; background: #fff; border-radius: 14px;
  padding: 40px 34px 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.login-logo {
  width: 52px; height: 52px; border-radius: 13px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-card h1 { font-size: 21px; text-align: center; font-weight: 600; letter-spacing: 1px; }
.login-sub { text-align: center; color: var(--text-soft); font-size: 13px; margin: 8px 0 26px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); outline: none; transition: .15s;
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.field textarea { resize: vertical; min-height: 64px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 6px; }
.login-foot { text-align: center; color: var(--text-mute); font-size: 12px; margin-top: 22px; }

/* ---------------- 主布局 ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex: 0 0 208px; background: var(--side-bg); color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px;
  font-size: 15px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-icon {
  width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
#nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-group {
  padding: 14px 18px 6px; font-size: 11px; color: #64748b; letter-spacing: .5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px;
  color: #cbd5e1; font-size: 14px; border-left: 3px solid transparent; transition: .12s;
}
.nav-item .ic { width: 16px; text-align: center; opacity: .75; font-style: normal; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: var(--side-bg2); color: #fff; border-left-color: #3b82f6; font-weight: 500; }
.side-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.me-name { color: #fff; font-size: 13px; font-weight: 500; }
.me-role { color: #64748b; font-size: 12px; margin: 3px 0 10px; }
.logout { color: #94a3b8; font-size: 13px; }
.logout:hover { color: #f87171; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.content { padding: 20px 22px 40px; flex: 1; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--radius); border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; transition: .15s;
  white-space: nowrap; font-size: 13px;
}
.btn:hover { border-color: #cbd5e1; background: #fafafa; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--line-soft); color: var(--text); }
.btn-link { border: none; background: none; color: var(--primary); padding: 2px 6px; }
.btn-link:hover { text-decoration: underline; background: none; }
.btn-link.danger { color: var(--danger); }

/* ---------------- 卡片 / 面板 ---------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.panel-head h3 { font-size: 14px; font-weight: 600; }
.panel-head .tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }

/* ---------------- 统计卡片 ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12px; color: var(--text-soft); margin-bottom: 8px; }
.stat .v { font-size: 23px; font-weight: 600; letter-spacing: -.5px; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--text-soft); margin-left: 3px; }
.stat .s { font-size: 12px; color: var(--text-mute); margin-top: 6px; }
.stat.blue .v { color: var(--primary); }
.stat.green .v { color: var(--success); }
.stat.red .v { color: var(--danger); }
.stat.orange .v { color: var(--warn); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.grid { font-size: 13px; }
table.grid th {
  background: #f8fafc; color: var(--text-soft); font-weight: 500; text-align: left;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0;
}
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
table.grid tbody tr:hover { background: #fafbfc; }
table.grid tbody tr.sel { background: var(--primary-light); }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.money { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
table.grid tfoot td { padding: 10px 12px; background: #f8fafc; font-weight: 600; border-top: 2px solid var(--line); }
.empty { text-align: center; color: var(--text-mute); padding: 46px 0; font-size: 13px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 11px; font-size: 12px; line-height: 18px; }
.tag-unpaid { background: var(--danger-light); color: var(--danger); }
.tag-partial { background: var(--warn-light); color: var(--warn); }
.tag-paid { background: var(--success-light); color: var(--success); }
.tag-void { background: var(--line-soft); color: var(--text-mute); }
.tag-info { background: var(--primary-light); color: var(--primary); }
/* 测试小区角标：提示该小区默认不参与统计口径（2026-10-10） */
.tag-test { background: var(--warn-light); color: var(--warn); }

/* ---------------- 工具条 / 筛选 ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.search-box { position: relative; }
.search-box input {
  padding: 8px 12px 8px 32px; border: 1px solid var(--line); border-radius: var(--radius);
  width: 260px; outline: none; background: #fff;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-box::before { content: "⌕"; position: absolute; left: 11px; top: 7px; color: var(--text-mute); font-size: 15px; }
select.ipt, input.ipt {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; outline: none; min-width: 120px;
}
select.ipt:focus, input.ipt:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px; border-radius: 15px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 13px; color: var(--text-soft);
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; gap: 12px; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager button {
  min-width: 32px; height: 30px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; color: var(--text-soft);
}
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 12px; width: 560px; max-width: 100%;
  box-shadow: var(--shadow-lg); animation: pop .16s ease-out;
}
.modal.wide { width: 880px; }
.modal.xwide { width: min(96vw, 1340px); }
.modal.xwide .modal-body { max-height: 76vh; }
.modal.narrow { width: 420px; }
@keyframes pop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-close { font-size: 22px; color: var(--text-mute); line-height: 1; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; max-height: 68vh; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--line-soft); background: #fafbfc; border-radius: 0 0 12px 12px;
}

/* ---------------- 排班考勤表（弹窗内网格化，2026-10-20） ----------------
 * 注意：打印窗口 printAttSheet 自带独立样式，不受本段影响；
 * 表格容器（弹窗 body）不能设 overflow:hidden，否则 sticky 失效。 */
.att-tbl { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed;
  border: 1px solid var(--line); border-radius: 6px; }
.att-tbl th, .att-tbl td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-align: center; padding: 4px 1px; font-size: 12px; line-height: 1.35; }
.att-tbl tr > *:last-child { border-right: none; }
.att-tbl tbody tr:last-child > * { border-bottom: none; }
.att-tbl thead th { position: sticky; background: #f8fafc; font-weight: 600; height: 26px; }
.att-tbl thead tr:nth-child(1) th { top: 0; z-index: 3; }
.att-tbl thead tr:nth-child(2) th { top: 27px; z-index: 3; }
.att-tbl th.att-key1, .att-tbl th.att-key2, .att-tbl th.att-key3,
.att-tbl td.att-key1, .att-tbl td.att-key2, .att-tbl td.att-key3 {
  position: sticky; background: #fff; z-index: 2; text-align: center; white-space: nowrap; }
.att-tbl th.att-key1, .att-tbl th.att-key2, .att-tbl th.att-key3 { background: #f8fafc; z-index: 4; }
.att-tbl .att-key1 { left: 0; }
.att-tbl .att-key2 { left: 38px; }
.att-tbl .att-key3 { left: 94px; padding: 4px 6px; }
.att-tbl .we { background: var(--line-soft); }
.att-tbl thead .we { background: #e8ecf1; }
.att-tbl td.att-key1.we, .att-tbl td.att-key2.we, .att-tbl td.att-key3.we { background: #fff; }
.att-tbl td.att-c { cursor: default; }
.att-c.st-v { color: var(--success); font-weight: 600; }
.att-c.st-x { color: var(--text-mute); }
.att-c.st-j { color: var(--warn); font-weight: 600; }
.att-c.st-t { color: var(--primary); }
.att-c.st-k { color: var(--danger); font-weight: 600; }
.att-c.st-a { color: var(--primary); font-weight: 600; }
/* 自填文字的格子（年假半天 / 休2h / 开会…）：字小一号、允许折行 */
.att-c.att-txt { font-size: 9px; line-height: 1.15; word-break: break-all; padding: 1px; }
.att-title { font-weight: 600; margin: 14px 0 6px; }
.att-sec:first-child .att-title { margin-top: 0; }
.form-row { display: flex; gap: 14px; }
.form-row > .field { flex: 1; }
.hint { font-size: 12px; color: var(--text-mute); margin-top: 5px; line-height: 1.6; }
.alert { padding: 11px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; line-height: 1.7; }
.alert-info { background: var(--primary-light); color: #1e40af; }
.alert-warn { background: var(--warn-light); color: #92400e; }
.alert-err { background: var(--danger-light); color: #991b1b; }
.alert-ok { background: var(--success-light); color: #166534; }
.alert ul { margin: 6px 0 0 18px; }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 999;
  background: #1f2937; color: #fff; padding: 11px 20px; border-radius: 8px;
  font-size: 13px; box-shadow: var(--shadow-lg); max-width: 80vw;
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }

/* ---------------- 收费台 ---------------- */
.counter { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.room-list { max-height: 640px; overflow-y: auto; }
.ct-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.ct-filters select { width: 100%; font-size: 13px; padding: 5px 8px; }
.ct-filters select.wide { grid-column: 1 / -1; }
.ct-filters select:disabled { opacity: .5; }
.room-item { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.room-item:hover { background: #fafbfc; }
.room-item.active { background: var(--primary-light); border-left: 3px solid var(--primary); }
.room-item .l1 { display: flex; justify-content: space-between; align-items: baseline; }
.room-item .rn { font-weight: 600; }
.room-item .ow { color: var(--danger); font-size: 13px; font-weight: 500; }
.room-item .l2 { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.room-item .zero { color: var(--success); }
.pay-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 18px; background: var(--primary-light); border-radius: var(--radius);
  margin-top: 14px; flex-wrap: wrap;
}
.pay-summary .big { font-size: 22px; font-weight: 600; color: var(--primary); }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }

/* 收费台：区块小标题 */
.sec-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px 6px; font-size: 13px; font-weight: 600;
}
.sec-title .muted { font-weight: 400; font-size: 12px; }
.sec-title .sec-tools { margin-left: auto; }

/* 收费台：按费种收费表 */
.cf-table td { vertical-align: middle; }
.cf-name { font-weight: 500; }
.cf-hint { font-size: 12px; color: var(--text-soft); margin-top: 3px; line-height: 1.5; }
/* 单价必填：费项没配默认单价时，单价框空着要显眼（算不出钱会变「待填单价」） */
.ipt.need { border-color: var(--danger); background: var(--danger-light); }
.ipt.need::placeholder { color: var(--danger); opacity: .85; }
.cf-paid b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* 待收账单：整体优惠减免栏 + 临时优惠行标记 */
.bulk-disc {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px; border-top: 1px dashed var(--line-soft);
  background: var(--bg-soft, #fafbfc); font-size: 13px;
}
.bulk-disc .bd-label { font-weight: 600; }
.bulk-disc .hint { flex-basis: 100%; margin: 0; }
.bulk-disc .bd-preview { color: var(--primary, #2563eb); }

/* 账单管理：批量作废选择栏 */
.batch-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft, #fafbfc); font-size: 13px;
}
.batch-bar .hint { margin: 0; }
.batch-bar b { color: var(--primary, #2563eb); }
.bl-row.ct-disc td { background: rgba(37, 99, 235, 0.05); }
.ct-disc-mark { color: var(--primary, #2563eb); font-style: normal; font-weight: 700; margin-left: 2px; }
.ct-disc-sub { font-size: 11px; color: var(--text-soft, #94a3b8); text-decoration: line-through; }

/* 账单管理：费项多选下拉 */
.msel { position: relative; }
.msel-btn { min-width: 108px; text-align: left; cursor: pointer; }
.msel-panel { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; background: var(--bg, #fff);
  border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 6px 12px; min-width: 150px;
  max-height: 260px; overflow: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.msel-panel label { display: flex; align-items: center; gap: 7px; padding: 5px 2px; white-space: nowrap; cursor: pointer; }
.msel-panel input { width: auto; margin: 0; }
.cf-paid .cf-from { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; white-space: nowrap; }
.cf-line { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.cf-line:last-child { margin-bottom: 0; }
.cf-line .ipt { padding: 4px 8px; font-size: 13px; min-width: 0; }
.cf-sep { color: var(--text-mute); font-size: 12px; }
.cf-quick { margin-left: 8px; display: inline-flex; gap: 0; }
.cf-quick .btn-link { font-size: 12px; padding: 1px 5px; }
/* 收费台「选择收费项」弹窗：可点选的费种列表（限高，保证下方「关联车位」同屏可见） */
.fee-pick { max-height: 24vh; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 8px; }
.fee-pick-item { padding: 7px 14px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.fee-pick-item:last-child { border-bottom: none; }
.fee-pick-item:hover { background: var(--primary-light, #eef4ff); }
.fee-pick-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* 收费台「关联车位」弹窗：来自「车位管理」的可点选车位列表 */
.spot-pick { max-height: 24vh; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 8px; }
.spot-pick .empty { padding: 18px 0; }
.spot-pick-item { padding: 7px 14px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.spot-pick-item:last-child { border-bottom: none; }
.spot-pick-item:hover { background: var(--primary-light, #eef4ff); }
.spot-pick-item .l1 { display: flex; align-items: center; gap: 7px; font-size: 14px; flex-wrap: wrap; }
.spot-pick-item .l2 { font-size: 12px; margin-top: 3px; }

/* 收费台「待收账单」按年份折叠：年份汇总行 + 可隐藏的明细行 */
table.grid tbody tr.bl-year { cursor: pointer; background: #f8fafc; }
table.grid tbody tr.bl-year:hover { background: #f1f5f9; }
table.grid tbody tr.bl-year td { padding: 8px 12px; }
/* 水电表待结算分组头（2026-10-19）：样式同年份行但不可折叠点击 */
table.grid tbody tr.bl-meter { background: #f8fafc; }
table.grid tbody tr.bl-meter td { padding: 8px 12px; }
table.grid tbody tr.ct-meter td { background: #fcfcf7; }
.bl-year-in { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bl-year-in b { color: var(--text); }
.bl-caret {
  display: inline-block; width: 0; height: 0; flex: 0 0 auto;
  border-left: 5px solid var(--text-mute);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .15s;
}
table.grid tbody tr.bl-year.open .bl-caret { transform: rotate(90deg); }
.bl-owe { margin-left: auto; font-weight: 600; color: var(--danger); font-variant-numeric: tabular-nums; }
table.grid tbody tr.bl-row.hide { display: none; }

.cf-amt { font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.cf-row.on { background: var(--primary-light); }
/* 收费台：优惠减免后金额下方的小字提示 */
.cf-save-note { font-size: 11px; font-weight: 500; color: #16a34a; margin-top: 2px; }

/* 收费台：账单已被费种周期覆盖时的提示 */
table.grid tbody tr.cf-dup { opacity: .5; }
/* 花名册年龄高亮（2026-10-13）：满 70 周岁标红、满 69 周岁标黄 */
table.grid tbody tr.st-row-red td { background: rgba(224, 82, 65, .16); }
table.grid tbody tr.st-row-yellow td { background: rgba(240, 180, 20, .18); }
table.grid tbody tr.st-row-red:hover td { background: rgba(224, 82, 65, .24); }
table.grid tbody tr.st-row-yellow:hover td { background: rgba(240, 180, 20, .26); }
.st-age-chip { display: inline-block; padding: 0 8px; border-radius: 9px; font-size: 12px; line-height: 18px; }
.st-red-chip { background: rgba(224, 82, 65, .16); color: #b23a2e; }
.st-yellow-chip { background: rgba(240, 180, 20, .2); color: #8a6d10; }table.grid tbody tr.cf-dup td:nth-child(3)::after {
  content: " · 已含在费种中"; color: var(--warn); font-size: 11px;
}

/* 收费台房号详情：缴费进度条（各费项缴至时间一览） */
.pay-progress {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 7px 16px; background: var(--bg-soft, #f7f8fa);
  border-bottom: 1px solid var(--line-soft); font-size: 12.5px;
}
.pay-progress .pp-label { color: var(--text-mute); flex: 0 0 auto; }
.pp-item { display: inline-flex; align-items: center; gap: 5px; color: var(--text-soft); }
.pp-item i { font-style: normal; color: var(--text-mute); font-size: 11.5px; }
.pp-item b { font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.pp-item.none b { color: var(--text-mute); font-weight: 400; }

/* 账单管理：月末自动出账状态条（管理员） */
.auto-chip { font-size: 12.5px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 6px; }
.auto-chip b.on { color: #16a34a; }
.auto-chip b.off { color: var(--text-mute); font-weight: 400; }
.auto-chip .btn-link { margin-left: 2px; }

/* 收费台：收款条（滚动时吸底，避免长列表下找不到收款按钮） */
.settle-bar {
  border-top: 2px solid var(--line); background: #fafbfc;
  position: sticky; bottom: 0; z-index: 5;
}
.settle-bar .pay-summary { margin-top: 12px; }
.tag-spot { background: #eef2ff; color: #4f46e5; }
.tag-soft { background: #f1f5f9; color: #475569; }

/* ---------------- 费项配置：自定义公式 ---------------- */
.expr-code {
  font-family: "SF Mono", Consolas, Monaco, monospace; font-size: 12px;
  background: #f1f5f9; border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; color: #0f172a; white-space: nowrap;
}
.expr-box {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fafbfc; padding: 14px 14px 2px; margin-bottom: 16px;
}
.expr-box .form-row > .field { margin-bottom: 12px; }
.expr-vars { margin-bottom: 12px; }
.expr-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 7px; }
.expr-lab { flex: 0 0 34px; font-size: 12px; color: var(--text-mute); }
.expr-chip {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 12px; color: var(--text-soft);
  font-family: "SF Mono", Consolas, Monaco, monospace;
}
.expr-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.expr-chip.tpl { font-family: inherit; color: var(--text); }
.expr-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.expr-result {
  border-radius: var(--radius); padding: 10px 12px; font-size: 13px;
  margin-bottom: 12px; line-height: 1.8;
}
.expr-result.ok { background: var(--success-light); color: #166534; }
.expr-result.bad { background: var(--danger-light); color: #991b1b; }
.expr-result .hint { color: inherit; opacity: .8; margin-top: 3px; }

/* ---------------- 收据（屏幕预览 + A4 打印） ---------------- */
.receipt {
  position: relative;
  background: #fff; border: 1px solid var(--line); padding: 26px 30px;
  font-family: "SimSun", "Songti SC", serif; color: #000;
}
.receipt h2 { text-align: center; font-size: 21px; letter-spacing: 6px; margin-bottom: 4px; font-weight: 600; }
.receipt .rc-sub { text-align: center; font-size: 12px; color: #444; margin-bottom: 16px; letter-spacing: 1px; }
.receipt .rc-sub2 { margin-top: -12px; }
.receipt .rc-meta { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 13px; }
.receipt table th, .receipt table td { border: 1px solid #333; padding: 7px 9px; }
.receipt table th { background: #f2f2f2; text-align: center; font-weight: 500; }
.receipt table td.num { text-align: right; }
.receipt .rc-total { font-size: 14px; font-weight: 600; }
.receipt .rc-chinese { font-size: 13px; margin-top: 10px; letter-spacing: 1px; }
.receipt .rc-signwrap { position: relative; }
.receipt .rc-sign { display: flex; justify-content: space-between; margin-top: 26px; font-size: 13px; }
.receipt .rc-seal { position: absolute; right: 56px; bottom: -24px; width: 130px; opacity: .93; pointer-events: none; }
.receipt .rc-company { text-align: right; font-size: 12.5px; letter-spacing: 1px; margin-top: 26px; }
.receipt .rc-note { margin-top: 18px; font-size: 11px; color: #666; border-top: 1px dashed #999; padding-top: 8px; }
.receipt.voided { position: relative; }
.receipt.voided::after {
  content: "已 作 废"; position: absolute; top: 42%; left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  font-size: 62px; color: rgba(220, 38, 38, .22); letter-spacing: 14px; font-weight: 700;
  border: 5px solid rgba(220, 38, 38, .18); padding: 8px 26px; border-radius: 10px; white-space: nowrap;
}

@media print {
  /* 页边距必须为 0：浏览器把页眉页脚（日期 / 网址 / 页码）画在 @page 边距里，
     边距为 0 它们就没有落脚之处、自动消失 —— 无需用户在打印对话框里手动取消
     「页眉和页脚」；原 14mm/12mm 留白改由 .receipt 自身 padding 提供。 */
  @page { size: A4 portrait; margin: 0; }
  body { background: #fff; }
  .app, .login-wrap, .modal-mask, .toast, .sidebar, .topbar { display: none !important; }
  #print-area { display: block !important; }
  .receipt { border: none; padding: 14mm 12mm; }
  .receipt table th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* 公章按原色打印，别被浏览器省墨掉 */
  .receipt .rc-seal { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#print-area { display: none; }

/* ---------------- 小区管理：分布图（百度底图 / 离线示意图回退） ---------------- */
.stats + .panel { margin-top: 16px; }
.cm-map-wrap { position: relative; }
/* 在线底图加载失败回退示意图时的一次性提示条 */
.cm-net-hint {
  margin-bottom: 8px; padding: 7px 12px; font-size: 12.5px; color: #92400e;
  background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px;
}
/* 百度底图容器内自带的 logo / 版权说明贴左下角，别被详情卡压住 */
.cm-map .BMap_cpyCtrl, .cm-map .anchorBL { z-index: 2 !important; }
.cm-map {
  width: 100%; height: 540px; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #eef3f9 100%); overflow: hidden;
}
.cm-map svg { display: block; width: 100%; height: 100%; cursor: grab; user-select: none; }
.cm-map svg.dragging { cursor: grabbing; }
.cm-map .empty { padding: 168px 16px; }
.cm-map .empty .hint { display: inline-block; margin-top: 4px; }
.cm-bg { fill: transparent; }
.cm-grid line { stroke: #dce4ee; stroke-width: 1; }
.cm-gl { font-size: 11px; fill: #94a3b8; }
.cm-pin { cursor: pointer; }
.cm-hit { fill: transparent; }
.cm-dot { fill: #2563eb; stroke: #fff; stroke-width: 2.5; }
.cm-pin.active .cm-dot { fill: #dc2626; r: 9; }
.cm-lb { font-size: 12px; font-weight: 600; fill: #1f2937;
  paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round; }
.cm-pin.active .cm-lb { fill: #dc2626; }
.cm-sl, .cm-st { stroke: #64748b; stroke-width: 2; }
.cm-note { font-size: 11px; fill: #a9b4c2; }
.cm-info {
  position: absolute; width: 236px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 5; font-size: 12.5px;
}
.cm-info-h { display: flex; justify-content: space-between; align-items: center;
  padding: 8px 11px; border-bottom: 1px solid var(--line-soft); }
.cm-info-x { color: var(--text-mute); font-size: 17px; line-height: 1; cursor: pointer; }
.cm-info-b { padding: 8px 11px; line-height: 1.8; }
.cm-info-b .k { display: inline-block; width: 56px; color: var(--text-mute); }
.cm-info-f { padding: 7px 11px; border-top: 1px solid var(--line-soft); }
.seal-thumb { width: 76px; height: 76px; object-fit: contain; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; }

/* ---------------- 其他 ---------------- */
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 13px; }
.kv .k { color: var(--text-soft); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 9px 16px; cursor: pointer; color: var(--text-soft); border-bottom: 2px solid transparent; font-size: 14px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.bar-row .nm { width: 76px; color: var(--text-soft); flex: 0 0 76px; }
.bar-row .bar { flex: 1; height: 16px; background: var(--line-soft); border-radius: 8px; overflow: hidden; }
.bar-row .bar > i { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 8px; }
.bar-row .vl { width: 108px; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .counter { grid-template-columns: 1fr; }
  .sidebar { width: 62px; flex: 0 0 62px; }
  .brand span:not(.brand-icon), .nav-item span, .nav-item, .side-foot { font-size: 0; }
  .nav-item .ic { font-size: 15px; }
  .nav-group { display: none; }
}

/* ---------------- 账号「负责小区」多选 ---------------- */
.scope-grid {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; max-height: 190px; overflow: auto;
}
.scope-grid input[type=checkbox] { width: auto; padding: 0; margin: 0; accent-color: var(--primary); }
.scope-item { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.scope-tools { margin-top: 6px; display: flex; gap: 14px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); margin: 0 0 14px; cursor: pointer; }
.chk input { width: auto; margin: 0; accent-color: var(--primary); }

/* ---------------- 看板顶部筛选栏 + 年份多选下拉 ---------------- */
.db-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; }
.db-fl { font-size: 13px; color: var(--text-soft); }
.db-fl-hint { margin: 0 0 0 auto; }
.msel { position: relative; }
.msel-btn { cursor: pointer; min-width: 150px; display: inline-flex; align-items: center;
  justify-content: space-between; gap: 8px; text-align: left; font-weight: 600; }
.msel-caret { border: 4px solid transparent; border-top-color: var(--text-mute, #94a3b8); margin-top: 4px; }
.msel-pop { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  min-width: 150px; max-height: 262px; overflow: auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: 6px; }
.msel-pop.open { display: block; }
.msel-it { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px;
  font-size: 13px; cursor: pointer; white-space: nowrap; margin: 0; font-weight: 400; }
.msel-it:hover { background: var(--primary-light); }
.msel-it input { width: auto; margin: 0; accent-color: var(--primary); }
.msel-foot { border-top: 1px solid var(--line-soft); margin-top: 4px; padding: 6px 8px 2px; }

/* ---------------- 排班管理列表（2026-10-15 整齐化 + 紧凑间距） ---------------- */
.sh-hint { margin: 10px 14px 0; padding: 7px 12px; font-size: 12.5px; line-height: 20px; }
.sh-tbl { font-size: 13px; }
.sh-tbl th { padding: 8px 10px; font-size: 12.5px; }
.sh-tbl td { vertical-align: middle; height: 38px; padding: 4px 10px; }
.sh-tbl tbody tr:nth-child(even) { background: #fafbfd; }
.sh-tbl .tag { min-width: 54px; text-align: center; font-size: 12px; }
/* 在职人数分岗位小标签：不用 min-width（岗位名长短不一），紧凑排列 */
.sh-tbl .post-tag { min-width: 0; padding: 1px 8px; font-size: 11.5px; line-height: 17px; }

/* ---------------- 欠费清单层级树（小区-期-楼栋-单元，2026-10-20） ---------------- */
.ag-hd { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 6px;
  margin-top: 6px; cursor: pointer; user-select: none; font-size: 13px; }
.ag-hd:hover { background: #f1f5f9; }
.ag-hd .ag-tt { font-weight: 600; }
.ag-hd.l1 { margin-left: 20px; }
.ag-hd.l2 { margin-left: 40px; }
.ag-hd.l3 { margin-left: 60px; }
.ag-hd.l3 .ag-tt { font-weight: 500; }
.ag-hd .ag-arrow { width: 14px; color: var(--text-mute); }
.ag-hd .ag-sum { margin-left: auto; color: var(--text-soft); font-size: 12px; font-weight: 400; }
.ag-hd .ag-owe { color: var(--danger); font-weight: 600; }
.ag-body[hidden] { display: none; }
.ag-cols { display: grid;
  grid-template-columns: 1.1fr 1.2fr 1.2fr .55fr 1fr 1fr .55fr 1.15fr .7fr;
  gap: 0 8px; padding: 5px 10px; font-size: 12.5px; line-height: 1.5;
  border-bottom: 1px solid var(--line-soft); align-items: center; }
.ag-cols.hd { color: var(--text-soft); font-size: 12px; background: #fafbfc;
  font-weight: 600; border-bottom: 1px solid var(--line); }
.ag-cols .num { text-align: right; font-variant-numeric: tabular-nums; }
.ag-cols .money { text-align: right; color: var(--danger); font-weight: 600;
  font-variant-numeric: tabular-nums; }
.sh-tbl .tag-void { background: #f1f5f9; color: #94a3b8; }
.sh-sep { display: inline-block; width: 1px; height: 11px; background: var(--line);
  margin: 0 8px; vertical-align: middle; }
.sh-tbl .btn-link { font-size: 13px; }
.sh-tbl td:first-child { font-weight: 600; }


/* ---------- 收缴热力（楼栋剖面图，2026-10-26） ---------- */
.hs-floor { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 6px; }
.hs-flbl { flex: 0 0 58px; text-align: right; font-size: 12px; color: var(--text-soft);
  padding-top: 9px; font-variant-numeric: tabular-nums; }
.hs-rooms { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-cell { width: 78px; padding: 5px 4px; border-radius: 6px; text-align: center;
  cursor: pointer; border: 1px solid transparent; user-select: none; }
.hs-cell b { display: block; font-size: 13px; line-height: 1.35; }
.hs-cell span { display: block; font-size: 11px; line-height: 1.3;
  font-variant-numeric: tabular-nums; }
.hs-cell:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.10); }
.hs-ok   { background: #e8f7ec; border-color: #bfe3c8; color: #1a7f37; }
.hs-warn { background: #fdf3d8; border-color: #ecd28a; color: #96690a; }
.hs-late { background: #fde8e8; border-color: #f0b1b1; color: #c0392b; }
.hs-none { background: #f4f5f7; border-color: #dfe3e8; color: #6b7280; }

/* ---------- 收缴热力：视图切换 + 3D 楼宇（2026-10-26） ---------- */
.ht-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.ht-seg button { border: 0; background: #fff; padding: 5px 11px; font-size: 13px;
  cursor: pointer; color: #4b5563; }
.ht-seg button + button { border-left: 1px solid var(--line); }
.ht-seg button:hover { background: #f3f7fb; }
.ht-seg button.on { background: #1e6fb8; color: #fff; }
.heat3d { position: relative; height: 560px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #0a2b47 0%, #04101f 55%, #02060d 100%); }
.heat3d canvas { display: block; }
.heat3d-tip { position: absolute; display: none; pointer-events: none;
  background: rgba(4, 18, 32, .93); border: 1px solid rgba(47, 212, 255, .45);
  color: #d7f3ff; font-size: 12px; line-height: 1.65; padding: 6px 9px;
  border-radius: 6px; white-space: nowrap; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); z-index: 3; }
@media (max-width: 760px) { .heat3d { height: 380px; } }
