/* ===== 设计系统变量 ===== */
:root {
  --bg-primary: #0a0b14;
  --bg-secondary: #0f1120;
  --bg-card: #131626;
  --bg-card-hover: #1a1f36;
  --bg-input: #1a1f36;
  --border: rgba(99, 102, 241, 0.15);
  --border-light: rgba(255, 255, 255, 0.06);
  
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --rose: #f43f5e;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --header-h: 64px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(99,102,241,0.15);
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans SC', 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 侧边栏 ===== */
:root {
  --sidebar-w: 196px;
  --topbar-h: 52px;
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(10, 11, 20, 0.97);
  border-right: 1px solid var(--border-light);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.logo-icon svg { width: 32px; height: 32px; }

.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.logo-sub   { font-size: 10px; color: var(--text-muted); }

/* 底部用户信息区 */
.sidebar-user {
  flex-shrink: 0;
  border-top: 1px solid var(--border-light);
  padding: 12px 10px;
  margin-top: auto;
}

/* 分组标签（可折叠） */
.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.nav-group-label:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
}
.nav-group-label .nav-group-arrow {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s ease;
  opacity: .6;
}
.nav-group-label.collapsed .nav-group-arrow {
  transform: rotate(-90deg);
}
/* 折叠容器过渡 */
.nav-group-items {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: max-height .28s ease, opacity .22s ease;
  max-height: 600px;
  opacity: 1;
}
.nav-group-items.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

/* 竖向导航 */
.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  flex: 1;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}

/* 子级导航：与普通 nav-tab 完全对齐 */
.nav-sub-tab:hover {
  color: var(--text-primary);
}
.nav-sub-tab.active {
  color: #a5b4fc;
}


.nav-tab:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

.nav-tab.active {
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent-light);
  font-weight: 500;
  border-left: 3px solid var(--accent);
  padding-left: 7px;
}

.tab-icon { font-size: 14px; flex-shrink: 0; }

/* ===== 顶部精简栏 ===== */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(10, 11, 20, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.badge-month {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  box-shadow: 0 0 14px var(--accent-glow);
}

/* ===== 主内容 ===== */
.main {
  margin-left: var(--sidebar-w);
  padding: 24px;
  min-height: 100vh;
  box-sizing: border-box;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-content.active {
  display: block;
}

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

/* ===== 上传区域 ===== */
.upload-hero {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 120px);
  padding-top: 40px;
  position: relative;
}

.upload-decoration {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.upload-center {
  width: 100%;
  max-width: 620px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.upload-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.upload-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 0 30px rgba(99,102,241,0.15);
}

.upload-center h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #f1f5f9 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.upload-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.drop-zone {
  border: 2px dashed rgba(99,102,241,0.4);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(99,102,241,0.03);
  margin-bottom: 24px;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99,102,241,0.08);
  box-shadow: 0 0 30px rgba(99,102,241,0.1);
}

.drop-anim { margin-bottom: 16px; }

.drop-svg {
  width: 56px;
  height: 56px;
  color: var(--accent-light);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.drop-main {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.drop-or {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.btn-upload {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border: none;
  color: white;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}

.btn-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99,102,241,0.5);
}

/* 进度条 */
.upload-progress {
  margin-bottom: 20px;
}

.upload-progress.hidden { display: none; }

.progress-bar-wrap {
  height: 6px;
  background: rgba(99,102,241,0.15);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 10px;
  width: 0;
  transition: width 0.3s ease;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { box-shadow: 0 0 8px rgba(99,102,241,0.5); }
  50% { box-shadow: 0 0 20px rgba(139,92,246,0.7); }
  100% { box-shadow: 0 0 8px rgba(99,102,241,0.5); }
}

.progress-text {
  color: var(--text-secondary);
  font-size: 13px;
}

/* 使用说明提示 */
.upload-tips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.tip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.tip-icon { font-size: 16px; }

/* 内置Demo */
.demo-section { text-align: center; }

.demo-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.demo-divider::before, .demo-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.btn-demo {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--cyan);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-demo:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

/* ===== 面板通用 ===== */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.data-badge {
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--accent-light);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.btn-export {
  background: linear-gradient(135deg, var(--green), #059669);
  border: none;
  color: white;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

/* ===== KPI卡片 ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s;
}

.kpi-card:hover {
  border-color: var(--border);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 图表区域 ===== */
.charts-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
}



.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-value {
  margin-left: auto;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== 表格卡片 ===== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: visible;
}

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

.table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.table-search-wrap {
  flex-shrink: 0;
}

.table-search, .filter-input, .filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 7px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 200px;
}

.filter-select { cursor: pointer; }

.table-search:focus, .filter-input:focus, .filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.table-scroll {
  overflow-x: auto;
  cursor: grab;
  user-select: none;     /* 拖拽时禁止文字选中 */
}
.table-scroll.drag-active {
  cursor: grabbing;
}

/* 只对含31天日历列的宽表格面板固定高度，使水平滚动条始终在视口内 */
#panel-injection .table-scroll,
#panel-dayshift  .table-scroll,
#panel-overtime  .table-scroll,
#panel-totalot   .table-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 170px);
}


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

