/* Attendance summary stat cards: 4 per row, 25% width, centered content, always fill row */
.attendance-summary-modern {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card-attendance {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card-attendance::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
}

.stat-card-attendance.present::before {
  background: linear-gradient(135deg, #10b981, #059669);
}

.stat-card-attendance.absent::before {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-card-attendance.justified::before {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card-attendance.total::before {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-card-attendance:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
  font-weight: 600;
}

.stat-icon-circle.success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon-circle.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-icon-circle.warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon-circle.info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-info .stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: #111827;
  margin-bottom: 0.25rem;
}

.stat-info .stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-percentage {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  text-align: center;
  margin-top: 0.5rem;
}

.stat-percentage.success {
  background-color: #dcfce7;
  color: #166534;
}

.stat-percentage.danger {
  background-color: #fef2f2;
  color: #991b1b;
}

.stat-percentage.warning {
  background-color: #fef3c7;
  color: #92400e;
}

.stat-percentage.info {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Responsive design */
@media (max-width: 1200px) {
  .attendance-summary-modern {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
  }
  
  .stat-card-attendance {
    padding: 1.25rem;
  }
  
  .stat-info .stat-number {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .attendance-summary-modern {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
  }
  
  .stat-card-attendance {
    padding: 1rem;
  }
  
  .stat-card-header {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }
  
  .stat-icon-circle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .stat-info .stat-number {
    font-size: 1.75rem;
  }
  
  .stat-info .stat-label {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .attendance-summary-modern {
    grid-template-columns: 1fr;
  }
}

.attendance-table-modern th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 2;
}
.attendance-table-modern tr:nth-child(even) { background: #f6f6f6; }
.attendance-table-modern td, .attendance-table-modern th {
  padding: 0.7rem 0.5rem;
  vertical-align: middle;
}
.attendance-table-modern .badge {
  font-size: 0.95em;
}

/* Modal de tomar asistencia */
#takeAttendanceModal .modal-dialog {
  max-width: 1200px;
}

#takeAttendanceModal .btn-group {
  border-radius: 6px;
  overflow: hidden;
}

#takeAttendanceModal .btn-check:checked + .btn {
  background-color: var(--bs-btn-color);
  border-color: var(--bs-btn-color);
  color: white;
}

#takeAttendanceModal .btn-outline-success:checked,
#takeAttendanceModal .btn-check:checked + .btn-outline-success {
  background-color: #28a745;
  border-color: #28a745;
  color: white;
}

#takeAttendanceModal .btn-outline-danger:checked,
#takeAttendanceModal .btn-check:checked + .btn-outline-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}

#takeAttendanceModal .btn-outline-warning:checked,
#takeAttendanceModal .btn-check:checked + .btn-outline-warning {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

#takeAttendanceModal .student-row:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

#takeAttendanceModal .form-control-sm {
  font-size: 0.875rem;
}

#takeAttendanceModal .table th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  white-space: nowrap;
}

#takeAttendanceModal .badge {
  font-size: 0.75em;
  padding: 0.375em 0.75em;
}

/* Responsive adjustments for take attendance modal */
@media (max-width: 1200px) {
  #takeAttendanceModal .modal-dialog {
    max-width: 95vw;
    margin: 0.5rem auto;
  }
}

@media (max-width: 768px) {
  #takeAttendanceModal .table-responsive {
    font-size: 0.875rem;
  }
  
  #takeAttendanceModal .btn-group .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
  }
  
  #takeAttendanceModal .form-control-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
}
  padding: 0.35em 0.7em;
  border-radius: 0.7em;
}
