/* ============================================
   Students Page — Specific Styles
   Extends base styles.css
   ============================================ */

/* Page Content */
.page-content {
  padding: 24px 30px 44px;
}

/* ---- Toolbar ---- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-box-lg {
  min-width: 280px;
  flex: 1;
  max-width: 360px;
}

.filter-group {
  display: flex;
  gap: 8px;
}

.select-filter {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  transition: all var(--t-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.select-filter:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-base);
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary .material-symbols-rounded {
  font-size: 18px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: rgba(66, 133, 244, 0.2);
}

.btn-secondary .material-symbols-rounded {
  font-size: 17px;
}

.btn-warning {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-base);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-warning:active {
  transform: translateY(0);
}

.btn-warning .material-symbols-rounded {
  font-size: 17px;
}

.btn-danger-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-danger-sm:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-edit-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-edit-sm:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ---- Summary Bar ---- */
.summary-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-item.interactive-pill {
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid transparent;
  transition: all var(--t-fast, 0.15s ease);
  user-select: none;
}

.summary-item.interactive-pill:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.04));
}

.summary-item.interactive-pill.is-active {
  background: var(--accent-subtle, rgba(99, 102, 241, 0.08));
  border-color: var(--accent, #6366f1);
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.15);
}

.summary-right {
  margin-left: auto;
}

.summary-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Summary count colors */
.summary-count.active-count {
  color: var(--success);
}

.summary-count.inactive-count {
  color: var(--text-muted);
}

.summary-label {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.summary-divider {
  width: 1px;
  height: 24px;
  background: var(--card-border);
}

/* Student Table Cell Ergonomics: Avatar + Phone Sub-label */
.student-cell-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.student-info-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.student-phone-sub {
  font-size: 11px;
  color: var(--text-tertiary, #64748b);
  display: flex;
  align-items: center;
  gap: 3px;
}

.student-phone-sub .material-symbols-rounded {
  font-size: 12px;
  color: var(--accent, #6366f1);
}

/* ---- Table Card ---- */
.table-card {
  animation: rise 0.5s var(--ease-out) forwards;
  animation-delay: 0.15s;
}

.student-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.student-table th {
  padding: 12px 14px;
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}

.student-table td {
  padding: 13px 14px;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.student-table tbody tr {
  transition: background var(--t-fast);
}

.student-table tbody tr:hover {
  background: var(--bg-hover);
}

.th-stt {
  width: 50px;
  text-align: center !important;
}

.th-actions {
  width: 130px;
  text-align: center !important;
}

/* Name cell */
.student-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* Class badge */
.class-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  background: var(--accent-bg);
  color: var(--accent);
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

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

.status-badge.inactive {
  background: rgba(0,0,0,0.04);
  color: var(--text-muted);
}

.status-badge .material-symbols-rounded {
  font-size: 14px;
}

/* Inactive row */
.student-table tbody tr.row-inactive {
  opacity: 0.5;
}

.student-table tbody tr.row-inactive .student-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* View detail button */
.btn-view-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-view-sm:hover {
  background: var(--info-bg);
  color: var(--info);
}

/* Retire button */
.btn-retire-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-retire-sm:hover {
  background: var(--warning-bg);
  color: var(--warning);
}

.btn-retire-sm.is-inactive {
  color: var(--warning);
  opacity: 0.7;
}

/* Fee display */
.fee-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
}

/* Cell actions */
.cell-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cell-actions .material-symbols-rounded {
  font-size: 17px;
}

/* Cell center */
.td-center {
  text-align: center;
}

/* Muted text for addresses */
.td-muted {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* ---- Table Footer / Pagination ---- */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
}

.table-info {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--t-fast);
}

.page-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: rgba(66, 133, 244, 0.2);
}

.page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn .material-symbols-rounded {
  font-size: 18px;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  width: 95%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s var(--ease-out);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 0;
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  border: none !important;
  background: var(--danger) !important;
  color: #fff !important;
  border-radius: 8px !important;
}

.modal-close:hover {
  background: #b91c1c !important;
  color: #fff !important;
  border-color: transparent !important;
  transform: scale(1.05);
}

.modal-body {
  padding: 20px 26px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 26px 22px;
}

.fee-scope-modal {
  max-width: 560px;
}

.fee-scope-options {
  display: grid;
  gap: 12px;
}

.fee-scope-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.fee-scope-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.fee-scope-option input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.fee-scope-option span {
  display: grid;
  gap: 4px;
}

.fee-scope-option strong {
  color: var(--text-primary);
  font-size: 0.88rem;
}

.fee-scope-option small,
.fee-scope-note {
  color: var(--text-tertiary);
  font-size: 0.76rem;
  line-height: 1.5;
}

.fee-scope-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

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

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
}

