:root {
    --ciu-blue: #1b1e3f;    /* Azul del fondo del escudo */
    --ciu-gold: #f4b41a;    /* Amarillo/Dorado de los rayos */
    --ciu-light: #f4f6f9;
    --text-dark: #333333;
    --text-light: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- LOGIN --- */
.login-body {
    background-color: var(--ciu-light);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    border-top: 5px solid var(--ciu-blue);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    max-width: 150px;
    margin-bottom: 15px;
}

.login-header h2 {
    color: var(--ciu-blue);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
}

.form-group input:focus {
    border-color: var(--ciu-gold);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--ciu-blue);
    color: var(--text-light);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: var(--ciu-gold);
    color: var(--ciu-blue);
}

.alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* --- DASHBOARD --- */
.dashboard-body {
    display: flex;
    height: 100vh;
    background-color: var(--ciu-light);
}

.sidebar {
    width: 250px;
    background-color: var(--ciu-blue);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
}

/* Ajustes del Logo y Cabecera Lateral */
.sidebar-brand {
    padding: 25px 20px; 
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    background-color: #ffffff; 
}

.sidebar-logo {
    max-width: 110px; /* Logo más pequeño */
    height: auto;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.05); 
}

/* Menú Lateral Moderno */
.sidebar-nav {
    flex-grow: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav ul li a {
    display: block;
    padding: 12px 20px;
    margin: 4px 16px; /* Separación de los bordes (tipo píldora) */
    color: #a0aec0; /* Texto más sutil por defecto */
    text-decoration: none;
    border-radius: 8px; 
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar-nav ul li a:hover, 
.sidebar-nav ul li.active a {
    background-color: rgba(244, 180, 26, 0.1); /* Fondo translúcido dorado */
    color: var(--ciu-gold); 
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    display: block;
    text-align: center;
    color: var(--text-light);
    text-decoration: none;
    padding: 10px;
    border: 1px solid var(--ciu-gold);
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background-color: var(--ciu-gold);
    color: var(--ciu-blue);
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Barra Superior Refinada */
.topbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.topbar h1 {
    font-size: 18px; 
    font-weight: 600;
    color: var(--ciu-blue);
}

.content {
    padding: 30px;
}

/* Tarjetas (Cards) Modernas */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.card {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--ciu-gold); /* Línea dorada superior */
}

.card:hover {
    transform: translateY(-5px); /* Efecto de elevación */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card h3 {
    color: #718096;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.card-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--ciu-blue);
    margin-top: 12px;
}

/* Panel Principal de Contenido */
.panel-modulo {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

/* =========================================
   HACER EL SISTEMA RESPONSIVE (MÓVIL / TABLET)
   ========================================= */

/* Botón del menú hamburguesa (Oculto en PC) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--ciu-blue);
    cursor: pointer;
}

@media (max-width: 768px) {
    /* --- Dashboard General --- */
    .dashboard-body {
        flex-direction: column;
    }

    /* --- Menú Lateral (Oculto tipo Off-Canvas) --- */
    .sidebar {
        position: fixed;
        left: -250px; /* Escondido a la izquierda */
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    }

    /* Clase que se activa con JavaScript para mostrar el menú */
    .sidebar.active {
        left: 0; 
    }

    /* --- Barra Superior --- */
    .topbar {
        padding: 15px 20px;
    }

    .menu-toggle {
        display: block; /* Mostramos el botón hamburguesa */
        margin-right: 15px;
    }

    /* Alinear título y botón en la barra superior */
    .topbar-left {
        display: flex;
        align-items: center;
    }

    /* --- Contenido y Tarjetas --- */
    .content {
        padding: 15px; /* Menos espacio a los bordes en móviles */
    }

    .cards-grid {
        grid-template-columns: 1fr; /* 1 sola columna en teléfonos */
        gap: 15px;
    }

    /* --- Login --- */
    .login-container {
        padding: 30px 20px;
        width: 90%;
    }
}