/* ============================================================
   SSE - Sistema de Seguimiento del Egresado
   Universidad Privada María Serrana (UPMS)
   Estilos institucionales
   ============================================================ */

:root {
    --primary:       #25604C;
    --primary-dark:  #1a4536;
    --primary-light: #2d7359;
    --secondary:     #64748b;
    --success:       #22c55e;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --info:          #3b82f6;
    --bg-dark:       #1a3a2f;
    --bg-darker:     #0f2a1f;
    --bg-light:      #f8fafc;
    --bg-white:      #ffffff;
    --text-primary:  #1e293b;
    --text-secondary:#64748b;
    --text-light:    #94a3b8;
    --text-white:    #ffffff;
    --border-color:  #e2e8f0;
    --shadow:        0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg:     0 4px 6px rgba(0,0,0,0.1);
    --radius:        8px;
    --radius-lg:     12px;
    --font-family:   -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --sidebar-width: 260px;
}

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

html, body { overflow-x:hidden; width:100%; max-width:100vw; }

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---- LOGIN ---- */
.login-page {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 100%);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
}

.login-container { width: 100%; max-width: 420px; padding: 20px; }

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { width: 80px; height: 80px; margin-bottom: 16px; }
.login-header h1 { font-size: 1.4rem; color: var(--primary); font-weight: 700; }
.login-header p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }
.login-footer { text-align: center; margin-top: 20px; color: var(--text-light); font-size: 0.8rem; }

/* ---- LAYOUT ---- */
.admin-page { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    position: fixed; top: 0; left: 0; height: 100vh;
    display: flex; flex-direction: column;
    z-index: 100; overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo { width: 40px; height: 40px; }

.sidebar-brand strong {
    display: block; color: var(--text-white);
    font-size: 1rem; font-weight: 700;
}
.sidebar-brand small { color: rgba(255,255,255,0.6); font-size: 0.75rem; }

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    transition: all 0.2s;
    position: relative;
}
.nav-item:hover { color: var(--text-white); background: rgba(255,255,255,0.08); }
.nav-item.active {
    color: var(--text-white);
    background: rgba(255,255,255,0.12);
    border-right: 3px solid var(--primary-light);
}
.nav-icon { width: 20px; flex-shrink: 0; }

.nav-section {
    padding: 16px 16px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.35);
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px;
}
.user-info { flex: 1; }
.user-info strong { display: block; color: white; font-size: 0.85rem; }
.user-info small { color: rgba(255,255,255,0.55); font-size: 0.75rem; }
.btn-logout {
    color: rgba(255,255,255,0.6);
    padding: 6px;
    border-radius: var(--radius);
    transition: all 0.2s;
}
.btn-logout:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex; flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow);
}
.sidebar-toggle { display: none; }
.page-title { font-size: 1.1rem; font-weight: 600; flex: 1; }
.top-bar-right { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 0.9rem; color: var(--text-secondary); }
.header-logo { width: 32px; height: 32px; }

.content-area { padding: 24px; flex: 1; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ---- ALERTS ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 0 24px 16px;
    font-size: 0.9rem;
    border-left: 4px solid;
}
.alert-success { background: #f0fdf4; border-color: var(--success); color: #166534; }
.alert-danger   { background: #fef2f2; border-color: var(--danger); color: #991b1b; }
.alert-warning  { background: #fffbeb; border-color: var(--warning); color: #92400e; }
.alert-info     { background: #eff6ff; border-color: var(--info); color: #1e40af; }

/* ---- CARDS ---- */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.card-title { font-size: 1rem; font-weight: 600; }

/* ---- STATS GRID ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    border-left: 4px solid var(--primary);
}
.stat-card.success { border-color: var(--success); }
.stat-card.warning { border-color: var(--warning); }
.stat-card.danger  { border-color: var(--danger); }
.stat-card.info    { border-color: var(--info); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; margin-top: 4px; }
.stat-sub   { font-size: 0.75rem; color: var(--text-light); margin-top: 4px; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; color: var(--text-primary); }
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem; font-family: var(--font-family);
    color: var(--text-primary); background: var(--bg-white);
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,96,76,0.1); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius); border: none; cursor: pointer;
    font-size: 0.875rem; font-weight: 500; font-family: var(--font-family);
    transition: all 0.2s;
    text-decoration: none;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger  { background: var(--danger); color: white; }
.btn-info    { background: var(--info); color: white; }
.btn-outline {
    background: transparent; color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; }

/* ---- TABLE ---- */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    background: var(--bg-light); padding: 10px 14px;
    text-align: left; font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); border-bottom: 2px solid var(--border-color);
    text-transform: uppercase; letter-spacing: 0.04em;
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border-color); font-size: 0.875rem; vertical-align: middle; }
tr:hover td { background: #f8fafc; }
tr:last-child td { border-bottom: none; }

/* ---- BADGES ---- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef9c3; color: #713f12; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #d1fae5; color: #065f46; }
.badge-gray    { background: #f1f5f9; color: #475569; }

/* ---- SEARCH / FILTERS ---- */
.filter-bar {
    display: flex; gap: 10px; flex-wrap: wrap;
    align-items: center; margin-bottom: 16px;
}
.filter-bar .form-control { width: auto; min-width: 150px; }
.search-input { position: relative; }
.search-input .form-control { padding-left: 38px; }
.search-input .search-icon {
    position: absolute; left: 11px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-light); pointer-events: none;
}

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 20px; }
.page-btn {
    padding: 6px 12px; border-radius: var(--radius);
    border: 1px solid var(--border-color); background: white;
    color: var(--text-primary); cursor: pointer; font-size: 0.875rem;
    text-decoration: none;
}
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:hover:not(.active) { background: var(--bg-light); }

