/* Sistema Educativo - Estilos principales (paleta login) */
:root {
    --primary: #1e3a8a;
    --primary-light: #2563eb;
    --primary-dark: #0b1f4a;
    --accent: #0ea5e9;
    --accent-light: #38bdf8;
    --bg: #eef2f7;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e2e8f0;
    --success: #059669;
    --error: #dc2626;
    --warning: #d97706;
    --info: #2563eb;
    --sidebar-width: 260px;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(11, 31, 74, 0.08);
    --shadow-lg: 0 12px 40px rgba(11, 31, 74, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ========== AUTH / LOGIN ========== */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #eef2f7 0%, #f8fafc 50%, #e8eef5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
    width: 100%;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 560px;
}

.auth-panel-brand {
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 24px 0 8px;
    line-height: 1.3;
}

.auth-brand-content p {
    opacity: 0.85;
    font-size: 0.95rem;
}

.auth-brand-icon {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.12);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
}

.auth-brand-logo {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
}

.auth-features {
    list-style: none;
    margin-top: 32px;
}

.auth-features li {
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    opacity: 0.9;
    font-size: 0.9rem;
}

.auth-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-light);
    font-weight: 700;
}

.auth-brand-footer {
    font-size: 0.8rem;
    opacity: 0.6;
}

.auth-panel-form {
    padding: 48px 40px;
    display: flex;
    align-items: center;
}

.auth-form-container { width: 100%; max-width: 360px; margin: 0 auto; }

.auth-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.auth-form-header p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.auth-form .form-group { margin-bottom: 20px; }

.auth-form label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: var(--text);
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form input[type="number"],
.auth-form input[type="date"],
.auth-form input[type="time"],
.auth-form select,
.auth-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
    background: #fff;
}

