:root {
  --bg: #f0f9ff;
  --card: #ffffff;
  --border: #dbeafe;
  --text: #0c4a6e;
  --muted: #64748b;
  --primary: #0369a1;
  --primary-dark: #075985;
  --secondary: #0ea5e9;
  --primary-soft: #e0f2fe;
  --cta: #22c55e;
  --cta-soft: #dcfce7;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(2, 60, 100, .05), 0 1px 3px rgba(2, 60, 100, .06);
  --shadow-lg: 0 24px 50px rgba(2, 60, 100, .22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Fira Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

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

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  width: 224px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  box-shadow: 0 3px 8px rgba(3, 105, 161, .25);
}
.brand-text { font-weight: 700; font-size: 15px; color: var(--text); }
.nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--muted);
  text-align: left; width: 100%;
  transition: background .18s ease, color .18s ease;
}
.nav-item:hover { background: var(--primary-soft); color: var(--text); }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 3px 8px rgba(3, 105, 161, .22); }
.nav-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 18px; height: 18px; }
.sidebar-footer { padding: 14px 18px; font-size: 12px; color: #94a3b8; border-top: 1px solid var(--border); }

/* ---------------- 主区 ---------------- */
.main { flex: 1; padding: 28px 32px; max-width: 1240px; }
.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: all .18s ease;
}
.btn:hover { border-color: var(--secondary); background: var(--primary-soft); color: var(--primary-dark); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #fca5a5; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { border: none; background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }

/* ---------------- KPI 卡片 ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 30px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-value.green { color: var(--green); }
.kpi-value.red { color: var(--red); }
.kpi-value.amber { color: var(--amber); }
.kpi-value.blue { color: var(--primary); }
.kpi-link { cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.kpi-link:hover { border-color: var(--secondary); box-shadow: 0 8px 18px rgba(3, 105, 161, .14); transform: translateY(-1px); }

/* ---------------- 看板四行阶段概览 ---------------- */
.stage-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 12px; }
.stage-head { font-weight: 700; font-size: 13px; color: var(--primary-dark); margin-bottom: 10px; }
.stage-cells { display: flex; flex-wrap: wrap; gap: 10px; }
.stage-cell {
  flex: 1 1 90px; min-width: 90px; text-align: center; padding: 9px 6px;
  background: #f8fbff; border: 1px solid var(--border); border-radius: 9px;
}
.stage-cell-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stage-cell-value.green { color: var(--green); }
.stage-cell-value.red { color: var(--red); }
.stage-cell-value.amber { color: var(--amber); }
.stage-cell-value.blue { color: var(--primary); }
.stage-cell-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------------- 进展总结 / 阻塞点 ---------------- */
.blocker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.blocker {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--amber-soft); background: #fffbeb; border-radius: 10px;
  cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.blocker:hover { border-color: var(--amber); box-shadow: 0 4px 12px rgba(217, 119, 6, .14); }