/* ---- DASHBOARD ---- */
.welcome-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: white;
    margin-bottom: 24px;
}
.welcome-header h2 { font-size: 1.4rem; }
.welcome-header p  { opacity: 0.85; font-size: 0.9rem; margin-top: 4px; }

/* ---- INDICADORES ---- */
.indicador-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--border-color);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 16px;
}
.indicador-card.cumple   { border-color: var(--success); }
.indicador-card.no-cumple { border-color: var(--danger); }
.indicador-code {
    font-size: 0.75rem; font-weight: 700;
    color: var(--text-secondary); letter-spacing: 0.05em;
    min-width: 70px;
}
.indicador-nombre { flex: 1; font-weight: 500; }
.indicador-valor {
    font-size: 1.5rem; font-weight: 700;
    color: var(--primary); min-width: 80px; text-align: right;
}
.indicador-meta { font-size: 0.8rem; color: var(--text-light); text-align: right; }

/* ---- ENCUESTA PÚBLICA ---- */
.encuesta-page {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    min-height: 100vh;
    padding: 40px 20px;
}
.encuesta-container { max-width: 700px; margin: 0 auto; }
.encuesta-header {
    text-align: center; margin-bottom: 32px; color: white;
}
.encuesta-header img { width: 70px; height: 70px; margin-bottom: 12px; }
.encuesta-header h1 { font-size: 1.5rem; }
.encuesta-header p  { opacity: 0.85; }

.encuesta-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    margin-bottom: 20px;
}
.bloque-titulo {
    font-size: 1rem; font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px; padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.escala-grupo { margin-bottom: 16px; }
.escala-label { font-size: 0.875rem; margin-bottom: 8px; }
.escala-opciones { display: flex; gap: 8px; flex-wrap: wrap; }
.escala-opciones label {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius); min-width: 48px;
    transition: all 0.2s; font-size: 0.8rem; text-align: center;
}
.escala-opciones input[type=radio] { display: none; }
.escala-opciones input[type=radio]:checked + span { display: block; }
.escala-opciones label:has(input:checked) {
    border-color: var(--primary);
    background: rgba(37,96,76,0.08);
    color: var(--primary);
    font-weight: 600;
}

/* ---- PLAN DESARROLLO ---- */
.oe-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}
.oe-code { font-weight: 700; color: var(--primary); font-size: 0.85rem; }
.oe-descripcion { margin: 8px 0; }
.votos-bar { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.voto-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.voto-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---- SECTIONS ---- */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-header h3 { font-size: 1rem; font-weight: 600; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state svg { margin-bottom: 16px; color: var(--text-light); }
.empty-state p { font-size: 1rem; }

/* ---- SPLASH ---- */
.splash-screen {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, var(--bg-dark), var(--primary));
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}
.splash-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.splash-logo { width: 100px; height: 100px; filter: brightness(0) invert(1); animation: splashScale 1.2s ease-out forwards; }
.splash-spinner {
    width: 30px; height: 30px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes splashScale { from { opacity:0; transform:scale(0.5); } to { opacity:1; transform:scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE (mobile) ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .sidebar-toggle {
        display: flex; align-items: center; gap: 6px;
        background: var(--primary); color: white;
        padding: 8px 12px; border-radius: var(--radius); border: none;
        cursor: pointer; font-size: 0.85rem;
    }
    .main-content { margin-left: 0; }
    .content-area { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-control { width: 100%; }
    .form-row { grid-template-columns: 1fr; }
    table { font-size: 0.8rem; }
}
