﻿/* ==========================================================================
   ITACHI SCHOOL MANAGEMENT SYSTEM - THEME
   One stylesheet for every page. Change colours here only.
   ========================================================================== */


/* ==========================================
   COLOURS / FONT
========================================== */

:root {
    --navy: #0B1730;            /* sidebar */
    --navy-2: #12308F;          /* headings, dark blue */
    --blue: #1D4ED8;            /* main blue */
    --blue-2: #1D3FE0;          /* gradient start */
    --azure: #0A78D6;           /* gradient end */
    --cyan: #06C8EE;            /* logo cyan accent */
    --tint: #EEF3FF;            /* light blue background */
    --tint-2: #E6EDFF;
    --page: #F4F7FC;            /* page background */
    --card: #FFFFFF;
    --border: #E1E7F2;
    --input-border: #CBD6E8;
    --text: #0B1B3A;
    --text-2: #33405A;
    --muted: #5A6A86;
    --green: #0E7A55;
    --green-bg: #DFF5EC;
    --amber: #B45309;
    --amber-bg: #FDF0DC;
    --red: #C2410C;
    --red-bg: #FDECDC;
    --violet: #6D3AE0;
    --violet-bg: #EEE7FE;
    --gradient: linear-gradient(135deg, var(--blue-2), var(--azure));
    --header-gradient: linear-gradient(135deg, #12308F, #1D4ED8 55%, #0A78D6);
    --font: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    --sidebar-width: 260px;
}


/* ==========================================
   BASE
========================================== */

body {
    background: var(--page);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
}

a {
    color: var(--blue);
}

    a:hover {
        color: var(--navy-2);
    }


/* ==========================================
   LAYOUT: SIDEBAR + MAIN
========================================== */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--navy);
    color: #C3CFE6;
    padding: 20px 14px;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .25s ease;
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-content {
    padding: 22px 28px;
    flex: 1;
}

.app-footer {
    padding: 14px 28px;
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}


/* ==========================================
   FIXED LAYOUT (desktop)
   Sidebar, top bar, page header and side panels stay in place,
   only the page content scrolls - same feeling as the sidebar.
========================================== */

@media (min-width: 992px) {

    /* the window itself never scrolls (only .app-content does): Crystal Report Viewer adds its
       hidden print / export boxes at the end of the page, which made a long empty area below */
    body.app-body {
        overflow: hidden;
    }

    .app-main {
        height: 100vh;
        overflow: hidden;
    }

    .app-topbar,
    .app-footer {
        flex: 0 0 auto;
    }

    .app-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding-top: 0;
        scrollbar-gutter: stable;       /* same width on short and long pages (no jump between pages) */
    }

    /* page header stays at the top of the content area */
    .page-header {
        position: sticky;
        top: 22px;
        z-index: 20;
        margin-top: 22px;
    }

        /* page colour band above / below the header so scrolled content does not show through */
        .page-header::before {
            content: "";
            position: absolute;
            left: -28px;
            right: -28px;
            top: -23px;
            bottom: -21px;
            background: var(--page);
            z-index: -1;
        }

        .page-header::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 18px;
            background: var(--header-gradient);
            box-shadow: 0 10px 24px rgba(18, 48, 143, .2);
            z-index: -1;
        }

    /* left panels (forms, filters) stay in place while the list scrolls */
    .side-panel {
        position: sticky;
        top: var(--sticky-top, 140px);
        max-height: var(--sticky-max, none);
        overflow-y: auto;
    }

    /* grid headers stay visible while the list scrolls */
    .app-content .table-wrap {
        overflow: visible;
    }

        .app-content .table-wrap .app-table th {
            position: sticky;
            top: var(--sticky-top, 140px);
            z-index: 5;
        }

        .app-content .table-wrap .app-table th:first-child {
            border-top-left-radius: 11px;
        }

        .app-content .table-wrap .app-table th:last-child {
            border-top-right-radius: 11px;
        }

        /* wide grids (e.g. payroll) scroll inside their own box */
        .app-content .table-wrap.wide {
            overflow: auto;
            max-height: var(--sticky-max, 70vh);
        }

            .app-content .table-wrap.wide .app-table th {
                top: 0;
            }

}


/* ==========================================
   THIN SCROLLBARS (content, side panels, wide grids)
========================================== */

