/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #0c4387;       /* Royal Corporate Blue Sidebar */
    --primary-light: #1565c0;      /* Bright blue active/accent */
    --primary-hover: #0b3a72;
    --accent-color: #db2777;       /* Fuchsia active accent */
    --accent-light: #f472b6;
    --bg-color: #f1f5f9;           /* Light cool gray background */
    --card-bg: #ffffff;
    --text-color: #0f172a;         /* Slate 900 */
    --text-muted: #64748b;        /* Slate 500 */
    --border-color: #e2e8f0;       /* Slate 200 */
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
    
    /* Notification Red Dot */
    --danger-color: #ef4444;
    --success-color: #16a34a;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Sidebar Styling - Matches image 2 */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--primary-color);
    color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all var(--transition-speed) ease-in-out;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    padding: 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar .brand-logo-icon {
    font-size: 1.8rem;
    color: #3b82f6; /* Bright blue hat */
}

.sidebar .brand-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu-item {
    margin: 0.15rem 1rem;
}

.sidebar-menu-link,
.sidebar-menu-link span,
.sidebar-menu-item .sidebar-menu-link,
.sidebar-menu-item.active .sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.45rem 0.85rem;
    color: #ffffff; /* Texto blanco nítido */
    text-decoration: none;
    font-weight: 400 !important; /* Fuerza peso normal sin negrita */
    font-size: 0.92rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.sidebar-menu-link span {
    padding: 0;
    font-weight: 400 !important;
}

.sidebar-menu-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9); /* Iconos blancos limpios */
}

.sidebar-menu-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-menu-item.active .sidebar-menu-link {
    color: #ffffff;
    background-color: var(--accent-color);
    box-shadow: none;
}

/* Sidebar Category Headers */
.sidebar-category-header {
    font-size: 0.7rem;
    font-weight: 800; /* Extra bold headings */
    text-transform: uppercase;
    letter-spacing: 1.2px; /* Spaced out headers */
    padding: 0 1.5rem;
    margin-top: 1.2rem;
    margin-bottom: 0.35rem;
    font-family: 'Outfit', sans-serif;
    list-style: none;
    color: #cbd5e1; /* Gris claro unificado y legible */
}

/* Eliminate top margin for the first heading */
.sidebar-menu > .sidebar-category-header:first-of-type,
.sidebar-menu > :first-child + .sidebar-category-header {
    margin-top: 0.6rem;
}

/* Sidebar Footer area for logout */
.sidebar-footer {
    padding: 1.25rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Main Area Layout */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2.25rem;
    min-height: 100vh;
    transition: all var(--transition-speed) ease;
}

/* Header Styling */
.top-navbar {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    margin-bottom: 2.25rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* User profile avatar inside dropdown */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

/* Modern Metric Cards */
.card-metric {
    background-color: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 18px;
    padding: 1.65rem 1.5rem;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
    transition: all var(--transition-speed) ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.card-metric:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-color: rgba(37, 99, 235, 0.15);
}

.metric-info h6 {
    font-size: 0.85rem;
    text-transform: capitalize;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.metric-info h3 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0;
}

.metric-trend {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-trend.up {
    color: var(--success-color);
}
.metric-trend.down {
    color: var(--danger-color);
}
.metric-trend.none {
    color: var(--text-muted);
}

.metric-icon {
    font-size: 1.5rem;
    padding: 0.9rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    transition: all 0.2s ease;
}

/* Color palettes matching screen 1 / 2 */
.metric-icon.blue {
    color: #2563eb;
    background-color: #eff6ff;
}
.metric-icon.cyan {
    color: #0891b2;
    background-color: #ecfeff;
}
.metric-icon.pink {
    color: #db2777;
    background-color: #fdf2f8;
}
.metric-icon.green {
    color: #16a34a;
    background-color: #f0fdf4;
}

/* Modern Card Layouts */
.card-content {
    background-color: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 0.55rem 1.25rem;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

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

.btn-accent:hover {
    background-color: #be185d;
    border-color: #be185d;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.2);
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

/* Modern tables styling */
.table-responsive {
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.95rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-color);
    vertical-align: middle;
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Form inputs styling */
.form-control, .form-select {
    border-radius: 10px;
    padding: 0.65rem 1rem;
    border: 1px solid #cbd5e1;
    font-size: 0.92rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Badge states */
.badge {
    padding: 0.45rem 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 8px;
}

.badge-success {
    background-color: #dcfce7 !important;
    color: #16803d !important;
}

.badge-danger {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}

.badge-warning {
    background-color: #fef9c3 !important;
    color: #a16207 !important;
}

.badge-info {
    background-color: #ecfeff !important;
    color: #0891b2 !important;
}

/* --- SPLIT SCREEN LOGIN LAYOUT --- */
.login-split-container {
    min-height: 100vh;
    display: flex;
    background-color: #ffffff;
}

.login-banner-side {
    flex: 1.2;
    background: linear-gradient(135deg, #0b1329 0%, #1e3a8a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.login-banner-side::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.login-banner-content {
    max-width: 480px;
    z-index: 2;
    text-align: center;
}

.login-banner-content h1 {
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    letter-spacing: -1px;
}

.login-banner-content p {
    font-size: 1.05rem;
    color: #94a3b8;
    margin-bottom: 3rem;
}

.login-illustration-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 280px;
    margin-top: 1rem;
}

.login-illustration-container svg {
    max-height: 100%;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.3));
}

.login-form-side {
    flex: 0.9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    background-color: #ffffff;
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.login-logo-header {
    margin-bottom: 2rem;
    text-align: center;
    display: block;
}

.login-logo-header img {
    display: block;
    margin: 0 auto 0.6rem auto;
    height: 52px;
    max-width: 80px;
    object-fit: contain;
    border-radius: 8px;
}

.login-logo-header h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 auto;
    color: var(--primary-color);
}

.login-logo-icon {
    font-size: 3.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
}

.login-form-wrapper h2 {
    font-weight: 800;
    font-size: 1.85rem;
    color: var(--text-color);
    margin-bottom: 0.35rem;
}

.login-form-wrapper p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2.25rem;
}

.login-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.login-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.login-input-group {
    position: relative;
}

.login-input-group .form-control {
    padding-left: 2.75rem;
}

.login-footer-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-top: 1.5rem;
}

.login-footer-links a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.login-footer-links a:hover {
    text-decoration: underline;
}

.login-copyright-text {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 4rem;
}

@media (max-width: 991px) {
    .login-split-container {
        flex-direction: column;
    }
    .login-banner-side {
        display: none;
    }
    .login-form-side {
        padding: 3rem 1.5rem;
        flex: 1;
    }
}

/* --- EXCEL GRADES GRID STYLING --- */
.table-excel-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-excel {
    width: 100%;
    border-collapse: collapse;
}

.table-excel th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.75rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
}

