/* ============================================================
   人事管理系统 · 设计系统
   纯本地 CSS，无 CDN、无构建步骤（园区断网也能用）
   ============================================================ */
:root {
  --bg: #f4f7f5;
  --card: #ffffff;
  --ink: #1b2b28;
  --ink-2: #46605a;
  --muted: #7c918c;
  --line: #e2eae6;
  --line-soft: #eef3f0;

  --brand: #1f6f5c;
  --brand-ink: #145245;
  --brand-soft: #e7f2ee;
  --brand-softer: #f2f8f6;

  --ok: #2f7d4f;      --ok-soft: #e8f5ed;
  --warn: #b56a12;    --warn-soft: #fdf4e4;
  --danger: #bf3b2f;  --danger-soft: #fcecea;
  --info: #2b6c99;    --info-soft: #e9f2f9;

  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 50, 40, .04), 0 6px 18px -8px rgba(20, 50, 40, .12);
  --shadow-lg: 0 12px 36px -12px rgba(20, 50, 40, .22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Hiragino Sans GB", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

/* ---------- 布局骨架 ---------- */
.app { display: flex; min-height: 100vh; }

.side {
  width: 216px; flex: 0 0 216px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 18px;
}
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2a8470, #17584a);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
  box-shadow: 0 4px 10px -3px rgba(23, 88, 74, .5);
}
.brand-txt { line-height: 1.25; }
.brand-txt b { display: block; font-size: 14.5px; }
.brand-txt span { font-size: 11.5px; color: var(--muted); }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 0; }
.nav-label {
  font-size: 11px; color: var(--muted); letter-spacing: .08em;
  padding: 6px 10px 4px; font-weight: 600;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8.5px 10px; margin: 1px 0;
  border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav a svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .72; }
.nav a:hover { background: var(--brand-softer); color: var(--brand-ink); }
.nav a.on {
  background: var(--brand-soft); color: var(--brand-ink);
  font-weight: 600;
}
.nav a.on svg { opacity: 1; }
.nav .count {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: var(--brand); color: #fff;
  padding: 1px 6px; border-radius: 20px; min-width: 18px; text-align: center;
}
.nav a.on .count { background: var(--brand-ink); }

.side-foot {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px;
}
.avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 600; font-size: 12.5px;
}
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; font-size: 12.5px; }
.side-foot .who span { color: var(--muted); font-size: 11px; }
.side-foot a.out { color: var(--muted); font-size: 12px; }
.side-foot a.out:hover { color: var(--danger); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px; flex: 0 0 60px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 10;
}
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .today {
  font-size: 12.5px; color: var(--muted);
  background: var(--bg); padding: 5px 11px; border-radius: 20px;
}

.content { padding: 22px 24px 48px; max-width: 1400px; width: 100%; }

/* ---------- 页头 ---------- */
.page-head {
  display: flex; align-items: flex-end; gap: 16px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.page-head .t h2 { font-size: 21px; }
.page-head .t p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.page-head .ops { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden;
}
.panel-h {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft);
}
.panel-h h3 { font-size: 14.5px; }
.panel-h .sub { font-size: 12.5px; color: var(--muted); }
.panel-h .ops { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-b { padding: 16px 18px; }
.panel-b.flush { padding: 0; }

/* ---------- 指标卡 ---------- */
.stats { display: grid; gap: 14px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 15px 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 27px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; line-height: 1.1; }
.stat .v small { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 5px; }
.stat.is-warn .v { color: var(--warn); }
.stat.is-danger .v { color: var(--danger); }
.stat.is-ok .v { color: var(--ok); }
.stat::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--brand); opacity: .9;
}
.stat.is-warn::after { background: var(--warn); }
.stat.is-danger::after { background: var(--danger); }
.stat.is-ok::after { background: var(--ok); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  font-family: inherit;
  transition: all .12s;
}
.btn:hover { border-color: #cfdcd7; background: var(--brand-softer); color: var(--brand-ink); }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 3px 10px -4px rgba(31, 111, 92, .6);
}
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f0d3cf; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); border-color: #e7bcb6; color: var(--danger); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.search {
  position: relative; flex: 1; min-width: 200px; max-width: 320px;
}
.search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted);
}
.search input {
  width: 100%; height: 34px; padding: 0 12px 0 32px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13px; font-family: inherit; color: var(--ink);
  background: #fff; outline: none; transition: border-color .12s, box-shadow .12s;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.toolbar select {
  height: 34px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 13px; font-family: inherit;
  color: var(--ink-2); background: #fff; outline: none; cursor: pointer;
}
.toolbar select:focus { border-color: var(--brand); }
.toolbar .grow { flex: 1; }

