/* Reset básico */
* {
  box-sizing: border-box;
}

:root {
  --notia-primario: #0D5C63;
  --notia-secundario: #3DA6A6;
  --notia-enfasis: #F9C74F;
  --notia-fondo-claro: #FFFFFF;
  --notia-texto-principal: #333333;
  --notia-texto-desactivado: #999999;
  --notia-hover-azul: #e3f2fd;
  --notia-hover-logout: #fdecea;
  --notia-rojo-logout: #dc3545;
  --notia-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #FFFFFF !important;
  font-family: var(--notia-font);
  color: var(--notia-texto-principal);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  width: 100vw;
  min-height: 100vh;
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
  box-sizing: border-box;
  background-color: #FFFFFF !important;
}

/* Asegurar que el contenido del dashboard sea visible */
.container-fluid {
  padding: 20px;
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: auto;
  padding-top: 150px;
  padding-bottom: 40px;
}

/* Cuando hay config-container, eliminar el padding-top del container-fluid */
.container-fluid:has(.config-container) {
  padding-top: 0 !important;
}

/* Asegurar que todas las vistas tengan scroll correcto */
/* NOTA: Las reglas de .config-container están ahora en configuracion.css */
.usuarios-panel {
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

/* Scroll personalizado para el contenido principal */
.main-content::-webkit-scrollbar {
  width: 12px;
  background: #f1f1f1;
}

.main-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--notia-secundario);
  border-radius: 6px;
  border: 2px solid #f1f1f1;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: var(--notia-primario);
}

/* Forzar que el scroll sea visible */
.main-content {
  scrollbar-width: thin;
  scrollbar-color: var(--notia-secundario) #f1f1f1;
}

/* Asegurar que el scroll funcione en todos los navegadores */
.main-content {
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch;
}

/* Forzar que el contenido sea más alto que el viewport para activar el scroll */
.main-content .container-fluid {
  min-height: calc(100vh + 200px);
}

/* Espaciado adicional para el dashboard */
.dashboard-header {
  margin-top: 1120px; /*No cambiar*/
  margin-bottom: 30px;
  padding-top: 20px;
}

/* Espaciado para las tarjetas del dashboard */
.stats-cards {
  margin-top: 20px;
  margin-bottom: 30px;
}

/* Alinear todas las tarjetas a la misma altura usando flexbox */
.stats-cards .row {
  display: flex !important;
  align-items: stretch !important;
}

.stats-cards .col-6,
.stats-cards .col-md-3 {
  display: flex !important;
  align-items: stretch !important;
}

.stats-cards .col-6 .card,
.stats-cards .col-md-3 .card {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Ajustes específicos para el dashboard */
.dashboard-container .row:first-child {
  margin-top: 0;
}

.dashboard-container .card:first-child {
  margin-top: 0;
}

/* Ajustes para las secciones del dashboard */
.alertas-section {
  margin-bottom: 30px;
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
}

.alertas-section > [class*="col-"] {
  display: flex;
}

/* Tarjetas de alertas - fondo blanco y misma altura */
.alerta-card {
  background-color: #FFFFFF !important;
  background: #FFFFFF !important;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.alerta-card.card-danger {
  border: 1px solid #E0E0E0 !important;
  border-left: 4px solid #dc3545 !important;
}

.alerta-card.card-warning {
  border: 1px solid #E0E0E0 !important;
  border-left: 4px solid #ffc107 !important;
}

.alerta-card .card-header {
  background-color: #FFFFFF !important;
  background: #FFFFFF !important;
  border-bottom: 1px solid #E0E0E0 !important;
  color: #333333 !important;
}

.alerta-card .card-body {
  background-color: #FFFFFF !important;
  background: #FFFFFF !important;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.alerta-card .card-title {
  color: #333333 !important;
}

.alerta-card .card-body {
  color: #333333 !important;
}

.alerta-card .text-muted {
  color: #6c757d !important;
}

.alerta-card .text-success {
  color: #28a745 !important;
}

.acciones-rapidas {
  margin-bottom: 30px;
  margin-top: 20px;
}

/* Botones de acciones rápidas - misma altura y ancho */
.acciones-rapidas-buttons {
  display: flex;
  flex-wrap: wrap;
}

.acciones-rapidas-buttons > [class*="col-"] {
  display: flex;
}

.acciones-rapidas-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  height: 100%;
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
  padding: 16px 12px;
  line-height: 1.4;
  flex-direction: column;
}