.required {
  color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.86rem;
  outline: none;
  transition: all var(--t-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form-group textarea {
  resize: vertical;
  min-height: 84px;
}

.form-hint {
  color: var(--text-tertiary);
  font-size: 0.72rem;
  line-height: 1.4;
}

.fee-waive-remaining {
  padding: 12px 14px;
  border: 1px solid rgba(5, 150, 105, 0.24);
  border-radius: 10px;
  background: rgba(5, 150, 105, 0.06);
}

.fee-waive-remaining[hidden],
.fee-waiver-reason[hidden] {
  display: none !important;
}

.fee-waive-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.fee-waive-option input {
  flex: 0 0 auto;
}

.fee-waiver-reason {
  margin-top: 12px;
}

/* Toggle Checkbox Switch */
.toggle-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0;
}

.toggle-checkbox input {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-active);
  border-radius: 12px;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform 0.25s var(--ease-out);
}

.toggle-checkbox input:checked + .toggle-switch {
  background: var(--success);
}

.toggle-checkbox input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.toggle-text {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}



/* ============================================
   DETAIL MODAL GRID
   ============================================ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

.detail-note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-family: 'Space Grotesk', sans-serif;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

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

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  font-size: 0.84rem;
  color: var(--text-primary);
  animation: toastIn 0.4s var(--ease-out) forwards;
  min-width: 260px;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.info {
  border-left: 3px solid var(--info);
}

.toast .material-symbols-rounded {
  font-size: 20px;
}

.toast.success .material-symbols-rounded { color: var(--success); }
.toast.error .material-symbols-rounded { color: var(--danger); }
.toast.info .material-symbols-rounded { color: var(--info); }

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

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

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-state .material-symbols-rounded {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.empty-state h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

/* ============================================
   CLASSES PAGE — CELL COMPONENTS
   ============================================ */
.class-info-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.class-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
  flex-shrink: 0;
}

.class-icon-badge .material-symbols-rounded {
  font-size: 18px;
}

.schedule-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.schedule-icon {
  font-size: 16px !important;
  color: var(--text-muted);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  background: rgba(99, 102, 241, 0.08);
  color: #6366f1;
}

.count-badge .material-symbols-rounded {
  font-size: 15px;
}

.count-badge.capacity-full {
  background: var(--warning-bg);
  color: var(--warning);
}

.class-info-cell > span:last-child {
  min-width: 0;
}

.class-list-note {
  display: block;
  max-width: 260px;
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-retry-btn {
  margin-top: 14px;
}

/* Type badge (chính khóa) */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.type-badge.yes {
  background: var(--success-bg);
  color: var(--success);
}

.type-badge.no {
  background: rgba(0,0,0,0.04);
  color: var(--text-muted);
}

.type-badge .material-symbols-rounded {
  font-size: 14px;
}

/* Fee method badge */
.fee-method-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.fee-method-badge.prepaid {
  background: var(--success-bg);
  color: var(--success);
}

.fee-method-badge.postpaid {
  background: var(--accent-bg);
  color: var(--accent);
}

.fee-method-badge .material-symbols-rounded {
  font-size: 14px;
}

/* Radio Group */
.radio-group {
  display: flex;
  gap: 16px;
  padding: 6px 0;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  transition: color var(--t-fast);
}

.radio-option:hover {
  color: var(--text-primary);
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-mark {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid var(--card-border);
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.radio-mark::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.2s var(--ease-out);
}

.radio-option input[type="radio"]:checked + .radio-mark {
  border-color: var(--accent);
}

.radio-option input[type="radio"]:checked + .radio-mark::after {
  transform: scale(1);
}

.radio-option input[type="radio"]:checked ~ span:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   COURSES PAGE — LAYOUT & COMPONENTS
   ============================================ */

/* Class Selector */
.class-selector-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-filter-lg {
  min-width: 280px;
  padding: 10px 16px !important;
  font-size: 0.9rem !important;
  font-weight: 500;
}

/* Two-panel layout */
.courses-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  min-height: calc(100vh - 220px);
}

/* Left Panel */
.courses-panel-left {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--card-border);
}

.panel-section-title .material-symbols-rounded {
  font-size: 18px;
  color: var(--accent);
}