.form-row { margin-bottom: 20px; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-block { width: 100%; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.auth-footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
}

.install-card .auth-brand { text-align: center; margin-bottom: 24px; }
.install-card .auth-logo { font-size: 3rem; margin-bottom: 12px; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.alert-info { background: #eff6ff; color: var(--info); border: 1px solid #bfdbfe; }

.text-muted { color: var(--text-muted); font-size: 0.9rem; }

/* ========== DASHBOARD LAYOUT ========== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo img {
    max-height: 36px;
    max-width: 36px;
    object-fit: contain;
    border-radius: 8px;
}

.sidebar-nav { padding: 16px 12px; }

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.5;
    padding: 12px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-item.active {
    background: rgba(201, 162, 39, 0.25);
    color: var(--accent-light);
}

.nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.9;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--bg-card);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.topbar-left p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.period-badge {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: var(--primary-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-info { text-align: right; }
.user-info .name { font-weight: 600; font-size: 0.9rem; display: block; }
.user-info .role { font-size: 0.75rem; color: var(--text-muted); }

.page-content { padding: 28px; flex: 1; }

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-card .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 1.25rem;
}

.kpi-card .kpi-icon.blue { background: #dbeafe; }
.kpi-card .kpi-icon.green { background: #d1fae5; }
.kpi-card .kpi-icon.gold { background: #fef3c7; }
.kpi-card .kpi-icon.purple { background: #ede9fe; }

.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.kpi-card .kpi-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Cards & Tables */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.card-body { padding: 24px; }

.table-responsive { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th,
table.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table.data-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
    background: #f8fafc;
}

table.data-table tr:hover td { background: #fafbfc; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Forms in admin */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin: 24px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}

.preview-image {
    max-width: 120px;
    max-height: 80px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-top: 8px;
}

.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.error-page h1 { font-size: 4rem; color: var(--primary); }
.error-page p { color: var(--text-muted); margin: 16px 0 24px; }

/* Responsive */
@media (max-width: 768px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-panel-brand { display: none; }
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .landing-hero-grid { grid-template-columns: 1fr; }
    .landing-menu { display: none; }
    .portal-cards { grid-template-columns: 1fr; }
}

/* ========== LANDING PAGE ========== */
.landing-body { background: #f8fafc; }

.landing-container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.landing-header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.landing-logo { max-height: 42px; }
.landing-logo-icon { font-size: 1.8rem; }

.landing-menu { display: flex; align-items: center; gap: 20px; }
.landing-menu a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.landing-menu a:hover { color: var(--primary); }

.landing-hero {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, #eef2f7 0%, #ffffff 50%, #f0f7ff 100%);
}

.landing-hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
}

.landing-tag {
    display: inline-block;
    background: rgba(30,58,95,0.08);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.landing-hero-text h1 {
    font-size: 2.4rem;
    line-height: 1.2;
    color: var(--primary);
    margin-bottom: 16px;
}

.landing-hero-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 540px;
    margin-bottom: 28px;
}

.landing-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.landing-hero-cards { position: relative; min-height: 320px; }

.landing-float-card {
    position: absolute;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
}

.landing-float-card span { font-size: 2rem; }
.landing-float-card strong { display: block; color: var(--primary); }
.landing-float-card small { color: var(--text-muted); font-size: 0.8rem; }
.landing-float-1 { top: 20px; left: 0; }
.landing-float-2 { top: 120px; right: 0; }
.landing-float-3 { bottom: 20px; left: 40px; }

.landing-section { padding: 72px 0; }
.landing-section-alt { background: #fff; }

.landing-section-title {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.landing-section-desc { color: var(--text-muted); margin-bottom: 36px; }

.portal-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.portal-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.portal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.portal-card-icon { font-size: 2.5rem; margin-bottom: 16px; }
.portal-card h3 { color: var(--primary); margin-bottom: 10px; font-size: 1.3rem; }
.portal-card p { color: var(--text-muted); margin-bottom: 16px; font-size: 0.95rem; }
.portal-card ul { list-style: none; margin-bottom: 24px; }
.portal-card li {
    padding: 6px 0 6px 22px;
    position: relative;
    font-size: 0.9rem;
    color: var(--text);
}
.portal-card li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.portal-card-admin { border-top: 4px solid var(--primary); }
.portal-card-aula { border-top: 4px solid #0d9488; }

.landing-about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.landing-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.landing-stat {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
}

.landing-stat span { display: block; opacity: 0.8; font-size: 0.85rem; }
.landing-stat strong { font-size: 1.2rem; }

.landing-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    padding: 28px 0;
    text-align: center;
    font-size: 0.9rem;
}

.landing-contact p { margin: 8px 0; color: var(--text-muted); }

/* ========== AUTH THEMES ========== */
.auth-back-home {
    position: fixed;
    top: 20px;
    left: 24px;
    z-index: 10;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-theme-aula .auth-panel-brand {
    background: linear-gradient(160deg, #0f766e 0%, #134e4a 100%);
}

.auth-theme-aula .btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.portal-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.portal-badge-admin { background: #dbeafe; color: #1e40af; }
.portal-badge-aula { background: #ccfbf1; color: #0f766e; }

/* ========== AULA VIRTUAL PORTAL ========== */
.aula-body { --aula-primary: #0d9488; --aula-dark: #134e4a; }

.sidebar-aula {
    background: linear-gradient(180deg, #134e4a 0%, #0f766e 100%);
}

.sidebar-aula .nav-item.active {
    background: rgba(255,255,255,0.15);
    color: #99f6e4;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.topbar-aula { border-bottom-color: #ccfbf1; }
.period-badge-aula {
    background: linear-gradient(135deg, #14b8a6, #5eead4);
    color: #134e4a;
}

.user-avatar-aula { background: #0d9488; }

.card-aula { border-left: 4px solid #14b8a6; }

.aula-welcome h2 { color: #134e4a; margin-bottom: 8px; }

.section-title-aula {
    font-size: 1.1rem;
    font-weight: 700;
    color: #134e4a;
    margin: 28px 0 16px;
}

.aula-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.aula-course-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    color: inherit;
    display: block;
}

.aula-course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: #5eead4;
}

.aula-course-icon { font-size: 2rem; margin-bottom: 12px; }
.aula-course-card h3 { color: #134e4a; margin-bottom: 6px; font-size: 1.05rem; }
.aula-course-card p { color: var(--text-muted); font-size: 0.9rem; }
.aula-course-card small { color: var(--text-muted); font-size: 0.8rem; }

.aula-list { list-style: none; }
.aula-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }

.aula-task-item {
    padding: 16px;
    background: #f0fdfa;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #ccfbf1;
}

.aula-task-item h4 { color: #134e4a; margin-bottom: 4px; }