/* ---------- 表格 ---------- */
.tw { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  letter-spacing: .03em; padding: 10px 14px; white-space: nowrap;
  background: #fafcfb; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
table.tb td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.tb tbody tr { transition: background .1s; }
table.tb tbody tr:hover { background: var(--brand-softer); }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb .num { font-variant-numeric: tabular-nums; }
table.tb .r { text-align: right; }
table.tb .c { text-align: center; }
table.tb .nowrap { white-space: nowrap; }
table.tb a.row-link { color: var(--ink); font-weight: 500; }
table.tb a.row-link:hover { color: var(--brand); }

/* ---------- 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500; padding: 2px 8px;
  border-radius: 20px; white-space: nowrap; line-height: 1.7;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: #eff2f1; color: var(--muted); }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- 空状态 ---------- */
.empty { padding: 46px 20px; text-align: center; }
.empty .ic {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px;
  background: var(--brand-softer); color: var(--brand);
  display: grid; place-items: center;
}
.empty .ic svg { width: 24px; height: 24px; }
.empty b { display: block; font-size: 14px; margin-bottom: 4px; }
.empty p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
.field label .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13.5px; font-family: inherit; color: var(--ink); background: #fff;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.field textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 提示条 ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 15px; border-radius: var(--r-sm);
  font-size: 13px; margin-bottom: 16px; border: 1px solid transparent;
}
.alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.alert.warn { background: var(--warn-soft); color: #8a5310; border-color: #f3dfba; }
.alert.danger { background: var(--danger-soft); color: #8f2e24; border-color: #f0cdc8; }
.alert.ok { background: var(--ok-soft); color: #24603c; border-color: #c9e6d4; }
.alert.info { background: var(--info-soft); color: #245b80; border-color: #cfe2f0; }

/* ---------- 待办列表 ---------- */
.todo { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.todo:last-child { border-bottom: none; }
.todo .ico {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  display: grid; place-items: center;
}
.todo .ico svg { width: 17px; height: 17px; }
.todo .ico.warn { background: var(--warn-soft); color: var(--warn); }
.todo .ico.danger { background: var(--danger-soft); color: var(--danger); }
.todo .ico.info { background: var(--info-soft); color: var(--info); }
.todo .ico.brand { background: var(--brand-soft); color: var(--brand); }
.todo .bd { flex: 1; min-width: 0; }
.todo .bd b { font-size: 13.5px; display: block; }
.todo .bd span { font-size: 12.5px; color: var(--muted); }
.todo .go { align-self: center; font-size: 12.5px; white-space: nowrap; }

/* ---------- 详情页 ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 24px; }
.dl .i .k { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.dl .i .v { font-size: 13.5px; font-weight: 500; }
.dl .i .v.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .01em; }

.person {
  display: flex; align-items: center; gap: 15px;
  padding: 20px 18px;
}
.person .av {
  width: 56px; height: 56px; flex: 0 0 56px; border-radius: 16px;
  background: linear-gradient(145deg, #2a8470, #17584a); color: #fff;
  display: grid; place-items: center; font-size: 21px; font-weight: 600;
}
.person .nm { font-size: 18px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.person .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; }
.tabs a {
  padding: 11px 13px; font-size: 13.5px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--brand); }
.tabs a.on { color: var(--brand-ink); font-weight: 600; border-bottom-color: var(--brand); }

/* ---------- 进度条 ---------- */
.bar { height: 6px; background: var(--line-soft); border-radius: 20px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 20px; background: var(--brand); }

/* ---------- 分页 ---------- */
.pager {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--muted);
}
.pager .spacer { flex: 1; }

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .content { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn {
  display: none; width: 34px; height: 34px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff;
  cursor: pointer; color: var(--ink-2);
}

/* ---------- 月历 ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); }
.cal .hd {
  background: #fafcfb; padding: 9px 8px; text-align: center;
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.cal .d { background: #fff; min-height: 82px; padding: 8px 9px; position: relative; }
.cal .d .n { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal .d.blank { background: #fbfcfc; }
.cal .d.weekend .n { color: var(--muted); }
.cal .d.stat_holiday { background: #fdf5f3; }
.cal .d.stat_holiday .n { color: var(--danger); }
.cal .d.makeup_workday { background: #f2f8fb; }
.cal .d.makeup_workday .n { color: var(--info); }
.cal .d.org_holiday { background: #f8f6fc; }
.cal .d.org_holiday .n { color: #6a5a9e; }
.cal .d.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal .d.today .n::after {
  content: "今天"; font-size: 9.5px; font-weight: 500; color: #fff;
  background: var(--brand); border-radius: 10px; padding: 1px 6px; margin-left: 5px;
  vertical-align: 2px;
}
.cal .tag { display: block; font-size: 10.5px; margin-top: 5px; line-height: 1.5; }
.cal .tag.rest { color: var(--muted); }
.cal .tag.holi { color: var(--danger); }
.cal .tag.mk { color: var(--info); }
.cal .tag.org { color: #6a5a9e; }
.cal .tag.none { color: #c3cfcb; }

/* 空的时间胶囊不占位 */
.topbar .today:empty { display: none; }

/* ---------- 工资条 ---------- */
.slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .slip-grid { grid-template-columns: 1fr; } }
.tb tfoot td { padding-top: 10px; padding-bottom: 10px; }

/* ============================================================
   登录页（独立版式，不依赖侧栏骨架）
   ============================================================ */
.auth-body { background: var(--bg); }

.auth {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

/* ---- 左：品牌区 ---- */
.auth-side {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 46px 56px 34px;
  background: linear-gradient(150deg, #1f6f5c 0%, #17564a 55%, #123f37 100%);
  color: #eaf3f0;
}
.auth-side::after {
  content: ""; position: absolute; right: -140px; bottom: -160px;
  width: 440px; height: 440px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.13), rgba(255,255,255,0) 68%);
}
.auth-side::before {
  content: ""; position: absolute; right: 40px; top: -110px;
  width: 300px; height: 300px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.10);
}
.auth-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.auth-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 600; color: #fff;
}
.auth-brand b { display: block; font-size: 16px; letter-spacing: .02em; color: #fff; }
.auth-brand span { display: block; font-size: 11px; color: rgba(234,243,240,.62); letter-spacing: .06em; }

.auth-pitch { position: relative; z-index: 1; margin-top: auto; padding-top: 60px; }
.auth-pitch h1 {
  font-size: 31px; line-height: 1.42; font-weight: 600;
  color: #fff; letter-spacing: -.01em;
}
.auth-pitch p {
  margin: 14px 0 0; max-width: 430px;
  font-size: 13.5px; line-height: 1.75; color: rgba(234,243,240,.72);
}

.auth-feats {
  position: relative; z-index: 1;
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; gap: 1px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.auth-feats li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 13px 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.auth-feats i {
  font-style: normal; font-size: 10.5px; font-weight: 600;
  color: rgba(255,255,255,.42); letter-spacing: .08em;
  padding-top: 3px; min-width: 18px;
}
.auth-feats b { display: block; font-size: 13.5px; color: #fff; font-weight: 500; }
.auth-feats span { display: block; font-size: 11.5px; color: rgba(234,243,240,.55); margin-top: 1px; }

.auth-foot {
  position: relative; z-index: 1;
  margin-top: 26px; font-size: 11px;
  color: rgba(234,243,240,.42); letter-spacing: .04em;
}

/* ---- 右：表单区 ---- */
.auth-main {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 32px; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 352px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 30px 26px;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 { font-size: 20px; letter-spacing: -.01em; }
.auth-sub { margin: 6px 0 22px; font-size: 12.5px; color: var(--muted); }

.auth-btn {
  width: 100%; height: 42px; margin-top: 22px;
  border: 1px solid var(--brand); border-radius: var(--r-sm);
  background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 500; letter-spacing: .22em;
  cursor: pointer; font-family: inherit;
  transition: background .16s, border-color .16s, box-shadow .16s;
  box-shadow: 0 6px 16px -8px rgba(31,111,92,.65);
}
.auth-btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.auth-btn:active { transform: translateY(.5px); }

.auth-tip {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px; line-height: 1.7; color: var(--muted);
}
.auth-tip code {
  display: inline-block; margin-top: 4px; padding: 2px 6px;
  background: var(--brand-softer); border: 1px solid var(--line);
  border-radius: 5px; font-size: 11px; color: var(--brand-ink);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.auth-copy { margin-top: 22px; font-size: 11px; color: #a8b8b3; }

/* ---- 窄屏：品牌区收起，只留表单 ---- */
@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { min-height: 100vh; padding: 28px 20px; }
  .auth-card { padding: 26px 22px 22px; }
}

/* ============================================================
   表单页（新增 / 编辑）
   ============================================================ */
.crumb .sep { margin: 0 7px; color: #c2cfca; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--brand); }

.form-page { max-width: 1080px; }
.form-card { padding: 0 0 6px; }
.form-card-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 1080px) { .form-card-wrap { grid-template-columns: 1fr; } }

.form-sec {
  font-size: 12.5px; font-weight: 600; color: var(--brand-ink);
  letter-spacing: .04em;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--brand-softer);
}
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px 20px; padding: 18px 22px 10px;
}
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .field.wide { grid-column: 1 / -1; }

/* 控件：统一 36px 高，和列表页按钮对齐 */
.field .inp {
  width: 100%; height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 11px; font-size: 13.5px; color: var(--ink);
  background: #fff; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea.inp { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; }
.field .inp:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 111, 92, .10);
}
.field .inp:disabled { background: var(--bg); color: var(--muted); }
.field.bad .inp { border-color: #e0a49c; background: #fffbfa; }
.field.bad .inp:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(191, 59, 47, .10); }
.err-msg { font-size: 11.5px; color: var(--danger); margin-top: 5px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.55; }
.field label .req { color: var(--danger); margin-left: 2px; }

/* 复选框 */
.field .chk { width: 15px; height: 15px; accent-color: var(--brand); vertical-align: -2px; margin-right: 6px; }

/* 操作条 */
.form-actions {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 24px; padding: 14px 22px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.form-actions .btn.primary { height: 36px; padding: 0 22px; }
.form-actions .spacer { flex: 1; }
.form-note { font-size: 12px; color: var(--muted); margin-left: 4px; }

/* 列表行的编辑/删除按钮：贴右排一行，不换行 */
td.row-ops { white-space: nowrap; text-align: right; }
td.row-ops form { display: inline-block; margin-left: 6px; }

/* 右侧说明栏 */
.form-side { padding: 0 0 16px; position: sticky; top: 16px; }
.form-side .form-sec { background: #fff; border-bottom: 1px solid var(--line-soft); }
.form-side .rule-list { margin: 0; padding: 12px 22px 0 22px; list-style: none; }
.form-side .rule-list li {
  position: relative; padding-left: 14px; margin-bottom: 10px;
  font-size: 12px; line-height: 1.7; color: var(--ink-2);
}
.form-side .rule-list li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%; background: #bfd4cd;
}
.form-side .rule-list b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.form-side .hint { padding: 0 22px; }

/* ---------- 工作日历维护 ---------- */
.cal-edit td { padding: 6px 10px; vertical-align: middle; }
.cal-edit .sm-inp { height: 30px; font-size: 12.5px; padding: 0 8px; }
.cal-edit .chk { width: 15px; height: 15px; accent-color: var(--brand); }
.cal-edit .dow-rest { color: var(--danger); }
.cal-edit tr.row-rest td:first-child { color: var(--muted); }
.cal-edit tr.row-holi { background: #fdf7f6; }
.cal-edit tr.row-mk { background: #f4f9fc; }
.cal-edit tr.row-org { background: #f9f7fd; }

/* 工具类 */
.muted { color: var(--muted); }

/* 日历维护：日期列不换行，行高压紧 */
.cal-edit th:nth-child(1), .cal-edit td:nth-child(1),
.cal-edit th:nth-child(2), .cal-edit td:nth-child(2) { white-space: nowrap; }
.cal-edit td:nth-child(1) { font-size: 13px; }

/* 员工删除确认页 */
.del-target { display: flex; gap: 12px; align-items: center; }
.del-target .av {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--danger-soft); color: var(--danger);
  font-weight: 600; font-size: 18px;
}
.del-target .nm { font-size: 15px; font-weight: 600; color: var(--ink); }
.del-target .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.del-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.del-actions .form-note { max-width: 560px; line-height: 1.7; }
td.row-ops .btn + .btn, td.row-ops .btn + form { margin-left: 6px; }

/* 页面内确认弹窗（替代原生 confirm：嵌入式预览/禁用弹窗的环境里原生框会被直接吞掉） */
.mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(23, 33, 30, .38);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.mask[hidden] { display: none; }
.cfm {
  width: 100%; max-width: 440px; background: var(--card);
  border-radius: 12px; box-shadow: 0 18px 48px rgba(16, 32, 28, .22);
  overflow: hidden;
}
.cfm-h {
  padding: 16px 20px 0; font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.cfm-h .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.cfm-b {
  padding: 10px 20px 18px; font-size: 13px; line-height: 1.75; color: var(--ink-2);
  white-space: pre-line; max-height: 46vh; overflow: auto;
}
.cfm-f {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px; background: var(--brand-softer); border-top: 1px solid var(--line-soft);
}
.cfm-f .btn { height: 34px; }

/* ---------- 批量勾选与批量删除 ---------- */
.chk-col { width: 40px; }
input.rowchk {
  width: 15px; height: 15px; margin: 0; cursor: pointer;
  accent-color: var(--danger); vertical-align: middle;
}
.bulk-count { font-size: 12.5px; color: var(--danger); white-space: nowrap; }
.bulk-count:empty { display: none; }
.bulkbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 18px; border-bottom: 1px solid var(--line-soft);
  background: var(--brand-softer);
}
.bulkbar .bulk-tip { font-size: 12px; color: var(--muted); }

/* 系统生成的编码/工号：只读、浅底，视觉上区分「系统给的」与「我填的」 */
.field .inp[readonly] {
  background: var(--bg); color: var(--ink-2); cursor: default;
  border-style: dashed;
}
.field .inp[readonly]:focus {
  border-color: var(--line); box-shadow: none;
}

/* ---------- 多选筛选（胶囊 chips） ---------- */
.calsel { padding: 14px 18px 12px; display: grid; gap: 10px; }
.csrow { display: flex; align-items: flex-start; gap: 12px; }
.cslabel {
  flex: 0 0 46px; font-size: 12.5px; color: var(--muted);
  padding-top: 7px; letter-spacing: .02em;
}
.cshelptext { font-size: 11.5px; color: #a9b8b3; padding-top: 8px; white-space: nowrap; }
.chips {
  display: flex; flex-wrap: wrap; gap: 6px; flex: 1;
  max-height: 96px; overflow-y: auto; padding: 1px 4px 1px 1px;
}
.chip {
  position: relative;
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none;
  transition: all .12s; line-height: 1;
}
.chip[hidden] { display: none; }
.chip:hover { border-color: #cfdcd7; background: var(--brand-softer); color: var(--brand-ink); }
.chip input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; margin: 0; cursor: pointer;
}
.chip.on, .chip:has(input:checked) {
  background: var(--brand-soft); border-color: var(--brand);
  color: var(--brand-ink); font-weight: 600;
}
.chip.on::before, .chip:has(input:checked)::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand); margin-right: 6px;
}
.cs-select {
  height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12.5px; font-family: inherit; color: var(--ink-2); background: #fff;
  outline: none; cursor: pointer; flex: 0 0 auto;
}
.cs-select:focus { border-color: var(--brand); }
.csrow .grow2 { flex: 1; }

/* 范围摘要条 */
.scope {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 18px; font-size: 12.5px; color: var(--ink-2);
  background: var(--brand-softer); border-top: 1px solid var(--line-soft);
}
.scope b { color: var(--brand-ink); }
.scope .sep { color: #c9d6d1; }
.scope .grow2 { flex: 1; }

/* 日历格里的人数与"缺园区"提示 */
.cal .d .n { position: relative; }
.cal .d .need {
  position: absolute; right: 0; top: -1px; font-size: 10px; font-weight: 500;
  color: var(--brand-ink); background: var(--brand-soft); border-radius: 4px;
  padding: 0 4px; line-height: 15px;
}
.cal .d .sub { font-size: 10px; color: #a9b8b3; margin-top: 3px; }
.cal .d .sub.gap { color: var(--warn); }
.cal .tag.mix { color: var(--warn); font-weight: 600; }

/* ---------- 附件（合同扫描件 / 学历证书 / 证照照片） ---------- */
.panel-h .att-hint { font-weight: 400; }
.att-warn {
  display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 10px 18px;
  background: #fffaf0; border-top: 1px solid #f5e6c8;
  font-size: 12.5px; color: #8a6a25;
}
.att-warn svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--warn); }

.att-up {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 4px;
  border-bottom: 1px dashed var(--line);
}
.att-up select {
  height: 34px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 13px; font-family: inherit;
  color: var(--ink-2); background: #fff; outline: none; cursor: pointer;
}
.att-up select:focus { border-color: var(--brand); }
.att-up .att-title {
  flex: 1; min-width: 180px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
}
.att-up .att-title:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.att-tip { font-size: 11.5px; color: #a9b8b3; }

.att-file { position: relative; display: inline-flex; }
.att-file input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.att-file-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px; max-width: 260px;
  border: 1px dashed #cfdcd7; border-radius: var(--r-sm);
  background: #fbfdfc; font-size: 12.5px; color: var(--ink-2);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.att-file-btn svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted); }
.att-file-btn:hover { border-color: var(--brand); background: var(--brand-softer); color: var(--brand-ink); }
.att-file-text.picked { color: var(--brand-ink); font-weight: 600; }

.att-list { display: grid; gap: 2px; margin-top: 10px; }
.att {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line-soft);
}
.att:last-child { border-bottom: 0; }
.att-ic {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 8px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--brand-softer); border: 1px solid var(--line);
}
.att-ic svg { width: 19px; height: 19px; color: var(--brand); }
.att-ic img { width: 100%; height: 100%; object-fit: cover; }
.att-meta { flex: 1; min-width: 0; }
.att-meta .nm { font-size: 13.5px; font-weight: 600; }
.att-meta .nm a { color: var(--ink); }
.att-meta .nm a:hover { color: var(--brand); text-decoration: underline; }
.att-meta .sub { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.att-ops { display: flex; gap: 6px; flex: 0 0 auto; }
.att-empty {
  margin-top: 12px; padding: 22px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--r);
  background: #fbfcfc; color: var(--muted); font-size: 12.5px; line-height: 1.7;
}
.att-note {
  margin-top: 14px; padding: 10px 12px; border-radius: var(--r-sm);
  background: #fbfcfc; border: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.7;
}

/* ---------- 下拉多选菜单（替换原来的胶囊 chips） ---------- */
.ms { position: relative; flex: 1; min-width: 0; max-width: 420px; }
.ms-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  height: 34px; padding: 0 11px 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font-size: 13px; font-family: inherit;
  color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.ms-btn:hover { border-color: #cfdcd7; }
.ms.open .ms-btn, .ms-btn:focus-visible {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none;
}
.ms-val {
  flex: 1; min-width: 0; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.ms-val.is-empty { color: var(--muted); }
.ms-val.is-set { color: var(--brand-ink); font-weight: 600; }
.ms-caret {
  flex: 0 0 auto; width: 0; height: 0;
  border-left: 4.5px solid transparent; border-right: 4.5px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform .15s;
}
.ms.open .ms-caret { transform: rotate(180deg); border-top-color: var(--brand); }

.ms-pop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 40;
  width: max(100%, 260px); padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg);
}
.ms-pop[hidden] { display: none; }

/* 卡片 .panel 有 overflow:hidden，绝对定位面板会被裁掉；
   打开时改由 JS 计算位置，钉在视口上（fixed 不受祖先裁切），宽度与高度按可用空间自适应 */
.ms-pop.is-fixed {
  position: fixed; top: auto; right: auto; bottom: auto; left: auto;
  z-index: 200; width: auto; display: flex; flex-direction: column;
  max-height: calc(100vh - 20px);
}
.ms-pop.is-fixed[hidden] { display: none; }
.ms-pop.is-fixed .ms-tools, .ms-pop.is-fixed .ms-foot { flex: 0 0 auto; }
.ms-pop.is-fixed .ms-list {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto;
  overscroll-behavior: contain;
}
.ms-tools { display: flex; align-items: center; gap: 5px; padding: 2px 2px 6px; }
.ms-find {
  flex: 1; min-width: 0; height: 30px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 12.5px; font-family: inherit; color: var(--ink); background: #fbfcfc;
  outline: none;
}
.ms-find:focus { border-color: var(--brand); background: #fff; }
.ms-mini {
  flex: 0 0 auto; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  font-size: 12px; font-family: inherit; color: var(--ink-2); cursor: pointer;
}
.ms-mini:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-softer); }

.ms-list { max-height: 244px; overflow-y: auto; padding: 2px 1px; }
.ms-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--ink-2); line-height: 1.4;
}
.ms-opt[hidden] { display: none; }
.ms-opt:hover { background: var(--brand-softer); }
.ms-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.ms-box {
  flex: 0 0 16px; width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid #cfdcd7; background: #fff;
  display: grid; place-items: center; transition: all .12s;
}
.ms-box svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.ms-opt input:checked + .ms-box { background: var(--brand); border-color: var(--brand); }
.ms-opt input:checked + .ms-box svg { opacity: 1; }
.ms-opt input:checked ~ .ms-text { color: var(--brand-ink); font-weight: 600; }
.ms-opt.is-off { opacity: .38; cursor: not-allowed; }
.ms-opt.is-off:hover { background: transparent; }
.ms-empty { padding: 14px 10px; text-align: center; font-size: 12.5px; color: var(--muted); }
.ms-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px; padding: 6px 2px 2px; border-top: 1px solid var(--line-soft);
}
.ms-count { flex: 1; font-size: 11.5px; color: var(--muted); }

/* 筛选行里下拉的排布 */
.calsel .csrow { align-items: center; }
.calsel .ms { flex: 0 0 268px; width: 268px; }
.calsel .cs-select { min-width: 150px; }

.calsel .cslabel { padding-top: 0; }
.calsel .cshelptext { padding-top: 0; }
.ms-pop.up { top: auto; bottom: calc(100% + 4px); }

/* 窄屏：筛选行改成竖排，避免下拉与选择框挤出卡片被裁掉 */
@media (max-width: 760px) {
  .calsel .csrow { flex-wrap: wrap; gap: 8px; }
  .calsel .cslabel { flex: 0 0 100%; }
  .calsel .ms { flex: 1 1 100%; width: auto; max-width: none; }
  .calsel .cshelptext { flex: 1 1 100%; }
  .calsel .cs-select { flex: 1 1 100%; width: 100%; }
}

/* 列表页工具条里的下拉多选 */
.toolbar .ms { flex: 0 0 190px; width: 190px; max-width: 190px; }