.panel-badge {
  margin-left: auto;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.course-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* Ergonomic Course Card */
.course-card {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  background: var(--bg-card);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1.5px solid var(--border-color);
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.course-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
}

.course-card.active {
  background: rgba(66, 133, 244, 0.05);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(66, 133, 244, 0.12);
}

.course-card.status-active {
  border-left: 4px solid var(--success);
}

.course-card.status-upcoming {
  border-left: 4px solid #6366f1;
}

.course-card.status-completed {
  border-left: 4px solid var(--text-muted);
  opacity: 0.85;
}

.course-card.completed .course-card-name {
  color: var(--text-secondary);
}

.course-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.course-card-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.course-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.course-status-dot.active {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.course-status-dot.upcoming {
  background: #6366f1;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
}

.course-status-dot.completed {
  background: var(--text-muted);
}

.course-card-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--text-tertiary);
}

.course-meta-item .material-symbols-rounded {
  font-size: 14px;
}

/* Course Progress Bar inside Card */
.course-card-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.course-card-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.course-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.course-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), #10b981);
  transition: width 0.4s var(--ease-out);
}

.course-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.crs-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.crs-badge .material-symbols-rounded {
  font-size: 12px;
}

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

.crs-badge.upcoming {
  background: rgba(99, 102, 241, 0.08);
  color: #6366f1;
}

.crs-badge.completed {
  background: rgba(0,0,0,0.04);
  color: var(--text-muted);
}

/* Right Panel */
.courses-panel-right {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  padding: 40px;
}

.detail-placeholder .material-symbols-rounded {
  font-size: 48px;
  opacity: 0.4;
}

.detail-placeholder h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: var(--text-secondary);
}

.detail-placeholder p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.detail-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.detail-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-header-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Warning Outline Button (Safe ergonomics) */
.btn-warning-outline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #d97706;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-warning-outline:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: #d97706;
}

.btn-warning-outline .material-symbols-rounded {
  font-size: 16px;
}

/* Course Students Toolbar */
.course-students-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.course-student-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 200px;
  max-width: 280px;
}

.course-student-search-wrap .material-symbols-rounded {
  position: absolute;
  left: 10px;
  font-size: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.course-student-search-wrap input {
  width: 100%;
  padding: 6px 28px 6px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 0.84rem;
  color: var(--text-primary);
  transition: border-color var(--t-fast);
}

.course-student-search-wrap input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
}

.course-search-clear-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
}

.course-fee-filter-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.course-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
}

.course-filter-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.course-filter-pill.is-active {
  background: rgba(66, 133, 244, 0.08);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.course-filter-pill .pill-count {
  font-size: 0.72rem;
  padding: 1px 5px;
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.course-filter-pill.is-active .pill-count {
  background: var(--accent);
  color: #fff;
}

.course-filter-pill .pill-icon {
  font-size: 15px;
}

.course-filter-pill .pill-icon.success { color: var(--success); }
.course-filter-pill .pill-icon.warn { color: var(--warning); }
.course-filter-pill .pill-icon.info { color: var(--info); }

.upcoming-badge {
  background: rgba(99, 102, 241, 0.08) !important;
  color: #6366f1 !important;
}

/* Exam Section */
.exam-section {
  border-top: 1px solid var(--card-border);
  padding: 16px 22px;
  animation: fadeSlideIn 0.25s ease;
}

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

.exam-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.exam-section-header h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.exam-section-header h4 .material-symbols-rounded {
  font-size: 20px;
  color: #6366f1;
}

.enrollment-table-wrapper {
  flex: 1;
  overflow: auto;
}

/* Fee buttons */
.btn-collect {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-collect:hover {
  background: var(--accent);
  color: #fff;
}

.btn-collect .material-symbols-rounded {
  font-size: 15px;
}

.btn-paid {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--success);
  background: var(--success-bg);
  color: var(--success);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

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

.btn-paid .material-symbols-rounded {
  font-size: 15px;
}

.btn-partial {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--warning);
  background: var(--warning-bg);
  color: var(--warning);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-partial:hover {
  filter: brightness(0.96);
}

.btn-partial .material-symbols-rounded {
  font-size: 15px;
}

.payment-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 600;
}

.payment-state .material-symbols-rounded {
  font-size: 15px;
}

.payment-state.unpaid {
  color: var(--text-muted);
}

.payment-state.partial {
  color: var(--warning);
}

.payment-state.paid {
  color: var(--success);
}

.payment-state.overpaid {
  color: var(--accent);
}

.btn-xs {
  padding: 5px 10px !important;
  font-size: 0.72rem !important;
}

.btn-xs .material-symbols-rounded {
  font-size: 14px !important;
}

/* Small modal */
.modal-sm {
  max-width: 440px;
}

/* Empty state small */
.empty-state-sm {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.empty-state-sm .material-symbols-rounded {
  font-size: 36px;
  opacity: 0.4;
  margin-bottom: 8px;
  display: block;
}

.empty-state-sm p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

/* ============================================
   SCHEDULE PAGE — STACKED TIMELINE & CALENDAR
   ============================================ */

/* Toolbar extras */
.sch-toolbar { align-items: center; }

.view-toggle {
  display: flex;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
}

.view-btn .material-symbols-rounded { font-size: 16px; }
.view-btn.active { background: var(--accent); color: #fff; }
.view-btn:not(.active):hover { background: var(--bg-hover); }

.period-nav { display: flex; align-items: center; gap: 6px; }

.period-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  min-width: 180px;
  text-align: center;
}

.btn-today {
  padding: 5px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--t-fast);
}
.btn-today:hover { background: var(--accent-bg); }

.sch-card { overflow: auto; }

/* ---- STACKED WEEK VIEW ---- */
.stk-grid {
  min-width: 700px;
}

.stk-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--card-border);
}

