/* ========== GLOBAL & MODERATELY COMPACT SIDEBAR ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, sans-serif;
}
body {
    background: #f1f5f9;
    overflow-x: hidden;
}

/* ---------- SIDEBAR (260px, comfortable padding) ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #0a2e3f;
    color: #e2e8f0;
    z-index: 1030;
    overflow-y: auto;
    border-right: 1px solid #1e4a62;
}
.sidebar-header {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid #2c5a6e;
    margin-bottom: 0.8rem;
}
.sidebar-header h3 {
    font-weight: 700;
    font-size: 1.4rem;
    color: white;
}
.sidebar-header p {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1rem;
    color: #cbd5e6;
    font-weight: 500;
    text-decoration: none;
    margin: 2px 8px;
    border-radius: 4px;
    transition: 0.2s;
}
.nav-link i {
    font-size: 1.2rem;
    width: 26px;
}
.nav-link:hover {
    background: #1f4e62;
    color: white;
}
.nav-link.active {
    background: #2c7da0;
    color: white;
    border-left: 3px solid #ffc107;
}

/* ---------- TOP BAR (adjusted for 260px sidebar) ---------- */
.top-bar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    background: white;
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1020;
}
.page-title {
    font-weight: 700;
    font-size: 1.75rem;
    color: #0f2c38;
}
.admin-badge {
    background: transparent;
    padding: 6px 12px;
    font-weight: 500;
    font-size: 0.85rem;
    color: #1e4a62;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}
.logout-power {
    color: #1e6f8c;
    margin-left: 0.6rem;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: 0.2s;
}
.logout-power:hover {
    color: #0f5a74;
}

/* ---------- MAIN CONTENT (adjusted for 260px sidebar) ---------- */
.main-content {
    margin-left: 260px;
    padding: 90px 2rem 2rem 2rem;
    min-height: 100vh;
}

/* ---------- REST OF THE STYLES (cards, buttons, tables, etc.) ---------- */
.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    border-radius: 4px;
}
.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f3b4c;
    line-height: 1.2;
}
.table-wrapper {
    background: white;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    border-radius: 4px;
    padding: 1rem;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9edf2;
}
th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #1e3e4a;
}
.btn-sm {
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #cbd5e1;
    background: white;
    cursor: pointer;
    transition: 0.15s;
    border-radius: 4px;
}
.btn-sm:hover {
    background: #f1f5f9;
}
.btn-primary-outline {
    background: #1e6f8c;
    border: 1px solid #1e6f8c;
    color: white;
}
.btn-primary-outline:hover {
    background: #0f5a74;
}
.btn-primary {
    background: #1e6f8c;
    border-color: #1e6f8c;
    color: white;
}
.btn-primary:hover {
    background: #0f5a74;
}
.btn-secondary {
    background: white;
    border-color: #1e6f8c;
    color: #1e6f8c;
}
.btn-secondary:hover {
    background: #1e6f8c;
    color: white;
}
.btn-icon {
    padding: 5px 8px;
    font-size: 1rem;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: white;
    margin: 0 2px;
    transition: 0.2s;
}
.btn-icon-primary {
    background: #1e6f8c;
    border-color: #1e6f8c;
    color: white;
}
.btn-icon-primary:hover {
    background: #0f5a74;
}
.btn-icon-secondary {
    background: white;
    border-color: #1e6f8c;
    color: #1e6f8c;
}
.btn-icon-secondary:hover {
    background: #1e6f8c;
    color: white;
}
.badge-status {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #e2e8f0;
    color: #1e293b;
    border-radius: 4px;
}
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #ffe4e2; color: #9b1c1c; }
.badge-upcoming { background: #fff3e3; color: #b45309; }
.modal-container {
    background: white;
    width: 90%;
    max-width: 500px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1.5rem;
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: 0.1s;
}
.modal-overlay.show {
    visibility: visible;
    opacity: 1;
}
.close-modal {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
}
#notificationToast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    min-width: 250px;
    max-width: 350px;
    background: white;
    border-left: 4px solid;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0.75rem 1rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.notification-success { border-left-color: #28a745; }
.notification-error { border-left-color: #dc3545; }
.notification-info { border-left-color: #17a2b8; }
.notification-icon { font-size: 1.2rem; }
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e9ecef;
    border-top-color: #1e6f8c;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.table-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 1050;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .top-bar {
        left: 0;
    }
    .main-content {
        margin-left: 0;
        padding-top: 85px;
    }
    .mobile-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: #2c7da0;
        width: 48px;
        height: 48px;
        text-align: center;
        line-height: 52px;
        font-size: 1.8rem;
        color: white;
        z-index: 1060;
        cursor: pointer;
        border-radius: 50%;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
}
@media (min-width: 993px) {
    .mobile-toggle {
        display: none;
    }
}

/* Compact attendance matrix */
.attendance-icon {
    font-size: 1.2rem;
    cursor: default;
}
.attendance-present { color: #28a745; }
.attendance-absent { color: #dc3545; }
.attendance-late { color: #ffc107; }
.attendance-excused { color: #6c757d; }
.attendance-notmarked { color: #adb5bd; }
#attendanceMatrixTable {
    font-size: 0.85rem;
}
#attendanceMatrixTable th,
#attendanceMatrixTable td {
    padding: 0.4rem 0.2rem;
    vertical-align: middle;
    text-align: center;
}
#attendanceMatrixTable th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}
.attendance-learner-cell {
    text-align: left;
    font-weight: 500;
}