@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --primary-green: #2ecc71; /* Verde intenso del dashboard */
    --light-green: #eafaf1;   /* Fondo suave del icono */
    --dark-sidebar: #2c3e50;  /* Azul oscuro barra lateral */
    --text-dark: #333;
    --text-grey: #7f8c8d;
    --bg-body: #f4f6f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', sans-serif; }
a { text-decoration: none; }
ul { list-style: none; }

/* =========================================
   ESTILOS GENERALES Y DASHBOARD
   ========================================= */
body { background-color: var(--bg-body); color: var(--text-dark); }

/* --- LAYOUT PRINCIPAL --- */
.admin-wrapper { display: flex; min-height: 100vh; }

/* --- SIDEBAR (Barra Lateral) --- */
.sidebar {
    width: 260px;
    background-color: var(--dark-sidebar);
    color: white;
    position: fixed;
    height: 100%;
    display: flex;
    flex-direction: column;
    left: 0; top: 0;
    z-index: 100;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding-left: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header span { color: var(--primary-green); margin-right: 5px; }

.sidebar-menu { margin-top: 20px; flex: 1; }

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #b0c4de;
    font-size: 0.95rem;
    transition: 0.3s;
    border-left: 4px solid transparent;
}

.sidebar-menu li a i { width: 30px; font-size: 1.1rem; }

/* Estado Activo y Hover */
.sidebar-menu li a:hover, 
.sidebar-menu li a.active {
    background-color: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--primary-green);
}

/* Item especial: Dashboard Activo */
.sidebar-menu li a.dashboard-active {
    background-color: var(--primary-green);
    color: white;
    border-left-color: var(--primary-green);
}

.logout-link {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.logout-link a { color: #e74c3c; display: flex; align-items: center; gap: 10px; font-weight: 600; }

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Barra Superior Blanca */
.top-header {
    background: white;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-bottom: 1px solid #e1e1e1;
}

.top-header h2 { font-size: 1.5rem; color: #2c3e50; font-weight: 700; }
.user-welcome { font-size: 0.95rem; color: #555; font-weight: 500; }

/* Grid de Tarjetas */
.content-padding { padding: 40px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

/* --- TARJETAS DE MÓDULOS --- */
.module-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    gap: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: var(--primary-green);
}

.icon-circle {
    width: 70px;
    height: 70px;
    background-color: var(--light-green);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.icon-circle i { font-size: 2rem; color: var(--primary-green); }

.card-info h3 { font-size: 1.2rem; color: #2c3e50; margin-bottom: 8px; font-weight: 700; }
.card-info p { font-size: 0.85rem; color: var(--text-grey); line-height: 1.4; }

/* Responsive Dashboard */
@media (max-width: 768px) {
    .sidebar { width: 70px; }
    .sidebar span, .user-welcome { display: none; }
    .main-content { margin-left: 70px; }
    .top-header { padding: 0 20px; }
    .dashboard-grid { grid-template-columns: 1fr; }
}


/* =========================================
   ESTILOS ESPECÍFICOS DEL LOGIN
   ========================================= */

/* Fondo degradado elegante */
body.login-page {
    background: linear-gradient(135deg, var(--dark-sidebar) 0%, var(--primary-green) 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tarjeta de Login */
.login-card {
    background: white;
    width: 90%;
    max-width: 400px;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    text-align: center;
}

/* Cabecera del Login */
.login-header { margin-bottom: 30px; }
.login-header img { height: 60px; margin-bottom: 15px; }
.login-header h3 { color: var(--dark-sidebar); font-size: 1.5rem; font-weight: 700; margin-bottom: 5px; }
.login-header p { color: var(--text-grey); font-size: 0.9rem; }

/* Inputs */
.input-group { position: relative; margin-bottom: 20px; text-align: left; }
.input-group label { display: block; font-size: 0.85rem; color: var(--text-dark); margin-bottom: 5px; font-weight: 600; }
.input-wrapper { position: relative; }
.input-wrapper i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--primary-green); }

.input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: 0.3s;
    background-color: #f9f9f9;
}
.input-wrapper input:focus {
    border-color: var(--primary-green);
    background-color: white;
}

/* Botón */
.btn-login {
    width: 100%;
    background-color: var(--primary-green);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}
.btn-login:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

/* Alerta Error */
.alert-error {
    background-color: #fee2e2;
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Link Volver */
.back-home {
    display: block;
    margin-top: 25px;
    color: var(--text-grey);
    font-size: 0.9rem;
    transition: 0.3s;
}
.back-home:hover { color: var(--primary-green); }

/* ==========================================================================
   VISTA MÓVIL (SOLO SE ACTIVA EN CELULARES)
   No afecta en nada a la versión de PC
   ========================================================================== */
@media (max-width: 768px) {
    
    /* 1. Sidebar: Se esconde a la izquierda */
    .sidebar {
        left: -270px; 
        width: 260px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: left 0.3s ease;
    }
    
    /* Clase para mostrarlo cuando se toque el botón */
    .sidebar.active { left: 0; }

    /* Botón X para cerrar (solo visible en móvil) */
    .close-sidebar-btn { display: block !important; margin-left: auto; margin-right: 15px; }

    /* 2. El contenido ocupa el 100% de la pantalla */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* 3. Header: Se ajusta y muestra el botón hamburguesa */
    .top-header {
        padding: 0 15px;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* ¡IMPORTANTE! Hacemos visible el botón de menú SOLO AQUÍ */
    .menu-toggle { display: block !important; }

    .top-header h2 { font-size: 1.1rem; }
    .user-welcome { display: none; } /* Ocultar bienvenida larga */

    /* 4. Grids se vuelven de 1 columna */
    .dashboard-grid, .grid-dashboard, .form-grid { 
        grid-template-columns: 1fr !important; 
    }

    /* 5. Tablas con Scroll Horizontal (Deslizar con dedo) */
    .table-container { 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
    }
    table { min-width: 700px; } /* Fuerza el ancho para activar scroll */

    /* 6. Modales ocupan toda la pantalla */
    .modal-content {
        width: 95% !important;
        margin: 20px auto;
        padding: 15px;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .input-group, .row { display: block !important; }
    .input-full { margin-bottom: 10px; }
    
    /* 7. Calendario ajustado */
    .fc-header-toolbar { flex-direction: column; gap: 10px; }
    .fc-toolbar-chunk { display: flex; justify-content: center; width: 100%; gap: 5px; }
}