/* 社保协理员工作台 — 政务蓝视觉 */
:root {
  --primary: #1a5fb4;
  --primary-dark: #144a8f;
  --primary-light: #e8f0fb;
  --accent: #e8a33d;
  --danger: #d43a3a;
  --danger-light: #fdecec;
  --ok: #2e8b57;
  --ok-light: #e9f6ef;
  --warn: #b7791f;
  --warn-light: #fdf3e3;
  --ink: #212b3a;
  --ink-2: #5b6a80;
  --line: #dde4ee;
  --bg: #f2f5fa;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(30, 50, 80, .08);
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink); background: var(--bg);
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: .95rem; color: var(--ink); }
a { color: var(--primary); text-decoration: none; }

.layout { display: flex; min-height: 100vh; }

/* ---------- 侧栏 ---------- */
.sidebar {
  width: 228px; flex-shrink: 0; background: linear-gradient(180deg, #143a6e, #1a5fb4);
  color: #dce8f8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-logo {
  width: 40px; height: 40px; border-radius: 9px; background: #fff; color: var(--primary);
  font-weight: 700; font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { font-size: .98rem; color: #fff; }
.brand-text span { font-size: .72rem; opacity: .75; }
nav { padding: 14px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; margin-bottom: 4px;
  border-radius: 8px; color: #cfdef5; font-size: .93rem; transition: background .15s;
}
.nav-item i { font-style: normal; width: 18px; text-align: center; opacity: .9; }
.nav-item:hover { background: rgba(255,255,255,.09); }
.nav-item.active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: var(--shadow); }
.badge { margin-left: auto; background: var(--danger); color: #fff; font-size: .7rem; border-radius: 10px; padding: 1px 7px; font-weight: 600; }
.nav-item.active .badge { background: var(--danger); color: #fff; }
.sidebar-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .78rem; }
.today { color: #fff; font-weight: 600; margin-bottom: 4px; }
.hint { opacity: .6; line-height: 1.5; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 26px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 1.15rem; color: var(--primary-dark); }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.view { padding: 22px 26px 60px; }

/* ---------- 通用组件 ---------- */
.btn {
  border: 1px solid var(--primary); background: var(--primary); color: #fff;
  border-radius: 7px; padding: 8px 16px; font-size: .88rem; transition: all .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-light); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-light); }
.btn.sm { padding: 4px 10px; font-size: .8rem; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { border: none; background: none; font-size: 1rem; color: var(--ink-2); padding: 4px 8px; }
.icon-btn:hover { color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .8rem; color: var(--ink-2); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #bcd4f0; border-color: var(--primary); }
.field .err { color: var(--danger); font-size: .75rem; min-height: 1em; }

.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; }
.grid-form .span2 { grid-column: 1 / -1; }

.tag { display: inline-block; background: var(--primary-light); color: var(--primary-dark); border-radius: 20px; padding: 1px 9px; font-size: .74rem; margin: 1px 3px 1px 0; }
.tag.gray { background: #eef1f6; color: var(--ink-2); }
.tag.accent { background: var(--warn-light); color: var(--warn); }

.pill { display: inline-flex; align-items: center; border-radius: 20px; padding: 2px 10px; font-size: .74rem; font-weight: 600; }
.pill.cert-wait { background: var(--warn-light); color: var(--warn); }
.pill.cert-done { background: var(--ok-light); color: var(--ok); }
.pill.cert-late { background: var(--danger-light); color: var(--danger); }
.pill.cert-na { background: #eef1f6; color: var(--ink-2); }
.pill.st-todo { background: #eef1f6; color: var(--ink-2); }
.pill.st-doing { background: var(--primary-light); color: var(--primary-dark); }
.pill.st-done { background: var(--ok-light); color: var(--ok); }
.pill.overdue { background: var(--danger-light); color: var(--danger); }

.search-input { border: 1px solid var(--line); border-radius: 7px; padding: 8px 12px; width: 230px; background: #fff; }
select.sel { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: #fff; }

/* ---------- 卡片/统计 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(30,50,80,.12); }
.stat-card .num { font-size: 1.7rem; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.stat-card .num.red { color: var(--danger); }
.stat-card .num.green { color: var(--ok); }
.stat-card .lab { font-size: .8rem; color: var(--ink-2); margin-top: 3px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: .98rem; color: var(--ink); }
.panel-body { padding: 8px 18px 16px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.list-line {
  display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px dashed var(--line); font-size: .9rem;
}
.list-line:last-child { border-bottom: none; }
.list-line .grow { flex: 1; min-width: 0; cursor: pointer; }
.list-line .grow:hover { color: var(--primary); }
.list-line .meta { color: var(--ink-2); font-size: .78rem; white-space: nowrap; }
.empty { text-align: center; color: var(--ink-2); padding: 28px 0; font-size: .88rem; }
.pin { color: var(--danger); font-size: .78rem; border: 1px solid var(--danger); border-radius: 4px; padding: 0 4px; margin-right: 4px; }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; color: var(--ink-2); font-weight: 600; font-size: .78rem; padding: 9px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #f7fafd; }
.tbl .ops { white-space: nowrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 4px 0; font-size: .82rem; color: var(--ink-2); }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 10px; }
.pager button:disabled { opacity: .4; }

/* ---------- 任务看板 ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .board { grid-template-columns: 1fr; } }
.board-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.board-col-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .9rem; }
.board-col-head .cnt { background: #eef1f6; color: var(--ink-2); border-radius: 10px; padding: 0 8px; font-size: .75rem; }
.board-col.todo .board-col-head { border-top: 3px solid #9aa8bc; }
.board-col.doing .board-col-head { border-top: 3px solid var(--primary); }
.board-col.done .board-col-head { border-top: 3px solid var(--ok); }
.task-card { margin: 10px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.task-card:hover { border-color: #c4d4ea; }
.task-card.high { border-left: 3px solid var(--danger); }
.task-card.medium { border-left: 3px solid var(--accent); }
.task-card.low { border-left: 3px solid #9aa8bc; }
.task-card .t-title { font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.task-card .t-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.task-card .t-due { font-size: .76rem; color: var(--ink-2); margin-bottom: 8px; }
.task-card .t-due.red { color: var(--danger); font-weight: 600; }
.task-card .t-ops { display: flex; gap: 6px; }

/* ---------- 知识库 ---------- */
.kb-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.kb-tab { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 16px; font-size: .85rem; color: var(--ink-2); }
.kb-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.kb-item { padding: 14px 4px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: baseline; }
.kb-item:hover .kb-title { color: var(--primary); cursor: pointer; }
.kb-title { font-size: .95rem; font-weight: 600; flex: 1; }
.kb-src { font-size: .78rem; color: var(--ink-2); }
.doc-body { white-space: pre-wrap; line-height: 1.9; font-size: .93rem; }
.doc-view { font-size: .78rem; color: var(--ink-2); margin-left: 8px; }

/* ---------- 弹层 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,30,50,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 12px; width: min(680px, 94vw); max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal.wide { width: min(860px, 94vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 1rem; color: var(--primary-dark); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal-foot:empty { display: none; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: rgba(25,35,55,.92); color: #fff; border-radius: 8px; padding: 10px 22px;
  font-size: .88rem; z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.toast.err { background: rgba(180,40,40,.95); }
.hidden { display: none !important; }