.stk-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 4px 10px;
  border-right: 1px solid var(--card-border);
  transition: background var(--t-fast);
}
.stk-day-head:last-child { border-right: none; }

.stk-day-head.is-today { background: var(--accent-bg); }

.stk-day-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.stk-day-head.is-today .stk-day-name { color: var(--accent); font-weight: 600; }

.stk-day-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}
.stk-day-head.is-today .stk-day-num {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
}

.stk-count {
  font-size: 0.6rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 1px 7px;
  border-radius: 8px;
  margin-top: 2px;
}

.stk-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.stk-day-col {
  border-right: 1px solid var(--card-border);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 140px;
}
.stk-day-col:last-child { border-right: none; }

.stk-today-col { background: rgba(66, 133, 244, 0.02); }

/* Lesson Card */
.stk-lesson {
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid #9ca3af;
  background: var(--lbg, #f3f4f6);
  color: var(--ltxt, #4b5563);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stk-lesson:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stk-lesson-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 3px;
}

.stk-lesson-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
  display: block;
}

.stk-lesson-status {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.stk-lesson-time {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.64rem;
  opacity: 0.8;
}
.stk-lesson-time .material-symbols-rounded { font-size: 12px; }

.stk-tag {
  font-size: 0.56rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.stk-tag.cancelled { background: rgba(220,38,38,0.12); color: #dc2626; }
.stk-tag.done { background: rgba(34,197,94,0.15); color: #059669; }

.stk-reason {
  font-size: 0.6rem;
  margin-top: 3px;
  opacity: 0.7;
  font-style: italic;
}

.stk-cancelled { opacity: 0.5; }
.stk-cancelled .stk-lesson-name { text-decoration: line-through; }
.stk-completed { opacity: 0.75; }

.stk-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  opacity: 0.3;
}
.stk-empty .material-symbols-rounded { font-size: 24px; }

/* ---- ATTENDANCE MODAL ---- */
.modal-lg { max-width: 560px; }
.modal-subtitle { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 2px; }

.att-section-title {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.att-section-title .material-symbols-rounded { font-size: 18px; color: var(--accent); }

.att-list {
  display: flex; flex-direction: column; gap: 3px;
  max-height: calc(100vh - 280px); overflow-y: auto;
}

/* Toggle All Row */
.att-toggle-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.att-toggle-all-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: auto;
}

.att-tall-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--card-border);
  background: var(--bg-card);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.att-tall-btn .material-symbols-rounded { font-size: 15px; }

.att-tall-btn.present {
  color: var(--success);
  border-color: rgba(5,150,105,0.25);
}
.att-tall-btn.present:hover {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.att-tall-btn.absent {
  color: var(--danger);
  border-color: rgba(220,38,38,0.25);
}
.att-tall-btn.absent:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* Per-student attendance row */
.att-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  gap: 12px;
}

.att-student { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.att-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 0.82rem; flex-shrink: 0;
}

.att-name {
  font-size: 0.84rem; font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Toggle button group */
.att-toggle-group {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.att-tbtn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--card-border);
  background: var(--bg-card);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.att-tbtn .material-symbols-rounded { font-size: 14px; }

.att-tbtn.present.active {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 2px 8px rgba(5,150,105,0.25);
}
.att-tbtn.present:not(.active):hover {
  border-color: rgba(5,150,105,0.4);
  color: var(--success);
}

.att-tbtn.absent.active {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}
.att-tbtn.absent:not(.active):hover {
  border-color: rgba(220,38,38,0.4);
  color: var(--danger);
}

.att-bulk-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.att-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.att-bulk-btn .material-symbols-rounded { font-size: 16px; }
.att-bulk-btn.present:hover {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.5);
  color: #15803d;
}
.att-bulk-btn.absent:hover {
  background: rgba(220,38,38,0.06);
  border-color: rgba(220,38,38,0.4);
  color: var(--danger);
}

.att-empty {
  text-align: center; padding: 20px;
  color: var(--text-muted); font-size: 0.82rem;
}

.att-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.att-footer-left { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-danger-outline {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--danger); background: transparent;
  color: var(--danger); font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
}
.btn-danger-outline:hover { background: var(--danger); color: #fff; }
.btn-danger-outline .material-symbols-rounded { font-size: 16px; }

.btn-warning-outline {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid #f59e0b; background: transparent;
  color: #b45309; font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
}
.btn-warning-outline:hover { background: #f59e0b; color: #fff; }
.btn-warning-outline .material-symbols-rounded { font-size: 16px; }

/* Repeat Section */
.repeat-section { display: flex; flex-direction: column; gap: 10px; }
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 0.86rem; color: var(--text-secondary);
}
.repeat-weeks { display: flex; align-items: center; gap: 10px; padding-left: 26px; }
.repeat-weeks label { font-size: 0.82rem; color: var(--text-tertiary); white-space: nowrap; }
.repeat-weeks input { width: 70px; }

/* ---- Edit Lesson Section in Attendance Modal ---- */
.att-edit-section { animation: slideDown 0.3s var(--ease-out) forwards; }

@keyframes slideDown {
  from { opacity: 0; max-height: 0; transform: translateY(-8px); }
  to { opacity: 1; max-height: 400px; transform: translateY(0); }
}

.att-edit-form { margin-bottom: 0; }

.att-edit-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-border), transparent);
  margin: 18px 0 16px;
}

.btn-edit-outline {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--info); background: transparent;
  color: var(--info); font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
}
.btn-edit-outline:hover, .btn-edit-outline.active {
  background: var(--info); color: #fff;
}
.btn-edit-outline .material-symbols-rounded { font-size: 16px; }

