/* pec/css/style.css */
:root {
    --clr-primary: #3884C0;
    --clr-primary-light: #67A8DB;
    --clr-primary-dark: #2c6a99;
    --clr-secondary: #0F172A;
    --clr-accent: #F59E0B;
    --clr-success: #10B981;
    --clr-danger: #EF4444;
    --clr-bg: #F1F5F9;
    --clr-surface: #FFFFFF;
    --clr-text: #1E293B;
    --clr-text-light: #64748B;
    --clr-border: #E2E8F0;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-pill: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--clr-bg); color: var(--clr-text); font-size: 15px; }
h1, h2, h3 { font-family: 'Outfit', sans-serif; font-weight: 700; color: var(--clr-secondary); }

/* Layout */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--clr-secondary); color: white; display: flex; flex-direction: column; flex-shrink: 0; transition: all 0.3s; }
.sidebar-header { padding: 1.5rem; height: var(--topbar-height); display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.logo-text { font-family: 'Outfit'; font-size: 1.7rem; font-weight: 800; color: var(--clr-primary-light); letter-spacing: 1px; }

.sidebar-nav { padding: 1.5rem 0; flex-grow: 1; }
.nav-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; color: #94A3B8; text-decoration: none; transition: 0.2s; border-left: 3px solid transparent; font-weight: 500; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,0.05); border-left-color: var(--clr-primary-light); }
.nav-item i { width: 20px; height: 20px; }

.sidebar-footer { padding: 1.5rem; font-size: 0.8rem; color: #64748B; border-top: 1px solid rgba(255,255,255,0.1); }

/* Main Content */
.main-content { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--topbar-height); background: var(--clr-surface); display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; border-bottom: 1px solid var(--clr-border); }
.topbar-title h1 { font-size: 1.3rem; font-weight: 600; margin: 0; }
.topbar-user { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; }
.avatar { width: 36px; height: 36px; background: var(--clr-primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.btn-icon { background: none; border: none; cursor: pointer; color: var(--clr-text-light); display: flex; padding: 0.5rem; border-radius: var(--radius-sm); transition: 0.2s; }
.btn-icon:hover { background: var(--clr-bg); color: var(--clr-text); }
#menu-toggle { display: none; }

/* Views */
.views-wrapper { flex-grow: 1; padding: 2rem; overflow-y: auto; position: relative; }
.view { display: none; animation: fadeIn 0.4s ease; }
.view.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Dashboard Specs */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: var(--clr-surface); padding: 1.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 1.25rem; border: 1px solid var(--clr-border); transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card.highlight { background: var(--clr-primary); color: white; border-color: var(--clr-primary); }
.stat-card.highlight .stat-title, .stat-card.highlight .stat-value { color: white; }
.stat-card.highlight .stat-icon { background: rgba(255,255,255,0.2); color: white; }

.stat-icon { width: 54px; height: 54px; border-radius: var(--radius-md); background: var(--clr-bg); color: var(--clr-primary); display: flex; align-items: center; justify-content: center; }
.stat-title { font-size: 0.85rem; color: var(--clr-text-light); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.stat-value { font-size: 1.4rem; margin-top: 0.25rem; font-weight: 700; color: #1E293B; }

.dashboard-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1.5rem; }
.panel { background: var(--clr-surface); padding: 2rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--clr-border); margin-bottom: 1.5rem; }
.panel h2 { font-size: 1.2rem; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--clr-border); }
.tag { display: inline-block; padding: 0.4rem 0.8rem; background: var(--clr-bg); border-radius: var(--radius-pill); font-weight: 600; color: var(--clr-primary); font-size: 0.85rem; border: 1px solid var(--clr-border); }

/* Grupos y Equipos */
.filters-bar { background: var(--clr-surface); padding: 1.5rem; border-radius: var(--radius-lg); margin-bottom: 2rem; border: 1px solid var(--clr-border); box-shadow: var(--shadow-sm); }
.input-control { padding: 0.8rem 1rem; border: 1px solid #cbd5e1; border-radius: var(--radius-md); font-size: 1rem; outline: none; transition: 0.2s; background: #fff; width: 100%; font-family: 'Inter', sans-serif;}
.input-control.border-focus:focus { border-color: var(--clr-primary); box-shadow: 0 0 0 3px rgba(56, 132, 192, 0.2); }

.equipos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.equipo-card { background: var(--clr-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--clr-border); overflow: hidden; display: flex; flex-direction: column; transition: 0.3s; }
.equipo-card:hover { box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.equipo-header { padding: 1.25rem; background: #f8fafc; border-bottom: 1px solid var(--clr-border); display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.equipo-title { font-size: 1.15rem; margin: 0; line-height: 1.3; }
.equipo-tema { font-size: 0.85rem; color: var(--clr-text-light); margin-top: 0.25rem; font-weight: 500; display: block; }
.badge { font-size: 0.7rem; padding: 0.25rem 0.6rem; border-radius: var(--radius-pill); font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.badge.pendiente { background: #FEF3C7; color: #D97706; }
.badge.evaluado { background: #D1FAE5; color: #059669; }

.equipo-body { padding: 1.25rem; flex-grow: 1; }
.integrantes-title { font-size: 0.85rem; font-weight: 600; color: var(--clr-text-light); text-transform: uppercase; }
.integrantes-list { list-style: none; margin: 0.5rem 0 0 0; font-size: 0.9rem; color: var(--clr-text); }
.integrantes-list li { padding: 0.35rem 0; border-bottom: 1px dashed var(--clr-border); }
.integrantes-list li:last-child { border-bottom: none; }
.equipo-footer { padding: 1.25rem; border-top: 1px solid var(--clr-border); display: flex; gap: 0.5rem; background: #fff; }

.btn { padding: 0.75rem 1rem; border-radius: var(--radius-md); font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: 0.2s; border: none; display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center; }
.btn-primary { background: var(--clr-primary); color: white; }
.btn-primary:hover { background: var(--clr-primary-dark); }
.btn-secondary { background: var(--clr-bg); color: var(--clr-text); border: 1px solid var(--clr-border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-outline { background: transparent; border: 1px solid var(--clr-border); color: var(--clr-text-light); }
.btn-outline:hover { background: var(--clr-bg); color: var(--clr-danger); border-color: var(--clr-danger); }
.btn-full { width: 100%; }

/* Formularios y Modales */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 2000; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: 2rem 1rem; }
.modal.hidden { display: none !important; }
.modal-content { background: var(--clr-surface); width: 100%; max-width: 550px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: slideUp 0.3s; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--clr-border); display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
.modal-header h2 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 1.5rem; }

.info-alert { background: #EEF2FF; border: 1px solid #C7D2FE; color: #4338CA; padding: 1rem; border-radius: var(--radius-md); margin-bottom: 1.5rem; font-size: 0.95rem; display: flex; align-items: center; justify-content: space-between; }
.info-alert a { color: white; background: #4338CA; padding: 0.5rem 1rem; border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; transition: 0.2s;}
.info-alert a:hover { background: #3730A3; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--clr-text-light); margin-bottom: 0.5rem; }
.puntaje-input { font-size: 1.5rem; max-width: 180px; font-weight: 700; color: var(--clr-primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 2rem; border-top: 1px solid var(--clr-border); padding-top: 1.5rem; }

/* Tabla concentrado */
.table-responsive { overflow-x: auto; background: white; border-radius: var(--radius-md); border: 1px solid var(--clr-border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th, .data-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--clr-border); }
.data-table th { background: #f8fafc; font-weight: 700; color: var(--clr-text-light); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.data-table tbody tr:hover { background: #f1f5f9; }
.data-table td { color: #334155; font-weight: 500; }

.panel-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--clr-border); }
.panel-header-flex h2 { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* Loader */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.7); backdrop-filter: blur(4px); z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 45px; height: 45px; border: 4px solid var(--clr-border); border-top-color: var(--clr-primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { font-weight: 600; color: var(--clr-primary); font-size: 1.1rem; }
.hidden { display: none !important; }

/* Responsive Options */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -100%; z-index: 1050; height: 100vh; box-shadow: var(--shadow-lg); }
    .sidebar.open { left: 0; }
    #menu-toggle { display: block; }
    .views-wrapper { padding: 1rem; }
    .dashboard-panels { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .panel-header-flex { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
