/* ========== CSS Variables ========== */
:root {
  --primary: #164E78;
  --primary-light: #1e6294;
  --primary-lighter: #e8f0f7;
  --primary-dark: #0f3a5a;
  --danger: #E94D38;
  --danger-light: #f06b5a;
  --danger-lighter: #fde8e5;
  --success: #2e7d32;
  --success-light: #4caf50;
  --success-lighter: #e8f5e9;
  --warning: #e65100;
  --warning-lighter: #fff3e0;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555770;
  --text-muted: #8e90a6;
  --border: #e4e6eb;
  --border-light: #f0f1f4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-width: 230px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Reset & Base ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

ul, ol { list-style: none; }

img { max-width: 100%; display: block; }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4c6d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a2b0; }

/* ========== Layout ========== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #123952 0%, var(--primary) 30%, #134568 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,0.1);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.sidebar-header p {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section {
  padding: 8px 24px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  margin: 2px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--danger);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active .nav-icon {
  color: #fff;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--danger), #f08070);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { line-height: 1.3; }
.user-name { font-weight: 600; color: rgba(255,255,255,0.9); }
.user-role { font-size: 11px; color: rgba(255,255,255,0.45); }

.logout-btn {
  margin-left: auto;
  width: 30px; height: 30px;
  border: none; border-radius: 8px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.logout-btn:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* ========== 通知铃铛 ========== */