.app-content,
.side-panel,
.table-wrap {
    scrollbar-width: thin;
    scrollbar-color: #C3D1EE transparent;
}

    .app-content::-webkit-scrollbar,
    .side-panel::-webkit-scrollbar,
    .table-wrap::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .app-content::-webkit-scrollbar-thumb,
    .side-panel::-webkit-scrollbar-thumb,
    .table-wrap::-webkit-scrollbar-thumb {
        background: #C3D1EE;
        border-radius: 8px;
    }

        .app-content::-webkit-scrollbar-thumb:hover,
        .side-panel::-webkit-scrollbar-thumb:hover,
        .table-wrap::-webkit-scrollbar-thumb:hover {
            background: #9DB2E0;
        }

    .app-content::-webkit-scrollbar-track,
    .side-panel::-webkit-scrollbar-track,
    .table-wrap::-webkit-scrollbar-track {
        background: transparent;
    }


/* ==========================================
   SIDEBAR PARTS
========================================== */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    text-decoration: none;
}

    .brand img {
        width: 44px;
        height: 44px;
        object-fit: contain;
    }

.brand-name {
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 3px;
    line-height: 1.1;
}

.brand-sub {
    font-size: 10px;
    letter-spacing: 1.5px;
    line-height: 1.35;
    margin-top: 2px;
    color: #5FD4F5;
}

.user-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #1B2A4A;
}

.user-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.user-caption {
    font-size: 11px;
    letter-spacing: 2px;
    color: #8094B8;
}

.user-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.user-role {
    font-size: 12px;
    color: #8FA3C7;
}

.nav-group {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6F84AC;
    padding: 14px 12px 6px;
}

.nav-link-app {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: #C3CFE6;
    text-decoration: none;
    font-size: 15px;
    transition: background .15s ease, color .15s ease;
}

    .nav-link-app i {
        font-size: 17px;
        width: 20px;
        text-align: center;
    }

    .nav-link-app:hover {
        background: #16264A;
        color: #fff;
    }

    .nav-link-app.active {
        background: rgba(59, 110, 246, .22);
        color: #fff;
        box-shadow: inset 3px 0 0 #4F8BFF;
    }

        .nav-link-app.active i {
            color: #7FAAFF;
        }

    .nav-link-app.signing-out {
        pointer-events: none;
        color: #fff;
    }

        .nav-link-app.signing-out .spinner-border {
            width: 16px;
            height: 16px;
            border-width: 2px;
            margin: 0 2px;
        }

    .nav-link-app.disabled {
        opacity: .45;
        pointer-events: none;
    }

    .nav-link-app .soon {
        margin-left: auto;
        font-size: 10px;
        padding: 2px 7px;
        border-radius: 10px;
        background: #1B2A4A;
        color: #8FA3C7;
    }


/* ==========================================
   TOP BAR (branch / session)
========================================== */

.app-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.topbar-left,
.topbar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.topbar-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

    .topbar-picker select {
        height: 38px;
        border: 1px solid var(--input-border);
        border-radius: 8px;
        padding: 0 10px;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        color: var(--text);
        background: #fff;
    }

.topbar-date {
    font-size: 13px;
    color: var(--muted);
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 20px;
}

.sidebar-backdrop {
    display: none;
}


/* ==========================================
   PAGE HEADER (gradient banner)
========================================== */

.page-header {
    background: var(--header-gradient);
    border-radius: 18px;
    padding: 22px 26px;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 10px 24px rgba(18, 48, 143, .2);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

    .page-header h3 {
        margin: 0;
        font-size: 23px;
        font-weight: 700;
    }

    .page-header p {
        margin: 4px 0 0;
        font-size: 14px;
        opacity: .88;
    }

.header-icon {
    font-size: 52px;
    opacity: .25;
    line-height: 1;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

    .header-actions .btn-header {
        height: 40px;
        padding: 0 16px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, .35);
        background: rgba(255, 255, 255, .14);
        color: #fff;
        font-weight: 600;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
    }

        .header-actions .btn-header:hover {
            background: rgba(255, 255, 255, .24);
            color: #fff;
        }


/* ==========================================
   CARDS
========================================== */

.app-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 5px 18px rgba(11, 27, 58, .05);
    margin-bottom: 20px;
}

