/* ALNILAM School Management System - Custom Styles */

:root {
    --primary: #1a3a5c;
    --primary-light: #2563a8;
    --secondary: #e8a020;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --sidebar-width: 260px;
    --topbar-height: 65px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

/* ===================== SIDEBAR ===================== */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, #0d2137 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar .sidebar-brand {
    padding: 20px 15px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

#sidebar .sidebar-brand .brand-logo {
    width: 55px;
    height: 55px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 24px;
    font-weight: bold;
    color: white;
}

#sidebar .sidebar-brand h5 {
    color: white;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

#sidebar .sidebar-brand small {
    color: rgba(255,255,255,0.6);
    font-size: 11px;
}

#sidebar .nav-section {
    padding: 10px 15px 5px;
    color: rgba(255,255,255,0.4);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 10px;
}

#sidebar .nav-item .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 0;
    transition: all 0.2s;
    font-size: 14px;
    border-left: 3px solid transparent;
}

#sidebar .nav-item .nav-link:hover,
#sidebar .nav-item .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--secondary);
}

#sidebar .nav-item .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

/* ===================== MAIN CONTENT ===================== */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* ===================== TOPBAR ===================== */
#topbar {
    background: white;
    height: var(--topbar-height);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 0 25px;
    gap: 15px;
}

#topbar .page-title {
    flex: 1;
    font-weight: 600;
    color: var(--primary);
    font-size: 18px;
}

#topbar .topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ===================== CARDS ===================== */
.stat-card {
    border: none;
    border-radius: 12px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.07);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* ===================== TABLES ===================== */
.table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.07);
    overflow: hidden;
}

.table-card .table-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.table-card .table-header h6 {
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    font-size: 15px;
}

.table thead th {
    background: #f8f9fa;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 14px;
}

/* ===================== CBC GRADE BADGES ===================== */
.badge-cbc {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-EE { background: #d1fae5; color: #065f46; }
.badge-ME { background: #dbeafe; color: #1e40af; }
.badge-AE { background: #fef3c7; color: #92400e; }
.badge-BE { background: #fee2e2; color: #991b1b; }

/* ===================== PAGE CONTENT ===================== */
.page-content {
    padding: 25px;
}

.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.07);
    padding: 25px;
    margin-bottom: 20px;
}

/* ===================== LOGIN PAGE ===================== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #2563a8 50%, #0d2137 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 45px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 2.5px solid #23272b;
    box-shadow: 0 0 16px 2px #23272b, 0 20px 60px rgba(0,0,0,0.3);
    transition: box-shadow 0.3s, border-color 0.3s;
}
.login-card:hover, .login-card:focus-within {
    border-color: #23272b;
    box-shadow: 0 0 32px 8px #23272b, 0 20px 60px rgba(0,0,0,0.3);
}



.login-card {
    background: white;
    border-radius: 20px;
    padding: 45px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 2px solid #2563a8;
}

.login-card .login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    font-weight: bold;
    color: white;
}

/* ===================== FORMS ===================== */
.form-label {
    font-weight: 500;
    font-size: 13px;
    color: #555;
}

.form-control, .form-select {
    border-radius: 8px;
    border-color: #dee2e6;
    font-size: 14px;
    padding: 9px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.15);
}

/* ===================== BUTTONS ===================== */
.btn {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 18px;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

/* ===================== AVATAR ===================== */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* ===================== REPORT CARD ===================== */
.report-card-print {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    font-family: 'Times New Roman', serif;
}

.report-card-print .school-header {
    text-align: center;
    border-bottom: 3px double #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* ===================== FEE RECEIPT ===================== */
.receipt-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border: 2px solid var(--primary);
    border-radius: 8px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        width: 80vw;
        min-width: 220px;
        max-width: 320px;
    }
    #sidebar.show {
        transform: translateX(0);
    }
    #main-content {
        margin-left: 0;
        padding: 10px;
    }
    .page-content {
        padding: 10px;
    }
    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px;
    }
    .table-card, .content-card, .login-card, .receipt-container, .report-card-print {
        padding: 12px;
        border-radius: 10px;
        box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    }
    .table thead th, .table tbody td {
        padding: 8px 6px;
        font-size: 12px;
    }
    .login-card {
        padding: 18px 4vw;
        max-width: 98vw;
    }
    .report-card-print, .receipt-container {
        max-width: 98vw;
        padding: 10px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .stat-card .stat-value {
        font-size: 18px;
    }
    .stat-card .stat-label {
        font-size: 11px;
    }
    .table thead th, .table tbody td {
        font-size: 10px;
        padding: 6px 2px;
    }
    .login-card, .content-card, .table-card, .receipt-container, .report-card-print {
        padding: 4px;
        border-radius: 6px;
    }
    .page-header h4 {
        font-size: 16px;
    }
}
}

/* ===================== UTILITIES ===================== */
.text-primary-dark { color: var(--primary) !important; }
.bg-primary-dark { background: var(--primary) !important; }
.border-radius-12 { border-radius: 12px; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.page-header h4 {
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.3;
}

@media print {
    #sidebar, #topbar, .no-print { display: none !important; }
    #main-content { margin: 0 !important; }
    .page-content { padding: 0 !important; }
}
