﻿/* 钲鹏机床ERP - 打卡排班管理样式（企业微信风格） */

/* ==================== 班次卡片 V2（三时段） ==================== */
.shift-card-v2 .shift-card-body {
  padding: 10px 16px;
}

.shift-card-v2 .shift-total-hours {
  font-size: 14px;
  font-weight: 700;
  color: #1a73e8;
  background: #e8f0fe;
  padding: 4px 12px;
  border-radius: 14px;
}

.shift-periods {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shift-period-item {
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #ddd;
}

.shift-period-item.shift-period-ot {
  background: #fff8f0;
  border-left-color: #F5A623;
}

.shift-period-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.shift-period-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.shift-period-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================== 班次表单V2 ==================== */
.shift-form-v2 {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 4px;
}

.shift-form-section {
  margin-bottom: 16px;
}

.shift-form-section h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

.form-grid-4col {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .form-grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== 打卡多时段表格 ==================== */
.punch-multi-table {
  min-width: 1100px;
}

.punch-multi-table thead th.period-header {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 8px;
}

.punch-multi-table thead th.morning-header {
  background: #e8f4fd;
  color: var(--primary);
}

.punch-multi-table thead th.afternoon-header {
  background: #fff8e8;
  color: #F5A623;
}

.punch-multi-table thead th.overtime-header {
  background: #f0e8ff;
  color: #8B5CF6;
}

.punch-multi-table thead th.sub-header {
  font-size: 11px;
  font-weight: 500;
  color: #888;
  padding: 4px 6px;
  background: #fafafa;
}

.punch-multi-table tbody td {
  vertical-align: middle;
  text-align: center;
  padding: 6px 4px;
}

/* ==================== 考勤统计多时段表格 ==================== */
.att-multi-table {
  min-width: 1200px;
}
.shift-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.shift-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.shift-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.shift-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 0;
}

.shift-name {
  font-size: 16px;
  font-weight: 700;
}

.shift-code {
  font-size: 12px;
  color: var(--text-muted);
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 4px;
}

.shift-card-body {
  padding: 14px 20px;
}

.shift-time-range {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 8px;
}

.shift-time-icon {
  font-size: 20px;
}

.shift-time-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}

.shift-hours {
  margin-left: auto;
  font-size: 13px;
  background: #e8f0fe;
  color: #1a73e8;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.shift-detail-row {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.shift-card-actions {
  padding: 10px 20px 16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid #f0f0f0;
}

/* ==================== 排班组卡片 ==================== */
.group-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.group-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.group-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.group-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.group-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.group-count {
  font-size: 13px;
  color: var(--text-light);
  background: #f0f0f0;
  padding: 3px 10px;
  border-radius: 12px;
}

.group-card-body {
  padding: 14px 20px;
}

.group-default-shift {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}

.shift-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.group-members {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
}

.group-card-actions {
  padding: 10px 20px 16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid #f0f0f0;
}

/* ==================== 排班日历 ==================== */
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 900px;
}

.calendar-table thead th {
  background: #f8f9fa;
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-light);
  border-bottom: 2px solid var(--border);
}

.calendar-table tbody td {
  vertical-align: top;
  height: 110px;
  padding: 6px;
  border: 1px solid #f0f0f0;
  cursor: default;
}

.cal-empty {
  background: #fafafa;
}

.cal-cell {
  background: white;
  transition: background 0.15s ease;
}

.cal-cell:hover {
  background: #f8fbff;
}

.cal-weekend {
  background: #fdfdff;
}

.cal-weekend .cal-day-num {
  color: #c0c0c0;
}

.cal-day-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  padding: 0 4px;
}

.cal-schedules {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 80px;
  overflow-y: auto;
}

.cal-sched-item {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-sched-item:hover {
  filter: brightness(0.95);
}

.cal-sched-emp {
  font-weight: 600;
  margin-right: 4px;
}

.cal-sched-shift {
  opacity: 0.8;
}

/* ==================== 打卡表格 ==================== */
.punch-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.punch-in-out {
  display: flex;
  gap: 16px;
}

.punch-time-block {
  text-align: center;
}

.punch-time-block .time {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.punch-time-block .label {
  font-size: 11px;
  color: var(--text-muted);
}

.punch-time-block .status {
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}

.punch-divider {
  width: 1px;
  height: 40px;
  background: #e0e0e0;
}

/* ==================== 考勤统计 ==================== */
.att-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.att-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.att-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.att-card-name {
  font-size: 16px;
  font-weight: 700;
}

.att-card-dept {
  font-size: 12px;
  color: var(--text-muted);
}

.att-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.att-stat-item {
  text-align: center;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
}

.att-stat-value {
  font-size: 20px;
  font-weight: 700;
}

.att-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.att-rate-bar {
  margin-top: 12px;
  height: 6px;
  background: #e8eaed;
  border-radius: 3px;
  overflow: hidden;
}

.att-rate-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ==================== checkbox 网格 ==================== */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .shift-card-grid,
  .group-card-grid {
    grid-template-columns: 1fr;
  }
  
  .calendar-table {
    font-size: 12px;
  }
  
  .calendar-table tbody td {
    height: 80px;
  }

  .att-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== 多人排班表（企业微信风格） ==================== */
.sched-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sched-multi-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  table-layout: auto;
}

.sched-multi-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8f9fa;
  padding: 8px 2px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  border-right: 1px solid #eee;
  min-width: 42px;
  white-space: nowrap;
}