.card-title-app {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E5EAF3;
}

    .card-title-app h5 {
        margin: 0;
        font-size: 17px;
        font-weight: 700;
        color: var(--navy-2);
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .card-title-app h5 i {
            color: var(--blue);
        }

.section-note {
    font-size: 13px;
    color: var(--navy-2);
    background: var(--tint);
    padding: 5px 12px;
    border-radius: 20px;
}

.form-section {
    margin-bottom: 26px;
}


/* ==========================================
   KPI CARDS (dashboard)
========================================== */

.kpi-card {
    display: flex;
    gap: 14px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 5px 18px rgba(11, 27, 58, .05);
    height: 100%;
}

.kpi-icon {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.kpi-label {
    font-size: 13px;
    color: #4A5A78;
    font-weight: 600;
}

.kpi-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
}

.kpi-sub {
    font-size: 12px;
    color: var(--muted);
}

.tint-blue { background: var(--tint-2); color: var(--blue); }
.tint-green { background: var(--green-bg); color: var(--green); }
.tint-violet { background: var(--violet-bg); color: var(--violet); }
.tint-amber { background: var(--amber-bg); color: var(--amber); }

/* class strength bars */
.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 14px;
}

.bar-label {
    width: 90px;
    flex: none;
    color: var(--text-2);
    font-weight: 600;
}

.bar-track {
    flex: 1;
    height: 12px;
    border-radius: 6px;
    background: #E6ECF7;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--gradient);
}

.bar-value {
    width: 40px;
    text-align: right;
    font-weight: 700;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #EDF1F7;
    font-size: 14px;
}

    .stat-line span {
        color: #4A5A78;
    }


/* ==========================================
   FORM CONTROLS
========================================== */

.form-label-custom {
    font-size: 14px;
    font-weight: 500;
    color: #26324A;
    margin-bottom: 7px;
    display: block;
}

    .form-label-custom::before {
        content: "";
        display: inline-block;
        width: 6px;
        height: 6px;
        background: var(--blue);
        border-radius: 50%;
        margin-right: 8px;
        vertical-align: 2px;
        box-shadow: 0 0 0 3px rgba(29, 78, 216, .1);
    }

    .form-label-custom .req {
        color: var(--red);
        margin-left: 2px;
    }

.form-control-custom,
.form-select-custom {
    width: 100%;
    height: 46px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background-color: #fff;
    color: var(--text);
    font-size: 15px;
    padding: 9px 13px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

    .form-control-custom:hover,
    .form-select-custom:hover {
        border-color: #93ACE8;
    }

    .form-control-custom:focus,
    .form-select-custom:focus {
        border-color: var(--blue);
        box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
        outline: none;
    }

    .form-control-custom::placeholder {
        color: #98A3B8;
        font-size: 14px;
    }

    .form-control-custom:disabled,
    .form-control-custom[readonly] {
        background: #EEF2F8;
        color: #4A5A78;
    }

textarea.form-control-custom {
    height: auto;
    min-height: 46px;
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px;
}

.form-ok {
    font-size: 13px;
    color: var(--green);
    margin-top: 5px;
}

.form-bad {
    font-size: 13px;
    color: var(--red);
    margin-top: 5px;
}

/* status switch (Active / Inactive) */
.status-switch {
    height: 46px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 14px;
}

    .status-switch .form-check-input {
        cursor: pointer;
    }

        .status-switch .form-check-input:checked {
            background-color: var(--blue);
            border-color: var(--blue);
        }

    .status-switch .form-check-label {
        margin-left: 6px;
        font-weight: 600;
        cursor: pointer;
        color: var(--green);
    }

        .status-switch .form-check-label.inactive {
            color: var(--red);
        }

/* checkbox list (subjects -> classes) */
.check-grid table {
    width: 100%;
}

.check-grid td {
    padding: 6px 4px;
}

.check-grid label {
    margin-left: 6px;
    cursor: pointer;
}

.check-grid input[type=checkbox] {
    width: 17px;
    height: 17px;
    accent-color: var(--blue);
    vertical-align: -3px;
    cursor: pointer;
}

/* photo box */
.photo-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

    .photo-box img,
    .photo-placeholder {
        width: 130px;
        height: 150px;
        border-radius: 12px;
        object-fit: cover;
        border: 2px dashed var(--input-border);
        background: #F7F9FD;
    }

.photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    color: #A9B6CF;
}

