/* ===== QUICK PLAN 管理台（亮色 · 对齐 TDesign）· 积分系统共享样式 ===== */
:root {
  --bg: #F5F6F7;
  --panel: #FFFFFF;
  --card: #F7F8FA;
  --border: #E3E5E7;
  --text: #1A1A1A;
  --strong: #1A1A1A;
  --muted: #8C8C8C;
  --blue: #0052D9;
  --blue-link: #0052D9;
  --red: #D54941;
  --selbg: #ECF2FE;
  --green: #007F24;
  --orange: #E37318;
  /* 品牌侧栏（深青识别带） */
  --sidebar-bg: #09352E;
  --sidebar-text: rgba(255,255,255,.85);
  --sidebar-muted: rgba(255,255,255,.55);
  --sidebar-group: rgba(255,255,255,.4);
  --brand-gold: #D4A657;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px;
}
a { color: var(--blue-link); text-decoration: none; }

/* 布局：左侧导航 + 右侧内容 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex-shrink: 0; background: var(--sidebar-bg); border-right: 1px solid rgba(255,255,255,.08);
  padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; color: #FFFFFF; padding: 4px 10px 18px; }
.sidebar .brand .qp-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; background: var(--brand-gold); color: var(--sidebar-bg); font-size: 11px; font-weight: 800; letter-spacing: .3px; }
.sidebar .brand small { display: block; font-size: 11px; color: var(--sidebar-muted); font-weight: 400; margin-top: 4px; }
.sidebar .group { font-size: 11px; color: var(--sidebar-group); padding: 14px 10px 6px; }
.sidebar .nav-item {
  display: block; padding: 9px 10px; border-radius: 6px; color: var(--sidebar-text);
  font-size: 13.5px; margin-bottom: 2px; cursor: pointer;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,.08); }
.sidebar .nav-item.active { background: var(--blue); color: #FFFFFF; font-weight: 600; }
.sidebar .foot { margin-top: auto; }
.sidebar .foot .nav-item { color: var(--sidebar-muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
  padding: 0 24px; gap: 8px; font-size: 13px; color: var(--muted);
}
.topbar .crumb-cur { color: var(--strong); }
.topbar .right { margin-left: auto; display: flex; gap: 18px; }
.topbar .right a { color: var(--muted); }
.topbar .right a:hover { color: var(--strong); }

.content { padding: 24px; max-width: 1080px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { font-size: 18px; font-weight: 600; color: var(--strong); }

.notice {
  background: var(--card); border-radius: 8px; padding: 14px 16px; color: var(--muted);
  font-size: 13px; line-height: 1.7; margin-bottom: 18px;
}
.notice b { color: var(--text); }

/* 按钮 */
.btn {
  display: inline-block; padding: 8px 18px; border-radius: 6px; border: 1px solid transparent;
  background: var(--blue); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }

/* 统计卡 */
.stats { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 132px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 18px 12px; }
.stat-card .l { font-size: 12.5px; color: var(--muted); }
.stat-card .n { font-size: 30px; font-weight: 700; color: var(--strong); margin-top: 8px; }
.stat-card .n small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 4px; }