/* ---- REPEAT ACTION MODAL ---- */
.repeat-action-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.repeat-action-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.repeat-choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
}

.repeat-choice-btn:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.repeat-choice-btn.danger:hover {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.repeat-choice-btn .material-symbols-rounded {
  font-size: 24px;
  color: var(--accent);
  flex-shrink: 0;
}
.repeat-choice-btn.danger .material-symbols-rounded { color: var(--danger); }

.repeat-choice-btn strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.repeat-choice-btn small {
  font-size: 0.74rem;
  color: var(--text-tertiary);
}

/* ---- REASON TEXTAREA ---- */
.reason-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.86rem;
  outline: none;
  resize: vertical;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.reason-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.reason-textarea::placeholder { color: var(--text-muted); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar-right { justify-content: flex-end; }
  .search-box-lg { max-width: 100%; }
  .courses-layout { grid-template-columns: 1fr; }
  .courses-panel-left { max-height: 300px; }
  .detail-header { flex-wrap: wrap; gap: 10px; }
  .detail-header-actions { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .filter-group { flex-wrap: wrap; gap: 6px; }
  .summary-bar { flex-wrap: wrap; gap: 12px; }
  .summary-divider { display: none; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-group.full-width, .detail-item.full-width { grid-column: 1; }
  .toolbar-right { flex-wrap: wrap; }
  .att-footer-left { flex-wrap: wrap; }
  .att-toggle-group { flex-direction: column; gap: 3px; }
  .att-tbtn { padding: 4px 8px; font-size: 0.66rem; }

  /* Course detail header — icon-only buttons on mobile */
  .detail-header { padding: 14px 16px; }
  .detail-header-info h3 { font-size: 0.92rem; }
  .detail-header-actions { width: 100%; justify-content: flex-end; }
  .detail-header-actions .btn-secondary span:not(.material-symbols-rounded),
  .detail-header-actions .btn-primary span:not(.material-symbols-rounded) {
    display: none;
  }
  .detail-header-actions .btn-secondary,
  .detail-header-actions .btn-primary,
  .detail-header-actions .btn-warning {
    padding: 7px 10px;
  }

  /* Enrollment table scroll */
  .enrollment-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .enrollment-table-wrapper .data-table { min-width: 550px; }

  /* Course card meta wrapping */
  .course-card-meta { flex-wrap: wrap; gap: 8px; }

  /* Class selector */
  .class-selector-group { flex-wrap: wrap; }
  .select-filter-lg { min-width: auto; width: 100%; }
}


/* Toolbar extras */
.sch-toolbar {
  align-items: center;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
}

.view-btn .material-symbols-rounded { font-size: 16px; }

.view-btn.active {
  background: var(--accent);
  color: #fff;
}

.view-btn:not(.active):hover {
  background: var(--bg-hover);
}

.period-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.period-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  min-width: 180px;
  text-align: center;
}

.btn-today {
  padding: 5px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-today:hover {
  background: var(--accent-bg);
}

/* Schedule Card */
.sch-card {
  overflow: auto;
}

/* ---- WEEK TIMELINE ---- */
.tl-header-row {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-card);
  border-bottom: 1px solid var(--card-border);
}

.tl-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-right: 1px solid var(--card-border);
}

.tl-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  border-right: 1px solid var(--card-border);
}