/* real file input is hidden; the label below is the button */
.photo-box .photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.photo-button {
    width: 130px;
    height: 38px;
    border: 1px solid #D1D9E6;
    border-radius: 8px;
    background: #fff;
    color: var(--navy-2);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all .2s ease;
}

    .photo-button:hover {
        background: var(--tint);
        border-color: #C7D5F5;
    }

.photo-name {
    width: 130px;
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ==========================================
   BUTTONS
========================================== */

.save-button,
.cancel-button,
.btn-app,
.btn-outline-app {
    height: 46px;
    min-width: 110px;
    padding: 0 22px;
    border-radius: 8px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all .2s ease;
}

.save-button,
.btn-app {
    border: none;
    background: var(--gradient);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 15px rgba(29, 63, 224, .22);
}

    .save-button:hover,
    .btn-app:hover {
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 8px 18px rgba(29, 63, 224, .32);
    }

.cancel-button,
.btn-outline-app {
    border: 1px solid #D1D9E6;
    background: #fff;
    color: var(--text-2);
}

    .cancel-button:hover,
    .btn-outline-app:hover {
        background: #F7F9FD;
        border-color: #9CA9C0;
        color: var(--text);
    }

.btn-sm-app {
    height: 40px;
    min-width: 0;
    padding: 0 16px;
    font-size: 14px;
}

/* small icon buttons inside tables */
.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-left: 4px;
}

    .icon-btn:hover {
        background: var(--tint);
        color: var(--blue);
        border-color: #C7D5F5;
    }

    .icon-btn.danger:hover {
        background: var(--red-bg);
        color: var(--red);
        border-color: #F3C9B0;
    }


/* ==========================================
   FILTER BAR
========================================== */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

    .filter-bar .form-control-custom,
    .filter-bar .form-select-custom {
        height: 42px;
        width: auto;
        min-width: 160px;
    }

    .filter-bar .grow {
        flex: 1 1 240px;
    }


/* ==========================================
   TABLES (GridView)
========================================== */

.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 0;
    background: #fff;
}

    .app-table th {
        text-align: left;
        font-weight: 700;
        color: var(--navy-2);
        padding: 12px 14px;
        background: var(--tint);
        border-bottom: 2px solid #D5E0FA;
        white-space: nowrap;
    }

    .app-table td {
        padding: 11px 14px;
        border-bottom: 1px solid #EDF1F7;
        color: #26324A;
        vertical-align: middle;
    }

    .app-table tr:hover td {
        background: #FAFBFE;
    }

    .app-table .pager td {
        background: #fff;
        border: none;
    }

    .app-table .pager table td {
        padding: 4px 2px;
    }

    .app-table .pager a,
    .app-table .pager span {
        display: inline-block;
        min-width: 34px;
        height: 34px;
        line-height: 32px;
        text-align: center;
        border-radius: 8px;
        border: 1px solid var(--border);
        text-decoration: none;
        color: var(--text-2);
    }

    .app-table .pager span {
        background: var(--blue);
        border-color: var(--blue);
        color: #fff;
        font-weight: 700;
    }

.empty-row {
    padding: 30px;
    text-align: center;
    color: var(--muted);
}

.person-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.person-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tint-2);
    color: var(--navy-2);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    object-fit: cover;
}

.person-sub {
    font-size: 12px;
    color: var(--muted);
}


/* ==========================================
   BADGES / ALERT STRIPS
========================================== */