/* ─── 含31天打卡列的表格：直接限定表格最小宽度，强制横向滚动 ─── */
/* overtime-table 类名被 注塑/长白班/职员/总加班 四个表格共用        */
/* width:100% 让表格与容器同宽，必须用 min-width 覆盖才能溢出         */
.overtime-table {
  min-width: 2000px;       /* 6信息列(~480px)+31天列(~1860px)≈2340px */
}
.overtime-table th,
.overtime-table td {
  min-width: 60px;
}
.overtime-table th:nth-child(-n+6),
.overtime-table td:nth-child(-n+6) {
  min-width: 80px;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  background: rgba(0,0,0,0.2);
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: rgba(99,102,241,0.05);
  color: var(--text-primary);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.tag-病假 { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }
.tag-年假 { background: rgba(99,102,241,0.1); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }
.tag-事假 { background: rgba(245,158,11,0.1); color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }
.tag-调休 { background: rgba(6,182,212,0.1); color: #67e8f9; border: 1px solid rgba(6,182,212,0.2); }
.tag-育儿假 { background: rgba(16,185,129,0.1); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2); }
.tag-通过 { background: rgba(16,185,129,0.1); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2); }
.tag-异常 { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

/* ===== 人员查询 ===== */
.search-box-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto 28px;
}

.search-big {
  position: relative;
}

.search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-big-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 14px 16px 14px 44px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.search-big-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}

.quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 4px 2px;
}

.quick-chip {
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--accent-light);
  cursor: pointer;
  transition: all 0.2s;
}

.quick-chip:hover {
  background: rgba(99,102,241,0.15);
  border-color: var(--accent);
}

/* 人员卡片 */
.person-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

.person-card.hidden { display: none; }

.person-header {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  border-bottom: 1px solid var(--border-light);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.person-avatar {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}

.person-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.person-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.person-stats {
  margin-left: auto;
  display: flex;
  gap: 20px;
}

.person-stat {
  text-align: center;
}

.person-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-light);
}

.person-stat-lab {
  font-size: 11px;
  color: var(--text-muted);
}

.person-body {
  padding: 24px;
}

.person-section {
  margin-bottom: 24px;
}

.person-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.person-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.person-item-label {
  flex: 1;
  color: var(--text-secondary);
}

.person-item-val {
  color: var(--text-primary);
  font-weight: 500;
}

.person-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 10px 0;
}

/* 空提示 */
.empty-hint {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-hint p { font-size: 14px; }

/* ===== 考勤大表（51列）===== */
.attend-table {
  width: max-content;
  table-layout: auto;
}

.attend-table th {
  font-size: 11px;
  white-space: nowrap;
  padding: 10px 7px;
}

.attend-table td {
  font-size: 12px;
  padding: 8px 7px;
  white-space: nowrap;
}

.attend-table .col-seq {
  width: 36px;
  text-align: center;
}

/* 考勤表分页栏 */
.attend-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 10px;
}

.attend-page-info {
  font-size: 13px;
  color: var(--text-muted);
}

.attend-page-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attend-page-label {
  font-size: 13px;
  color: var(--text-muted);
}

.attend-page-size {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.attend-page-size:focus {
  border-color: var(--accent);
}

.attend-page-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.attend-page-btn:hover:not(:disabled) {
  background: rgba(99,102,241,0.15);
  border-color: var(--accent);
  color: var(--accent-light);
}
.attend-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.attend-page-num {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 50px;
  text-align: center;
}

/* 序号列：按"102"（3位数）固定宽度 */
.attend-table .col-no {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
}
.attend-table td:first-child {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  color: var(--text-secondary);
  overflow: hidden;
}

/* 在职/离职筛选按钮组 */
.resign-filter {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.resign-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.resign-btn:not(:last-child) {
  border-right: 1px solid var(--border-light);
}
.resign-btn:hover {
  background: rgba(99,102,241,0.1);
  color: var(--text-primary);
}
.resign-btn.active {
  background: var(--accent);
  color: #fff;
}
/* 已离职行：背景叠加灰色，文字用次要色（仍可读），OT列单独保持醒目 */
.attend-table tr.row-resigned td {
  color: var(--text-secondary);           /* #94a3b8，深色背景下清晰可读 */
  background: rgba(100,116,139,0.06);     /* 微妙灰底 */
}
/* 平日加班(17th td) / 周末加班(18th td)：保持绿/橙颜色完全可见 */
.attend-table tr.row-resigned td:nth-child(17) {
  color: #10b981 !important;
  background: rgba(16,185,129,0.12) !important;
  font-weight: 700 !important;
}
.attend-table tr.row-resigned td:nth-child(18) {
  color: #f59e0b !important;
  background: rgba(245,158,11,0.12) !important;
  font-weight: 700 !important;
}
/* 姓名列「 离职」角标 */
.attend-table tr.row-resigned td:nth-child(5) strong::after {
  content: '\00a0离职';
  font-size: 10px;
  font-weight: 600;
  color: #f87171;
  background: rgba(248,113,113,0.15);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* 考勤表功能按钮 */
.btn-attend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-attend-import {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}
.btn-attend-import:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99,102,241,0.5);
}

.btn-attend-export {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.btn-attend-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16,185,129,0.45);
}