.acciones-rapidas-btn i {
  flex-shrink: 0;
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.acciones-rapidas-btn span {
  display: block;
  width: 100%;
}

/* Ajustes responsivos para botones de acciones rápidas */
@media (max-width: 767.98px) {
  .acciones-rapidas-btn {
    min-height: 70px;
    padding: 12px 8px;
  }
  
  .acciones-rapidas-btn i {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }
}

/* Ajustes específicos para las tarjetas de acciones rápidas */
.row .col-6:first-child .card {
  margin-top: 20px;
}

/* Asegurar que la sección de grupos no se salga */
.grupos-grid {
  margin-bottom: 30px;
}

.grupos-grid .card {
  margin-bottom: 20px;
}

/* Diseño mejorado para las tarjetas de estadísticas */
.stats-cards .card {
  border: none !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  position: relative !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}

.stats-cards .card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 12px 32px rgba(0, 0, 0, 0.12) !important;
}

.stats-cards .card-body {
  padding: 24px !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  position: relative !important;
  z-index: 2 !important;
}

/* Gradientes modernos y vibrantes para cada tipo de tarjeta */
.stats-cards .card-primary,
.stats-cards .card.card-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
}

.stats-cards .card-success,
.stats-cards .card.card-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
  color: white !important;
}

.stats-cards .card-danger,
.stats-cards .card.card-danger {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
  background-image: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
  color: white !important;
}

/* Asegurar que el texto sea visible en la tarjeta de peligro */
.stats-cards .card-danger .card-body,
.stats-cards .card.card-danger .card-body {
  background: transparent !important;
}