.badge-app {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green { background: var(--green-bg); color: #0E6B4A; }
.badge-red { background: var(--red-bg); color: #9A3412; }
.badge-amber { background: var(--amber-bg); color: #92400E; }
.badge-blue { background: var(--tint-2); color: var(--navy-2); }
.badge-violet { background: var(--violet-bg); color: #5B21B6; }
.badge-grey { background: #EEF1F6; color: #4A5A78; }

.note-strip {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--tint);
    border: 1px solid #D5E0FA;
    color: var(--navy-2);
    font-size: 14px;
    margin-bottom: 18px;
}


/* ==========================================
   SETTINGS / OPERATION CARDS
========================================== */

.operation-box {
    height: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all .2s ease;
}

a.operation-box:hover {
    border-color: #C7D5F5;
    box-shadow: 0 8px 20px rgba(29, 78, 216, .10);
    transform: translateY(-2px);
    color: inherit;
}

.operation-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--tint);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
}

    .operation-icon.danger {
        background: var(--red-bg);
        color: var(--red);
    }

.operation-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy-2);
}

.operation-text {
    font-size: 14px;
    color: var(--muted);
    flex-grow: 1;
}

.danger-button {
    height: 46px;
    min-width: 110px;
    padding: 0 22px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #DC2626, #C2410C);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 6px 15px rgba(194, 65, 12, .22);
    transition: all .2s ease;
}

    .danger-button:hover {
        color: #fff;
        transform: translateY(-2px);
    }


/* ==========================================
   ATTENDANCE STATUS BUTTONS
========================================== */

.att-options {
    position: relative;     /* hidden radio stays inside the row: clicking it never scrolls the whole page */
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .att-options input[type=radio] {
        position: absolute;
        opacity: 0;
        width: 1px;
        height: 1px;
    }

    .att-options label {
        min-width: 70px;
        height: 34px;
        padding: 0 12px;
        border-radius: 8px;
        border: 1px solid #D1D9E6;
        background: #fff;
        color: var(--text-2);
        font-size: 13px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        margin: 0;
    }

    .att-options input[value=Present]:checked + label {
        background: var(--green-bg);
        border-color: #9AD9BF;
        color: #0E6B4A;
    }

    .att-options input[value=Absent]:checked + label {
        background: var(--red-bg);
        border-color: #F3C2A4;
        color: #9A3412;
    }

    .att-options input[value=Late]:checked + label {
        background: var(--amber-bg);
        border-color: #F1D29A;
        color: #92400E;
    }

    .att-options input[value=Leave]:checked + label {
        background: var(--tint-2);
        border-color: #BCCDF5;
        color: var(--navy-2);
    }

.count-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


/* ==========================================
   FEES
========================================== */

.money {
    text-align: right;
    white-space: nowrap;
}

.student-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 30px;
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--tint);
    border: 1px solid #D5E0FA;
    margin-bottom: 18px;
}

    .student-strip div span {
        display: block;
        font-size: 12px;
        color: var(--muted);
    }

    .student-strip div strong {
        font-size: 15px;
        color: var(--text);
    }

.amount-box {
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

    .amount-box span {
        display: block;
        font-size: 12px;
        color: var(--muted);
    }

    .amount-box strong {
        font-size: 22px;
        font-weight: 800;
    }


/* ==========================================
   MESSAGE BOX (SweetAlert2 theme)
========================================== */

.swal2-popup.sms-popup {
    border-radius: 18px;
    padding: 30px 26px 24px;
    font-family: var(--font);
    background: linear-gradient(90deg, var(--blue-2), var(--cyan)) top / 100% 5px no-repeat, #fff;
    box-shadow: 0 24px 60px rgba(11, 23, 48, .25);
}

.swal2-popup.sms-popup .swal2-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    padding-top: 6px;
}

.swal2-popup.sms-popup .swal2-html-container {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.55;
}

.swal2-popup.sms-popup .swal2-actions {
    gap: 10px;
    margin-top: 22px;
}

.sms-btn {
    height: 44px;
    min-width: 120px;
    padding: 0 22px;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.sms-btn:focus,
.sms-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .25);
}

.photo-box .form-hint {
    margin-top: 0;
}

.sms-btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 6px 15px rgba(29, 63, 224, .28);
}