.btn-attend-tpl {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  color: var(--accent-light);
}
.btn-attend-tpl:hover {
  background: rgba(99,102,241,0.18);
  border-color: var(--accent);
}

.btn-attend-clear {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}
.btn-attend-clear:hover {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
  box-shadow: 0 0 16px rgba(239,68,68,0.15);
}

/* ===== 加班明细表 ===== */
.overtime-table {
  width: max-content;
}

/* 日期格：超窄 */
.overtime-table .ot-day {
  min-width: 28px;
  max-width: 36px;
  text-align: center;
  font-size: 11px;
  padding: 6px 3px;
}

/* 注塑考勤日期格：需要更宽显示多行打卡时间 */
.overtime-table .inj-day {
  min-width: 68px;
  max-width: 90px;
  text-align: center;
  font-size: 10px;
  padding: 4px 3px;
  line-height: 1.5;
  vertical-align: top;
  white-space: normal;
  word-break: keep-all;
}

/* 加班工时徽章 */
.inj-ot-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 5px;
  border-radius: 10px;
  border: 1px solid rgba(16,185,129,0.3);
  font-size: 9px;
  font-weight: 700;
  background: rgba(0,0,0,0.15);
  letter-spacing: 0.3px;
}

/* 打卡行：底部无分隔线 */
.inj-punch-row td {
  border-bottom: none !important;
}

/* 工时行：微蓝底色、较小高度 */
.inj-ot-row td {
  background: rgba(99,102,241,0.05);
  border-top: 1px dashed rgba(99,102,241,0.15) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 2px 3px !important;
}

/* 工时行第一格标签 */
.inj-ot-row .inj-ot-label {
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* 工时值格 */
.inj-ot-cell {
  padding: 2px 3px !important;
}

/* 星期行 */
.overtime-table .ot-head-2 th {
  font-size: 10px;
  color: var(--text-muted);
  padding: 4px 3px;
  background: rgba(99,102,241,0.06);
}

/* 汇总列表头 */
.overtime-table th.ot-sum {
  background: rgba(99,102,241,0.12);
  color: var(--accent-light);
  font-size: 11px;
  min-width: 70px;
}

/* 汇总列数据格有值时 */
.overtime-table td.ot-sum {
  background: rgba(99,102,241,0.05);
  text-align: center;
  font-size: 12px;
}
.overtime-table td.ot-sum.ot-sum-val {
  color: var(--accent-light);
  font-weight: 700;
}

/* 平时加班列（一至五）：蓝 */
.overtime-table th.ot-sum-weekday {
  background: rgba(99,102,241,0.2);
  color: var(--accent-light);
}
.overtime-table td.ot-weekday {
  color: var(--accent-light);
  font-weight: 700;
  background: rgba(99,102,241,0.07);
}

/* 周日加班列（六日）：橙 */
.overtime-table th.ot-sum-weekend {
  background: rgba(245,158,11,0.22);
  color: var(--amber);
}
.overtime-table td.ot-weekend {
  color: var(--amber);
  font-weight: 700;
  background: rgba(245,158,11,0.07);
}

/* 表头 small 标签 */
.overtime-table th small {
  font-size: 9px;
  opacity: 0.75;
  display: block;
  font-weight: 400;
  margin-top: 2px;
}

/* ===== 导入明细块 ===== */

.rawdata-block {
  margin-bottom: 28px;
}

.rawdata-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 16px;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius);
}

.rawdata-icon { font-size: 18px; }

.rawdata-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.rawdata-count {
  margin-left: auto;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.25);
  color: var(--accent-light);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* ===== Toast通知 ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  min-width: 280px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 52px; }
  .sidebar-logo { padding: 14px 10px; justify-content: center; }
  .logo-text { display: none; }
  .nav-group-label { display: none; }
  .nav-tab { justify-content: center; padding: 10px 0; }
  .nav-tab span:not(.tab-icon) { display: none; }
  .tab-icon { font-size: 17px; }
  .main { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 22px; }
  .filter-input, .table-search { width: 140px; }
  .sidebar-user { padding: 10px 4px; }
}


/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* Canvas 图表适应容器 */
canvas { max-width: 100%; }

/* 长白班 & 职员加班考勤：表格内容全部居中 */
#dayshiftTable td,
#overtimeTable td {
  text-align: center;
}


/* 登录验证通过的淡入动画（纯 opacity，不加 transform 避免破坏 fixed 定位） */
@keyframes authFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== 冻结列（左右滚动时固定） ===== */
.freeze-th {
  position: sticky !important;
  z-index: 4;
  background: #0e0f1a;
}
.freeze-td {
  position: sticky !important;
  z-index: 2;
  background: #14151f;
}
/* 冻结列右边框分隔线 */
.freeze-last-th { border-right: 2px solid rgba(99,102,241,0.4) !important; }
.freeze-last-td { border-right: 2px solid rgba(99,102,241,0.25) !important; }