.sidebar-footer { position: relative; }
.notif-btn {
  position: relative;
  width: 30px; height: 30px;
  border: none; border-radius: 8px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.notif-btn:hover { background: rgba(255,255,255,0.22); color: #fff; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: #E94D38; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}
.notif-panel {
  position: absolute; bottom: calc(100% + 6px); left: 12px; right: 12px;
  z-index: 50;
  background: #fff; color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  overflow: hidden;
  max-height: 420px;
  display: flex; flex-direction: column;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
.notif-mark-all {
  border: none; background: none; color: var(--primary);
  cursor: pointer; font-size: 12px;
}
.notif-list { overflow-y: auto; padding: 6px; }
.notif-item {
  display: block; width: 100%; text-align: left;
  border: none; background: none; cursor: pointer;
  padding: 10px 12px; border-radius: 8px;
  border-left: 3px solid transparent;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { border-left-color: var(--primary); background: rgba(22,78,120,0.06); }
.notif-item-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; color: var(--text); }
.notif-item-content { font-size: 12px; color: var(--text-muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item-time { font-size: 11px; color: #aaa; margin-top: 4px; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* 小屏隐藏用户名时，铃铛保持可见 */
@media (max-width: 680px) {
  .notif-panel { left: 8px; right: 8px; }
}

/* ========== 登录浮层（参考 KPI 同款风格）========== */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #164E78 0%, #2c5f8a 50%, #3a7ca5 100%);
}
.login-box {
  width: 420px; max-width: 92vw;
  background: #fff; border-radius: 16px;
  padding: 48px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-icon { font-size: 48px; margin-bottom: 16px; }
.login-header h1 { font-size: 24px; font-weight: 600; color: #1f2937; margin-bottom: 8px; }
.login-desc { font-size: 14px; color: #6b7280; margin-top: 8px; }
.login-form { margin-top: 24px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form .form-group label {
  display: block; font-size: 14px; font-weight: 500;
  color: #374151; margin-bottom: 8px;
}
.login-input {
  width: 100%; padding: 12px 16px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  font-size: 14px; box-sizing: border-box;
  transition: all 0.2s;
}
.login-input:focus {
  outline: none; border-color: #164E78;
  box-shadow: 0 0 0 3px rgba(22,78,120,0.1);
}
.login-btn {
  width: 100%; font-size: 16px; padding: 14px;
  border-radius: 8px; cursor: pointer;
}
.login-hint {
  margin-top: 20px; text-align: center;
  font-size: 13px; color: #6b7280; line-height: 1.5;
}
.btn-block { width: 100%; justify-content: center; }

/* 响应式：窄屏登录卡片 */
@media (max-width: 480px) {
  .login-box { width: 94vw; padding: 32px 24px; }
  .login-header h1 { font-size: 20px; }
  .login-icon { font-size: 40px; }
}

/* ========== Main Content ========== */
.main-content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  min-height: 100vh;
}

.page { display: none; animation: fadeSlideIn 0.3s ease; }
.page.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Page Header ========== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  position: relative;
}

.page-header h1::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(135deg, var(--primary), var(--danger));
  border-radius: 2px;
  margin-top: 6px;
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ========== Stats Grid ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

/* 考勤页 8 张统计卡：4 列 × 2 行对称排列（不影响其他页通用 6 列） */
#att-stats-grid { grid-template-columns: repeat(4, 1fr); }
/* 工作台统计卡：4 列（与下方快捷操作 4 列对齐）；个人工作台同理 */
#dashboard-stats-grid,
#emp-dashboard .stats-grid { grid-template-columns: repeat(4, 1fr); }

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 10px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: default;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.06;
}

.stat-card:nth-child(1)::after { background: var(--primary); }
.stat-card:nth-child(2)::after { background: var(--success); }
.stat-card:nth-child(3)::after { background: var(--warning); }
.stat-card:nth-child(4)::after { background: var(--danger); }

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.stat-card:nth-child(1) .stat-icon { background: var(--primary-lighter); color: var(--primary); }
.stat-card:nth-child(2) .stat-icon { background: var(--success-lighter); color: var(--success); }
.stat-card:nth-child(3) .stat-icon { background: var(--warning-lighter); color: var(--warning); }
.stat-card:nth-child(4) .stat-icon { background: var(--danger-lighter); color: var(--danger); }
.stat-card:nth-child(5) .stat-icon { background: #e3f2fd; color: var(--info); }
.stat-card:nth-child(6) .stat-icon { background: #f3e8ff; color: #7c3aed; }

.stat-num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-card:nth-child(1) .stat-num { color: var(--primary); }
.stat-card:nth-child(2) .stat-num { color: var(--success); }
.stat-card:nth-child(3) .stat-num { color: var(--warning); }
.stat-card:nth-child(4) .stat-num { color: var(--danger); }
.stat-card:nth-child(5) .stat-num { color: var(--info); }
.stat-card:nth-child(6) .stat-num { color: #7c3aed; }

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== Panel ========== */
.panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header h3 .panel-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.panel-badge-info { background: var(--primary-lighter); color: var(--primary); }
.panel-badge-warning { background: var(--warning-lighter); color: var(--warning); }
.panel-badge-danger { background: var(--danger-lighter); color: var(--danger); }

.panel-body { }

/* ========== 部门分布 + 快速操作 并排行（参考 KPI 仪表盘布局） ========== */
.qa-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  align-items: stretch;
}
.qa-row .panel { margin-bottom: 0; }

/* 右侧快速操作面板：flex 纵向布局，让 qa-grid 撑满剩余空间并居中 */
.qa-panel {
  display: flex;
  flex-direction: column;
}

.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: center;
  flex: 1;
}

/* 员工个人工作台快捷操作（3 列，复用 .quick-action 纯色块按钮） */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 16px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all var(--transition);
}
.quick-action:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* 图标色块：兼容管理端（色类在按钮上）与员工端（色类在图标上）两种写法 */
.qa-onboard .quick-action-icon,
.quick-action-icon.qa-onboard   { background: var(--primary-lighter);   color: var(--primary); }
.qa-probation .quick-action-icon,
.quick-action-icon.qa-probation { background: var(--warning-lighter);   color: var(--warning); }
.qa-report .quick-action-icon,
.quick-action-icon.qa-report    { background: var(--success-lighter);   color: var(--success); }
.qa-offboard .quick-action-icon,
.quick-action-icon.qa-offboard  { background: var(--danger-lighter);    color: var(--danger); }

.quick-action-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.quick-action-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 0;
}

/* ========== Data Table ========== */
.table-wrap {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 10px;
}

.table-toolbar-left {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.table-toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.data-table th {
  background: #f7f8fa;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  padding: 12px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.3px;
}

.data-table th:first-child { padding-left: 20px; }
.data-table th:last-child { padding-right: 20px; }

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table td:first-child { padding-left: 20px; }
.data-table td:last-child { padding-right: 20px; }

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: #f5f7fb;
}

/* 绩效占位/未录入记录：灰显弱化，避免满屏 0 分 D 级显得杂乱 */
.data-table tbody tr.row-muted td {
  color: var(--text-muted);
  background: #fafbfc;
}
.data-table tbody tr.row-muted:hover td {
  background: #f1f3f5;
}

.data-table tbody tr.emp-row {
  cursor: pointer;
}

.data-table tbody tr.emp-row:hover {
  background: #eef3f9;
}

.data-table .expand-icon {
  display: inline-block;
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
  transition: transform var(--transition);
}

.data-table .emp-name-cell {
  font-weight: 600;
  color: var(--primary);
}

.data-table .emp-dept-cell {
  color: var(--text-secondary);
  font-size: 12px;
}

.data-table .text-muted { color: var(--text-muted); cursor: default; }

/* ========== Detail Row ========== */
.emp-detail-row { background: #f8fafd; }
.emp-detail-row td { padding: 0 !important; }

.emp-detail-panel {
  padding: 20px 28px;
  border-top: 2px solid var(--primary);
  border-bottom: 2px solid var(--border-light);
  animation: expandIn 0.25s ease;
}

@keyframes expandIn {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 300px; }
}

.emp-detail-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.emp-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 24px;
}

.emp-detail-item {
  font-size: 13px;
}

.emp-detail-item .dl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.emp-detail-item .dv {
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}

/* ========== Tabs (Department & Line) ========== */
.dept-tabs, .line-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.dept-tag {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: #fff;
  color: var(--text-secondary);
  user-select: none;
}

.dept-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lighter);
}

.dept-tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(22,78,120,0.25);
}

.dept-tag .count {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.8;
}

/* 子部门标签（层级缩进，如 业务部 / 销售） */
.dept-tag-child {
  margin-left: 18px;
  font-size: 12px;
  background: #eef3f8;
  border-color: #cfe0ee;
  color: var(--primary);
}
.dept-tag-child::before {
  content: "└ ";
  opacity: 0.6;
}

/* ========== 行内实时编辑单元格 ========== */
.cell-edit {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 7px;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  color: inherit;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.cell-edit:hover {
  border-color: #cbd5e1;
}
.cell-edit:focus {
  border-color: var(--primary);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(22, 78, 120, 0.15);
}
td .cell-edit {
  min-width: 60px;
}
/* 工号列只读，不让其占据过多 */
.emp-num-cell {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.prob-end-cell {
  font-size: 12px;
  color: var(--secondary);
  white-space: nowrap;
}

/* ========== Buttons ========== */
.btn {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.2px;
}

.btn:active { transform: scale(0.97); }

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lighter);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(22,78,120,0.3);
}

.btn-purple {
  background: linear-gradient(135deg, var(--primary), #1a5c8a);
  color: #fff;
}

.btn-purple:hover {
  background: linear-gradient(135deg, var(--primary-light), #1e6a9e);
  box-shadow: 0 4px 12px rgba(22,78,120,0.35);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-light);
  box-shadow: 0 4px 12px rgba(233,77,56,0.3);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: var(--success-light);
  box-shadow: 0 4px 12px rgba(46,125,50,0.3);
}

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========== Status Badge ========== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-active {
  background: var(--success-lighter);
  color: var(--success);
}

.badge-probation {
  background: var(--warning-lighter);
  color: var(--warning);
}

.badge-resigned {
  background: var(--danger-lighter);
  color: var(--danger);
}

.badge-pending {
  background: #e3f2fd;
  color: #1565c0;
}

.badge-wecom {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 10px;
}

/* ========== 企业微信面板 ========== */
.wecom-panel {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wecom-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wecom-icon {
  width: 40px; height: 40px;
  background: var(--success-lighter);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.wecom-info {
  display: flex; flex-direction: column; gap: 2px;
}
.wecom-info strong {
  font-size: 14px; color: var(--text);
}
.wecom-info span {
  font-size: 12px; color: var(--text-muted);
}
.wecom-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}

/* ========== 考勤月历方格 ========== */
.att-month-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 4px 0 10px;
}

/* 日历网格 */
#att-calendar {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-row.cal-header {
  background: #f8f9fb;
  border-bottom: 1px solid var(--border-light);
}
.cal-cell {
  min-height: 52px;
  padding: 4px 4px;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: all 0.15s;
  cursor: default;
  position: relative;
}
.cal-cell:nth-child(7n) { border-right: none; }

.cal-day-label {
  aspect-ratio: auto;
  min-height: auto;
  padding: 6px 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  background: transparent;
  border-bottom: 1px solid var(--border-light);
}
.weekend-label { color: var(--danger); }

.cal-empty {
  background: #fafbfc;
}
.cal-no-data {
  background: #fff;
  color: #ccc;
}
.cal-no-data .cal-day-num {
  font-size: 13px;
  color: #bbb;
}

/* 有数据的日期 */
.cal-has-data {
  cursor: pointer;
}
.cal-has-data:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 1;
}