/* 表格 */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.panel .panel-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel .panel-head .t { font-size: 14px; font-weight: 600; color: var(--strong); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 500;
  padding: 11px 18px; background: var(--panel); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--text); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:nth-child(even) td { background: #FAFBFC; }
.tbl tr:hover td { background: #F0F5FF; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .strong { color: var(--strong); font-weight: 600; }
.op-link { color: var(--blue-link); cursor: pointer; margin-right: 14px; font-size: 13px; background: none; border: none; padding: 0; }
.op-link:last-child { margin-right: 0; }
.op-link.red { color: var(--red); }
.op-link:hover { text-decoration: underline; }
.amt-pos { color: var(--green); font-weight: 600; }
.amt-neg { color: var(--red); font-weight: 600; }
.amt-fix { color: var(--orange); font-weight: 600; }

/* 标签 */
.tag { display: inline-block; font-size: 11.5px; border-radius: 4px; padding: 2px 8px; }
.tag.on { color: var(--green); background: rgba(0,127,36,.12); }
.tag.off { color: var(--muted); background: #F2F3F5; }
.tag.warn { color: var(--orange); background: rgba(227,115,24,.12); }

/* 表单 */
.label { font-size: 12.5px; color: var(--muted); margin: 14px 0 6px; }
.field {
  width: 100%; padding: 9px 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 14px; outline: none;
}
.field:focus { border-color: var(--blue); }
select.field option { background: var(--panel); }
input[type="date"].field, input[type="month"].field, .dp-input.field {
  color-scheme: light; min-height: 42px; font-size: 15px; letter-spacing: .3px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 17px;
  padding-right: 40px;
}

/* 弹层（居中对话框） */
.mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 10; }
.modal {
  display: none; position: fixed; z-index: 11; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(440px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px; max-height: 86vh; overflow-y: auto;
}
.modal h3 { font-size: 15.5px; color: var(--strong); margin-bottom: 6px; }
.modal .sub { font-size: 12.5px; color: var(--muted); }
.modal .ops { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; }
.msg { font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
.msg.warn { color: var(--orange); }

.dir-row { display: flex; gap: 10px; margin-top: 12px; }
.dir { flex: 1; text-align: center; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; cursor: pointer; color: var(--text); }
.dir.active.add { border-color: var(--green); color: var(--green); background: rgba(0,127,36,.1); font-weight: 600; }
.dir.active.sub { border-color: var(--red); color: var(--red); background: rgba(213,73,65,.1); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 36px 0; font-size: 13.5px; }

/* 窄屏：侧栏收为顶栏 */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid rgba(255,255,255,.08);
    flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 4px;
  }
  .sidebar .brand { padding: 4px 8px; }
  .sidebar .brand small { display: none; }
  .sidebar .group { display: none; }
  .sidebar .nav-item { padding: 7px 10px; margin: 0; }
  .sidebar .foot { margin-top: 0; margin-left: auto; }
  .content { padding: 16px; margin: 0 auto; }
  .tbl th, .tbl td { padding: 10px 12px; }
  .topbar { display: none; }
}

/* ===== V2 增补 ===== */
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat-card .sub b { color: var(--text); font-weight: 600; }
.wide { overflow-x: auto; }
.wide .tbl { min-width: 1180px; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #F0F5FF; }
.tbl tr.expanded > td { background: var(--bg); padding: 16px 18px; }
.badge { display: inline-block; font-size: 11.5px; border-radius: 4px; padding: 2px 8px; }
.badge.ok { color: var(--green); background: rgba(0,127,36,.12); }
.badge.overlap { color: var(--orange); background: rgba(227,115,24,.12); }
.badge.error { color: var(--red); background: rgba(213,73,65,.12); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .field { width: auto; min-width: 200px; }
.mini-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.mini-tabs .mt { padding: 6px 14px; border-radius: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; border: 1px solid var(--border); }
.mini-tabs .mt.active { color: var(--blue); background: var(--selbg); border-color: transparent; font-weight: 600; }
.upload-box {
  border: 1.5px dashed var(--border); border-radius: 8px; padding: 28px; text-align: center;
  color: var(--muted); font-size: 13px; cursor: pointer; margin-bottom: 16px;
}
.upload-box:hover { border-color: var(--blue); color: var(--text); }
.crumb-path { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.crumb-path a { cursor: pointer; }

/* ===== QUICK PLAN 增补：表头吸顶 + 预警条 + Toast ===== */
.tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); }
/* 双段滚动：表格放进定高容器，滚动时表头吸顶、仅表体滚动（横向溢出也在容器内滚动） */
.tbl-scroll { max-height: calc(100vh - 330px); min-height: 240px; overflow: auto; }
.tbl-scroll .tbl thead th { position: sticky; top: 0; z-index: 3; background: var(--panel); box-shadow: 0 1px 0 var(--border); }
/* 序号列 */
.tbl th.seq, .tbl td.seq { width: 52px; min-width: 52px; text-align: center; color: var(--muted); font-weight: 400; }
/* 全局预警条（如「9 月政策未录入」） */
.alert-banner {
  display: flex; align-items: center; gap: 10px; background: #FFF7E6; border: 1px solid #FFD591;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; font-size: 13px; color: #AD4E00; line-height: 1.6;
}
.alert-banner b { color: #873800; }
.alert-banner .alert-act { flex: none; margin-left: auto; color: var(--blue); font-weight: 600; cursor: pointer; white-space: nowrap; }
/* Toast 轻提示 */
#toast {
  display: none; position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(26,26,26,.92); color: #fff; padding: 10px 20px;
  border-radius: 8px; font-size: 13px; z-index: 200; max-width: 82vw; box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
#toast.err { background: var(--red); }
#toast.ok { background: var(--green); }

/* ===== 版面统一：跨页共用组件（从各页内联样式收敛） ===== */
/* 筛选卡（仪表台 / 出勤管理） */
.filter-card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; margin-bottom: 18px; }
.filter-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 12px; }
/* 分段切换（选中态统一品牌蓝） */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; border: none; color: var(--muted); font-size: 13px; padding: 7px 18px; cursor: pointer; }
.seg button.active { background: var(--selbg); color: var(--blue); font-weight: 600; }
/* 机构四级联动网格 */
.org-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; flex: 1; min-width: 280px; }
.org-cell { text-align: center; }
.org-cell .oc-label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.org-cell select { text-align: center; }
.lvl-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lvl-tabs .mt { padding: 6px 14px; border-radius: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; border: 1px solid var(--border); }
.lvl-tabs .mt.active { color: var(--blue); background: var(--selbg); border-color: transparent; font-weight: 600; }
/* 可排序表头 */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--blue); }
th .arr, .sort-arrow { font-size: 10px; margin-left: 3px; color: var(--blue); }
/* 日期区间 */
.range-label { font-size: 12.5px; color: var(--muted); }
.date-range { display: none; align-items: center; gap: 8px; }
.date-range.show { display: inline-flex; }
.date-range .field { width: 172px; }
@media (max-width: 760px) { .org-grid { grid-template-columns: repeat(2, 1fr); } }
/* 筛选下拉（积分明细 / 人员管理） */
.filter-sel { width: 128px; padding: 6px 8px; }
/* 表单网格（业绩追踪 / 工作通告） */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
/* 发送预览条目（业绩追踪 / 工作通告） */
.pv-item { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.pv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pv-head .nm { font-weight: 600; color: var(--strong); }
.pv-head .no { font-size: 12px; color: var(--muted); }
.pv-body { background: var(--card); border-radius: 6px; padding: 10px 12px; font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-all; color: var(--text); }
.pv-body b { font-weight: 700; }
.pv-skip { color: var(--muted); font-size: 13px; }
/* 徽标补全（工作通告用到 pending/skip，V2 段缺） */
.badge.fail { color: var(--red); background: rgba(213,73,65,.12); }
.badge.skip { color: var(--muted); background: #F2F3F5; }
.badge.pending { color: var(--orange); background: rgba(227,115,24,.12); }
/* 通告表单行等高：标题输入框/下拉/月份选择器统一 42px（与 date-picker 增强的月份框一致），AI 按钮拉伸齐平 */
.form-grid .field { min-height: 42px; }
.ai-row .field { min-height: 42px; }
/* 输入框/下拉框在表单网格与 AI 行内强制等高（select 原生渲染高度不稳，显式钉死） */
.form-grid input.field, .form-grid select.field,
.ai-row input.field, .ai-row select.field { height: 42px; }
.ai-row .btn { align-self: stretch; }
