/* 村务综合管理系统 —— 政务绿主题 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px; color: #24312c; background: #f2f5f3;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid #ccd9d3; border-radius: 6px; background: #fff; color: #24312c; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #12855a; box-shadow: 0 0 0 2px rgba(18,133,90,.12); }
.btn { padding: 7px 16px; border: none; border-radius: 6px; background: #12855a; color: #fff; font-size: 14px; }
.btn:hover { background: #0e7a4e; }
.btn.ghost { background: #fff; color: #12855a; border: 1px solid #9fc9b8; }
.btn.ghost:hover { background: #eef7f3; }
.btn.danger { background: #c0453a; }
.btn.danger:hover { background: #a83a30; }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #0a5c3c 0%, #0e7a4e 55%, #169161 100%); }
.login-card { width: 400px; max-width: 92vw; background: #fff; border-radius: 14px; padding: 38px 36px 30px;
  box-shadow: 0 18px 50px rgba(4,44,28,.35); text-align: center; }
.login-logo { width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 16px; background: #0e7a4e;
  display: flex; align-items: center; justify-content: center; font-size: 34px; color: #fff; }
.login-card h1 { font-size: 22px; color: #14342a; margin-bottom: 4px; }
.login-card .sub { color: #7d9188; font-size: 13px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 14px; text-align: left; }
.login-card .field label { display: block; font-size: 13px; color: #55685f; margin-bottom: 5px; }
.login-card .field input { width: 100%; padding: 10px 12px; }
.login-btn { width: 100%; padding: 11px; font-size: 15px; margin-top: 6px; }
.login-tip { margin-top: 16px; font-size: 12px; color: #8aa096; line-height: 1.7; }

/* ---------- 主布局 ---------- */
.layout { display: flex; height: 100%; }
.sidebar { width: 224px; background: linear-gradient(180deg, #0a5c3c, #084a31); color: #d7e9e0; display: flex; flex-direction: column; flex-shrink: 0; }
.side-head { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
.side-head .vname { font-size: 17px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-head .vsub { font-size: 12px; opacity: .75; margin-top: 3px; }
.side-menu { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
.side-menu::-webkit-scrollbar { width: 4px; } .side-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }
.menu-group-title { padding: 12px 18px 4px; font-size: 12px; color: rgba(215,233,224,.55); letter-spacing: 1px; }
.menu-item { display: flex; align-items: center; padding: 9px 16px 9px 18px; cursor: pointer; color: #cfe2d8; border-left: 3px solid transparent; user-select: none; }
.menu-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-item.active { background: rgba(255,255,255,.14); color: #fff; border-left-color: #6fe0a8; }
.menu-item .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-badge { background: #1d9a68; color: #fff; border-radius: 9px; padding: 0 7px; font-size: 11px; line-height: 17px; min-width: 18px; text-align: center; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 54px; background: #fff; border-bottom: 1px solid #e2ebe6; display: flex; align-items: center; padding: 0 20px; gap: 12px; flex-shrink: 0; }
.topbar .title { font-size: 16px; font-weight: 600; flex: 1; }
.topbar .who { color: #5b736a; font-size: 13px; }
.content { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }

/* 手机适配 */
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 50; left: -240px; transition: left .2s; height: 100%; }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex !important; }
  .content { padding: 12px 10px 30px; }
  .toolbar { flex-wrap: wrap; }
  .table-wrap { overflow-x: auto; }
}
.menu-toggle { display: none; border: 1px solid #ccd9d3; background: #fff; border-radius: 6px; padding: 5px 10px; font-size: 16px; }

/* ---------- 卡片与统计 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 4px rgba(20,52,42,.06); }
.card .num { font-size: 24px; font-weight: 700; color: #0e7a4e; }
.card .lab { font-size: 12px; color: #7d9188; margin-top: 2px; }
.panel { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 4px rgba(20,52,42,.06); margin-bottom: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; color: #14342a; }

/* ---------- 工具栏 / 表格 / 分页 ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select { max-width: 180px; }
.toolbar .spacer { flex: 1; }
table { width: 100%; border-collapse: collapse; background: #fff; }
.table-wrap { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(20,52,42,.06); overflow: hidden; }
th { background: #eef5f1; color: #40584e; font-weight: 600; text-align: left; padding: 10px 12px; font-size: 13px; white-space: nowrap; }
td { padding: 9px 12px; border-top: 1px solid #edf3f0; font-size: 13px; vertical-align: middle; }
tr:hover td { background: #f7fbf9; }
.tag-pill { display: inline-block; background: #e6f4ec; color: #0e7a4e; border-radius: 4px; padding: 1px 8px; font-size: 12px; margin: 1px 3px 1px 0; }
.tag-pill.off { background: #f0f0f0; color: #999; }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #6b8177; font-size: 13px; }
.empty { text-align: center; color: #93a89e; padding: 40px 0; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(10,30,22,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 560px; max-width: 96vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: 760px; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid #e8efeb; display: flex; align-items: center; }
.modal-head b { flex: 1; font-size: 15px; }
.modal-x { border: none; background: none; font-size: 20px; color: #90a49b; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid #e8efeb; text-align: right; display: flex; gap: 8px; justify-content: flex-end; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-row.full { grid-template-columns: 1fr; }
.form-item label { display: block; font-size: 13px; color: #55685f; margin-bottom: 4px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; }
.form-item textarea { min-height: 70px; resize: vertical; }
.err-text { color: #c0453a; font-size: 12px; margin-top: 4px; }

/* ---------- 抽屉（人员全档案）---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(10,30,22,.35); z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 94vw; background: #fff; z-index: 95;
  box-shadow: -12px 0 40px rgba(0,0,0,.18); display: flex; flex-direction: column; animation: slideIn .18s ease; }
@keyframes slideIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 14px 18px; background: #0e7a4e; color: #fff; display: flex; align-items: center; }
.drawer-head b { flex: 1; font-size: 16px; }
.drawer-head button { background: none; border: none; color: #fff; font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.d-section { margin-bottom: 18px; }
.d-section h4 { font-size: 13px; color: #0e7a4e; border-left: 3px solid #0e7a4e; padding-left: 8px; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; font-size: 13px; }
.kv .k { color: #7d9188; }
.kv .v { color: #24312c; word-break: break-all; }

/* ---------- Toast ---------- */
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; padding: 10px 22px;
  border-radius: 8px; color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.ok { background: #0e7a4e; } .toast.err { background: #c0453a; }

/* ---------- 其他 ---------- */
.notice-content { white-space: pre-wrap; line-height: 1.8; color: #37463f; }
.search-hit { padding: 10px 12px; border: 1px solid #e2ebe6; border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.search-hit:hover { border-color: #12855a; background: #f4faf7; }
.muted { color: #8aa096; font-size: 12px; }
.upload-box { border: 2px dashed #bfd6cb; border-radius: 10px; padding: 26px; text-align: center; color: #6b8177; }
.import-result { background: #f6faf8; border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.9; margin-top: 10px; }
.import-result .bad { color: #c0453a; }
.roles { display: flex; gap: 6px; }
.status-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }
.status-dot.on { background:#1d9a68; } .status-dot.off { background:#c8d4cf; }
