/* --- VARIABLES DE MARCA --- */
:root {
    --amarillo: #F9D806;
    --rojo: #E21F26;
    --negro: #121212;
    --gris-oscuro: #2C2C2C;
    --gris-claro: #F4F6F8;
    --blanco: #FFFFFF;
    --borde: #E5E7EB;
    --sombra-suave: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* --- RESET BÁSICO --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Open Sans', sans-serif; 
    background-color: var(--gris-claro); 
    color: #333; 
    overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- ESTRUCTURA PRINCIPAL (APP LAYOUT) --- */
.app-container {
    display: flex;
    height: 100vh;
}

/* --- SIDEBAR (MENÚ LATERAL) --- */
.sidebar {
    width: 260px;
    background-color: var(--negro);
    color: var(--blanco);
    display: flex;
    flex-direction: column;
    transition: 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-logo { height: 40px; }
.brand-text { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.1rem; }

.nav-menu {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    padding: 15px 20px 5px;
    letter-spacing: 1px;
    font-weight: 700;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ccc;
    transition: 0.3s;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
}

.nav-menu a i { width: 30px; font-size: 1.1rem; }
.nav-menu a:hover, .nav-menu a.active {
    background-color: rgba(249, 216, 6, 0.1);
    color: var(--amarillo);
    border-left-color: var(--amarillo);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex; align-items: center; gap: 10px;
    color: var(--rojo); font-weight: 600; transition: 0.3s;
}
.logout-btn:hover { color: #ff4a4a; }

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* TOP BAR */
.top-bar {
    height: 70px;
    background-color: var(--blanco);
    border-bottom: 1px solid var(--borde);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    position: sticky; top: 0; z-index: 90;
}

.search-box {
    display: flex; align-items: center;
    background: var(--gris-claro);
    padding: 10px 20px; border-radius: 50px;
    width: 300px;
}
.search-box i { color: #888; margin-right: 10px; }
.search-box input { border: none; background: transparent; outline: none; width: 100%; font-family: 'Open Sans', sans-serif;}

.user-profile { display: flex; align-items: center; gap: 25px; }
.notifications { position: relative; cursor: pointer; font-size: 1.2rem; color: #555; }
.badge {
    position: absolute; top: -5px; right: -8px;
    background: var(--rojo); color: white; font-size: 0.7rem;
    font-weight: bold; width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.user-info { display: flex; flex-direction: column; text-align: right; }
.user-name { font-weight: 700; font-size: 0.95rem; color: var(--negro); }
.user-role { font-size: 0.8rem; color: #888; }
.avatar i { font-size: 2.2rem; color: var(--amarillo); }

/* DASHBOARD AREA */
.dashboard-area { padding: 40px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* Banner de Bienvenida */
.welcome-banner {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 40px;
}
.welcome-text h1 { font-size: 1.8rem; color: var(--negro); margin-bottom: 5px; }
.welcome-text p { color: #666; font-size: 1rem; }

.btn-primary {
    background: var(--amarillo); color: var(--negro);
    border: none; padding: 12px 25px; border-radius: 8px;
    font-weight: 700; font-family: 'Montserrat', sans-serif;
    cursor: pointer; transition: 0.3s; box-shadow: 0 4px 15px rgba(249, 216, 6, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); background: var(--negro); color: var(--amarillo); }

/* GRID DE WIDGETS */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}
.col-span-2 { grid-column: span 2; }

.widget-card {
    background: var(--blanco);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--sombra-suave);
    border: 1px solid var(--borde);
    display: flex; flex-direction: column;
}

.widget-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--gris-claro);
}
.widget-header h3 { font-size: 1.1rem; color: var(--negro); display: flex; align-items: center; gap: 10px; }
.icon-yellow { color: var(--amarillo); }
.icon-red { color: var(--rojo); }
.view-all { font-size: 0.85rem; color: #0066cc; font-weight: 600; }

/* Estilos Internos de Widgets */
/* Progreso */
.progress-module { padding: 10px 0; }
.module-info { display: flex; justify-content: space-between; margin-bottom: 10px; }
.module-info h4 { font-size: 0.95rem; color: #444; }
.module-info span { font-weight: 700; color: var(--negro); font-size: 0.9rem;}
.progress-bar-bg { width: 100%; height: 10px; background: #eee; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--amarillo); border-radius: 5px; }

.btn-outline-dark {
    background: transparent; border: 2px solid var(--negro); color: var(--negro);
    padding: 8px 20px; border-radius: 5px; font-weight: 700; cursor: pointer; transition: 0.3s;
}
.btn-outline-dark:hover { background: var(--negro); color: white; }
.mt-15 { margin-top: 15px; }

/* Enlaces Rápidos (SG Calidad) */
.quick-links li { margin-bottom: 15px; }
.quick-links a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 15px; background: var(--gris-claro); border-radius: 8px;
    font-size: 0.9rem; font-weight: 600; transition: 0.3s;
}
.quick-links a:hover { background: var(--amarillo); color: var(--negro); transform: translateX(5px); }
.quick-links i { color: var(--rojo); font-size: 1.2rem; }
.quick-links a:hover i { color: var(--negro); }

/* Calendario / Eventos */
.event-item {
    display: flex; gap: 15px; margin-bottom: 20px;
}
.event-date {
    background: rgba(249, 216, 6, 0.2); color: var(--negro);
    min-width: 55px; height: 55px; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.event-date .day { font-size: 1.2rem; font-weight: 800; line-height: 1; }
.event-date .month { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.alert-date { background: rgba(226, 31, 38, 0.1); color: var(--rojo); }

.event-details h4 { font-size: 0.95rem; color: var(--negro); margin-bottom: 3px; }
.event-details p { font-size: 0.85rem; color: #666; }

/* Widget Software .EXE */
.software-card {
    background: var(--negro); color: white; position: relative; overflow: hidden;
    justify-content: center;
}
.software-content { position: relative; z-index: 2; }
.software-content h3 { color: var(--amarillo); margin-bottom: 10px; font-size: 1.2rem; }
.software-content p { font-size: 0.9rem; color: #ccc; margin-bottom: 20px; line-height: 1.5; }
.btn-download {
    display: inline-block; background: var(--rojo); color: white;
    padding: 10px 20px; border-radius: 8px; font-weight: 700; font-size: 0.9rem;
    transition: 0.3s;
}
.btn-download:hover { background: white; color: var(--rojo); }
.bg-icon {
    position: absolute; right: -20px; bottom: -20px;
    font-size: 8rem; color: rgba(255,255,255,0.05); z-index: 1;
}

/* --- RESPONSIVE BÁSICO --- */
@media (max-width: 1024px) {
    .widgets-grid { grid-template-columns: repeat(2, 1fr); }
    .col-span-2 { grid-column: span 1; }
}
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; flex-direction: row; justify-content: space-between; padding: 10px; }
    .nav-menu { display: none; } /* En móvil se ocultaría bajo un botón hamburguesa */
    .widgets-grid { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: span 1; }
    .welcome-banner { flex-direction: column; text-align: left; align-items: flex-start; gap: 15px; }
}