/**
 * 学术考勤 · 样式表
 * 前缀: attn- (academic-attendance)
 */

/* ── 页面容器 ────────────────────────────────────────── */
.attn-page { padding: 20px; font-family: inherit; color: #333; }

/* ── Header ──────────────────────────────────────────── */
.attn-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.attn-header h2 { margin: 0; font-size: 20px; font-weight: 600; }

/* ── Tab 导航 ────────────────────────────────────────── */
.attn-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid #f0f0f0; }
.attn-tab {
  padding: 10px 20px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: #666; position: relative; transition: color 0.2s;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.attn-tab:hover { color: #F18D24; }
.attn-tab.active { color: #F18D24; font-weight: 600; border-bottom-color: #F18D24; }

/* ── 工具栏 ──────────────────────────────────────────── */
.attn-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

/* ── 输入框/选择框 ────────────────────────────────────── */
.attn-input, .attn-select {
  padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px;
  font-size: 14px; outline: none; transition: border-color 0.2s; background: #fff;
}
.attn-input:focus, .attn-select:focus { border-color: #F18D24; }
.attn-input { min-width: 160px; }
.attn-select { min-width: 120px; cursor: pointer; }
.attn-date-input { width: 150px; }
.attn-date-sep { color: #999; font-size: 13px; padding: 0 2px; }
.attn-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px;
  font-size: 14px; resize: vertical; min-height: 60px; outline: none; font-family: inherit;
}
.attn-textarea:focus { border-color: #F18D24; }

/* ── 按钮 ────────────────────────────────────────────── */
.attn-btn {
  padding: 8px 16px; border: 1px solid #d9d9d9; border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.attn-btn:hover { border-color: #F18D24; color: #F18D24; }
.attn-btn-primary { background: #F18D24; border-color: #F18D24; color: #fff; }
.attn-btn-primary:hover { background: #e07d1a; color: #fff; }
.attn-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.attn-btn-danger { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }
.attn-btn-danger:hover { background: #e04343; color: #fff; }
.attn-btn-success { background: #52c41a; border-color: #52c41a; color: #fff; }
.attn-btn-success:hover { background: #45a818; color: #fff; }
.attn-btn-sm {
  padding: 4px 10px; border: 1px solid #d9d9d9; border-radius: 4px;
  background: #fff; cursor: pointer; font-size: 12px; transition: all 0.2s;
}
.attn-btn-sm:hover { border-color: #F18D24; color: #F18D24; }
.attn-btn-sm[disabled] { opacity: 0.5; cursor: not-allowed; }
.attn-btn-close {
  background: none; border: none; font-size: 22px; cursor: pointer; color: #999; padding: 0 8px; line-height: 1;
}
.attn-btn-close:hover { color: #333; }

/* ── 汇总卡片 ────────────────────────────────────────── */
.attn-summary-cards { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.attn-summary-card {
  flex: 1; min-width: 120px; padding: 16px 20px; border-radius: 8px;
  background: #fff; border-left: 4px solid #ddd; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.attn-card-label { font-size: 13px; color: #999; margin-bottom: 6px; }
.attn-card-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.attn-card-present { border-left-color: #52c41a; }
.attn-card-present .attn-card-value { color: #52c41a; }
.attn-card-late { border-left-color: #faad14; }
.attn-card-late .attn-card-value { color: #faad14; }
.attn-card-absent { border-left-color: #ff4d4f; }
.attn-card-absent .attn-card-value { color: #ff4d4f; }
.attn-card-leave { border-left-color: #1890ff; }
.attn-card-leave .attn-card-value { color: #1890ff; }

/* ── 区块标题 ────────────────────────────────────────── */
.attn-section-title { font-size: 16px; font-weight: 600; margin: 20px 0 12px; color: #333; }

/* ── 表格 ────────────────────────────────────────────── */
.attn-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.attn-table th {
  background: #fafafa; padding: 10px 12px; text-align: left; font-weight: 600;
  border-bottom: 1px solid #f0f0f0; white-space: nowrap;
}
.attn-table td { padding: 10px 12px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.attn-table tr:hover { background: #fafafa; }
.attn-table .attn-leave-actions { white-space: nowrap; display: flex; gap: 4px; }

/* ── 徽标 ────────────────────────────────────────────── */
.attn-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500;
}
.attn-badge-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.attn-badge-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.attn-badge-danger  { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.attn-badge-info    { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.attn-text-muted { color: #999; font-size: 13px; }

/* ── 状态提示 ────────────────────────────────────────── */
.attn-loading, .attn-empty {
  text-align: center; padding: 60px 20px; color: #999; font-size: 15px;
}

/* ── 分页 ────────────────────────────────────────────── */
.attn-pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 12px; margin-top: 16px; font-size: 14px; color: #666;
}

/* ── 隐藏 ────────────────────────────────────────────── */
.attn-hidden { display: none !important; }

/* ── 弹窗 ────────────────────────────────────────────── */
.attn-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex;
  align-items: center; justify-content: center; z-index: 9999;
}
.attn-modal {
  background: #fff; border-radius: 10px; width: 560px; max-width: 95vw;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 6px 30px rgba(0,0,0,0.15);
}
.attn-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid #f0f0f0;
}
.attn-modal-header h3 { margin: 0; font-size: 17px; font-weight: 600; }
.attn-modal-content { padding: 20px; }
.attn-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid #f0f0f0;
}

/* ── 签到弹窗 ────────────────────────────────────────── */
.attn-checkin-modal .attn-checkin-students {
  max-height: 250px; overflow-y: auto; border: 1px solid #f0f0f0;
  border-radius: 6px; padding: 8px;
}
.attn-student-check-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; cursor: pointer; border-radius: 4px; font-size: 14px;
}
.attn-student-check-row:hover { background: #fafafa; }
.attn-student-check-row input[type="checkbox"] { cursor: pointer; }
.attn-student-manual { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.attn-select-all { border-bottom: 1px solid #f0f0f0; margin-bottom: 4px; padding-bottom: 8px; font-weight: 500; }

/* ── 报表区域 ────────────────────────────────────────── */
.attn-report-section { margin-bottom: 20px; }
.attn-chart-container {
  background: #fff; border-radius: 8px; padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 16px;
  max-width: 800px;
}

/* ── 表单 ────────────────────────────────────────────── */
.attn-form-group { margin-bottom: 14px; }
.attn-form-group label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: #555; }
.attn-form-row { display: flex; gap: 12px; }
.attn-form-row .attn-form-group { flex: 1; }
.attn-required { color: #ff4d4f; }

/* ── 请假操作 ────────────────────────────────────────── */
.attn-leave-actions { display: flex; gap: 6px; }
.attn-leave-actions .attn-btn-sm { min-width: 50px; }

/* ── 列表内容区域 ────────────────────────────────────── */
.attn-list-content { min-height: 200px; }
.attn-leaves-content { min-height: 200px; }
.attn-report-content { min-height: 200px; }

/* ── 响应式 ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .attn-toolbar { flex-direction: column; align-items: stretch; }
  .attn-form-row { flex-direction: column; }
  .attn-modal { width: 95vw; }
  .attn-summary-cards { flex-direction: column; }
  .attn-summary-card { min-width: auto; }
  .attn-tabs { overflow-x: auto; white-space: nowrap; }
  .attn-table { font-size: 13px; }
  .attn-table th, .attn-table td { padding: 8px 6px; }
  .attn-date-input { width: 100%; }
}