.tl-day-head.is-today {
  background: var(--accent-bg);
}

.tl-day-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.tl-day-head.is-today .tl-day-name { color: var(--accent); font-weight: 600; }

.tl-day-date {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tl-day-head.is-today .tl-day-date {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Body */
.tl-body {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  position: relative;
}

.tl-time-col {
  position: relative;
  border-right: 1px solid var(--card-border);
}

.tl-hour-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--text-muted);
}

.tl-day-col {
  position: relative;
  border-right: 1px solid var(--card-border);
}

.tl-day-col.is-today-col {
  background: rgba(99, 102, 241, 0.015);
}

.tl-grid-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--card-border);
}

/* Current time line */
.tl-now-line {
  position: absolute;
  left: -1px;
  right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 3;
}

.tl-now-dot {
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

/* Lesson Block */
.tl-lesson {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 2;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tl-lesson:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 4;
}

.tl-lesson-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.tl-lesson-time {
  font-size: 0.62rem;
  opacity: 0.75;
}

.tl-lesson-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

.tl-lesson-tag.done {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.tl-cancelled {
  opacity: 0.45;
}

.tl-cancelled .tl-lesson-name {
  text-decoration: line-through;
}

.tl-completed {
  opacity: 0.7;
}

/* ---- MONTH VIEW ---- */
.month-grid {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.month-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-hover);
}

.month-head {
  padding: 10px 4px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--card-border);
}

.month-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.month-cell {
  min-height: 90px;
  padding: 6px;
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.month-cell:nth-child(7n) { border-right: none; }

.month-cell.empty {
  background: var(--bg-hover);
  opacity: 0.5;
}

.month-cell.is-today {
  background: rgba(99, 102, 241, 0.04);
}

.month-cell.is-today .month-day-num {
  background: var(--accent);
  color: #fff;
  padding: 2px 7px;
  border-radius: 10px;
}

.month-day-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-block;
  margin-bottom: 4px;
}