.sched-multi-table thead th.sched-fixed-col {
  position: sticky;
  z-index: 3;
  background: #e8ecf0;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
}

.sched-multi-table thead th.sched-name-col {
  left: 0;
  min-width: 100px;
}

.sched-multi-table thead th.sched-dept-col {
  left: 100px;
  min-width: 140px;
}

.sched-multi-table tbody td {
  padding: 4px 2px;
  text-align: center;
  border: 1px solid #f0f0f0;
  font-size: 12px;
  vertical-align: middle;
  transition: background 0.15s ease;
  min-width: 42px;
  height: 36px;
}

.sched-multi-table tbody td.sched-fixed-col {
  position: sticky;
  z-index: 1;
  background: #fff;
  text-align: left;
  padding: 4px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.sched-multi-table tbody td.sched-name-col {
  left: 0;
}

.sched-multi-table tbody td.sched-dept-col {
  left: 100px;
}

.sched-multi-table tbody tr:hover td.sched-fixed-col {
  background: #f8fbff;
}

.sched-multi-table tbody tr:hover td:not(.sched-fixed-col) {
  background: #f8fbff;
}

.sched-weekend-col,
.sched-weekend-cell {
  background: #fafafa !important;
}

.sched-weekend-col .sched-dow {
  color: #d0d0d0;
}

.sched-date-col {
  position: relative;
}

.sched-dow {
  font-size: 10px;
  color: #999;
  font-weight: 400;
}

.sched-dept-sep td {
  position: sticky;
  z-index: 1;
}

.sched-dept-sep td.sched-fixed-col {
  left: 0;
  z-index: 2;
}

.sched-emp-name {
  font-weight: 600;
  color: var(--text);
}

.sched-emp-dept {
  font-size: 12px;
  color: var(--text-light);
}

.sched-cell {
  cursor: pointer;
  position: relative;
}

.sched-cell:hover {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  z-index: 1;
}

.sched-cell-text {
  display: block;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sched-cell-select {
  width: 100%;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 11px;
  background: transparent;
  cursor: pointer;
  text-align: center;
  outline: none;
}

.sched-cell-select:focus {
  border-color: var(--primary);
  background: #fff;
}

.shift-menu-item:hover {
  background: var(--primary-bg);
}

/* 部门筛选 */
.sched-dept-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sched-dept-filter .dept-chip {
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  transition: all 0.15s ease;
}

.sched-dept-filter .dept-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.sched-dept-filter .dept-chip:hover {
  border-color: var(--primary);
}

/* ==================== 批量排班：姓名/日期可点击 ==================== */
.sched-name-clickable {
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}
.sched-name-clickable:hover {
  background: #e8f0fe !important;
}
.sched-name-clickable .sched-emp-name {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--primary);
}
.sched-name-clickable::after {
  content: '✎';
  position: absolute;
  right: 8px;
  font-size: 11px;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.15s;
}
.sched-name-clickable:hover::after {
  opacity: 1;
}

.sched-date-clickable {
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.sched-date-clickable:hover {
  background: #e8f0fe !important;
  color: #1A73E8;
}
.sched-date-clickable::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.15s;
}
.sched-date-clickable:hover::after {
  opacity: 0.6;
}

/* ==================== 考勤机管理 ==================== */
.att-device-card {
  transition: all 0.2s ease;
}
.att-device-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.att-device-grid {
  padding: 16px;
}

@media (max-width: 768px) {
  .att-device-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 考勤统计进度条 */
.att-rate-bar {
  margin-top: 8px;
  height: 6px;
  background: #e8eaed;
  border-radius: 3px;
  overflow: hidden;
}
.att-rate-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.att-rate-fill.excellent {
  background: linear-gradient(90deg, #7ED321, #2ecc71);
}
.att-rate-fill.warning {
  background: linear-gradient(90deg, #F5A623, #f39c12);
}
.att-rate-fill.danger {
  background: linear-gradient(90deg, #D0021B, #e74c3c);
}
