﻿/* ==========================================================================
   启邻时代物业智慧社区服务平台 · 管理端样式
   纯手写 CSS，无外部依赖（离线可运行）
   ========================================================================== */

:root {
  --c-primary: #2f6fed;
  --c-primary-dark: #1f56c9;
  --c-primary-soft: #eaf1ff;
  --c-bg: #f4f6fb;
  --c-surface: #ffffff;
  --c-text: #1e2733;
  --c-muted: #6b7a90;
  --c-border: #e5e9f0;
  --c-success: #15a34a;
  --c-success-soft: #e7f7ed;
  --c-warn: #e08700;
  --c-warn-soft: #fdf3e2;
  --c-danger: #d93b3b;
  --c-danger-soft: #fdeaea;
  --c-info: #0b8fb8;
  --c-info-soft: #e6f6fb;
  --c-side: #16233a;
  --c-side-hover: #223350;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(24, 39, 75, .05), 0 6px 18px -8px rgba(24, 39, 75, .12);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: #132033; }

/* ---------------------------------------------------------------- 布局 */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--c-side);
  color: #cbd6e6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-title { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 11.5px; color: #7f92ad; margin-top: 3px; }

.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 11px; color: #66799a; padding: 14px 10px 6px; letter-spacing: 1px; }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; margin-bottom: 2px;
  color: #c3cfe1; border-radius: var(--radius-sm);
  font-size: 13.5px; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--c-side-hover); color: #fff; text-decoration: none; }
.nav a.active { background: var(--c-primary); color: #fff; font-weight: 600; }
.nav .ico { width: 16px; text-align: center; opacity: .9; font-size: 14px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 12px 26px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; }
.topbar .crumb { font-size: 12px; color: var(--c-muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.who { color: var(--c-muted); }
.who b { color: var(--c-text); font-weight: 600; }

/* 顶栏「当前小区」切换 */
.community-switch {
  display: flex; align-items: center; gap: 7px;
  margin: 0; padding: 3px 8px 3px 10px;
  background: var(--c-primary-soft);
  border: 1px solid #d6e2fb; border-radius: 999px;
}
.community-switch select {
  border: 0; background: transparent; padding: 2px 18px 2px 0;
  font-size: 13px; font-weight: 600; color: var(--c-primary-dark);
  cursor: pointer; max-width: 190px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-primary-dark) 50%),
                    linear-gradient(135deg, var(--c-primary-dark) 50%, transparent 50%);
  background-position: right 6px center, right 2px center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.community-switch select:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.community-label { font-size: 11px; color: var(--c-primary-dark); opacity: .7; letter-spacing: .2px; }
.community-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px;
  background: var(--c-primary-soft); border: 1px solid #d6e2fb;
  font-size: 13px; font-weight: 600; color: var(--c-primary-dark);
}

/* 顶栏「投诉建议」入口：图标 + 右上角未处理红点数字 */
.topbar-msg {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin: 0;
  border-radius: 10px; border: 1px solid transparent;
  color: var(--c-muted); background: transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.topbar-msg:hover {
  color: var(--c-primary); background: var(--c-primary-soft); border-color: #d6e2fb;
}
.topbar-msg-dot {
  position: absolute; top: -2px; right: -3px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #e0473f; color: #fff;
  font-size: 11px; font-weight: 600; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--c-surface);
  font-variant-numeric: tabular-nums;
}

/* 顶栏用户菜单：头像 + 姓名，点开是个人资料 / 修改密码 / 意见反馈 / 退出登录 */
.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 8px 3px 4px; border-radius: 999px;
  border: 1px solid transparent; background: transparent;
  font: inherit; color: var(--c-text); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.user-trigger:hover { background: #f4f7fc; border-color: #e3ebf7; }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  flex: 0 0 26px; border: 1px solid #dbe5f5;
}
.user-avatar-initial {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary-soft); color: var(--c-primary-dark);
  font-size: 12px; font-weight: 600;
}
.user-name { font-size: 13px; line-height: 1.2; white-space: nowrap; }
.user-name b { font-weight: 600; }
.user-role { color: var(--c-muted); }
.user-caret { font-size: 10px; color: var(--c-muted); margin-left: -2px; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 176px;
  background: #fff; border: 1px solid var(--c-border); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 35, 65, .12);
  padding: 6px; display: none; z-index: 60;
}
.user-pop.open { display: block; }
.user-pop a, .user-pop button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border-radius: 8px; border: 0; background: transparent;
  font-size: 13px; color: var(--c-text); text-decoration: none; text-align: left; cursor: pointer;
}
.user-pop a:hover, .user-pop button:hover { background: #f4f7fc; }
.user-pop .ico { width: 16px; text-align: center; color: var(--c-muted); font-size: 14px; }
.user-pop .sep { height: 1px; background: var(--c-border); margin: 6px 8px; }
.user-pop form { margin: 0; }

/* ---------------------------------------------------------------- 个人资料 */
.profile-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.avatar-block { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.avatar-lg {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #dbe5f5;
}
.avatar-initial {
  background: var(--c-primary-soft); color: var(--c-primary-dark);
  font-size: 36px; font-weight: 600;
}
.avatar-form { width: 100%; }
.avatar-file { width: 100%; font-size: 12.5px; color: var(--c-muted); }
.narrow-form { max-width: 540px; }
.form-group input:disabled { background: #f6f8fb; color: var(--c-muted); cursor: not-allowed; }

/* ---------------------------------------------------------------- 意见反馈 */
.fb-list { display: flex; flex-direction: column; gap: 10px; }
.fb-item {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 12px; padding: 14px 16px;
}
.fb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-title { font-size: 14px; font-weight: 600; }
.fb-meta { margin-left: auto; font-size: 12px; color: var(--c-muted); white-space: nowrap; }
.fb-content {
  margin-top: 8px; font-size: 13px; line-height: 1.65; color: #3c4b62;
  white-space: pre-wrap; word-break: break-word;
}
.fb-reply {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #f4f8ff; border: 1px solid #dbe8fb; font-size: 13px; line-height: 1.6;
}
.fb-reply b { color: var(--c-primary-dark); }
.fb-reply-by { margin-left: 8px; font-size: 12px; color: var(--c-muted); }
.fb-empty { padding: 30px 0; text-align: center; font-size: 13px; color: var(--c-muted); }

.content { padding: 22px 26px 60px; max-width: 1440px; width: 100%; }

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; }
.card-head .sub { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ---------------------------------------------------------------- 指标卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--c-primary);
}
.stat.ok::after { background: var(--c-success); }
.stat.warn::after { background: var(--c-warn); }
.stat.danger::after { background: var(--c-danger); }
.stat.info::after { background: var(--c-info); }
.stat-label { font-size: 12.5px; color: var(--c-muted); }
.stat-value { font-size: 25px; font-weight: 700; margin-top: 4px; letter-spacing: -.5px; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--c-muted); margin-left: 3px; }
.stat-foot { font-size: 12px; color: var(--c-muted); margin-top: 5px; }
.stat-foot .up { color: var(--c-danger); font-weight: 600; }
.stat-foot .down { color: var(--c-success); font-weight: 600; }