.month-chips {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.month-chip {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: opacity var(--t-fast);
  white-space: nowrap;
}

.month-chip:hover { opacity: 0.8; }
.month-chip.cancelled { opacity: 0.35; text-decoration: line-through; }

.month-chip-more {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 1px 4px;
}

/* ---- Schedule reliability/accessibility additions ---- */
.schedule-loading {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
}

.schedule-loading .material-symbols-rounded {
  color: var(--accent);
}

.schedule-error .btn-secondary {
  margin-top: 10px;
}

button.stk-lesson,
button.m-lesson-card,
button.month-chip,
button.month-chip-more {
  appearance: none;
  font: inherit;
  text-align: left;
}

button.stk-lesson,
button.m-lesson-card {
  width: 100%;
}

button.stk-lesson {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
}

button.m-lesson-card {
  border: 0;
}

button.stk-lesson:focus-visible,
button.m-lesson-card:focus-visible,
button.month-chip:focus-visible,
button.month-chip-more:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.month-chip {
  border: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-chip-overflow {
  display: none;
}

.month-cell.is-expanded .month-chip-overflow {
  display: block;
}

.month-chip-more {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

.att-correction-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
}

.att-correction-panel label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.att-correction-panel textarea {
  width: 100%;
  resize: vertical;
}

.form-hint {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.schedule-import-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(55vh, 480px);
  overflow-y: auto;
}

.schedule-import-row {
  display: grid;
  grid-template-columns: 74px 64px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.78rem;
}

.schedule-import-row.ready { border-left: 4px solid #16a34a; }
.schedule-import-row.skipped { border-left: 4px solid #ca8a04; }
.schedule-import-row.error { border-left: 4px solid #dc2626; }
.schedule-import-row-number { font-weight: 600; }
.schedule-import-row-status { color: var(--text-secondary); }
.schedule-import-row-message { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 768px) {
  .month-grid {
    min-width: 700px;
  }

  .schedule-import-row {
    grid-template-columns: 62px 56px 1fr;
    gap: 6px;
  }
}

/* ---- ATTENDANCE MODAL ---- */
.modal-lg {
  max-width: 560px;
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.att-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.att-section-title .material-symbols-rounded { font-size: 18px; color: var(--accent); }

.att-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}

.att-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  gap: 12px;
}

.att-student {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.att-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.att-name {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-select {
  padding: 5px 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.76rem;
  color: var(--text-primary);
  background: var(--bg-card);
  cursor: pointer;
  min-width: 145px;
}

.att-select:focus { border-color: var(--accent); outline: none; }

.att-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.att-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.att-footer-left {
  display: flex;
  gap: 8px;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--danger);
  background: transparent;
  color: var(--danger);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-danger-outline:hover { background: var(--danger); color: #fff; }
.btn-danger-outline .material-symbols-rounded { font-size: 16px; }

.btn-warning-outline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #f59e0b;
  background: transparent;
  color: #b45309;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-warning-outline:hover { background: #f59e0b; color: #fff; }
.btn-warning-outline .material-symbols-rounded { font-size: 16px; }

/* Repeat Section */
.repeat-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.repeat-weeks {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 26px;
}

.repeat-weeks label {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.repeat-weeks input {
  width: 70px;
}

/* ---- Edit Lesson Section in Attendance Modal ---- */
.att-edit-section {
  animation: slideDown 0.3s var(--ease-out) forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    max-height: 400px;
    transform: translateY(0);
  }
}

.att-edit-form {
  margin-bottom: 0;
}

.att-edit-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-border), transparent);
  margin: 18px 0 16px;
}

/* Edit toggle button */
.btn-edit-outline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--info);
  background: transparent;
  color: var(--info);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-edit-outline:hover,
.btn-edit-outline.active {
  background: var(--info);
  color: #fff;
}

.btn-edit-outline .material-symbols-rounded {
  font-size: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }
  .toolbar-right {
    justify-content: flex-end;
  }
  .search-box-lg {
    max-width: 100%;
  }
  .courses-layout {
    grid-template-columns: 1fr;
  }
  .courses-panel-left {
    max-height: 300px;
  }
  .detail-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .detail-header-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (max-width: 768px) {
  .page-content {
    padding: 16px;
  }
  .filter-group {
    flex-wrap: wrap;
    gap: 6px;
  }
  .summary-bar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .summary-divider {
    display: none;
  }
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full-width,
  .detail-item.full-width {
    grid-column: 1;
  }
  .toolbar-right {
    flex-wrap: wrap;
  }
  /* Course detail — icon-only buttons on mobile */
  .detail-header { padding: 14px 16px; }
  .detail-header-info h3 { font-size: 0.92rem; }
  .detail-header-actions { width: 100%; justify-content: flex-end; }
  .detail-header-actions .btn-secondary span:not(.material-symbols-rounded),
  .detail-header-actions .btn-primary span:not(.material-symbols-rounded) {
    display: none;
  }
  .detail-header-actions .btn-secondary,
  .detail-header-actions .btn-primary,
  .detail-header-actions .btn-warning {
    padding: 7px 10px;
  }
  .enrollment-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .enrollment-table-wrapper .data-table { min-width: 550px; }
  .course-card-meta { flex-wrap: wrap; gap: 8px; }
  .class-selector-group { flex-wrap: wrap; }
  .select-filter-lg { min-width: auto; width: 100%; }
}

/* ============================================
   Course Homework Leaderboard & Tabs
   ============================================ */
.course-tabs-bar {
  display: flex;
  gap: 8px;
  padding: 14px 22px 10px;
  border-bottom: 1px solid var(--card-border);
  margin: 0;
}

#course-tab-homework {
  padding: 20px 22px;
}

@media (max-width: 768px) {
  .course-tabs-bar {
    padding: 12px 16px 8px;
  }
  #course-tab-homework {
    padding: 16px;
  }
}

.course-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: var(--t-fast);
}

