body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
}

/* Contenedor del layout con sidebar y contenido */
.page-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Contenedor principal del menú lateral */
.sidebar-container {
    width: 30px;
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
}

/* Trigger del menú lateral */
.sidebar-trigger {
    width: 30px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
}

.sidebar-trigger:hover {
    width: 35px;
    box-shadow: 3px 0 8px rgba(0,0,0,0.3);
}

/* Menú lateral emergente */
.sidebar-menu {
    position: fixed;
    left: 30px;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(-310px);
}

.sidebar-container:hover .sidebar-menu {
    transform: translateX(0);
}

/* Contenido principal */
.main-content {
    flex: 1;
    padding: 20px;
}

/* Header del menú lateral */
.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-title {
    color: white;
    font-weight: bold;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.sidebar-user {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

/* Navegación del menú lateral */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 10px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sidebar-link i {
    width: 25px;
    margin-right: 10px;
    font-size: 16px;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 25px;
}

.sidebar-logout {
    color: #ffcccc;
}

.sidebar-logout:hover {
    background: rgba(255,0,0,0.2);
    color: white;
}

/* Contenido principal */
.main-content {
    padding: 20px;
}

.login-page {
    background: linear-gradient(120deg, #2980b9, #8e44ad);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 15px;
    overflow-x: hidden;
}

.login-form {
    background: #ffffff;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    word-wrap: break-word;
}

.login-form .logo {
    display: block;
    margin: 0 auto 10px;
    width: 60px !important;
    height: 60px !important;
    object-fit: contain !important;
    max-width: 60px !important;
}

.login-form h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1rem !important;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Estilos personalizados para títulos del login */
.login-title {
    color: #333;
    font-weight: 600;
    font-size: 1rem !important;
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.login-subtitle {
    color: #555;
    font-weight: 500;
    font-size: 0.9rem !important;
    margin-bottom: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.login-form .form-group {
    margin-bottom: 12px;
}

.login-form .form-control {
    font-size: 14px;
    padding: 10px 12px;
}

.login-form .btn-primary {
    padding: 10px 20px;
    font-size: 14px;
    margin-top: 10px;
}

.btn-primary {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-primary:hover {
    background-color: #3498db;
    border-color: #3498db;
}

.table-responsive {
    margin: 20px 0;
}

.bajo-rendimiento {
    background-color: #ffebee !important;
    color: #c62828;
}

.navbar {
    background-color: #1e3a8a !important;
    background-image: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%) !important;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    border-bottom: 3px solid #1e40af;
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
}

.nav-link:hover {
    color: white !important;
}

.card {
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,0.125);
}

.form-control:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 0.2rem rgba(41,128,185,0.25);
}

.alert {
    margin-top: 20px;
}

.sistema-no-disponible {
    text-align: center;
    padding: 50px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    margin: 50px auto;
    max-width: 600px;
}

.sistema-no-disponible h1 {
    color: #e74c3c;
    margin-bottom: 20px;
}

/* Estilos para tablas en todos los módulos */
.table {
    background-color: #ffffff;
    border-radius: 5px;
    overflow: hidden;
}

.table thead th {
    background-color: #2980b9;
    color: white;
    border-bottom: none;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(41, 128, 185, 0.05);
}

.table td, .table th {
    vertical-align: middle;
    padding: 12px;
}

/* Estilos para botones de acción */
.btn-action {
    margin: 0 2px;
    padding: 5px 10px;
    font-size: 0.875rem;
}

.btn-info {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-danger {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

/* Estilos para modales */
.modal-header {
    background-color: #2980b9;
    color: white;
    border-bottom: none;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
}

.modal-header .close:hover {
    opacity: 1;
}

/* Estilos específicos para notas */
.nota-input {
    width: 80px;
    text-align: center;
    margin: 0 auto;
}

.nota-input.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

/* Estilos para reportes */
.reporte-header {
    background-color: #f8f9fa;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.stats-card {
    background-color: #fff;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stats-card strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

.stats-card p {
    color: #2980b9;
    font-size: 1.25rem;
    margin: 0;
}

/* Badges y etiquetas */
.badge {
    padding: 5px 10px;
    font-weight: 500;
}

.badge-info {
    background-color: #3498db;
}

/* Estilos para formularios */
.form-group label {
    color: #2c3e50;
    font-weight: 500;
}

.form-control {
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 8px 12px;
}

/* Estilos para cards */
.card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* Estilos para mensajes de alerta */
.alert {
    border-radius: 5px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 1rem;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nota-input {
        width: 60px;
        font-size: 12px;
    }
    
    .btn-action {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    .login-form {
        padding: 15px 20px;
        max-width: 100%;
        margin: 0 10px;
        width: calc(100% - 20px);
    }
    
    .login-form .logo {
        width: 50px !important;
        height: 50px !important;
        max-width: 50px !important;
    }
    
    .login-form h4 {
        font-size: 0.9rem !important;
        margin-bottom: 8px;
    }
    
    .login-title {
        font-size: 1rem !important;
    }
    
    .login-subtitle {
        font-size: 0.95rem !important;
    }
    
    .sidebar-menu {
        width: 250px;
    }
    
    /* Mejoras para celulares - tamaño de fuente */
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    /* Prioridad a formularios */
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-control {
        font-size: 16px;
        padding: 10px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    /* Mantener menú emergente */
    .dropdown-menu {
        position: absolute !important;
        z-index: 1000;
    }
    
    /* Ajustar alertas */
    .alert {
        font-size: 0.9rem;
        padding: 10px;
    }
    
    .welcome-small h5 {
        font-size: 16px;
    }
    
    .welcome-small p {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .login-page {
        padding: 10px;
    }
    
    .login-form {
        padding: 15px;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .login-form .logo {
        width: 45px !important;
        height: 45px !important;
        max-width: 45px !important;
    }
    
    .login-form h4 {
        font-size: 0.85rem !important;
        margin-bottom: 8px;
    }
    
    .login-title {
        font-size: 0.95rem !important;
    }
    
    .login-subtitle {
        font-size: 0.9rem !important;
    }
    
    .login-form .form-control {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .btn-primary {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .sidebar-menu {
        width: 220px;
    }
    
    .sidebar-link {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    /* Mejoras adicionales para celulares pequeños */
    body {
        font-size: 13px;
    }
    
    .form-control {
        font-size: 14px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .container {
        padding: 5px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .main-content {
        padding: 20px;
    }
    
    .container {
        max-width: 100%;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .main-content {
        padding: 25px;
    }
}

@media (min-width: 1400px) {
    .main-content {
        padding: 30px;
    }
    
    .card {
        margin-bottom: 25px;
    }
    
    /* Ajustes para computadoras - botones más grandes y centrados */
    .quick-access-btn {
        padding: 15px 30px;
        font-size: 1.1rem;
        border-radius: 10px;
    }
    
    /* Espacios uniformes en dashboard */
    .container {
        max-width: 1200px;
    }
    
    .alert {
        padding: 20px;
        margin-bottom: 20px;
        font-size: 1rem;
    }
    
    /* Centrado vertical y horizontal del contenido */
    .main-content {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    .card {
        padding: 20px;
    }
    
    .card-body {
        padding: 20px;
    }
}

/* Ajustes generales para pantallas medianas */
@media (min-width: 768px) and (max-width: 991px) {
    .main-content {
        padding: 15px;
    }
    
    .quick-access-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
}

/* Notificaciones pequeñas estilo badge */
.notification-badge {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    margin-bottom: 8px;
    display: inline-block;
}

.notification-badge h5 {
    font-size: 0.9rem;
    margin: 0 0 4px 0;
}

.notification-badge p {
    font-size: 0.8rem;
    margin: 0;
}

/* Botón de acceso rápido para notas */
.quick-access-btn {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.quick-access-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
    color: white;
}

/* Bienvenida reducida para móviles */
.welcome-small {
    font-size: 1rem;
}

.welcome-small h1 {
    font-size: 1.4rem;
}

.welcome-small h2 {
    font-size: 1.2rem;
}

.welcome-small h5 {
    font-size: 1.1rem;
}

.welcome-small p {
    font-size: 1rem;
}