/* ---------------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th {
  text-align: left; font-weight: 600; color: #46566e;
  background: #f8fafc; padding: 11px 14px;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap; font-size: 12.5px;
}
table.table td { padding: 11px 14px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
table.table tbody tr:hover { background: #fafbfe; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr.row-weekend { background: #fcfdff; }
table.table tfoot tr.row-total td {
  background: #f8fafc; border-top: 2px solid var(--c-border);
  border-bottom: none; padding: 12px 14px;
}
table.table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 逐笔流水表：列多、行密，压缩行高让一屏看更多笔 */
table.table.table-dense th { padding: 9px 10px; }
table.table.table-dense td { padding: 8px 10px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; color: #3a4a63; }
.muted { color: var(--c-muted); }
.strong { font-weight: 600; }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- 徽标 */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 1.7; font-weight: 600; white-space: nowrap;
  background: #eef1f6; color: #55647c;
}
.badge.primary { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.badge.success { background: var(--c-success-soft); color: #0f7a37; }
.badge.warn { background: var(--c-warn-soft); color: #9a6100; }
.badge.danger { background: var(--c-danger-soft); color: #b32424; }
.badge.info { background: var(--c-info-soft); color: #0b6a86; }
.badge.dot::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: 5px; vertical-align: middle;
}

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border); background: var(--c-surface);
  color: var(--c-text); font-size: 13px; font-family: var(--font);
  cursor: pointer; text-decoration: none; transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: #f5f7fb; text-decoration: none; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #bf2f2f; }
.btn-warn { color: var(--c-warn); border-color: #f0d3a4; background: var(--c-warn-soft); }
.btn-warn:hover { background: #fbe9cd; border-color: var(--c-warn); }
.btn-ghost { background: transparent; border-color: var(--c-border); color: var(--c-muted); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
/* 表格操作列专用：三个按钮并排时要更紧凑，否则 1080 宽窗口放不下 */
.btn-xs { padding: 3px 7px; font-size: 12px; border-radius: 5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- 表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* 整行表单块：楼栋多选等需要横向铺开的内容跨满整行 */
.form-grid .full { grid-column: 1 / -1; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 2px 0; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #3c4b62; margin-bottom: 5px; }
.form-group label .req { color: var(--c-danger); margin-left: 2px; }
.form-group .hint { font-size: 12px; color: var(--c-muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email],
select, textarea {
  width: 100%; padding: 8px 11px; font-size: 13.5px; font-family: var(--font);
  border: 1px solid #d7dde8; border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text); transition: .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .13);
}
textarea { resize: vertical; min-height: 88px; line-height: 1.7; }
.field-error { color: var(--c-danger); font-size: 12.5px; margin-top: 4px; }
input.input-validation-error, textarea.input-validation-error, select.input-validation-error {
  border-color: var(--c-danger); background: #fffafa;
}
.check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px;
  border: 1px solid #d7dde8; border-radius: var(--radius-sm); padding: 12px; max-height: 260px; overflow-y: auto;
}
.check-item { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.check-item input { width: auto; }

/* 单个勾选项（如住户「是否缴费人」）：整块可点，勾选后高亮 */
.form-group label.form-check {
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 0; padding: 9px 12px; font-weight: 400; cursor: pointer;
  border: 1px solid #d7dde8; border-radius: var(--radius-sm);
  background: #fbfcfe; transition: .15s;
}
.form-group label.form-check:hover { border-color: #b9c6dd; background: #f6f9fe; }
.form-group label.form-check:has(input:checked) {
  border-color: var(--c-primary); background: var(--c-primary-soft);
}
.form-check input[type=checkbox] {
  width: 15px; height: 15px; margin: 2px 0 0; flex: none;
  accent-color: var(--c-primary); cursor: pointer;
}
.form-check .txt { font-size: 13px; color: var(--c-text); line-height: 1.45; }
.form-check .txt small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--c-muted); }

/* 只读勾选状态（详情页展示，不可点击） */
.check-static {
  width: 15px; height: 15px; margin: 0; padding: 0;
  accent-color: var(--c-primary); cursor: default; vertical-align: -2px;
}

/* ---------------------------------------------------------------- 提示条 */
.alert {
  padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: 13.5px; border: 1px solid transparent; display: flex; gap: 9px; align-items: flex-start;
}
.alert-ok { background: var(--c-success-soft); color: #0f7a37; border-color: #bfe8cd; }
.alert-err { background: var(--c-danger-soft); color: #b32424; border-color: #f4cccc; }
.alert-warn { background: var(--c-warn-soft); color: #9a6100; border-color: #f5dfb3; }
.alert-info { background: var(--c-info-soft); color: #0b6a86; border-color: #bde6f2; }

/* ---------------------------------------------------------------- 页内标签页 */
.tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px; margin-bottom: 18px;
}
.tabs .tab {
  padding: 8px 20px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--c-muted);
  font-size: 13.5px; font-family: var(--font); font-weight: 600;
  cursor: pointer; transition: .15s;
}
.tabs .tab:hover { background: #f3f6fb; color: var(--c-text); }
.tabs .tab.active { background: var(--c-primary); color: #fff; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------------------------------------------------------------- 图表（纯 CSS） */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding: 8px 4px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bars { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; justify-content: center; }
.chart .bar { width: 42%; max-width: 26px; border-radius: 4px 4px 0 0; background: var(--c-primary); min-height: 2px; transition: height .4s; position: relative; }
.chart .bar.alt { background: #9dbbf7; }
.chart .bar.alt2 { background: var(--c-warn); }
.chart .bar.alt3 { background: var(--c-danger); }
.chart .cap { font-size: 11.5px; color: var(--c-muted); margin-top: 7px; white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--c-muted); margin-top: 10px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-item .bi-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.bar-item .bi-head b { font-weight: 600; }
.track { height: 8px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: 999px; background: var(--c-primary); }
.track > span.ok { background: var(--c-success); }
.track > span.warn { background: var(--c-warn); }
.track > span.danger { background: var(--c-danger); }

/* ---------------------------------------------------------------- 进度 */
.progress { height: 7px; border-radius: 999px; background: #eef1f6; overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--c-primary); }
.progress.done > span { background: var(--c-success); }

/* ---------------------------------------------------------------- 看板 */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; align-items: start; }
.kanban-col { background: #f8fafc; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 12px; min-height: 140px; }
.kanban-col h4 { font-size: 13.5px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.kanban-col h4 span { background: #e8edf5; color: #55647c; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.kcard {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 11px 12px; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(24,39,75,.04);
}
.kcard .kt { font-size: 13px; font-weight: 600; margin-bottom: 5px; line-height: 1.5; }
.kcard .km { font-size: 12px; color: var(--c-muted); display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; }
.kcard .kfoot { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--c-border); }

/* ---------------------------------------------------------------- 时间轴 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--c-border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: #fff; border: 2px solid var(--c-primary);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tl-head b { font-size: 13.5px; }
.tl-head time { font-size: 12px; color: var(--c-muted); }
.tl-body { font-size: 13px; color: #4d5c74; margin-top: 2px; }

/* ---------------------------------------------------------------- 描述列表 */
.dl { display: grid; grid-template-columns: 118px 1fr; gap: 10px 14px; font-size: 13.5px; }
.dl dt { color: var(--c-muted); }
.dl dd { margin: 0; }

/* ---------------------------------------------------------------- 其它 */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; }
.page-head .desc { font-size: 13px; color: var(--c-muted); margin-top: 3px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 140px; }
.empty { text-align: center; padding: 46px 20px; color: var(--c-muted); font-size: 13.5px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; opacity: .5; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--c-border); font-size: 13px; }
.pager a, .pager span.cur {
  min-width: 32px; padding: 4px 9px; text-align: center; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); color: var(--c-text); text-decoration: none; background: #fff;
}
.pager span.cur { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
.pager .info { color: var(--c-muted); margin-right: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; align-items: start; }
.kv-inline { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--c-muted); }
.kv-inline b { color: var(--c-text); }
.room-tag { display: inline-block; background: #eef1f6; border-radius: 5px; padding: 1px 7px; font-size: 12px; color: #55647c; margin: 0 4px 4px 0; }
.stars { color: #f0a020; letter-spacing: 2px; }
.stars .off { color: #d9dfe8; }
.flow-steps { display: flex; gap: 0; flex-wrap: wrap; margin: 4px 0 2px; }
.flow-steps .fs {
  display: flex; align-items: center; font-size: 12.5px; color: var(--c-muted); padding: 4px 0;
}
.flow-steps .fs .dot {
  width: 22px; height: 22px; border-radius: 50%; background: #e8edf5; color: #7a8aa3;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; margin-right: 6px;
}
.flow-steps .fs.done .dot { background: var(--c-success); color: #fff; }
.flow-steps .fs.cur .dot { background: var(--c-primary); color: #fff; }
.flow-steps .fs.done, .flow-steps .fs.cur { color: var(--c-text); font-weight: 600; }
.flow-steps .fs::after { content: "›"; margin: 0 10px; color: #c3cbd8; font-size: 15px; }
.flow-steps .fs:last-child::after { content: ""; margin: 0; }

/* ---------------------------------------------------------------- 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef3fb 0%, #e3ecfa 45%, #e9f2f6 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 14px;
  box-shadow: 0 18px 50px -20px rgba(24, 39, 75, .3); padding: 34px 32px 28px;
}
.login-card .logo { font-size: 20px; font-weight: 700; color: #14233a; }
.login-card .logo-sub { font-size: 12.5px; color: var(--c-muted); margin: 4px 0 24px; }
.login-tabs { display: flex; background: #f1f4f9; border-radius: 9px; padding: 3px; margin-bottom: 20px; }
.login-tabs a {
  flex: 1; text-align: center; padding: 7px 0; font-size: 13px; border-radius: 7px;
  color: var(--c-muted); text-decoration: none; font-weight: 600;
}
.login-tabs a.on { background: #fff; color: var(--c-primary); box-shadow: 0 1px 3px rgba(24,39,75,.12); }
.login-tip {
  margin-top: 18px; padding: 11px 13px; background: #f7f9fc; border: 1px dashed var(--c-border);
  border-radius: var(--radius-sm); font-size: 12.5px; color: var(--c-muted); line-height: 1.85;
}
.login-tip b { color: #3c4b62; }

/* ---------------------------------------------------------------- 业主端 */
.owner-shell { max-width: 520px; margin: 0 auto; background: var(--c-bg); min-height: 100vh; padding-bottom: 70px; }
.owner-top {
  background: linear-gradient(135deg, var(--c-primary) 0%, #4a86f7 100%);
  color: #fff; padding: 22px 20px 52px; border-radius: 0 0 20px 20px;
}
.owner-top .hi { font-size: 17px; font-weight: 700; }
.owner-top .meta { font-size: 12.5px; opacity: .88; margin-top: 4px; }
.owner-body { padding: 0 14px; margin-top: -38px; }
.owner-nav {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 520px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--c-border);
  display: flex; justify-content: space-around; padding: 8px 0 10px; z-index: 30;
}
.owner-nav a { text-align: center; font-size: 11.5px; color: var(--c-muted); text-decoration: none; flex: 1; }
.owner-nav a .ico { display: block; font-size: 19px; margin-bottom: 1px; }
.owner-nav a.on { color: var(--c-primary); font-weight: 700; }
.mcard { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 15px 16px; margin-bottom: 12px; }
.mcard-title { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.mrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f4f8; font-size: 13.5px; }
.mrow:last-child { border-bottom: none; }
.mrow .mt { min-width: 0; }
.mrow .mt b { display: block; font-weight: 600; }
.mrow .mt span { font-size: 12px; color: var(--c-muted); }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.quick-grid a { color: var(--c-text); font-size: 12px; text-decoration: none; padding: 12px 4px; border-radius: 10px; }
.quick-grid a:hover { background: #f5f7fb; }
.quick-grid .ico { display: block; font-size: 21px; margin-bottom: 5px; }

/* ---------- 计费明细：面积 × 单价 = 金额 ---------- */
.calc-row { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.calc-cell {
  flex: 1 1 150px; background: #f8fafd; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 13px 16px;
}
.calc-cell.highlight { background: var(--c-primary-soft); border-color: #c9dcff; }
.calc-label { font-size: 12.5px; color: var(--c-muted); }
.calc-value { font-size: 21px; font-weight: 700; margin-top: 3px; letter-spacing: -.4px; }
.calc-cell.highlight .calc-value { color: var(--c-primary-dark); }
.calc-value small { font-size: 12.5px; font-weight: 500; color: var(--c-muted); }
.calc-hint { font-size: 12px; color: var(--c-muted); margin-top: 4px; }
.calc-op {
  display: flex; align-items: center; font-size: 19px; font-weight: 700;
  color: var(--c-muted); padding: 0 2px;
}

/* ---------------------------------------------------------------- 关键字输入框清除按钮
   由 wwwroot/js/kw-clear.js 在页面加载后包裹生成，无需改动各视图的表单结构。
   布局：容器是一行 flex，按钮是输入框的兄弟节点，紧跟在输入框后面（不叠在框内、也不会换行）。
   · 用 flex 而不是 inline 流式排列：输入框可收缩、按钮固定宽度，任何宽度下都保持同一行。
   · 输入框 min-width:0 是关键，否则默认最小宽度会把按钮挤到下一行。 */
.kw-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.kw-wrap > input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
/* 部分浏览器给 type=search 自带清除图标，避免出现两个 × */
.kw-wrap > input::-webkit-search-cancel-button,
.kw-wrap > input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.kw-clear {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #d7dde8;
  border-radius: 50%;
  background: #fff;
  color: #7d8b9e;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  /* 始终占位，只切换可见性：否则开始输入时按钮突然出现，
     会把输入框挤窄 30px，视觉上跳一下 */
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s, background .15s, border-color .15s, color .15s;
}
.kw-clear:hover { border-color: #b9c4d4; color: #3f5068; background: #f4f7fb; }
.kw-clear:active { background: #e7edf5; }
/* 输入框有内容时才出现，空框不打扰（占位保留，避免布局跳动） */
.kw-wrap.has-value .kw-clear { opacity: 1; visibility: visible; }
.kw-clear:focus-visible { outline: 2px solid rgba(47, 111, 237, .45); outline-offset: 1px; }

@media (max-width: 980px) {
  .kanban { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
}
@media (max-width: 780px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; overflow-x: auto; gap: 4px; padding: 8px; }
  .nav-group { display: none; }
  .nav a { white-space: nowrap; margin: 0; }
  .content { padding: 16px 14px 50px; }
  .kanban { grid-template-columns: 1fr; }
  .calc-op { display: none; }
  .calc-cell { flex: 1 1 100%; }
}

/* ==========================================================================
   房屋台账 · 树形视图（楼栋 → 单元 → 楼层 → 房屋）
   ========================================================================== */
.tree-layout {
  display: grid;
  /* 套数 / 面积从节点里去掉后，树面板不需要那么宽：340 → 200 */
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tree-panel { position: sticky; top: 14px; }

.tree-body {
  padding: 8px 8px 12px;
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.room-tree, .room-tree .tchildren {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 子层用虚线导轨，深度一眼可辨；缩进做小一点，四层也能塞进窄面板 */
.room-tree .tchildren {
  margin-left: 5px;
  padding-left: 6px;
  border-left: 1px dashed var(--c-border);
}

/* 默认收起；.open 才展开 —— 首次渲染时由服务端决定哪些层打开 */
.tnode > .tchildren { display: none; }
.tnode.open > .tchildren { display: block; }

.trow {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--radius-sm);
  padding: 1px 2px 1px 0;
  overflow: hidden;
}
.trow:hover { background: #f5f8ff; }
.trow.on { background: var(--c-primary-soft); }
.trow.on .tname { color: var(--c-primary-dark); font-weight: 600; }

.twisty {
  flex: 0 0 14px;
  width: 14px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-muted);
  font-size: 10px;
  line-height: 16px;
  cursor: pointer;
  transition: transform .15s;
}
.tnode.open > .trow > .twisty { transform: rotate(90deg); }
.twisty:hover { color: var(--c-primary); }
.twisty:focus-visible { outline: 2px solid rgba(47, 111, 237, .45); border-radius: 3px; }
.twisty.ph { visibility: hidden; }

.tlink {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding: 3px 4px;
  color: var(--c-text);
  text-decoration: none;
  font-size: 13px;
}
.tlink:hover { text-decoration: none; }
.tlink .tname {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tlink .badge { flex: 0 0 auto; font-size: 10px; padding: 1px 4px; }
.tnode.kind-building > .trow > .tlink .tname { font-weight: 600; }
.tnode.kind-unit > .trow > .tlink .tname,
.tnode.kind-floor > .trow > .tlink .tname { color: #46586f; }
.tnode.kind-room > .trow > .tlink .tname { font-family: Consolas, "Courier New", monospace; }

.tree-detail { min-width: 0; }

@media (max-width: 1180px) {
  .tree-layout { grid-template-columns: 1fr; }
  .tree-panel { position: static; }
  .tree-body { max-height: 380px; }
}

/* ==================================================================
   单据打印（押金单 / 收费凭证）
   页面本身仍然跑在标准布局里，方便用户先核对再打印；
   点「打印」或按 Ctrl+P 时，用 @media print 把侧栏、顶栏、按钮全部隐藏，
   只留纸面区域。屏幕预览用 .print-sheet 模拟纸张，所见即所得。
   ================================================================== */
.print-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.print-toolbar .hint { color: var(--c-muted); font-size: 12px; }

.print-sheet {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  max-width: 820px;
  margin: 0 auto 18px;
  color: #10161f;
}
.print-sheet.a5 { max-width: 640px; }

/* 抬头：小区名 + 单据标题 */
.ph-head { text-align: center; border-bottom: 2px solid #10161f; padding-bottom: 12px; }
.ph-head .ph-org { font-size: 19px; font-weight: 700; letter-spacing: 2px; }
.ph-head .ph-addr { font-size: 11.5px; color: #5b6878; margin-top: 3px; }
.ph-head .ph-title { font-size: 15px; font-weight: 700; margin-top: 10px; letter-spacing: 6px; }

/* 单据编号 / 打印时间那一行 */
.ph-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  font-size: 12px;
  color: #3d4a5c;
  margin: 12px 0 10px;
  flex-wrap: wrap;
}
.ph-meta .ph-no { font-family: Consolas, "Courier New", monospace; font-size: 13px; font-weight: 700; }

/* 字段表：两列 / 四列自适应 */
.ph-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid #c9d2de;
  font-size: 12.5px;
}
.ph-fields .pf {
  display: flex;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  min-height: 34px;
}
.ph-fields .pf:nth-child(3n) { border-right: none; }
.ph-fields .pf-label {
  flex: 0 0 78px;
  background: #f6f8fb;
  color: #4b5a6e;
  padding: 8px 8px;
  border-right: 1px solid #e2e8f0;
}
.ph-fields .pf-value {
  flex: 1 1 auto;
  padding: 8px 10px;
  font-weight: 600;
  word-break: break-all;
}
.ph-fields .pf.span2 { grid-column: span 2; }

/* 明细表 */
.ph-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 14px; }
.ph-table th, .ph-table td { border: 1px solid #c9d2de; padding: 6px 8px; }
.ph-table th { background: #f6f8fb; font-weight: 600; color: #3d4a5c; }
.ph-table td.num, .ph-table th.num { text-align: right; }
.ph-table tfoot td { background: #fafbfd; font-weight: 700; }

/* 金额大写 + 签章区 */
.ph-amount {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #c9d2de;
  border-top: none;
  padding: 9px 10px;
  font-size: 12.5px;
  background: #fafbfd;
}
.ph-amount .pa-label { color: #4b5a6e; flex: 0 0 auto; }
.ph-amount .pa-value { font-weight: 700; letter-spacing: 1px; }

.ph-sign {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 26px;
  font-size: 12px;
  color: #3d4a5c;
  flex-wrap: wrap;
}
.ph-sign .ps-item { flex: 1 1 0; min-width: 140px; }
.ph-sign .ps-line {
  margin-top: 30px;
  border-top: 1px solid #7d8a99;
  padding-top: 4px;
  color: #5b6878;
}

.ph-note { margin-top: 16px; font-size: 11px; color: #5b6878; line-height: 1.8; }
.ph-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #c9d2de;
  font-size: 10.5px;
  color: #7d8a99;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* 批量打印：每张单据独立一页 */
.print-sheet.page-break { page-break-after: always; break-after: page; }
.print-sheet.page-break:last-child { page-break-after: auto; break-after: auto; margin-bottom: 0; }

/* ------------------------------------------------------------------
   税票式缴费收据（账单打印）
   参考纸质收据：全框线、蓝色印刷感、左侧竖排标签、单行费用明细、
   大写/小写合计行、备注行、底部四栏签章。
   ------------------------------------------------------------------ */
.receipt-sheet {
  --rc-ink: #1c3f8f;          /* 票据主色（印花蓝） */
  --rc-line: #1c3f8f;
  --rc-thin: #6f8ac4;
  max-width: 760px;
  padding: 26px 26px 18px;
  color: #10161f;
}

/* 抬头：标题居中 + 票据号右角 */
.rc-head { position: relative; text-align: center; padding: 4px 0 14px; }
.rc-head .rc-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--rc-ink);
}
.rc-head .rc-ticket {
  position: absolute;
  right: 0;
  bottom: 14px;
  font-size: 12px;
  color: #1f2937;
}

/* 项目 / 房号 / 姓名 */
.rc-sub {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  padding: 3px 2px 7px;
  color: #10161f;
}
.rc-sub .rc-sub-room { flex: 1 1 auto; text-align: center; }
.rc-sub .rc-sub-item b { font-weight: 700; }

/* 主体框：左边竖排标签 + 右边内容 */
.rc-body {
  display: flex;
  border: 1.5px solid var(--rc-line);
}
.rc-side {
  flex: 0 0 30px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 4px;
  font-size: 12px;
  color: var(--rc-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1.5px solid var(--rc-line);
  padding: 8px 0;
  background: #f4f7fd;
}
.rc-main { flex: 1 1 auto; min-width: 0; }

/* 费用明细表 */
.rc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rc-table th, .rc-table td {
  border-right: 1px solid var(--rc-thin);
  border-bottom: 1px solid var(--rc-thin);
  padding: 6px 7px;
  vertical-align: middle;
}
.rc-table th:last-child, .rc-table td:last-child { border-right: none; }
.rc-table th {
  color: var(--rc-ink);
  font-weight: 700;
  text-align: left;
  background: #f4f7fd;
}
.rc-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rc-table td.ctr { text-align: center; }

/* 大写 / 小写合计行 */
.rc-sum {
  display: grid;
  grid-template-columns: 74px 1fr 52px 120px;
  border-bottom: 1px solid var(--rc-thin);
  font-size: 12px;
}
.rc-sum > div {
  padding: 6px 7px;
  border-right: 1px solid var(--rc-thin);
  display: flex;
  align-items: center;
}
.rc-sum > div:last-child { border-right: none; }
.rc-sum .rc-sum-label { color: var(--rc-ink); font-weight: 700; }
.rc-sum .rc-sum-words { letter-spacing: 1px; font-weight: 600; }
.rc-sum .rc-sum-small { border-left: none; }
.rc-sum .rc-sum-num { justify-content: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 备注 */
.rc-remark {
  padding: 6px 7px;
  font-size: 11.5px;
  color: #3d4a5c;
}

/* 底部签章四栏 */
.rc-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
}
.rc-foot .rc-foot-item b { font-weight: 700; }
.rc-foot .rc-foot-item:last-child { color: #3d4a5c; }
/* 「业主签字」不贴票面右边缘：向右留出 5 个汉字位（12px × 5 = 60px）的空白 */
.rc-foot .rc-foot-sign { margin-right: 60px; }

.rc-page {
  margin-top: 8px;
  text-align: right;
  font-size: 10.5px;
  color: #8b97a8;
}

/* 打印时保留票面蓝色（浏览器默认会丢弃浅背景） */
@media print {
  .receipt-sheet .rc-side,
  .receipt-sheet .rc-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .receipt-sheet .rc-page { display: none; }
}

/* 批量打印前的勾选区 */
.pick-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--c-primary-soft);
  border: 1px solid #c7dbff;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
}
.pick-bar .pick-count { font-weight: 700; color: var(--c-primary-dark); }
.pick-bar .pick-sum { color: var(--c-muted); }
.pick-bar .pick-tickets { color: #0f6e56; }
.pick-bar .pick-tickets b { font-weight: 700; }

/* 勾选列 */
.table .col-pick { width: 34px; }
.table .col-pick input { width: 15px; height: 15px; cursor: pointer; vertical-align: middle; }

/* 账单列表列多：给关键列兜一个最小宽度，窗口偏窄时整表横向滚动，
   而不是把「缴费截止」压成「202…」这种断行。 */
table.table-bills th.c-min-room { min-width: 104px; }
table.table-bills th.c-min-item { min-width: 78px; }
table.table-bills th.c-min-money { min-width: 72px; }
table.table-bills th.c-min-due { min-width: 86px; }
/* 这张表列最多，单元格左右内边距再收 2px，把省下的宽度让给操作列 */
table.table-bills.table-dense th { padding: 9px 7px; }
table.table-bills.table-dense td { padding: 8px 7px; }
table.table-bills .col-pick { width: 26px; }
/* 操作列要同时容纳「收款 / 修改 / 删除」三个按钮，宽度写死成内容宽度，避免被压缩裁切 */
table.table-bills th.col-ops,
table.table-bills td.col-ops { width: 150px; min-width: 150px; }
.ops-row { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }

/* 收水电费列表列多（12 列），单元格左右间距收窄，给操作列留出「详情 / 修改 / 删除」三个按钮的位置 */
table.table-utility th, table.table-utility td { padding-left: 10px; padding-right: 10px; }

/* 房屋台账列多（16 列）：内边距比通用紧密表再收 2px，配合右侧固定操作列，
   在 1240 宽的窗口里也能一屏放下，不把「住户 / 操作」挤到看不见 */
table.table.table-rooms th, table.table.table-rooms td { padding-left: 8px; padding-right: 8px; }
table.table.table-rooms .btn-sm { padding-left: 8px; padding-right: 8px; }

/* 房屋名称列：名称可能较长（如「1 号楼-1单元-0101」），限宽省略，
   悬停看 title 里的全名，避免把后面 15 列整体挤出屏幕 */
table.table-rooms th.col-name,
table.table-rooms td.col-name { max-width: 168px; }
table.table-rooms td.col-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

table.table.table-rooms th.col-ops,
table.table.table-rooms td.col-ops { width: 100px; min-width: 100px; }

/* 右侧固定操作列：列多时表格会横向滚动，操作按钮必须始终可见，不能被裁切 */
.table .col-ops {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 1%;
  background: var(--c-surface);
  box-shadow: -8px 0 10px -8px rgba(20, 35, 60, .16);
}
table.table thead th.col-ops { background: #f8fafc; z-index: 3; }
table.table tbody tr:hover td.col-ops { background: #fafbfe; }
table.table tbody tr.row-weekend td.col-ops { background: #fcfdff; }
/* 末行取消下边框时，固定列阴影也要跟着收，避免出现悬空竖线 */
table.table tbody tr:last-child td.col-ops { border-bottom: none; }

@media print {
  /* 打印时横向滚动不存在，固定列回归普通单元格 */
  .table .col-ops { position: static !important; box-shadow: none !important; }
}

@media print {
  /* 打印时把界面外壳全部去掉，只留纸面 */
  .sidebar, .topbar, .print-toolbar, .pick-bar, .no-print { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff !important; }

  .print-sheet {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 打印时避免边框被浏览器丢弃背景色影响 */
  .ph-fields .pf-label, .ph-table th, .ph-table tfoot td, .ph-amount {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page { size: A4; margin: 12mm 14mm; }
}

@media (max-width: 720px) {
  .print-sheet { padding: 18px 14px; }
  .ph-fields { grid-template-columns: 1fr; }
  .ph-fields .pf:nth-child(3n) { border-right: 1px solid #e2e8f0; }
  .ph-fields .pf { border-right: none; }
  .ph-fields .pf.span2 { grid-column: auto; }

  /* 收据在窄屏下把明细表改为横滚，避免字段挤成一团 */
  .receipt-sheet { padding: 16px 12px 12px; }
  .rc-head .rc-title { font-size: 17px; letter-spacing: 1px; }
  .rc-head .rc-ticket { position: static; display: block; margin-top: 6px; }
  .rc-sub { flex-wrap: wrap; gap: 4px 12px; }
  .rc-sub .rc-sub-room { text-align: left; }
  .rc-main { overflow-x: auto; }
  .rc-table { min-width: 460px; }
  .rc-sum { grid-template-columns: 64px 1fr 46px 96px; }
  .rc-foot { flex-direction: column; gap: 4px; }
  /* 竖向排列时每项各占一行，右侧留白无意义，清零 */
  .rc-foot .rc-foot-sign { margin-right: 0; }
}

/* ---------------- 临时收费「指定房屋」选择器 ----------------
   左侧按楼栋列出待选房屋（勾选即选），右侧实时汇总已选对象，
   点「确定选中」收起为一行摘要，提交时仍用左侧勾选框的 RoomIds。 */
.room-picker { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: stretch; }
.room-pick-panel, .room-pick-side {
  display: flex; flex-direction: column; min-height: 250px;
  border: 1px solid #dde3ec; border-radius: 8px; background: #fbfcfe;
}
.room-pick-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; background: #f4f7fb;
  border-bottom: 1px solid #e8edf5; border-radius: 8px 8px 0 0;
}
.room-pick-title { font-size: 13px; font-weight: 600; color: #3c4b62; }
.room-pick-head .room-pick-search { width: 170px; height: 28px; padding: 0 8px; font-size: 12px; }
.room-pick-body { padding: 8px 10px; max-height: 300px; overflow: auto; }
.room-pick-building + .room-pick-building { margin-top: 10px; }
.room-pick-bhead {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 5px; font-size: 13px; cursor: pointer;
}
.room-picker input[type=checkbox] { width: auto; height: auto; margin: 0; }
.room-pick-rooms {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 2px 10px; padding-left: 8px;
}
.room-pick-item {
  display: flex; align-items: center; gap: 6px;
  margin: 0; padding: 3px 5px; border-radius: 5px;
  font-size: 12px; font-weight: 400; cursor: pointer;
}
.room-pick-item:hover { background: #eef4ff; }
.room-pick-item.is-hidden { display: none; }
.room-pick-no { font-weight: 600; color: #22304a; }
.room-pick-selected {
  flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px;
  padding: 9px 10px; max-height: 300px; overflow: auto;
}
.room-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 3px 2px 8px; border-radius: 12px;
  background: #e8f0ff; color: #1d4ed8; font-size: 12px;
}
.room-chip-x {
  border: none; background: transparent; color: #1d4ed8;
  font-size: 14px; line-height: 1; padding: 0 3px; cursor: pointer;
}
.room-chip-x:hover { color: #b91c1c; }
.room-pick-empty { color: #8a94a6; font-size: 12px; padding: 4px 2px; }
.room-pick-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 8px 10px; border-top: 1px solid #e8edf5;
}
.room-pick-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; font-size: 13px;
  border: 1px dashed #c8d4e6; border-radius: 8px; background: #f7fafd;
}

@media (max-width: 900px) {
  .room-picker { grid-template-columns: 1fr; }
  .room-pick-side { min-height: 0; }
}

/* ---------------- 账单生成：固定 / 临时两栏 ---------------- */
.gen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gen-panel {
  display: flex; flex-direction: column;
  padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fbfcfe;
}
.gen-title {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
  margin-bottom: 10px; font-size: 13px; font-weight: 600; color: #22304a;
}
.gen-form { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; }
.gen-form .form-group { margin-bottom: 0; min-width: 0; }
/* 字段区与按钮区分开：按钮统一落在面板底部，两个面板的按钮同一水平线 */
.gen-fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.gen-fields .gen-fw { flex: 1 1 100%; min-width: 0; }
.gen-fields .gen-half { flex: 1 1 150px; min-width: 140px; }
.gen-foot {
  margin-top: auto; display: flex; justify-content: flex-end;
  padding-top: 11px; border-top: 1px dashed #e2e8f0;
}
.gen-foot .btn { min-width: 156px; justify-content: center; }
.gen-empty {
  padding: 14px; font-size: 13px; color: #5b6779;
  border: 1px dashed #d7dde8; border-radius: 8px; background: #fff;
}

@media (max-width: 1000px) {
  .gen-grid { grid-template-columns: 1fr; }
}