.sms-btn-danger {
    background: linear-gradient(135deg, #DC2626, #C2410C);
    color: #fff;
    box-shadow: 0 6px 15px rgba(194, 65, 12, .25);
}

.sms-btn-cancel {
    background: #fff;
    color: var(--text-2);
    border: 1px solid #D1D9E6;
}

    .sms-btn-cancel:hover {
        background: #F7F9FD;
    }

.swal2-popup.sms-toast {
    font-family: var(--font);
    border-radius: 12px;
    border-left: none;
    box-shadow: 0 12px 30px rgba(11, 23, 48, .18);
}


/* ==========================================
   LOGIN PAGE (Login B2 - Light Blue Split)
========================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    background: #fff;
}

/* ---------- LEFT: brand panel ---------- */

.login-brand {
    flex: 1.2 1 520px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #F3F7FF 0%, #E3ECFF 55%, #D3E2FF 100%);
    color: var(--text);
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 36px;
}

    .login-brand > * {
        position: relative;
    }

    /* angled shapes taken from the logo */
    .login-brand .shard-1,
    .login-brand .shard-2,
    .login-brand .glow {
        position: absolute;
    }

    .login-brand .shard-1 {
        right: -60px;
        top: 40px;
        width: 520px;
        height: 220px;
        clip-path: polygon(0 100%, 100% 0, 78% 62%, 18% 100%);
        background: linear-gradient(90deg, #12308F, #1D4ED8 50%, #06C8EE);
        opacity: .22;
    }

    .login-brand .shard-2 {
        right: 40px;
        top: 250px;
        width: 360px;
        height: 200px;
        clip-path: polygon(0 0, 100% 100%, 70% 100%);
        background: linear-gradient(120deg, #7B3FF2, #2347F5 55%, #06C8EE);
        opacity: .18;
    }

    .login-brand .glow {
        left: -120px;
        bottom: -160px;
        width: 420px;
        height: 420px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(29, 78, 216, .18), rgba(29, 78, 216, 0) 70%);
    }

.login-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    letter-spacing: 3px;
    font-weight: 600;
    color: var(--navy-2);
}

    .login-kicker span {
        width: 34px;
        height: 4px;
        border-radius: 2px;
        background: linear-gradient(90deg, #2347F5, var(--cyan));
    }

.login-brand-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

    .login-brand-body img {
        width: 300px;
        height: 300px;
        object-fit: contain;
        margin: -40px 0 -30px -30px;
    }

    .login-brand-body h2 {
        margin: 0;
        font-size: 34px;
        line-height: 1.15;
        font-weight: 800;
        color: var(--text);
        max-width: 460px;
    }

    .login-brand-body p {
        margin: 0;
        font-size: 15px;
        line-height: 1.6;
        color: #34465F;
        max-width: 420px;
    }

.login-copy {
    font-size: 13px;
    color: #4A5A78;
}

/* ---------- RIGHT: form ---------- */

.login-form-side {
    flex: 1 1 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-welcome {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--blue);
}

.login-box h1 {
    margin: 6px 0 0;
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
}

.login-box .login-sub {
    margin: 8px 0 0;
    font-size: 14px;
    color: #4A5A78;
}

.login-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #26324A;
    margin-bottom: 7px;
}

.input-icon {
    position: relative;
}

    .input-icon > i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--blue);
        font-size: 17px;
        z-index: 2;
    }

.login-input {
    width: 100%;
    height: 50px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0 44px;
    font-size: 15px;
    color: var(--text);
    background: #F1F5FC;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

    .login-input:focus {
        background: #fff;
        border-color: var(--blue);
        box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
        outline: none;
    }

    .login-input::placeholder {
        color: #98A3B8;
    }

.toggle-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--muted);
    font-size: 18px;
    z-index: 2;
}

.login-remember {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    color: #4A5A78;
}

    .login-remember input {
        width: 16px;
        height: 16px;
        accent-color: var(--blue);
    }

.login-button {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(29, 63, 224, .3);
}

    .login-button:hover {
        color: #fff;
        filter: brightness(1.05);
    }

    .login-button.signing-in {
        pointer-events: none;
        opacity: .85;
    }

        .login-button.signing-in .spinner-border {
            width: 18px;
            height: 18px;
            border-width: 2px;
        }

.login-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--tint);
    font-size: 13px;
    color: var(--navy-2);
}

    .login-note i {
        color: var(--blue);
        font-size: 17px;
    }


/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 991px) {

    .app-sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(11, 23, 48, .45);
        z-index: 1030;
    }

    .app-main {
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767px) {

    .app-content {
        padding: 16px;
    }

    .app-topbar {
        padding: 10px 16px;
    }

    .app-card {
        padding: 16px;
    }

    .page-header {
        padding: 18px 20px;
    }

    .header-icon {
        display: none;
    }

    .login-brand {
        padding: 32px 24px;
        min-height: 0;
    }

    .login-brand-body img {
        width: 200px;
        height: 200px;
        margin: -24px 0 -20px -20px;
    }

    .login-brand-body h2 {
        font-size: 26px;
    }

    .filter-bar .form-control-custom,
    .filter-bar .form-select-custom {
        width: 100%;
    }
}


/* ==========================================
   EXAMS / TRANSPORT / PAYROLL
========================================== */

/* tick boxes inside tables */
.tick input,
.app-table th input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
    cursor: pointer;
    vertical-align: -3px;
}

/* small number boxes inside tables */
.app-table .marks-input {
    width: 90px;
    height: 38px;
}