.course-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.course-tab-btn.active {
  border-color: var(--card-border);
  background: var(--bg-card);
  color: var(--accent);
}

.course-hw-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.course-hw-stats-pills {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.course-hw-stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--card-shadow);
}

.course-hw-stat-pill span {
  color: var(--text-tertiary);
}

.course-hw-stat-pill strong {
  color: var(--text-primary);
  font-size: 15px;
  margin-left: 4px;
}

.course-hw-stat-pill strong.rate {
  color: var(--success);
}

.course-hw-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.course-hw-matrix-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.course-hw-matrix-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.course-hw-matrix-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.course-hw-matrix-header h4 .material-symbols-rounded {
  color: var(--accent);
  font-size: 18px;
}

.course-hw-matrix-header span {
  font-size: 12px;
  color: var(--text-tertiary);
}

.course-hw-matrix-table-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

.course-hw-matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  min-width: 600px;
}

.course-hw-matrix-table th {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-weight: 600;
}

.course-hw-matrix-table th.col-sticky-rank {
  width: 80px;
  text-align: center;
  position: sticky;
  left: 0;
  background: var(--bg-secondary);
  z-index: 2;
}

.course-hw-matrix-table th.col-sticky-name {
  min-width: 160px;
  position: sticky;
  left: 80px;
  background: var(--bg-secondary);
  z-index: 2;
}

.course-hw-matrix-table th.col-lesson {
  padding: 12px 10px;
  text-align: center;
  min-width: 70px;
}

.course-hw-matrix-table th.col-center,
.course-hw-matrix-table td.col-center {
  text-align: center;
}

.course-hw-matrix-table th.col-avg-rank {
  color: var(--accent);
  text-align: center;
  min-width: 100px;
}

.course-hw-matrix-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  transition: background var(--t-fast);
}

.course-hw-matrix-table tr:hover td {
  background: var(--bg-hover);
}

.course-hw-matrix-table td.col-sticky-rank {
  text-align: center;
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 1;
}

.course-hw-matrix-table td.col-sticky-name {
  font-weight: 600;
  color: var(--text-primary);
  position: sticky;
  left: 80px;
  background: var(--bg-card);
  z-index: 1;
}

.course-hw-matrix-table tr:hover td.col-sticky-rank,
.course-hw-matrix-table tr:hover td.col-sticky-name {
  background: var(--bg-hover);
}

.course-hw-matrix-table td.col-lesson {
  padding: 10px 8px;
  text-align: center;
}

.course-hw-lesson-rank {
  font-weight: 700;
  font-size: 13px;
}

.course-hw-lesson-rank.rank-1 { color: #eab308; }
.course-hw-lesson-rank.rank-2 { color: #94a3b8; }
.course-hw-lesson-rank.rank-3 { color: #d97706; }
.course-hw-lesson-rank.rank-other { color: var(--accent); }

.course-hw-lesson-time {
  font-size: 10px;
  color: var(--text-tertiary);
}

.course-hw-avg-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  background: rgba(66, 133, 244, 0.1);
  color: var(--accent);
}

/* Podium Stack (Single Column 1, 2, 3) */
.course-hw-podium-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.course-hw-podium-card {
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  transition: var(--t-fast);
}

.course-hw-podium-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-hover);
}

.course-hw-podium-card.rank-1 {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(234, 179, 8, 0.03));
  border-color: #eab308;
}

.course-hw-podium-card.rank-2 {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.03));
  border-color: #94a3b8;
}

.course-hw-podium-card.rank-3 {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(217, 119, 6, 0.03));
  border-color: #d97706;
}

.course-hw-podium-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.course-hw-podium-medal {
  font-size: 32px;
  line-height: 1;
}

.course-hw-podium-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.course-hw-podium-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.course-hw-podium-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.course-hw-podium-meta-rank {
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.course-hw-podium-meta-rank .material-symbols-rounded {
  font-size: 16px;
}

.course-hw-podium-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.course-hw-podium-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.06);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.course-hw-podium-card.rank-1 .course-hw-podium-label { color: #eab308; }
.course-hw-podium-card.rank-2 .course-hw-podium-label { color: #94a3b8; }
.course-hw-podium-card.rank-3 .course-hw-podium-label { color: #d97706; }

@media (max-width: 600px) {
  .course-hw-podium-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .course-hw-podium-right {
    align-items: flex-start;
    width: 100%;
    border-top: 1px solid var(--card-border);
    padding-top: 8px;
  }
  .course-hw-podium-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
}
