/* 物业管理系统 - 简洁管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f2f4f8; color: #333; font-size: 14px; }

.layout { display: flex; min-height: 100vh; padding-left: 210px; }

/* 侧边栏 */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 210px; background: #1f2d3d; color: #cbd5e1; overflow-y: auto; }
.logo { padding: 18px 20px; font-size: 17px; font-weight: bold; color: #fff; background: #182430; letter-spacing: 1px; }
.nav { padding: 10px 0; }
.nav a, .nav button.nav-link { display: block; width: 100%; text-align: left; padding: 10px 22px; color: #cbd5e1; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; box-sizing: border-box; }
.nav a:hover, .nav button.nav-link:hover { background: #2b3d52; color: #fff; }
.nav a.active, .nav button.nav-link.active { background: #2f6fed; color: #fff; }
.nav-group { padding: 14px 22px 6px; font-size: 12px; color: #7a8ba3; }

/* 主区域 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 54px; background: #fff; border-bottom: 1px solid #e5e9f0; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.page-title { font-size: 16px; font-weight: bold; }
.user-info { display: flex; align-items: center; gap: 12px; color: #666; }
.topbar-right { display: flex; align-items: center; }
.content { padding: 22px 24px; flex: 1; }

/* 提示消息 */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash.success { background: #e6f7ec; color: #1a7f37; border: 1px solid #b7e4c7; }
.flash.danger { background: #fdeaea; color: #c53030; border: 1px solid #f3c1c1; }
.flash.warning { background: #fff6e5; color: #b45309; border: 1px solid #f5d9a8; }

/* 卡片 */
.card { background: #fff; border: 1px solid #e5e9f0; border-radius: 8px; padding: 18px 20px; margin-bottom: 18px; }
.card-title { font-size: 15px; font-weight: bold; margin-bottom: 14px; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stats-block { margin-bottom: 20px; }
.stats-block-title { font-size: 15px; font-weight: bold; color: #1f2937; margin-bottom: 10px; }
.stats-block-title::before { content: ''; display: inline-block; width: 4px; height: 15px; background: #2f6fed; border-radius: 2px; margin-right: 8px; vertical-align: -2px; }
.stat { background: #fff; border: 1px solid #e5e9f0; border-radius: 8px; padding: 16px 18px; }
.stat .num { font-size: 26px; font-weight: bold; color: #2f6fed; margin: 6px 0 2px; }
.stat .label { color: #8892a6; font-size: 13px; }
.stat .sub { color: #a0a8b8; font-size: 12px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th { background: #f7f9fc; text-align: left; padding: 10px 12px; font-weight: 600; color: #55606f; border-bottom: 1px solid #e5e9f0; white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; }
tr:hover td { background: #fafbfe; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-blue { background: #e8f0fe; color: #1a56db; }
.tag-green { background: #e6f7ec; color: #1a7f37; }
.tag-red { background: #fdeaea; color: #c53030; }
.tag-orange { background: #fff6e5; color: #b45309; }
.tag-gray { background: #eef1f5; color: #6b7280; }
.perm-table { border-collapse: collapse; margin: 10px 0; }
.perm-table th, .perm-table td { border: 1px solid #e5e9f0; padding: 6px 12px; text-align: center; }
.perm-table th { background: #f7f9fc; }
.perm-table td:first-child { text-align: left; }
.check-group { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check-item { display: inline-flex; align-items: center; gap: 4px; }

/* 按钮 */
.btn { display: inline-block; padding: 6px 14px; border: 1px solid #d5dbe4; border-radius: 5px; background: #fff; color: #333; cursor: pointer; text-decoration: none; font-size: 13px; }
.btn:hover { background: #f5f7fa; }
.btn-primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.btn-primary:hover { background: #2459c9; }
.btn-danger { color: #c53030; border-color: #f0c4c4; }
.btn-danger:hover { background: #fdeaea; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 表单 */
.form-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; min-height: 35px; }
.card .form-row { margin-bottom: 16px; }
.card .form-row:last-child { margin-bottom: 0; }
.card.modal-active .form-row { row-gap: 30px; margin-bottom: 0; }
.form-row label { color: #55606f; }
input[type=text], input[type=number], input[type=date], input[type=password], select {
  border: 1px solid #d5dbe4; border-radius: 5px; padding: 3px 10px; font-size: 13px;
  height: 35px; box-sizing: border-box; background: #fff; color: #333;
}
textarea {
  border: 1px solid #d5dbe4; border-radius: 5px; padding: 7px 10px; font-size: 13px; background: #fff; color: #333;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2f6fed; }
textarea { width: 100%; min-height: 90px; resize: vertical; }

/* 筛选栏 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }

/* 页面头 */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }

/* 详情文本 */
.text-muted { color: #8892a6; }
.amount { font-weight: bold; color: #d97706; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1f2d3d; }
.login-box { background: #fff; border-radius: 10px; padding: 36px 40px; width: 360px; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 24px; color: #1f2d3d; }
.login-box .form-item { margin-bottom: 16px; }
.login-box .form-item label { display: block; margin-bottom: 6px; color: #55606f; }
.login-box input { width: 100%; padding: 9px 12px; }
.login-box .btn-primary { width: 100%; padding: 10px; font-size: 15px; }
.login-tip { margin-top: 14px; text-align: center; color: #8892a6; font-size: 12px; }

/* 详情面板 */
.detail-row { display: flex; padding: 7px 0; border-bottom: 1px dashed #eef1f5; }
.detail-row .k { width: 120px; color: #8892a6; flex-shrink: 0; }

/* 编辑弹窗（modal） */
.edit-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 999; display: none; }
.card.modal-active {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 1000; width: min(720px, 94vw);
  height: auto; max-height: 94vh; overflow-y: auto;
  margin: 0; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.card.modal-active .form-row { row-gap: 22px; }
.card.modal-active .hint { margin-top: 8px; }
.card.modal-active .modal-close {
  position: absolute; top: 10px; right: 12px;
  border: 1px solid #d1d5db; background: #fff; color: #64748b;
  border-radius: 6px; padding: 3px 12px; font-size: 13px; cursor: pointer;
}
.card.modal-active .modal-close:hover { background: #fef2f2; border-color: #f87171; color: #dc2626; }

/* 分页控件 */
.pagination { display: flex; align-items: center; gap: 6px; padding: 14px 4px 2px; flex-wrap: wrap; }
.pagination a, .pagination .page-cur, .pagination .page-disabled, .pagination .page-ellipsis {
  display: inline-block; min-width: 30px; padding: 4px 10px; text-align: center;
  border: 1px solid #d5dbe4; border-radius: 5px; font-size: 13px; color: #333; text-decoration: none;
}
.pagination a:hover { background: #eef4ff; border-color: #93b4f0; color: #2563eb; }
.pagination .page-cur { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.pagination .page-disabled { color: #b6bfcd; background: #f7f9fc; cursor: not-allowed; }
.pagination .page-ellipsis { border: none; background: transparent; }
.pagination .page-info { font-size: 13px; color: #64748b; margin-right: 6px; }
.pagination .page-size { font-size: 13px; color: #64748b; margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pagination .page-size a, .pagination .page-size .page-cur {
  padding: 3px 8px; border: 1px solid #dbe2ec; border-radius: 4px; text-decoration: none; color: #445; background: #fff; line-height: 1.2;
}
.pagination .page-size a:hover { background: #eef4ff; border-color: #93b4f0; color: #2563eb; }
.pagination .page-size .page-cur { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }

/* 快捷查询弹窗 */
#quickSearchForm.modal-active { width: min(1100px, 96vw); }
.quick-search-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; align-items: center; }
.quick-search-box label { font-size: 13px; color: #64748b; }
.quick-search-box input { padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.quick-search-actions { margin-top: 12px; text-align: right; }
.quick-result { max-height: 60vh; overflow-y: auto; }
.qr-section { margin-bottom: 14px; }
.qr-title { font-weight: bold; margin-bottom: 6px; color: #1f2d3d; }
.qr-section table { width: 100%; border-collapse: collapse; font-size: 13px; }
.qr-section table td, .qr-section table th { border: 1px solid #e5e7eb; padding: 6px 8px; text-align: left; }
.qr-section table th { background: #f1f5f9; }

/* 勾选框组（收费模式二选一） */
.chk-group { display: inline-flex; gap: 18px; align-items: center; }
.chk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }

/* 标记标签：SVG 图形（圆形/三角形/正方形）+ 颜色 */
.tag-shape-ico { display: inline-block; vertical-align: middle; margin-right: 4px; flex: none; }
/* 新增标签：图形/颜色选择器（仅图形，无文字说明） */
.shape-picker { display: inline-flex; gap: 12px; align-items: center; }
.shape-opt { display: inline-flex; cursor: pointer; padding: 3px; border-radius: 6px; }
.shape-opt input[type="radio"] { display: none; }
.shape-opt .shape-ico { display: inline-flex; border: 2px solid transparent; border-radius: 6px; padding: 1px; line-height: 0; }
.shape-opt input[type="radio"]:checked + .shape-ico { border-color: #2563eb; background: #eff6ff; }
