.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  min-height: 0;
  flex: 1;
}

.hidden {
  display: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.card-title {
  font-size: 14px;
  color: #6b7280;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 6px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.list {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #fff;
  padding: 22px 26px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
}

.muted {
  color: #94a3b8;
  margin-top: 4px;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 20px;
  padding: 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 50% auto -40px 60%;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.stat-icon {
  font-size: 28px;
}

.stat-meta {
  position: relative;
  z-index: 1;
}

.stat-label {
  font-size: 14px;
  margin: 0;
  opacity: 0.85;
}

.stat-value {
  font-size: 30px;
  margin: 4px 0;
}

.stat-change {
  font-size: 13px;
  opacity: 0.9;
}

.accent-blue {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.accent-green {
  background: linear-gradient(135deg, #059669, #34d399);
}

.accent-cyan {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
}

.accent-yellow {
  background: linear-gradient(135deg, #ca8a04, #facc15);
  color: #1f2937;
}

/* 可點擊統計卡片樣式 */
.stat-card.clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.stat-card.clickable:active {
  transform: translateY(0);
}

.stat-hint {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card.clickable:hover .stat-hint {
  opacity: 0.7;
}

/* 月度課程預覽模態框樣式 */
.monthly-courses-preview-modal {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  min-width: 200px;
  text-align: center;
}

/* 標題旁沒有導航按鈕時（如學生統計彈窗），min-width+center 會在左側留出空白，改為靠左 */
.modal-nav .modal-title:only-child {
  min-width: 0;
  text-align: left;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
}

.nav-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #475569;
}

.nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.nav-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 16px;
}

.retry-btn {
  margin-top: 12px;
  padding: 8px 16px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.retry-btn:hover {
  background: #2563eb;
}

.monthly-courses-preview {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.preview-summary {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.summary-stat .stat-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 4px;
}

.summary-stat .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.preview-courses-list h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.courses-by-date {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.date-group {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.date-title {
  margin: 0;
  padding: 12px 16px;
  background: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.courses-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
}

.course-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.course-item:last-child {
  border-bottom: none;
}

.course-time {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  min-width: 80px;
  padding: 4px 8px;
  background: #f8fafc;
  border-radius: 6px;
  text-align: center;
}

.course-info {
  flex: 1;
  min-width: 0;
}

.course-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.course-type {
  font-size: 11px;
  padding: 2px 6px;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 4px;
  font-weight: 500;
}

.course-status {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.course-status.upcoming {
  background: #fef3c7;
  color: #92400e;
}

.course-status.ongoing {
  background: #dcfce7;
  color: #166534;
}

.course-status.completed {
  background: #f3f4f6;
  color: #6b7280;
}

.student-count {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.no-courses {
  text-align: center;
  color: #94a3b8;
  font-style: italic;
  padding: 16px;
  margin: 0;
}

.preview-empty {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

.preview-empty p {
  margin: 0;
  font-size: 16px;
}

