/* ═══════════════════════════════════════════════════════════════════════════
   SGJE — Sistema de Gestión de Juicios Evaluativos · style.css
   Diseño System Premium (Modern, Clean, Professional)
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Paleta de Colores - Verde Sena Moderno */
    --primary:          #009a60;
    --primary-hover:    #007d4c;
    --primary-light:    #e6f6f0;
    --bg:               #f8fafc;
    --card-bg:          #ffffff;
    
    /* Sidebar (Dark Mode Premium) */
    --sidebar-bg:       #0f172a;
    --sidebar-hover:    rgba(255, 255, 255, 0.04);
    --sidebar-active:   #009a60;
    
    /* Neutros */
    --border:           #e2e8f0;
    --border-hover:     #cbd5e1;
    --text-main:        #0f172a;
    --text-muted:       #64748b;
    
    /* Estados Semánticos */
    --success:          #10b981;
    --success-light:    #ecfdf5;
    --warning:          #f59e0b;
    --warning-light:    #fffbeb;
    --danger:           #ef4444;
    --danger-light:     #fef2f2;
    --info:             #3b82f6;
    --info-light:       #eff6ff;

    /* Estructura y Sombras */
    --radius:           16px;
    --radius-sm:        10px;
    --shadow-sm:        0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --shadow-md:        0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg:        0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    
    --transition:       all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    transition: var(--transition);
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Layout Estructural ───────────────────────────────────────────────────── */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: #ffffff;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.15);
    transition: var(--transition);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0; /* previene desbordamiento en flexbox */
    transition: var(--transition);
}

/* ── Sidebar Componentes ───────────────────────────────────────────────────── */
.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
}

.logo-box {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 154, 96, 0.3);
}

.logo-box i {
    width: 20px;
    height: 20px;
}

.brand-name {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
    color: #f8fafc;
    line-height: 1.2;
}

.sidebar-desc {
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    display: block;
    margin-top: 1px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 20px 24px 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    margin: 0 12px;
    border-radius: var(--radius-sm);
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 154, 96, 0.25);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Topbar (Barra Superior) ──────────────────────────────────────────────── */
.topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

/* ── Contenedor General ───────────────────────────────────────────────────── */
.container {
    padding: 32px 40px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Tarjetas (Cards) ─────────────────────────────────────────────────────── */
.card, .glass-panel, .filters-card, .table-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover, .glass-panel:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* ── Actualización de Datos (Upload Strip) ─────────────────────────────────── */
.upload-strip {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 2px dashed var(--border);
    transition: var(--transition);
}

.upload-strip:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.upload-strip:hover .upload-icon {
    background: var(--primary);
    color: #ffffff;
    transform: scale(1.05);
}

.upload-info h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.upload-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Grids y Estructuras de Contenedores ───────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-val {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-wrap {
    height: 240px;
    position: relative;
}

/* ── Filtros y Formularios ────────────────────────────────────────────────── */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: flex-end;
}

.form-group, .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label, .filter-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control, .filter-control {
    width: 100%;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    color: var(--text-main);
    transition: var(--transition);
}

.form-control:focus, .filter-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 154, 96, 0.12);
}

/* ── Botones (Buttons) ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(0, 154, 96, 0.18);
}

.btn-outline {
    background: var(--card-bg);
    color: var(--text-main);
    border-color: var(--border);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.18);
}

/* ── Tablas (Tables) ──────────────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: #f8fafc;
    padding: 14px 24px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    color: #334155;
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.4);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ── Badges y Estados ─────────────────────────────────────────────────────── */
.badge, .status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
}

.badge.aprobado, .status-pill.aprobado {
    background: var(--success-light);
    color: var(--success);
}

.badge.por-evaluar, .status-pill.por-evaluar {
    background: var(--warning-light);
    color: var(--warning);
}

.badge.no-aprobado, .status-pill.no-aprobado {
    background: var(--danger-light);
    color: var(--danger);
}

.badge.en-formacion, .status-pill.en-formación {
    background: var(--info-light);
    color: var(--info);
}

/* ── Paginación (Pagination) ──────────────────────────────────────────────── */
.pagination-bar, .pagination-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.page-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not([disabled]) {
    border-color: var(--border-hover);
    background: #f1f5f9;
}

.page-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn.active {
    background: var(--sidebar-bg);
    color: #ffffff;
    border-color: var(--sidebar-bg);
}

.page-info {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 8px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── Notificaciones Bell & Panel ─────────────────────────────────────────── */
.notif-wrap-global {
    position: relative;
}

.notif-bell-btn-global {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.notif-bell-btn-global:hover {
    background: #f8fafc;
    border-color: var(--border-hover);
    transform: scale(1.02);
}

.notif-badge-global {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--danger);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 99px;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Table Helpers ────────────────────────────────────────────────────────── */
.table-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.table-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}
.table-user-info {
    display: flex;
    flex-direction: column;
}
.table-user-name {
    font-weight: 600;
    color: var(--text-main);
}
.table-user-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}
.table-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 12.5px;
}
.table-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ── Responsive Adaptations ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar {
        width: 72px;
    }
    .brand-name, .nav-item span, .nav-label, .sidebar-desc {
        display: none !important;
    }
    .sidebar-header {
        justify-content: center;
        padding: 20px 10px;
    }
    .main-content {
        margin-left: 72px;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
        margin: 0 8px;
    }
    .nav-item.active::before {
        left: -8px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 16px 20px;
    }
    .container {
        padding: 24px 20px;
        gap: 20px;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .upload-strip {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 20px;
    }
    .upload-icon {
        margin: 0 auto;
    }
    .upload-strip form {
        flex-direction: column;
        width: 100%;
    }
    .upload-strip form label, .upload-strip form button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 60px;
    }
    .main-content {
        margin-left: 60px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .nav-item {
        margin: 0 4px;
    }
    .topbar h1 {
        font-size: 16px;
    }
}