.blocker-ico { font-size: 20px; line-height: 1; }
.blocker-text { font-weight: 600; font-size: 13px; color: var(--text); }
.blocker-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* 重复简历弹窗 */
.dup-item { border: 1px solid var(--red-soft); background: #fff5f5; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.dup-text { font-weight: 600; font-size: 13px; color: var(--red); }
.dup-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------------- 卡片 / 表格 ---------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-head { padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; align-items: center; justify-content: space-between; color: var(--text); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: #f8fbff; white-space: nowrap; letter-spacing: .02em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--primary-soft); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* 状态徽标 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge.gray { background: #f1f5f9; color: #475569; }
.badge.blue { background: var(--primary-soft); color: var(--primary-dark); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }

/* ---------------- 筛选栏 / 面板 ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.input, select.input, textarea.input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: #fff; color: var(--text); font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { resize: vertical; min-height: 70px; width: 100%; }
.input.error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.req { color: var(--red); }
.toolbar .input { min-width: 160px; }
.search { flex: 1; min-width: 200px !important; }

.filter-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); animation: fade .18s ease;
}
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.filter-grid .form-field { gap: 4px; }
.filter-grid .form-field label { font-size: 12px; color: var(--muted); font-weight: 500; }

/* 状态多选（打勾） */
.status-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.status-bar-label { color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.check-group { display: flex; flex-wrap: wrap; gap: 6px; }
.check-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; font-size: 12px; color: var(--text); cursor: pointer;
  user-select: none; transition: all .15s ease;
}
.check-item:hover { border-color: var(--secondary); background: var(--primary-soft); }
.check-item input { accent-color: var(--primary); cursor: pointer; }
.check-item:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); font-weight: 500; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.form-section { margin: 18px 0 10px; font-weight: 600; font-size: 13px; color: var(--text); padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* 推荐面试时间「＋」按钮 */
.add-slot { border-style: dashed; border-color: var(--secondary); color: var(--primary-dark); background: var(--primary-soft); font-weight: 600; }
.add-slot:hover { background: var(--cta-soft); border-color: var(--cta); color: #15803d; }

/* ---------------- 弹窗 ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(2, 60, 100, .4);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 100;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 780px;
  box-shadow: var(--shadow-lg); padding: 24px 26px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { border: none; background: transparent; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; transition: color .15s ease; }
.modal-close:hover { color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* 面试块 */
.iv-block { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #f8fbff; }
.iv-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.iv-title { font-weight: 600; font-size: 13px; color: var(--primary-dark); }

/* 面试官多选 */
.iv-multi { display: flex; flex-direction: column; gap: 6px; }
.iv-multi-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; }
.iv-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--primary-soft); color: var(--primary-dark);
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.iv-chip-x { border: none; background: transparent; color: var(--primary); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.iv-chip-x:hover { color: var(--red); }
.iv-multi-box { position: relative; }
.iv-multi-box .input { width: 100%; }
.iv-multi-drop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-lg); max-height: 200px; overflow-y: auto; z-index: 50;
}
.iv-multi-item { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.iv-multi-item:hover { background: var(--primary-soft); }

/* 面试评价表 */
.eval-details {
  margin-top: 12px; border: 1px dashed var(--border); border-radius: 10px;
  background: #fff; padding: 10px 14px;
}
.eval-details summary {
  cursor: pointer; font-weight: 600; font-size: 13px; color: var(--primary-dark);
  user-select: none; padding: 2px 0;
}
.eval-details summary:hover { color: var(--primary); }
.eval-body { margin-top: 12px; }
.eval-skill-row {
  display: grid; grid-template-columns: 1fr 108px 1.2fr; gap: 8px; align-items: center;
  margin-bottom: 6px;
}
.eval-skill-row .input { padding: 5px 8px; font-size: 12px; }
.eval-key-row { grid-template-columns: 1fr 108px 1.2fr auto; }

/* ---------------- 日历 ---------------- */
.cal-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; margin-bottom: 8px; box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cal-item:hover { border-color: var(--secondary); box-shadow: 0 4px 12px rgba(3, 105, 161, .10); }
.cal-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 46px; color: var(--muted); }
.cal-round { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: var(--primary-soft); color: var(--primary-dark); white-space: nowrap; }
.cal-name { font-weight: 600; }
.cal-meta { color: var(--muted); font-size: 12px; }

/* 月视图网格 */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-week { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal-cell {
  min-height: 96px; padding: 8px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cal-cell:hover { border-color: var(--secondary); box-shadow: 0 4px 12px rgba(3, 105, 161, .10); }
.cal-cell.cal-today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-cell.cal-out { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.cal-out:hover { box-shadow: none; border-color: transparent; }
.cal-daynum { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; color: var(--text); }
.cal-count { background: var(--primary); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 500; padding: 0 6px; line-height: 17px; }
.cal-chip {
  background: var(--primary-soft); color: var(--primary-dark); border-radius: 6px;
  padding: 2px 6px; font-size: 11px; line-height: 1.35; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cal-chip-time { font-weight: 600; margin-right: 3px; }
.cal-link-ico { margin-right: 2px; }
.cal-more { font-size: 11px; color: var(--muted); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13px; z-index: 200; box-shadow: var(--shadow-lg);
  animation: fade .2s ease;
}
.toast.err { background: var(--red); }

/* 导入结果 */
.import-result { background: var(--primary-soft); border-radius: 8px; padding: 12px 16px; margin-top: 14px; font-size: 13px; color: var(--primary-dark); }

.link { color: var(--primary); text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* 角色权限：协作成员隐藏管理员专属功能 */
.role-collaborator .admin-only { display: none !important; }