.app-table .money-input {
    width: 100px;
    height: 38px;
    text-align: right;
}

.payroll-table td {
    vertical-align: top;
}

.payroll-table .form-control-custom {
    height: 38px;
    min-width: 90px;
}

/* radio list: one option per line */
ul.action-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

    ul.action-options li {
        margin-bottom: 10px;
    }

    ul.action-options input {
        accent-color: var(--blue);
        width: 16px;
        height: 16px;
        vertical-align: -2px;
        cursor: pointer;
    }

    ul.action-options label {
        margin-left: 8px;
        font-weight: 600;
        color: var(--text-2);
        cursor: pointer;
    }

/* pay salaries bar */
.pay-box-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px dashed #C9D7F5;
    background: var(--tint);
}

    .pay-box-bar .form-label-custom {
        margin-bottom: 4px;
    }

    .pay-box-bar .form-control-custom,
    .pay-box-bar .form-select-custom {
        height: 42px;
        min-width: 150px;
    }

    .pay-box-bar .btn-app {
        height: 42px;
    }

/* result card: provisional watermark */
.result-card {
    position: relative;
    overflow: hidden;
}

.provisional {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-24deg);
    font-size: 84px;
    font-weight: 800;
    letter-spacing: 8px;
    color: rgba(220, 38, 38, .08);
    pointer-events: none;
    white-space: nowrap;
}


/* ==========================================
   DETAILS (student profile)
========================================== */

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 22px;
}

    .info-grid span {
        display: block;
        font-size: 12px;
        color: var(--muted);
    }

    .info-grid strong {
        font-size: 14px;
        color: var(--text);
        font-weight: 600;
        word-break: break-word;
    }

    .info-grid .wide {
        grid-column: 1 / -1;
    }

@media (max-width: 767px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* grids inside a side panel never use the sticky page header position */
.side-panel .table-wrap .app-table th {
    position: static !important;
}


/* ==========================================
   FEE RECEIPT (print page)
========================================== */

.receipt-body {
    background: var(--page);
    padding: 24px 16px;
}

.receipt-actions {
    max-width: 820px;
    margin: 0 auto 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.receipt-paper {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
}

.receipt-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 3px solid var(--blue);
}

    .receipt-head h2 {
        margin: 0;
        font-size: 22px;
        font-weight: 800;
        color: var(--navy-2);
    }

.receipt-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.receipt-sub {
    font-size: 13px;
    color: var(--muted);
}

.receipt-title {
    text-align: right;
}

    .receipt-title span {
        display: block;
        font-size: 12px;
        letter-spacing: 2px;
        color: var(--muted);
    }

    .receipt-title strong {
        font-size: 18px;
        color: var(--text);
    }

.receipt-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 20px;
    padding: 18px 0;
}

    .receipt-info span,
    .receipt-totals span {
        display: block;
        font-size: 12px;
        color: var(--muted);
    }

    .receipt-info strong {
        font-size: 14px;
        color: var(--text);
    }

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .receipt-table th {
        background: var(--tint);
        color: var(--navy-2);
        font-weight: 700;
        padding: 9px 10px;
        border-bottom: 1px solid #D5E0FA;
    }

    .receipt-table td {
        padding: 9px 10px;
        border-bottom: 1px solid var(--border);
    }

.receipt-totals {
    display: flex;
    justify-content: flex-end;
    gap: 30px;
    padding: 16px 10px;
    text-align: right;
}

    .receipt-totals strong {
        font-size: 16px;
    }

    .receipt-totals .paid strong {
        font-size: 20px;
        color: var(--green);
    }

.receipt-remarks {
    font-size: 13px;
    color: var(--text-2);
    padding: 0 10px 10px;
}

.receipt-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 40px;
    font-size: 13px;
    color: var(--text-2);
}

.receipt-sign {
    min-width: 200px;
    text-align: center;
    border-top: 1px solid var(--text-2);
    padding-top: 6px;
}

.receipt-note {
    margin-top: 22px;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}

@media (max-width: 600px) {
    .receipt-info { grid-template-columns: repeat(2, 1fr); }
    .receipt-head { flex-wrap: wrap; }
    .receipt-paper { padding: 20px; }
}

.voucher {
    margin-bottom: 24px;
}

/* ==========================================
   STUDENT ID CARD (85.6 x 54 mm)
========================================== */

.id-sheet {
    max-width: 820px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 85.6mm);
    justify-content: center;
    gap: 6mm;
}