/* 颜色等级 */
.cal-green { background: #e8f5e9; }
.cal-green:hover { background: #c8e6c9; }
.cal-yellow { background: #fff8e1; }
.cal-yellow:hover { background: #ffecb3; }
.cal-orange { background: #fff3e0; }
.cal-orange:hover { background: #ffe0b2; }
.cal-red { background: #ffebee; }
.cal-red:hover { background: #ffcdd2; }

/* 选中状态 */
.cal-selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  z-index: 2;
}

/* 今日标记 */
.cal-today {
  background: #e3f2fd !important;
}
.cal-day-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 3px;
}
.cal-today-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
}

.cal-mini-stats {
  display: flex;
  gap: 4px;
  font-size: 10px;
}
.cal-mini-item {
  font-weight: 600;
}
.cal-mini-item.good { color: var(--success); }
.cal-mini-item.bad { color: var(--danger); }
.cal-mini-item.none { color: #ccc; }

/* 日期明细面板 */
#att-day-detail {
  margin-top: 16px;
  min-height: 60px;
}
.cal-detail-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 14px;
  background: #fafbfc;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
}
.cal-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #f0f4ff;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  gap: 8px;
}
.cal-detail-header h4 {
  margin: 0;
  font-size: 14px;
  color: var(--primary);
}
.cal-detail-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

/* 点状指示器（保留） */
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-normal { background: var(--success); }
.dot-late { background: var(--warning); }
.dot-early { background: var(--warning); }
.dot-absent { background: var(--danger); }
.dot-leave { background: var(--info); }
.dot-miss { background: #999; }
.dot-nopunch { background: var(--danger); }
.dot-biz { background: #7c3aed; }

/* 明细表格（保留） */
.att-detail-table {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
.att-detail-table th {
  background: #f0f1f4;
  font-size: 11px;
  padding: 8px 10px;
}
.att-detail-table td {
  font-size: 12px;
  padding: 7px 10px;
  white-space: nowrap;
}
.att-detail-table th:nth-child(4),
.att-detail-table th:nth-child(5),
.att-detail-table th:nth-child(6),
.att-detail-table th:nth-child(7) {
  background: #f0f4ff;
}
.att-detail-table th:nth-child(8),
.att-detail-table th:nth-child(9) {
  background: #fff8e1;
}

/* 工资表样式 */
.pay-table th, .pay-table td {
  font-size: 11px;
  white-space: nowrap;
  padding: 6px 6px;
}
.pay-table th {
  background: #f0f1f4;
}
.pay-table th:nth-child(6),
.pay-table th:nth-child(7) { background: #f0f4ff; }
.pay-table th:nth-child(11),
.pay-table th:nth-child(12),
.pay-table th:nth-child(13),
.pay-table th:nth-child(14) { background: #fff8e1; }
.pay-table th:nth-child(15),
.pay-table th:nth-child(17) { background: #fce4ec; }
.pay-table td:nth-child(15) { color: var(--primary); font-weight: 600; }
.pay-table td:nth-child(17) { color: var(--danger); font-weight: 600; }

/* ========== 薪酬月份折叠 ========== */
.pay-month-group {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--card-bg);
  transition: box-shadow var(--transition);
}
.pay-month-group:last-child { margin-bottom: 0; }
.pay-month-group:hover { box-shadow: var(--shadow-sm); }
.pay-month-group.expanded { border-color: var(--primary-lighter); }

.pay-month-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.pay-month-header:hover { background: var(--primary-lighter); }

.pay-month-arrow {
  font-size: 11px;
  color: var(--text-muted);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.pay-month-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  min-width: 100px;
}

.pay-month-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}

.pay-month-badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}
.pay-badge-gross { color: var(--primary); background: var(--primary-lighter); }
.pay-badge-net { color: var(--danger); background: var(--danger-lighter); }
.pay-badge-status { color: var(--success); background: var(--success-lighter); }

.pay-month-body {
  border-top: 1px solid var(--border-light);
  animation: payAccordionIn 0.25s ease;
}

@keyframes payAccordionIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.base-input {
  border: 1px solid transparent;
  background: transparent;
  text-align: right;
  transition: all 0.15s;
}
.base-input:hover, .base-input:focus {
  border-color: var(--primary);
  background: #fff;
  outline: none;
}

/* 弹窗分段标题 */
.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  padding: 8px 0 4px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 8px;
}

/* 统计卡片颜色变体 */
.stat-card.card-success { border-left-color: var(--success); }
.stat-card.card-success .stat-icon { background: var(--success-lighter); color: var(--success); }
.stat-card.card-warning { border-left-color: var(--warning); }
.stat-card.card-warning .stat-icon { background: var(--warning-lighter); color: var(--warning); }
.stat-card.card-danger { border-left-color: var(--danger); }
.stat-card.card-danger .stat-icon { background: var(--danger-lighter); color: var(--danger); }
.stat-card.card-info { border-left-color: var(--info); }
.stat-card.card-info .stat-icon { background: #e3f2fd; color: var(--info); }
.stat-card.card-purple { border-left-color: #7c3aed; }
.stat-card.card-purple .stat-icon { background: #f3e8ff; color: #7c3aed; }

/* ========== Search ========== */
.search-box {
  position: relative;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  padding: 8px 14px 8px 36px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  width: 240px;
  outline: none;
  transition: all var(--transition);
  background: #fff;
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,78,120,0.08);
  width: 280px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* ========== Modal ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 780px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-lg { max-width: 820px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--danger);
  background: var(--danger-lighter);
}

.modal-body {
  padding: 24px 28px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px;
  border-top: 1px solid var(--border-light);
  position: sticky;
  bottom: 0;
  background: #fff;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ========== Forms ========== */
.form-section {
  margin-bottom: 20px;
}

.form-section:last-child { margin-bottom: 0; }

.form-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-section h4::before {
  content: '';
  width: 4px;
  height: 16px;
  background: linear-gradient(180deg, var(--primary), var(--danger));
  border-radius: 2px;
  display: inline-block;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 18px;
}

.form-row-2 { grid-template-columns: repeat(2, 1fr); }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.form-group .req { color: var(--danger); margin-left: 2px; }
.form-group .hint { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.form-input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: all var(--transition);
  background: #fff;
  font-family: inherit;
  color: var(--text);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,78,120,0.08);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(233,77,56,0.08);
}

select.form-input {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e90a6' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") no-repeat right 10px center;
  padding-right: 32px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* ========== Onboarding ========== */
.onboard-container {
  max-width: 860px;
}

.onboard-steps {
  display: flex;
  margin-bottom: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.onboard-step {
  flex: 1;
  padding: 12px 16px;
  text-align: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.onboard-step .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--border-light);
  color: var(--text-muted);
  transition: all var(--transition);
}

.onboard-step.active {
  background: var(--primary);
  color: #fff;
}

.onboard-step.active .step-num {
  background: rgba(255,255,255,0.3);
  color: #fff;
}

.onboard-step.done {
  color: var(--success);
}

.onboard-step.done .step-num {
  background: var(--success-lighter);
  color: var(--success);
}

.onboard-form {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.onboard-form .form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.onboard-success {
  text-align: center;
  padding: 40px;
}

.onboard-success-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.onboard-success h2 {
  font-size: 22px;
  color: var(--success);
  margin-bottom: 8px;
}

.onboard-success p {
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-size: 14px;
}

.onboard-success .emp-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin: 12px 0;
}

/* ========== Probation ========== */
.probation-scores {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 16px 0;
}

.score-item {
  text-align: center;
  padding: 14px 8px;
  background: #f8f9fb;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}

.score-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(22,78,120,0.08);
}

.score-item label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

.score-item input {
  width: 64px;
  text-align: center;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  outline: none;
  transition: all var(--transition);
  font-family: inherit;
}

.score-item input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,78,120,0.08);
}

.score-item .score-label-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== Offboarding ========== */
.offboard-process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.offboard-check {
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #f8f9fb;
  transition: all var(--transition);
}

.offboard-check.checked {
  background: var(--success-lighter);
  border-color: var(--success);
}

.offboard-check .check-icon {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.offboard-check.checked .check-icon {
  color: var(--success);
}

.offboard-check label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.offboard-check select {
  font-size: 12px;
  padding: 4px 8px;
}

/* ========== Department Chart ========== */
/* 部门人员分布：与 KPI 仪表盘「部门人数分布」一致的柱状图样式 */
.dept-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  height: 220px;
  padding: 10px;
  margin-top: 8px;
  background: #f9fafb;
  border-radius: 8px;
  overflow-x: auto;
}

.dept-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  min-width: 44px;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
  animation: deptGrowUp 0.6s ease-out both;
}

.dept-col-fill {
  width: 28px;
  border-radius: 6px 6px 0 0;
  background: var(--primary);
  transition: height 0.5s ease;
  min-height: 3px;
}

.dept-col-num {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
}

.dept-col-label {
  font-size: 11px;
  color: #6b7280;
  text-align: center;
  white-space: nowrap;
}

@keyframes deptGrowUp {
  from { transform: scaleY(0); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

@media (max-width: 768px) {
  .dept-chart { height: 180px; }
  .dept-col-fill { width: 20px; }
  .dept-col-label { font-size: 10px; }
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
}

/* ========== Toast Notification ========== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.toast-error { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }
.toast-warning { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.toast-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ========== Loading ========== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 10px;
  font-size: 14px;
}

/* ========== Confirm Dialog ========== */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1100;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.confirm-overlay.show { display: flex; }

.confirm-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp 0.3s ease;
}

.confirm-box .confirm-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.confirm-box h3 {
  font-size: 17px;
  margin-bottom: 8px;
  color: var(--text);
}

.confirm-box p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ========== Recruitment ========== */
.stat-card-sm { padding: 12px 14px; }
.stat-label-card { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

.filter-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  background: #fff;
  transition: all var(--transition);
  user-select: none;
}
.filter-tag:hover { border-color: var(--primary); color: var(--primary); }
.filter-tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.rec-row { cursor: pointer; transition: background 0.15s; }
.rec-row:hover { background: var(--primary-lighter); }
.rec-row.row-active { background: #e8f0f8; }
.rec-row-urgent { border-left: 3px solid var(--danger); }

.expand-icon {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s;
  display: inline-block;
}
.rec-row.row-active .expand-icon { transform: rotate(90deg); }

.badge-green { background: #e8f5e9; color: #2e7d32; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-red { background: #fce4ec; color: #c62828; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-blue { background: #e3f2fd; color: #1565c0; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-purple { background: #f3e5f5; color: #7b1fa2; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-gray { background: #f0f1f4; color: #666; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }

/* ========== 招聘页：顶部三卡片一行 ========== */
.rec-three-cards {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}
.rec-card {
  padding: 16px !important;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rec-card .panel-header { margin-bottom: 12px; padding-bottom: 10px; }
.rec-card-body { flex: 1; min-height: 0; padding: 4px 4px 8px; overflow-y: auto; }

/* 招聘管道（竖立式柱状图） */
.pipeline-v { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; height: 200px; }
.pipeline-v-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}
.pipeline-v-count { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; white-space: nowrap; }
.pipeline-v-track {
  width: 60%;
  max-width: 44px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
}
.pipeline-v-bar { width: 100%; border-radius: 5px 5px 0 0; min-height: 4px; transition: height 0.4s ease; }
.pipeline-v-label { font-size: 12px; color: var(--secondary); margin-top: 8px; white-space: nowrap; }

/* ========== 看板 ========== */
.kanban-board { display: flex; gap: 12px; padding: 12px 16px; overflow-x: auto; min-height: 200px; }
.kanban-col { flex: 1; min-width: 180px; background: var(--gray-50); border-radius: 8px; display: flex; flex-direction: column; }
.kanban-col-header { padding: 8px 12px; font-size: 13px; font-weight: 600; background: #fff; border-radius: 8px 8px 0 0; display: flex; justify-content: space-between; align-items: center; }
.kanban-count { background: var(--gray-200); color: var(--text); padding: 1px 7px; border-radius: 10px; font-size: 11px; }
.kanban-items { padding: 6px 8px; flex: 1; min-height: 80px; }
.kanban-empty { color: var(--secondary); font-size: 12px; text-align: center; padding: 20px 0; }
.kanban-card { background: #fff; border-radius: 6px; padding: 10px 12px; margin-bottom: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); cursor: grab; transition: box-shadow 0.2s, transform 0.15s; border-left: 3px solid var(--primary); }
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); transform: translateY(-1px); }
.kanban-card:active { cursor: grabbing; }
.kanban-card-name { font-weight: 600; font-size: 14px; color: var(--text); }
.kanban-card-meta { font-size: 11px; color: var(--secondary); margin: 3px 0; }

/* ========== 学习园地 ========== */
.learn-tabs { display: flex; gap: 10px; margin: 16px 0 12px; }
.learn-cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.lc-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.learn-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow .2s, transform .15s; display: flex; flex-direction: column; }
.learn-card:hover { box-shadow: 0 4px 16px rgba(22, 78, 120, .15); transform: translateY(-2px); }
.lc-card-cover-wrap { position: relative; height: 150px; background: var(--gray-100); overflow: hidden; }
.lc-card-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-card-cover { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--text-muted); }
.lc-card-cover-video { background: linear-gradient(135deg, #164E78, #1e6a9e); }
.lc-play { color: #fff; font-size: 42px; }
.lc-type-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, .55); }
.lc-type-badge.video { background: var(--danger); }
.lc-type-badge.article { background: var(--primary); }
.lc-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lc-card-cats { display: flex; gap: 6px; align-items: center; }
.lc-cat-badge { background: var(--primary-lighter); color: var(--primary); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.lc-top-badge { background: #fff3e0; color: #e65100; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.lc-card-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-card-summary { font-size: 12px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-card-meta { margin-top: auto; display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }

.lc-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lc-detail-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lc-detail-title { font-size: 20px; margin: 6px 0; color: var(--text); }
.lc-detail-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.lc-detail-cover { width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.lc-detail-video-wrap { margin-bottom: 10px; background: #000; border-radius: 10px; overflow: hidden; }
.lc-detail-video { width: 100%; max-height: 420px; display: block; }
.lc-detail-iframe { width: 100%; height: 420px; border: 0; display: block; }
.lc-detail-summary { font-size: 14px; color: var(--text-secondary); background: var(--gray-50); padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; }
.lc-detail-content { font-size: 14px; line-height: 1.8; color: var(--text); word-break: break-word; }
.lc-detail-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.lc-detail-content p { margin: 8px 0; }

.lc-forward-item { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; cursor: pointer; transition: box-shadow .2s; }
.lc-forward-item:hover { box-shadow: 0 3px 12px rgba(22, 78, 120, .12); }
.lc-forward-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.lc-forward-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.lc-forward-name { font-weight: 600; font-size: 14px; }
.lc-forward-dept { font-weight: 400; color: var(--text-muted); font-size: 12px; margin-left: 4px; }
.lc-forward-time { font-size: 12px; color: var(--text-muted); }
.lc-forward-note { font-size: 14px; color: var(--text); background: var(--gray-50); padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; white-space: pre-wrap; }
.lc-forward-quote { font-size: 12px; color: var(--text-secondary); border-left: 3px solid var(--primary); padding-left: 10px; }

.lc-upload-prev { margin-top: 8px; }
.lc-upload-prev img, .lc-upload-prev video { max-width: 100%; max-height: 160px; border-radius: 8px; border: 1px solid var(--border); }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.kanban-source { font-size: 11px; color: var(--gray-500); }

/* ========== 迷你进度条 ========== */
.mini-progress { width: 60px; height: 5px; background: var(--gray-200); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.mini-progress-bar { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* ========== 紧急行高亮 ========== */
.rec-row-urgent { background: #fef2f2 !important; }
.rec-row-urgent:hover { background: #fee2e2 !important; }

/* ========== 招聘岗位 TAB 紧凑布局 ========== */
/* 顶部统计卡与面板：缩小外边距/内边距，整体更紧凑 */
#rec-tab-content .stats-grid { gap: 10px; margin-bottom: 14px; }
#rec-tab-content .stat-card-sm { padding: 10px 12px; }
#rec-tab-content .stat-card-sm .stat-num { font-size: 20px; }
#rec-tab-content .panel { margin-bottom: 14px !important; padding: 16px 18px !important; }
#rec-tab-content .panel-header { margin-bottom: 12px; padding-bottom: 10px; }
#rec-tab-content .pipeline-bar-track { height: 18px; }
#rec-tab-content .pipeline-stage { gap: 10px; }
/* 三卡片一行：抵消上方 .panel 的 margin-bottom，保证同行等高 */
#rec-tab-content .rec-three-cards .rec-card { margin-bottom: 0 !important; }

/* ========== 简历邮箱：按岗位分组 ========== */
.email-group-row { background: #eef3f8; }
.email-group-row td { padding: 8px 12px !important; border-bottom: 2px solid var(--primary); }
.email-group-pos { font-weight: 700; color: var(--primary); font-size: 13.5px; }
.email-group-badge {
  display: inline-block; margin-left: 10px; padding: 1px 9px; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 600;
}
.email-group-count { margin-left: 10px; font-size: 12px; color: var(--secondary); }
.email-row td { vertical-align: middle; }

/* 岗位表格：更紧凑的行高与单元格间距 */
#rec-position-area .data-table { font-size: 12.5px; }
#rec-position-area .data-table thead th {
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 600;
}
#rec-position-area .data-table tbody td {
  padding: 6px 10px;
  line-height: 1.35;
}
#rec-position-area .data-table th:first-child,
#rec-position-area .data-table td:first-child { padding-left: 12px; }
#rec-position-area .data-table th:last-child,
#rec-position-area .data-table td:last-child { padding-right: 12px; white-space: nowrap; }
#rec-position-area .data-table .expand-icon { font-size: 9px; }
#rec-position-area .data-table .rec-row td strong { font-weight: 600; }
#rec-position-area .data-table .btn-xs {
  padding: 2px 7px;
  font-size: 11px;
  margin: 1px 3px 1px 0;
  border-radius: 5px;
}
#rec-position-area .mini-progress { width: 52px; height: 5px; }

/* ========== 用人申请流程 ========== */
.srs-progress { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.srs-step { padding: 2px 8px; border-radius: 10px; background: #eee; color: var(--text-muted); }
.srs-step-done { background: var(--success-lighter); color: var(--success); font-weight: 600; }
.srs-step-rejected { background: var(--danger-lighter); color: var(--danger); font-weight: 600; text-decoration: line-through; }
.srs-step-pending { background: var(--border-light); color: var(--text-muted); }
.srs-arrow { color: var(--text-muted); margin: 0 2px; }

/* ========== 发布到招聘平台 ========== */
.publish-platform-tabs { display:flex; gap:8px; margin-bottom:12px; }
.pub-tab { flex:1; padding:14px 10px; border:2px solid var(--border); border-radius:8px; background:#fff; cursor:pointer; text-align:center; font-size:14px; font-weight:600; transition:all 0.2s; display:flex; flex-direction:column; align-items:center; gap:4px; }
.pub-tab:hover { border-color: var(--primary); background:#f0f7fb; }
.pub-tab.active { border-color: var(--primary); background:#e8f1f7; color: var(--primary); box-shadow:0 0 0 3px rgba(22,78,120,0.1); }
#publish-text-preview { font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif; }

/* ========== Responsive ========== */
@media (max-width: 1200px) {
  .main-content { padding: 20px 24px; }
  .form-row { grid-template-columns: repeat(2, 1fr); }
  .probation-scores { grid-template-columns: repeat(4, 1fr); }
  .dept-col { width: 46px; }
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  #att-stats-grid { grid-template-columns: repeat(2, 1fr); }
  #dashboard-stats-grid,
  #emp-dashboard .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .qa-row { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: repeat(2, 1fr); }
  .emp-detail-grid { grid-template-columns: repeat(2, 1fr); }
  .offboard-process { grid-template-columns: repeat(2, 1fr); }
  .onboard-steps { flex-wrap: wrap; }
  .onboard-step { flex: 0 1 50%; }
}

@media (max-width: 768px) {
  .main-content { padding: 64px 12px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  #att-stats-grid { grid-template-columns: repeat(2, 1fr); }
  #dashboard-stats-grid,
  #emp-dashboard .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .qa-row { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .emp-detail-grid { grid-template-columns: 1fr; }
  .probation-scores { grid-template-columns: repeat(2, 1fr); }
  .offboard-process { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .modal-box { max-width: 95vw; max-height: calc(100vh - 48px); }
  .search-input { width: 100%; }
  .search-input:focus { width: 100%; }
  .stat-card { padding: 14px; }
  .stat-num { font-size: 26px; }
  .page-header h1 { font-size: 20px; }
  .btn { padding: 9px 14px; }
  .data-table { font-size: 12.5px; }
  .dept-tabs, .rec-tab-header { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
}

/* ========== 移动端顶栏 + 抽屉侧栏（≤768px） ========== */
.mobile-topbar { display: none; }
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.25s ease;
}

@media (max-width: 768px) {
  /* 顶栏：常驻顶部 */
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    padding: 0 12px 0 8px;
    padding-top: env(safe-area-inset-top);
    background: linear-gradient(135deg, #123952 0%, #164E78 100%);
    color: #fff;
    z-index: 120;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }
  .m-hamburger {
    width: 42px; height: 42px;
    border: none; background: transparent;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 5px; cursor: pointer;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .m-hamburger:active { background: rgba(255,255,255,0.12); }
  .m-hamburger span {
    display: block; width: 20px; height: 2px;
    background: #fff; border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .m-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .m-hamburger.open span:nth-child(2) { opacity: 0; }
  .m-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .m-title {
    font-size: 16px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-logo-mini {
    margin-left: auto;
    font-size: 11px; font-weight: 600;
    padding: 4px 10px; border-radius: 12px;
    background: rgba(255,255,255,0.16);
    flex-shrink: 0;
  }

  /* 侧栏：改为抽屉 */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 264px;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 200;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0,0,0,0.3);
  }
  .sidebar .nav-item span:not(.nav-icon),
  .sidebar .logo, .sidebar .logo-sub,
  .sidebar .sidebar-header p,
  .sidebar .sidebar-footer .user-info,
  .nav-section { display: revert; }
  .nav-item {
    justify-content: flex-start;
    padding: 13px 20px;
    margin: 2px 10px;
    min-height: 44px;
    box-sizing: border-box;
  }
  .nav-item.active::before { display: block; }
  .sidebar-header { padding: 18px 20px; padding-top: calc(18px + env(safe-area-inset-top)); }
  .sidebar-footer { padding: 12px 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

  /* 遮罩显示 */
  .sidebar-backdrop.show {
    display: block;
    opacity: 1;
  }

  /* 登录页：避开顶栏 */
  .login-overlay { padding-top: 52px; }

  /* 触控优化：弹窗按钮更大 */
  .modal-footer .btn { min-height: 44px; min-width: 88px; }
  .notif-btn, .logout-btn { width: 44px; height: 44px; }
}

@media print {
  .sidebar, .btn, .modal-overlay, .toast-container, .search-input,
  .dept-tabs, .line-tabs, .page-actions { display: none !important; }
  .main-content { padding: 0; }
  .data-table th { background: #f0f0f0 !important; }
  .panel, .table-wrap { box-shadow: none; border: 1px solid #ccc; }
}

/* ========== 招聘标签页 ========== */
.rec-tab-header {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border);
}
.rec-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rec-tab-btn:hover { color: var(--primary); background: #eef4fa; }
.rec-tab-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
}
.rec-tab-badge {
  background: #E94D38;
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

/* ========== 简历邮箱 ========== */
.email-platform-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: #eef4fa;
  color: var(--primary);
  border: 1px solid #d0dff0;
}
.email-row { cursor: pointer; transition: background 0.15s; }
.email-row:hover { background: #fafbfc !important; }
.email-row td:first-child { font-size: 16px; }

/* 邮件详情弹窗 */
.email-detail-header {
  padding: 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
}
.email-detail-subject {
  font-size: 16px;
  color: var(--primary);
  margin-bottom: 8px;
}
.email-detail-meta {
  font-size: 13px;
  color: var(--secondary);
  line-height: 1.8;
}
.email-detail-meta div { margin-bottom: 2px; }
.email-detail-label { color: var(--secondary); font-weight: 500; }

.email-detail-info {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.email-detail-info h4, .email-detail-attachments h4, .email-detail-body h4 {
  font-size: 13px;
  color: var(--primary);
  margin: 0 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.email-detail-info .form-row { margin-bottom: 0; }
.email-detail-info .form-group { margin-bottom: 8px; }
.form-value {
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 14px;
  min-height: 32px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
}

.email-detail-attachments {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.email-attach-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 12px;
  color: #15803d;
}

.email-attach-link {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.email-attach-link:hover {
  background: #dcfce7;
  border-color: #86efac;
  text-decoration: underline;
}

.email-detail-body {
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}
.email-body-content {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
}
.email-body-content img { max-width: 100%; }
.email-body-content a { color: var(--primary); }

.email-detail-actions {
  padding: 16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  justify-content: center;
}

/* 匹配岗位选项 */
.match-rec-option {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}
.match-rec-option:hover {
  background: #f0f7ff;
  border-color: var(--primary);
}
.match-rec-option strong { flex-shrink: 0; }

/* 分页 */
.pagination { border-top: 1px solid var(--border); }
.pagination .btn[disabled] { opacity: 0.4; pointer-events: none; }

/* 行政事务 */
.aa-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ==================== 会议管理 ==================== */
.meeting-tabs { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }
.meeting-tab {
  padding: 8px 16px; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  cursor: pointer; font-size: 14px; color: var(--text-muted); transition: all .15s;
}
.meeting-tab:hover { border-color: var(--primary); }
.meeting-tab.active { background: var(--primary, #164E78); color: #fff; border-color: var(--primary, #164E78); }

.meeting-loading { padding: 30px; text-align: center; color: var(--text-muted); }

/* 提醒中心 */
.remind-banner {
  background: #fff4f1; border: 1px solid #f3c4ba; color: #b5371f;
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 6px 0 14px;
}
.remind-list { display: flex; flex-direction: column; gap: 10px; }
.remind-item {
  display: flex; gap: 14px; align-items: stretch; background: #fff;
  border: 1px solid var(--border); border-left: 4px solid #E94D38; border-radius: 10px; padding: 12px 14px;
}
.remind-item.today { background: #fff6f4; border-left-color: #E94D38; box-shadow: 0 0 0 2px #f6d8d1; }
.remind-when { text-align: center; min-width: 72px; display: flex; flex-direction: column; justify-content: center; border-right: 1px dashed var(--border); padding-right: 12px; }
.remind-days { font-size: 22px; font-weight: 700; color: #E94D38; }
.remind-days.d0 { font-size: 18px; }
.remind-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.remind-time { font-size: 12px; color: var(--text-muted); }
.remind-main { flex: 1; }
.remind-title { font-size: 16px; font-weight: 600; color: #164E78; }
.remind-meta { margin: 4px 0; }
.remind-people { font-size: 13px; color: #333; margin: 2px 0; }
.remind-agenda { font-size: 12px; color: var(--text-muted); }
.remind-actions { display: flex; flex-direction: column; gap: 6px; justify-content: center; }

/* 日程时间线 */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline-day { display: flex; gap: 14px; }
.timeline-date {
  min-width: 88px; font-weight: 600; color: #164E78; font-size: 14px;
  background: #eef4f9; border-radius: 8px; padding: 8px 10px; height: fit-content; text-align: center;
}
.timeline-items { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.timeline-item { display: flex; gap: 12px; cursor: pointer; }
.timeline-item:hover .timeline-card { border-color: #164E78; }
.timeline-time { min-width: 56px; text-align: right; font-size: 13px; color: #444; padding-top: 10px; }
.tl-end { color: var(--text-muted); font-size: 11px; }
.timeline-card {
  flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px;
  transition: all .15s;
}
.tl-title { font-weight: 600; color: #1a1a1a; }
.tl-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* 会议机制总览 */
.mechanism-note {
  background: #eef4f9; border: 1px solid #cfe0ee; color: #164E78;
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 6px 0 14px;
}
.meeting-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.meeting-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.mc-head { display: flex; justify-content: space-between; align-items: center; }
.mc-name { font-size: 16px; font-weight: 700; color: #164E78; }
.mc-freq { font-size: 13px; color: #444; margin: 6px 0 2px; }
.mc-block { font-size: 12px; color: #b5371f; margin: 2px 0; }
.mc-host { font-size: 13px; margin: 4px 0; }
.mc-att { font-size: 12px; color: var(--text-muted); }
.mc-agenda-title { font-size: 12px; font-weight: 600; color: #164E78; margin: 8px 0 4px; }
.agenda-list { margin: 0; padding-left: 18px; }
.agenda-list li { font-size: 12px; color: #333; margin: 2px 0; }
.mc-remind { font-size: 12px; color: #E94D38; margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }

/* 行动项红黄牌 */
.action-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.action-add .form-input { flex: 1; min-width: 140px; }
.card-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.card-todo { background: #eef4f9; color: #164E78; }
.card-yellow { background: #fff3d6; color: #9a6700; border: 1px solid #f0c869; }
.card-red { background: #fde4e1; color: #c0392b; border: 1px solid #e8a79f; }
.card-done { background: #e6f6ec; color: #1e7a46; }

/* ==================== 培训管理 ==================== */
.tabs { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  cursor: pointer; font-size: 14px; color: var(--text-muted); transition: all .15s;
}
.tab:hover { border-color: var(--primary); }
.tab.active { background: var(--primary, #164E78); color: #fff; border-color: var(--primary, #164E78); }

/* 培训日程时间线 */
.tr-schedule { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.tr-sch-item {
  display: flex; gap: 14px; align-items: stretch; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.tr-sch-item.soon { background: #fff6f4; border-left: 4px solid #E94D38; box-shadow: 0 0 0 2px #f6d8d1; }
.tr-sch-date { text-align: center; min-width: 64px; display: flex; flex-direction: column; justify-content: center; border-right: 1px dashed var(--border); padding-right: 12px; }
.tr-sch-day { font-size: 20px; font-weight: 800; color: #164E78; }
.tr-sch-wd { font-size: 12px; color: var(--text-muted); }
.tr-sch-main { flex: 1; }
.tr-sch-title { font-size: 15px; font-weight: 700; color: #164E78; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tr-sch-meta { font-size: 13px; color: #444; margin: 4px 0; }
.tr-sch-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tr-sch-act { display: flex; align-items: center; }
.tr-soon-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #fde4e1; color: #c0392b; border: 1px solid #e8a79f; }
.tr-reminded-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #e6f6ec; color: #1e7a46; border: 1px solid #b6e2c8; }

/* 执行统计 */
.tr-exec-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.tr-exec-card {
  flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.tr-exec-card span { font-size: 12px; color: var(--text-muted); }
.tr-exec-card b { font-size: 22px; color: #164E78; }
.tr-exec-card.ok b { color: #1e7a46; }
.tr-exec-card.bad b { color: #c0392b; }
.tr-exec-card.hl { background: #164E78; border-color: #164E78; }
.tr-exec-card.hl span { color: #cfe0ec; }
.tr-exec-card.hl b { color: #fff; }
.tr-bar { height: 8px; background: #eee; border-radius: 6px; overflow: hidden; margin: 4px 0 2px; min-width: 100px; }
.tr-bar-fill { height: 100%; background: linear-gradient(90deg, #164E78, #2e7d32); }

/* ============ 行政事务：审批栏 + 通知栏 ============ */
.aa-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.aa-panel { background: var(--card-bg); border: 1px solid var(--border-light); border-radius: 12px; padding: 14px 16px; }
.aa-panel-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 15px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.aa-panel-head .aa-panel-actions { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.aa-panel-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.aa-approval-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border-radius: 8px; background: var(--bg); font-size: 13px; }
.aa-approval-item .aa-ai-main { min-width: 0; flex: 1; }
.aa-approval-item .aa-ai-title { font-weight: 600; }
.aa-approval-item .aa-ai-sub { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.aa-approval-item .aa-ai-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.aa-notif-item { display: flex; gap: 10px; padding: 9px 11px; border-radius: 8px; background: var(--bg); font-size: 13px; align-items: flex-start; cursor: pointer; transition: background .15s; }
.aa-notif-item:hover { background: #e9ecf1; }
.aa-notif-item.unread { background: var(--primary-lighter); }
.aa-notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex: 0 0 auto; }
.aa-notif-dot.read { background: transparent; }
.aa-notif-body { flex: 1; min-width: 0; }
.aa-notif-title { font-weight: 600; }
.aa-notif-title .aa-notif-cat { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.aa-notif-content { color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.aa-st-count { font-style: normal; font-size: 11px; color: var(--text-muted); margin-left: 5px; font-weight: 400; }
.dept-tag.active .aa-st-count { color: #fff; font-weight: 600; }
.aa-notif-time { color: var(--text-muted); font-size: 11px; margin-top: 3px; }
@media (max-width: 900px) { .aa-panels { grid-template-columns: 1fr; } }


/* ========== 移动端宽表列优化（≤768px，纯展示层，不影响业务） ========== */
@media (max-width: 768px) {
  /* 表格滚动更顺滑 */
  .table-scroll { -webkit-overflow-scrolling: touch; }

  /* 表头/单元格紧凑化，表头不换行 */
  .data-table th, .data-table td { padding: 8px 8px; }
  .data-table th { white-space: nowrap; font-size: 12px; }

  /* 触控目标加大 */
  .data-table .btn-sm, .data-table .action-btn { min-height: 32px; min-width: 32px; }
  .data-table td a, .data-table td .link { padding: 6px 2px; display: inline-block; }

  /* ---- 各页宽表：隐藏次要列（th/td 同步隐藏） ---- */

  /* 员工管理（13列→7列）：隐藏 性别/拉线/手机号/学历/入职日期/试用期截止 */
  #emp-table th:nth-child(4), #emp-table td:nth-child(4),
  #emp-table th:nth-child(6), #emp-table td:nth-child(6),
  #emp-table th:nth-child(8), #emp-table td:nth-child(8),
  #emp-table th:nth-child(9), #emp-table td:nth-child(9),
  #emp-table th:nth-child(10), #emp-table td:nth-child(10),
  #emp-table th:nth-child(11), #emp-table td:nth-child(11) { display: none; }

  /* 薪酬管理（20列→9列）：隐藏 职位/出勤工资/绩效/津贴/全勤/平时H/平时费/休息H/休息费/社保/扣款 */
  .pay-table th:nth-child(4), .pay-table td:nth-child(4),
  .pay-table th:nth-child(7), .pay-table td:nth-child(7),
  .pay-table th:nth-child(8), .pay-table td:nth-child(8),
  .pay-table th:nth-child(9), .pay-table td:nth-child(9),
  .pay-table th:nth-child(10), .pay-table td:nth-child(10),
  .pay-table th:nth-child(11), .pay-table td:nth-child(11),
  .pay-table th:nth-child(12), .pay-table td:nth-child(12),
  .pay-table th:nth-child(13), .pay-table td:nth-child(13),
  .pay-table th:nth-child(14), .pay-table td:nth-child(14),
  .pay-table th:nth-child(16), .pay-table td:nth-child(16),
  .pay-table th:nth-child(17), .pay-table td:nth-child(17) { display: none; }

  /* 试用期考评（9列→5列）：隐藏 岗位/起止/各维度均分/考评人 */
  #page-probation .data-table th:nth-child(3), #page-probation .data-table td:nth-child(3),
  #page-probation .data-table th:nth-child(4), #page-probation .data-table td:nth-child(4),
  #page-probation .data-table th:nth-child(5), #page-probation .data-table td:nth-child(5),
  #page-probation .data-table th:nth-child(7), #page-probation .data-table td:nth-child(7) { display: none; }

  /* 离职管理（12列→6列）：隐藏 岗位/原因/交接/资产/财务/人事确认 */
  #page-offboarding .data-table th:nth-child(3), #page-offboarding .data-table td:nth-child(3),
  #page-offboarding .data-table th:nth-child(6), #page-offboarding .data-table td:nth-child(6),
  #page-offboarding .data-table th:nth-child(7), #page-offboarding .data-table td:nth-child(7),
  #page-offboarding .data-table th:nth-child(8), #page-offboarding .data-table td:nth-child(8),
  #page-offboarding .data-table th:nth-child(9), #page-offboarding .data-table td:nth-child(9),
  #page-offboarding .data-table th:nth-child(10), #page-offboarding .data-table td:nth-child(10) { display: none; }

  /* 招聘管理（11列→7列）：隐藏 候选人/优先级/面试官/发布日期 */
  #page-recruitment .data-table th:nth-child(6), #page-recruitment .data-table td:nth-child(6),
  #page-recruitment .data-table th:nth-child(7), #page-recruitment .data-table td:nth-child(7),
  #page-recruitment .data-table th:nth-child(9), #page-recruitment .data-table td:nth-child(9),
  #page-recruitment .data-table th:nth-child(10), #page-recruitment .data-table td:nth-child(10) { display: none; }

  /* 系统用户（6列→5列）：隐藏 部门 */
  #page-sysusers .data-table:not(.perm-matrix-table) th:nth-child(4),
  #page-sysusers .data-table:not(.perm-matrix-table) td:nth-child(4) { display: none; }

  /* 工作台-试用期到期（7列→5列）：隐藏 工号/岗位 */
  #dash-expiring-table th:nth-child(1), #dash-expiring-table td:nth-child(1),
  #dash-expiring-table th:nth-child(4), #dash-expiring-table td:nth-child(4) { display: none; }

  /* 工作台-会议提醒（5列→4列）：隐藏 主持人 */
  #dash-meeting-table th:nth-child(4), #dash-meeting-table td:nth-child(4) { display: none; }

  /* 考勤明细（14列→8列）：隐藏 部门/加班签到/加班签退/加班h/请假类型/来源 */
  .att-detail-table th:nth-child(3), .att-detail-table td:nth-child(3),
  .att-detail-table th:nth-child(8), .att-detail-table td:nth-child(8),
  .att-detail-table th:nth-child(9), .att-detail-table td:nth-child(9),
  .att-detail-table th:nth-child(10), .att-detail-table td:nth-child(10),
  .att-detail-table th:nth-child(12), .att-detail-table td:nth-child(12),
  .att-detail-table th:nth-child(13), .att-detail-table td:nth-child(13) { display: none; }

  /* 状态徽标不换行 */
  .data-table .badge { white-space: nowrap; }
}

/* ========== 移动端补丁2：部门图换行 + 操作行换行（≤768px） ========== */
@media (max-width: 768px) {
  /* 部门分布图：换行排布，不再撑破容器 */
  .dept-chart { flex-wrap: wrap; height: auto; row-gap: 14px; }
  .dept-col { flex: 1 1 72px; height: 150px; }

  /* 考勤页企微操作按钮行：允许换行 */
  .wecom-actions, .btn-group, .page-actions, .filter-bar { flex-wrap: wrap; }
  .wecom-actions .btn { flex: 1 1 auto; }

  /* 表格操作按钮组不换行但可滚动 */
  .data-table td .btn-group { flex-wrap: nowrap; }
}

/* ========== 移动端补丁3：企微面板 + 操作行（≤768px） ========== */
@media (max-width: 768px) {
  /* 企微面板：左右两块改为上下堆叠，actions 占满宽度 */
  .wecom-panel { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
  .wecom-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .wecom-actions .btn { flex: none; min-width: 0; padding: 9px 6px; font-size: 13px; }

  /* 页面通用操作行（页头下方筛选/按钮组）：每项占满一行 */
  .page-actions, .filter-bar, .att-filters { flex-direction: column; align-items: stretch; }
  .page-actions > *,
  .page-actions .search-box,
  .page-actions input,
  .page-actions select,
  .page-actions button { width: 100% !important; max-width: 100% !important; }
  .page-actions .search-input { width: 100%; }
}
