:root {
    --nu-navy: #0b3d5c;
    --nu-navy-dark: #072d44;
    --nu-teal: #1a7a6d;
    --nu-teal-light: #e8f5f2;
    --nu-gold: #c9a227;
    --nu-bg: #f3f6f9;
    --nu-sidebar-width: 260px;
    --nu-shadow: 0 8px 24px rgba(11, 61, 92, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--nu-bg);
    color: #1f2a37;
    margin: 0;
}

.app-wrapper {
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--nu-sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--nu-navy) 0%, var(--nu-navy-dark) 100%);
    color: #fff;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}

.brand-title {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    opacity: 0.75;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    overflow-y: auto;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.25rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-link.active {
    background: var(--nu-teal);
}

.sidebar-link.logout-link {
    margin-top: 1rem;
    color: #ffb4b4;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
}

.main-content {
    margin-left: var(--nu-sidebar-width);
    min-height: 100vh;
}

.top-navbar {
    background: #fff;
    border-bottom: 1px solid #e5ebf1;
    min-height: 64px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-heading {
    color: var(--nu-navy);
    font-weight: 700;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--nu-teal);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-weight: 700;
}

.user-menu {
    color: inherit;
}

.stat-card {
    border: none;
    border-radius: 14px;
    box-shadow: var(--nu-shadow);
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}

.stat-card.students .stat-icon { background: #e7f1ff; color: #0d6efd; }
.stat-card.lecturers .stat-icon { background: #e8f5f2; color: var(--nu-teal); }
.stat-card.courses .stat-icon { background: #fff4df; color: #c98500; }
.stat-card.attendance .stat-icon { background: #fde8ef; color: #c2185b; }

.card-soft {
    border: none;
    border-radius: 14px;
    box-shadow: var(--nu-shadow);
}

.table thead th {
    background: #f0f4f8;
    color: var(--nu-navy);
    font-weight: 600;
    white-space: nowrap;
}

.btn-primary {
    background: var(--nu-navy);
    border-color: var(--nu-navy);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--nu-navy-dark);
    border-color: var(--nu-navy-dark);
}

.btn-success {
    background: var(--nu-teal);
    border-color: var(--nu-teal);
}

.progress {
    height: 0.7rem;
    border-radius: 999px;
}

.badge-role {
    text-transform: capitalize;
}

/* Auth pages */
.auth-main {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(11, 61, 92, 0.92), rgba(26, 122, 109, 0.88)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    border: none;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--nu-gold);
    color: var(--nu-navy-dark);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
}

.attendance-radio .form-check-input:checked[value="Present"] + .form-check-label {
    color: #198754;
    font-weight: 600;
}

.attendance-radio .form-check-input:checked[value="Absent"] + .form-check-label {
    color: #dc3545;
    font-weight: 600;
}

.attendance-radio .form-check-input:checked[value="Late"] + .form-check-label {
    color: #d39e00;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }
}

@media print {
    @page {
        size: A4;
        margin: 12mm 12mm 14mm;
    }

    body {
        background: #fff !important;
        color: #111 !important;
        font-size: 11pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar,
    .top-navbar,
    .sidebar-overlay,
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .card,
    .card-soft {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        break-inside: avoid;
    }

    .card-header {
        border: none !important;
        background: transparent !important;
        padding: 0.4rem 0 0.25rem !important;
    }

    .card-header .h5,
    .card-header h2 {
        font-size: 12pt !important;
        font-weight: 700 !important;
        color: #0b3d5c !important;
        margin: 0 !important;
        border-bottom: 1.5px solid #0b3d5c;
        padding-bottom: 4px;
    }

    .card-header .text-muted {
        display: none !important;
    }

    .card-body {
        padding: 0 !important;
    }

    .row.g-3.mb-4,
    .progress {
        display: none !important;
    }

    .badge {
        border: 1px solid #333 !important;
        background: transparent !important;
        color: #111 !important;
        font-weight: 600 !important;
        padding: 0.15rem 0.4rem !important;
    }

    .table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9.5pt !important;
        margin-bottom: 1rem !important;
    }

    .table thead th {
        background: #0b3d5c !important;
        color: #fff !important;
        border: 1px solid #0b3d5c !important;
        font-weight: 600 !important;
        padding: 6px 5px !important;
        vertical-align: middle !important;
    }

    .table td {
        border: 1px solid #bbb !important;
        padding: 5px !important;
        vertical-align: top !important;
        color: #111 !important;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .text-muted {
        color: #444 !important;
    }

    /* —— Letterhead —— */
    .print-report-header {
        break-inside: avoid;
        margin-bottom: 12px;
    }

    .prh-letterhead {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        border-bottom: 3px double #0b3d5c;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .prh-brand {
        display: flex;
        gap: 12px;
        align-items: center;
        flex: 1;
    }

    .prh-logo {
        max-height: 70px;
        max-width: 90px;
        object-fit: contain;
    }

    .prh-logo-fallback {
        width: 64px;
        height: 64px;
        border: 2px solid #0b3d5c;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 16pt;
        color: #0b3d5c;
    }

    .prh-uni-name {
        font-size: 16pt;
        font-weight: 800;
        color: #0b3d5c;
        line-height: 1.15;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

    .prh-motto {
        font-size: 9pt;
        font-style: italic;
        color: #444;
        margin-top: 2px;
    }

    .prh-contact {
        font-size: 8.5pt;
        color: #333;
        margin-top: 3px;
    }

    .prh-docmeta {
        text-align: right;
        font-size: 8.5pt;
        min-width: 140px;
        border: 1px solid #0b3d5c;
        padding: 6px 8px;
    }

    .prh-doc-label {
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #0b3d5c;
        font-size: 8pt;
    }

    .prh-doc-ref,
    .prh-doc-date {
        margin-top: 2px;
    }

    .prh-title-bar {
        text-align: center;
        margin: 8px 0 10px;
    }

    .prh-title {
        font-size: 14pt;
        font-weight: 800;
        margin: 0;
        color: #111;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .prh-subtitle {
        font-size: 9pt;
        color: #444;
        margin-top: 2px;
    }

    .prh-info-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
        margin-bottom: 10px;
    }

    .prh-info-table th,
    .prh-info-table td {
        border: 1px solid #999;
        padding: 5px 7px;
        vertical-align: top;
    }

    .prh-info-table th {
        width: 18%;
        background: #eef3f7 !important;
        font-weight: 700;
        color: #0b3d5c;
        text-align: left;
    }

    .print-filters-meta {
        border: 1px solid #999 !important;
        border-radius: 0 !important;
        padding: 6px 8px !important;
        font-size: 8.5pt !important;
        margin-bottom: 10px !important;
        background: #fafafa !important;
    }

    /* —— Footer / signatures —— */
    .print-report-footer {
        margin-top: 1.5rem;
        page-break-inside: avoid;
    }

    .prf-note {
        font-size: 8pt;
        color: #444;
        border-left: 3px solid #0b3d5c;
        padding: 4px 0 4px 8px;
        margin-bottom: 18px;
        line-height: 1.35;
    }

    .prf-sign-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 16px 0;
        margin-bottom: 12px;
    }

    .prf-sign-table td {
        width: 33.33%;
        text-align: center;
        vertical-align: top;
        font-size: 8.5pt;
    }

    .prf-sign-space {
        height: 42px;
    }

    .prf-sign-line {
        border-top: 1px solid #333;
        margin: 0 8px 4px;
    }

    .prf-sign-label {
        font-weight: 700;
        color: #0b3d5c;
    }

    .prf-sign-name {
        font-weight: 600;
        margin-top: 2px;
    }

    .prf-sign-date {
        margin-top: 4px;
        color: #444;
    }

    .prf-bottom {
        display: flex;
        justify-content: space-between;
        border-top: 2px solid #0b3d5c;
        padding-top: 6px;
        font-size: 8pt;
        color: #333;
        margin-top: 8px;
    }

    .prf-developer {
        margin-top: 10px;
        text-align: center;
        font-size: 8pt;
        color: #333;
        border-top: 1px solid #ccc;
        padding-top: 8px;
        line-height: 1.45;
    }

    .prf-developer strong {
        color: #0b3d5c;
    }

    a {
        text-decoration: none !important;
        color: inherit !important;
    }
}

.print-only {
    display: none;
}