.id-card {
    width: 85.6mm;
    height: 54mm;
    border-radius: 3mm;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.id-top {
    display: flex;
    align-items: center;
    gap: 2.5mm;
    padding: 2mm 3mm;
    background: var(--header-gradient);
    color: #fff;
}

    .id-top img {
        width: 9mm;
        height: 9mm;
        object-fit: contain;
        background: #fff;
        border-radius: 1.5mm;
        padding: .5mm;
    }

.id-school {
    font-size: 9.5pt;
    font-weight: 800;
    line-height: 1.1;
}

.id-kind {
    font-size: 6pt;
    letter-spacing: 1.2px;
    opacity: .9;
}

.id-body {
    flex: 1;
    display: flex;
    gap: 3mm;
    padding: 2.5mm 3mm 1mm;
}

.id-photo {
    width: 19mm;
    height: 24mm;
    flex: 0 0 auto;
    border-radius: 1.5mm;
    border: 1px solid var(--input-border);
    background: #F7F9FD;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A9B6CF;
    font-size: 26pt;
    overflow: hidden;
}

    .id-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.id-info {
    font-size: 7pt;
    color: var(--text-2);
    line-height: 1.45;
    min-width: 0;
}

    .id-info span {
        display: inline-block;
        width: 13mm;
        color: var(--muted);
    }

    .id-info div {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.id-name {
    font-size: 9.5pt;
    font-weight: 800;
    color: var(--navy-2);
    margin-bottom: .5mm;
}

.id-bottom {
    display: flex;
    justify-content: space-between;
    padding: 1.2mm 3mm;
    font-size: 6.5pt;
    font-weight: 700;
    color: var(--navy-2);
    background: var(--tint);
    border-top: 1px solid #D5E0FA;
}

@media print {
    .id-sheet { gap: 3mm; }
    .id-card { border-color: #C9D3E5; }
}

/* totals row at the bottom of a grid */
.app-table tr.grid-total td {
    font-weight: 800;
    background: var(--tint);
    border-top: 2px solid #D5E0FA;
    color: var(--navy-2);
}

/* small session warning in the top bar */
.session-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--amber-bg);
    color: #92400E;
    font-size: 12px;
    font-weight: 700;
}

/* exam progress hints */
.step-hints span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

    .step-hints span i {
        margin-right: 5px;
    }

    .step-hints span.done {
        color: var(--green);
    }

@media print {
    .no-print { display: none !important; }
    .voucher { page-break-after: always; break-after: page; margin: 0; }
    .voucher:last-child { page-break-after: auto; break-after: auto; }
    .receipt-body { background: #fff; padding: 0; }
    .receipt-paper { border: none; border-radius: 0; padding: 0; max-width: none; }
    .receipt-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ==========================================
   ABOUT
========================================== */

.about-photo {
    position: relative;
    min-height: 320px;
}

    .about-photo img {
        position: absolute;
        inset: 14px;
        width: calc(100% - 28px);
        height: calc(100% - 28px);
        object-fit: cover;
        object-position: center 30%;
        border-radius: 12px;
        display: block;
    }

.about-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--navy-2);
}

.about-sub {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 22px;
}

.about-list {
    display: grid;
    gap: 12px;
}

.about-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--tint);
    border: 1px solid #D5E0FA;
    color: var(--navy-2);
    text-decoration: none;
    transition: border-color .15s ease;
}

    .about-item:hover {
        border-color: var(--blue);
        color: var(--navy-2);
    }

    .about-item i {
        font-size: 20px;
        color: var(--blue);
        width: 24px;
        text-align: center;
    }

    .about-item span {
        width: 80px;
        font-size: 13px;
        color: var(--muted);
    }

    .about-item strong {
        font-weight: 600;
        word-break: break-all;
    }



/* ==========================================
   FOOTER BRANDING + REPORTS
========================================== */

.app-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
}

    .app-footer .footer-brand {
        height: 30px;
        width: auto;
    }

/* the report (PDF) inside the Reports page */
/* Reports: Crystal Report Viewer (wide landscape pages scroll sideways inside the card) */
.report-viewer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;           /* the viewer scrolls inside itself, never the whole page */
    position: relative;         /* the viewer's hidden boxes (print / export) stay inside: no long empty page */
    contain: paint;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--page);
    padding: 8px;
}