.table-excel td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.88rem;
}

.table-excel tbody tr:hover {
    background-color: #f8fafc;
}

.grade-input {
    width: 68px !important;
    height: 34px !important;
    text-align: center;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.2rem 0.3rem !important;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem !important;
    color: var(--text-color);
    transition: all 0.15s ease;
    margin: 0 auto;
}

.grade-input:focus {
    background-color: #ffffff !important;
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none;
}

.grade-input.invalid-grade {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
}

.badge-performance {
    font-weight: 700;
    padding: 0.3rem 0.6rem !important;
    border-radius: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    display: inline-block;
}

.badge-superior {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-alto {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.badge-basico {
    background-color: #fef9c3;
    color: #a16207;
}

.badge-bajo {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-recovery {
    background-color: #ffedd5;
    color: #c2410c;
}

/* --- HORARIOS GRID TABLE (Screen 7) --- */
.schedule-grid-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.schedule-grid-table th {
    background-color: #0b1329;
    color: #ffffff;
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.schedule-grid-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    height: 100px;
    width: 16%;
}

.schedule-hour-col {
    background-color: #f8fafc;
    font-weight: 700;
    color: #475569;
    width: 10% !important;
    height: auto;
}

.schedule-card {
    border-radius: 8px;
    padding: 0.55rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    font-size: 0.8rem;
    position: relative;
    transition: all 0.2s ease;
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.schedule-card-subject {
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: #0f172a;
}

.schedule-card-details {
    font-size: 0.7rem;
    color: #475569;
}

/* Colored themes for subjects */
.sch-theme-math {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
}
.sch-theme-english {
    background-color: #faf5ff;
    border-left: 4px solid #a855f7;
}
.sch-theme-lang {
    background-color: #fdf2f8;
    border-left: 4px solid #ec4899;
}
.sch-theme-science {
    background-color: #f0fdf4;
    border-left: 4px solid #22c55e;
}
.sch-theme-social {
    background-color: #fffbeb;
    border-left: 4px solid #eab308;
}
.sch-theme-art {
    background-color: #ecfeff;
    border-left: 4px solid #06b6d4;
}
.sch-theme-pe {
    background-color: #fbfbfe;
    border-left: 4px solid #6366f1;
}
.sch-theme-religion {
    background-color: #fff7ed;
    border-left: 4px solid #f97316;
}
.sch-theme-default {
    background-color: #f8fafc;
    border-left: 4px solid #64748b;
}

.schedule-delete-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    color: #ef4444;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: none;
    border: none;
}

.schedule-card:hover .schedule-delete-btn {
    opacity: 1;
}

/* --- STUDENT OBSERVER TIMELINE --- */
.observer-timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1rem;
}

.observer-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: #e2e8f0;
}

.observer-timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.observer-timeline-badge {
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #cbd5e1;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px #cbd5e1;
}

.observer-timeline-badge.bg-acad {
    background-color: #2563eb;
    box-shadow: 0 0 0 2px #2563eb;
}

.observer-timeline-badge.bg-disc {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px #ef4444;
}

.observer-timeline-badge.bg-pos {
    background-color: #10b981;
    box-shadow: 0 0 0 2px #10b981;
}

.observer-timeline-content {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

/* Responsive sidebar collapse adjustments */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

/* Print Overrides */
@media print {
    .sidebar, .top-navbar, .btn, .no-print, header, footer {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
    .card-content {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
    }
    .table th {
        background-color: #f8fafc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
}

/* Gradientes para tarjetas de métricas y reportes KPI */
.bg-gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
}
.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
}
.bg-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    color: #ffffff !important;
}
.bg-gradient-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%) !important;
    color: #ffffff !important;
}
