* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  background: #f1f5f9; color: #1e293b; font-size: 14px;
}
a { cursor: pointer; color: #2563eb; text-decoration: none; }

/* ===== 登录 ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #0f172a, #1e3a8a 60%, #2563eb);
}
.login-card {
  width: 380px; background: #fff; border-radius: 20px; padding: 44px 38px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.login-logo { font-size: 44px; text-align: center; }
.login-card h1 { font-size: 22px; text-align: center; margin: 12px 0 4px; }
.login-sub { text-align: center; color: #94a3b8; font-size: 13px; margin-bottom: 26px; }
.login-err { color: #ef4444; font-size: 13px; min-height: 18px; margin-bottom: 6px; }

/* ===== 布局 ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; background: #0f172a; color: #cbd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid #1e293b; }
.brand-logo { font-size: 26px; }
.brand-name { font-size: 15px; font-weight: 600; color: #fff; }
.brand-sub { font-size: 11px; color: #64748b; }
.nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-group { font-size: 11px; color: #475569; padding: 12px 18px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  font-size: 14px; cursor: pointer; color: #cbd5e1; border-left: 3px solid transparent;
}
.nav-item .ico { font-size: 15px; width: 18px; text-align: center; }
.nav-item:hover { background: #1e293b; color: #fff; }
.nav-item.on { background: #1e3a8a; color: #fff; border-left-color: #3b82f6; font-weight: 600; }
.nav-item.disabled { color: #475569; cursor: not-allowed; font-size: 13px; }
.nav-item.disabled:hover { background: transparent; color: #475569; }
.side-foot {
  padding: 14px 18px; border-top: 1px solid #1e293b; font-size: 12px;
  display: flex; justify-content: space-between; color: #64748b;
}

.main { flex: 1; padding: 22px 26px 60px; min-width: 0; }
.page { display: none; }
.page.on { display: block; }
.page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.page-head h2 { font-size: 20px; font-weight: 600; }
.page-head .sub { font-size: 12px; color: #94a3b8; font-weight: 400; margin-left: 8px; }
.muted { color: #94a3b8; font-size: 13px; }

/* ===== 卡片 ===== */
.card {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(15,23,42,.05); margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.empty { text-align: center; color: #94a3b8; padding: 40px 0; font-size: 14px; }

/* ===== 统计卡 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(15,23,42,.05);
}
.stat .k { font-size: 12px; color: #94a3b8; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 8px; color: #1e293b; }
.stat .v.blue { color: #2563eb; }
.stat .v.green { color: #16a34a; }
.stat .v.orange { color: #f59e0b; }
.stat .v.red { color: #ef4444; }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; color: #64748b; font-weight: 500;
  padding: 10px 8px; border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
td { padding: 12px 8px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
tr:hover td { background: #f8fafc; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 11px; font-size: 12px; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-gray { background: #f1f5f9; color: #64748b; }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid #e2e8f0;
  background: #fff; color: #475569; font-size: 13px; cursor: pointer;
}
.btn:hover { background: #f8fafc; }
.btn-primary {
  padding: 8px 18px; border-radius: 8px; border: none;
  background: #2563eb; color: #fff; font-size: 13px; cursor: pointer; font-weight: 500;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: #ef4444; color: #fff; border: none; }
.btn-danger:hover { background: #dc2626; }
.full { width: 100%; padding: 12px; font-size: 15px; }
.search { padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; width: 200px; }

/* ===== 表单 ===== */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #475569; margin-bottom: 6px; }
.form-row label .req { color: #ef4444; margin-left: 3px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: #2563eb;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; z-index: 999; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; width: 620px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 26px 28px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-head .x { font-size: 22px; color: #94a3b8; cursor: pointer; line-height: 1; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px;
  padding-top: 18px; border-top: 1px solid #f1f5f9;
}

/* ===== 树 ===== */
.tree .node { background: #fff; border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.tree .node-title { font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.tree .child { margin: 10px 0 0 20px; border-left: 2px solid #e2e8f0; padding-left: 14px; }
.tree .child-item { padding: 6px 0; font-size: 13px; color: #475569; }
.tree .room { display: inline-block; padding: 3px 10px; margin: 3px; border-radius: 6px; background: #f1f5f9; font-size: 12px; }
.tree .room.rented { background: #dcfce7; color: #15803d; }
.tree .room.vacant { background: #fee2e2; color: #b91c1c; }

.quick { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { font-size: 12px; color: #94a3b8; margin-top: 6px; }

/* ===== 导航红点 ===== */
.nav-item { position: relative; }
.badge {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff;
  font-size: 11px; text-align: center; margin-left: auto;
}
/* ===== 预警横幅 ===== */
.warn-banner {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; font-size: 13px;
}
.warn-banner.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.warn-banner a { color: #2563eb; margin-left: 4px; }

/* 推送次数徽标（可点） */
.push-cnt {
  display: inline-block; font-size: 12px; color: #2563eb;
  background: #eff6ff; border-radius: 10px; padding: 2px 10px;
  cursor: pointer; text-decoration: underline;
}
.push-cnt:hover { background: #dbeafe; }

/* 收费记录展开明细 */
.pay-detail { padding: 12px 18px; background: #f8fafc; border-radius: 8px; line-height: 2; font-size: 13px; }
.pay-detail .k { color: #64748b; display: inline-block; width: 90px; }

/* 收费记录三层折叠 */
.pm-month { margin-bottom: 12px; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.pm-mhead { display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: #f8fafc; cursor: pointer; font-size: 14px; }
.pm-mhead:hover { background: #f1f5f9; }
.pm-arrow { color: #3b82f6; font-size: 12px; width: 14px; }
.pm-sum { margin-left: auto; font-weight: 700; color: #1e293b; }
.pm-mbody { padding: 4px 0; }
.pm-owner { border-top: 1px solid #f1f5f9; }
.pm-ohead { display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 34px;
  cursor: pointer; font-size: 13px; }
.pm-ohead:hover { background: #fafbfc; }
.pm-obody { padding: 0 18px 12px 58px; }
.pm-pay { display: flex; align-items: center; gap: 14px; padding: 8px 0;
  border-bottom: 1px dashed #f1f5f9; font-size: 13px; color: #475569; }
.pm-pay:last-child { border-bottom: none; }
.pm-pay b { margin-left: auto; color: #1e293b; }