.stats-cards .card-danger .card-title,
.stats-cards .card.card-danger .card-title,
.stats-cards .card-danger h3,
.stats-cards .card.card-danger h3 {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.stats-cards .card-danger p,
.stats-cards .card.card-danger p,
.stats-cards .card-danger .text-white,
.stats-cards .card.card-danger .text-white {
  color: white !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.stats-cards .card-danger .fas,
.stats-cards .card.card-danger .fas {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.stats-cards .card-info,
.stats-cards .card.card-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
  color: white !important;
}

.stats-cards .card-warning:not(.alerta-card),
.stats-cards .card.card-warning:not(.alerta-card) {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
  color: white !important;
}

/* Efecto de brillo sutil en las tarjetas */
.stats-cards .card::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%) !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

/* Tipografía mejorada */
.stats-cards .card-title {
  color: white !important;
  font-weight: 700 !important;
  font-size: 2.5rem !important;
  line-height: 1.2 !important;
  margin: 0 0 8px 0 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  letter-spacing: -0.5px !important;
}

.stats-cards .text-white {
  color: white !important;
}

.stats-cards .fas {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  opacity: 0.95 !important;
}

.stats-cards .opacity-75 {
  opacity: 0.95 !important;
}

/* Asegurar que todos los elementos de texto sean visibles */
.stats-cards .card-body * {
  color: white !important;
}

/* Estilos mejorados para los textos de las tarjetas */
.stats-cards .card-body p {
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  font-weight: 500 !important;
  letter-spacing: 0.3px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

/* Línea divisoria decorativa mejorada */
.stats-divider {
  width: 60px;
  min-width: 50px;
  max-width: 120px;
  height: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.6) 100%);
  border-radius: 3px;
  margin: 0 0 12px 0;
  display: block;
  transition: width 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Hacer que la línea se adapte al ancho del texto de la primera línea */
.stats-cards .card-body > .d-flex > .flex-grow-1 {
  position: relative;
}

/* Responsive: ajustar altura de la línea según el tamaño de pantalla */
@media (min-width: 1200px) {
  .stats-divider {
    height: 2.5px;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .stats-divider {
    height: 2px;
  }
}

@media (max-width: 767.98px) {
  .stats-divider {
    height: 1.5px;
    min-width: 30px;
  }
}

/* Iconos mejorados con mejor tamaño y posición */
.stats-cards .fas {
  font-size: 3rem !important;
  opacity: 0.9 !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
  transition: transform 0.3s ease !important;
}

.stats-cards .card:hover .fas {
  transform: scale(1.05) !important;
}

/* Responsive: Ajustes para pantallas medianas */
@media (min-width: 768px) and (max-width: 991.98px) {
  .stats-cards .fas {
    font-size: 2.5rem !important;
  }
  
  .stats-cards .card-title {
    font-size: 2rem !important;
  }
  
  .stats-cards .card-body {
    padding: 20px !important;
  }
}

/* Responsive: Ajustes para pantallas pequeñas */
@media (min-width: 576px) and (max-width: 767.98px) {
  .stats-cards .fas {
    font-size: 2rem !important;
  }
  
  .stats-cards .card-title {
    font-size: 1.75rem !important;
  }
  
  .stats-cards .card-body {
    padding: 18px !important;
  }
  
  .stats-divider {
    height: 2.5px !important;
  }
}

/* Responsive: Ajustes para móviles */
@media (max-width: 576px) {
  .stats-cards .fas {
    font-size: 2rem !important;
  }
  
  .stats-cards .card-title {
    font-size: 1.75rem !important;
  }
  
  .stats-cards .card-body {
    padding: 16px !important;
  }
  
  .stats-cards .card-body p {
    font-size: 0.85rem !important;
  }
  
  .stats-divider {
    height: 2px !important;
    width: 45px !important;
    min-width: 40px !important;
  }
  
  .stats-cards .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}


/* El efecto hover ya está definido arriba con mejor diseño */

/* Mejoras para las tarjetas de distribución por roles */
.config-card .card.border-info,
.config-card .card.border-warning,
.config-card .card.border-danger {
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  background: white !important;
}

.config-card .card.border-info:hover,
.config-card .card.border-warning:hover,
.config-card .card.border-danger:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 10px 28px rgba(0, 0, 0, 0.12) !important;
}

.config-card .card.border-info {
  border-left: 4px solid #17a2b8 !important;
}

.config-card .card.border-warning {
  border-left: 4px solid #ffc107 !important;
}

.config-card .card.border-danger {
  border-left: 4px solid #dc3545 !important;
}

.config-card .card.border-info .card-body,
.config-card .card.border-warning .card-body,
.config-card .card.border-danger .card-body {
  padding: 24px !important;
}

.config-card .card.border-info h4,
.config-card .card.border-warning h4,
.config-card .card.border-danger h4 {
  font-size: 2rem !important;
  font-weight: 700 !important;
  margin: 12px 0 8px 0 !important;
  color: #333 !important;
}

.config-card .card.border-info .fas,
.config-card .card.border-warning .fas,
.config-card .card.border-danger .fas {
  font-size: 2.5rem !important;
  margin-bottom: 12px !important;
}

/* Asegurar que todo el contenido del dashboard sea scrolleable */
.dashboard-container {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Forzar que el contenido sea scrolleable */
.main-content .container-fluid {
  height: auto;
  min-height: calc(100vh - 40px);
}

/* Espaciado general para las tarjetas */
.card {
  margin-bottom: 20px;
}

/* Asegurar que las filas tengan espaciado adecuado */
.row {
  margin-bottom: 20px;
}

.row:last-child {
  margin-bottom: 0;
}

/* Ajustes específicos para vistas con problemas de altura */
.perfil-container,
.configuracion-container,
.estudiantes-container,
.rubros-container,
.materias-container,
.grupos-container,
.asistencia-container,
/* Tarjetas de calificaciones - misma altura y ancho */
.calificaciones-grupos-row {
  display: flex;
  flex-wrap: wrap;
}

.calificaciones-grupos-row > [class*="col-"] {
  display: flex;
}

.calificaciones-grupo-card {
  background-color: #FFFFFF !important;
  border: 1px solid #E0E0E0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.calificaciones-grupo-card .card-header {
  background-color: #FFFFFF !important;
  border-bottom: 1px solid #E0E0E0;
  flex-shrink: 0;
}

.calificaciones-grupo-card .card-body {
  background-color: #FFFFFF !important;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.calificaciones-grupo-card .d-grid {
  margin-top: auto;
}

.calificaciones-container {
  min-height: calc(100vh - 100px);
  padding: 20px;
  margin: 0;
  padding-top: 0;
}

/* Ajustes para headers de todas las vistas */
.page-header,
.section-header,
.content-header {
  margin-top: 0;
  margin-bottom: 20px;
  padding-top: 0;
}

/* Ajustes para las primeras filas de contenido */
.row:first-child {
  margin-top: 0;
}

/* Ajustes para tarjetas que están muy abajo */
.card:first-child {
  margin-top: 0;
}

/* Asegurar que las tarjetas no se corten */
.card-body {
  padding: 20px;
  min-height: auto;
}

/* Ajustes para tablas que se cortan */
.table-responsive {
  max-height: none;
  overflow: visible;
}

/* Ajustes específicos para tablas del dashboard */
.table {
  margin-bottom: 0;
}

.table tbody tr:last-child {
  border-bottom: 1px solid #dee2e6;
}

/* Asegurar que las tablas no se corten en el dashboard */
.card .table-responsive {
  max-height: none;
  overflow: visible;
}

/* Ajustes para las tarjetas de alertas */
.card-danger,
.card-warning {
  margin-bottom: 20px;
}

.card-danger .card-body,
.card-warning .card-body {
  padding: 20px;
}

/* Ajustes para formularios */
.form-container {
  padding: 20px;
  margin-bottom: 20px;
}

/* Responsive - Ajustes para móviles */
@media (max-width: 768px) {
  .container-fluid {
    padding: 15px;
    min-height: auto;
    padding-top: 120px;
  }
  
  .dashboard-header {
    margin-bottom: 20px;
    padding-top: 10px;
  }
  
  .stats-cards {
    margin-bottom: 20px;
    margin-top: 10px;
  }
  
  .card {
    margin-bottom: 15px;
  }
  
  .card:first-child {
    margin-top: 0;
  }
  
  .row {
    margin-bottom: 15px;
  }
  
  .row:first-child {
    margin-top: 0;
  }
}

/* Responsive - Ajustes para pantallas muy pequeñas */
@media (max-width: 576px) {
  .container-fluid {
    padding: 10px;
    min-height: auto;
    padding-top: 100px;
  }
  
  .dashboard-header {
    margin-bottom: 15px;
    padding-top: 10px;
  }
  
  .card-body {
    padding: 15px;
  }
  
  .card:first-child {
    margin-top: 0;
  }
  
  .row:first-child {
    margin-top: 0;
  }
}

h2 {
  color: var(--notia-primario);
  font-weight: 700;
}

.table {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(13,92,99,0.06);
}

.table thead {
  background: var(--notia-primario);
  color: #fff;
}

.table th, .table td {
  vertical-align: middle !important;
  font-size: 1rem;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: var(--notia-fondo-claro);
}

/* Controles de formulario con radio consistente */
.form-control,
.form-select,
textarea,
input:not([type="checkbox"]):not([type="radio"]),
.input-group .form-control,
.input-group .form-select {
  border-radius: var(--notia-radio-input) !important;
}

.input-group-text {
  border-radius: var(--notia-radio-input) !important;
}

.form-check-input {
  border-radius: 8px;
  border: 1px solid var(--notia-secundario);
}

/* Botones con esquinas redondeadas (global) */
:root {
  --notia-radio-boton: 12px;
  --notia-radio-input: 12px;
}

.btn,
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
a.btn {
  border-radius: var(--notia-radio-boton) !important;
}

.btn-primary {
  background: var(--notia-primario);
  border: none;
}

.btn-primary:hover {
  background: var(--notia-hover-azul);
  color: var(--notia-primario);
}

.btn-warning {
  background: var(--notia-enfasis);
  color: var(--notia-texto-principal);
  border: none;
}

.btn-warning:hover {
  background: #ffe082;
  color: var(--notia-primario);
}

.form-check-input:checked {
  background-color: var(--notia-secundario);
  border-color: var(--notia-secundario);
}

.form-check-label {
  color: var(--notia-texto-principal);
  margin-left: 8px;
}

.btn-danger, .btn-danger:focus {
  background: var(--notia-rojo-logout);
  border: none;
}

.btn-danger:hover {
  background: var(--notia-hover-logout);
  color: var(--notia-rojo-logout);
}

/* Dashboard: Acciones Rápidas - botones con mismas dimensiones */
.acciones-rapidas-row > [class*="col-"] {
  display: flex;
}

.acciones-rapidas-row .btn {
  width: 100%;
  height: 56px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px !important;
  white-space: nowrap;
}

.acciones-rapidas-row .btn i {
  margin: 0 !important;
}
