/* =====================================================
   GLOBAL
===================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    font-family: Arial, sans-serif;
    color: #142744;
    background: #eef3f9;
    overflow-x: hidden;
}


/* =====================================================
   LOGIN PAGE
===================================================== */

.login-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 50% 50%;
}

.login-left {
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 70px 20%;
}

.school-logo,
.login-logo,
.sidebar-logo {
    display: block;
    object-fit: contain;
    filter: drop-shadow(
        0 12px 22px rgba(33, 70, 150, 0.25)
    );
    animation: logoFloat 3.2s ease-in-out infinite;
}

.school-logo,
.login-logo {
    width: 120px;
    height: auto;
    margin: 0 auto 50px;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-6px) scale(1.02);
    }
}

.login-left h1 {
    font-size: 45px;
    margin: 0 0 50px;
}

.login-left label {
    display: block;
    font-size: 19px;
    margin-bottom: 10px;
}

.login-left input {
    width: 100%;
    height: 68px;

    border: 1px solid #ccd6e5;
    border-radius: 9px;

    padding: 0 20px;

    font-size: 18px;
    margin-bottom: 25px;

    outline: none;
}

.login-left input:focus {
    border-color: #3155a0;
}

.password-box {
    position: relative;
}

.password-box button {
    position: absolute;

    right: 15px;
    top: 13px;

    height: 40px;

    border: none;
    background: transparent;

    font-size: 20px;
    cursor: pointer;
}

.login-button {
    width: 100%;
    height: 68px;

    margin-top: 30px;

    border: none;
    border-radius: 40px;

    background: #5147e8;
    color: #fff;

    font-size: 20px;
    font-weight: bold;

    cursor: pointer;
}

.login-button:hover {
    opacity: .92;
}

.error-message {
    background: #ffe8e8;
    color: #b00020;

    padding: 15px;

    border-radius: 8px;

    margin-bottom: 20px;
}


/* =====================================================
   LOGIN RIGHT
===================================================== */

.login-right {
    position: relative;
    overflow: hidden;

    background: #25438f;
    color: #fff;

    display: flex;
    align-items: center;

    padding-left: 18%;
}

.login-hero {
    position: relative;
    z-index: 5;
}

.login-hero h2 {
    font-size: 65px;
    line-height: 1.05;

    margin: 0;

    font-weight: 800;
}

.login-hero p {
    font-size: 21px;
    font-weight: bold;

    margin-top: 40px;
}

.circle {
    position: absolute;

    border-radius: 50%;

    border: 100px solid rgba(13, 42, 105, .5);
}

.circle1 {
    width: 650px;
    height: 650px;

    left: -450px;
    top: -350px;
}

.circle2 {
    width: 700px;
    height: 700px;

    right: -500px;
    bottom: -450px;
}

.circle3 {
    width: 450px;
    height: 450px;

    left: 45%;
    top: -300px;
}


/* =====================================================
   DASHBOARD LAYOUT
===================================================== */

.dashboard-layout {
    display: flex;

    width: 100%;
    min-height: 100vh;
}


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

.sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;

    height: 100vh;

    background: linear-gradient(
        180deg,
        #14346a 0%,
        #1d4a8f 100%
    );

    color: #fff;

    overflow-y: auto;
    overflow-x: hidden;

    z-index: 1000;

    box-sizing: border-box;

    transition: transform .3s ease;
}


/* Sidebar scrollbar */

.sidebar::-webkit-scrollbar {
    width: 7px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.30);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.45);
}


/* Firefox scrollbar */

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.30)
                     rgba(255,255,255,.05);
}


/* =====================================================
   SIDEBAR HEADER
===================================================== */

.sidebar-header {
    width: 100%;

    padding: 18px 12px 14px;

    text-align: center;

    border-bottom:
        1px solid
        rgba(255,255,255,.12);

    box-sizing: border-box;
}


/* Sidebar logo */

.sidebar-logo {
    width: 50px !important;
    height: 50px !important;

    margin: 0 auto 7px;

    object-fit: contain;

    border-radius: 8px;
}


/* Office name */

.office-name {
    color: #fff;

    font-size: 12px;
    font-weight: 800;

    line-height: 1.2;

    white-space: nowrap;
}


/* Office subtitle */

.office-subtitle {
    color: rgba(255,255,255,.72);

    font-size: 10px;

    margin-top: 4px;

    line-height: 1.2;

    white-space: nowrap;
}


/* =====================================================
   SIDEBAR NAVIGATION
===================================================== */

.sidebar-nav {
    width: 100%;

    padding: 0;
    margin: 0;

    list-style: none;

    box-sizing: border-box;
}


/* =====================================================
   SIDEBAR SECTION
===================================================== */

.sidebar-section {
    width: 100%;

    padding: 20px 10px 18px;

    margin: 0;

    border-bottom:
        1px solid
        rgba(255,255,255,.12);

    box-sizing: border-box;
}


/* =====================================================
   SECTION TITLE
===================================================== */

.sidebar-section-title {
    color: rgba(255,255,255,.65);

    font-size: 11px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 1px;

    margin: 0 0 10px;

    padding: 0 10px;

    line-height: 1.2;
}


/* Old title compatibility */

.section-title {
    color: rgba(255,255,255,.65);

    font-size: 11px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 1px;

    padding: 0 10px;

    margin: 0 0 10px;
}


/* Subtitle */

.sidebar-section-subtitle {
    display: none;
}

.section-subtitle {
    display: none;
}


/* =====================================================
   SIDEBAR MENU
===================================================== */

.sidebar-menu {
    width: 100%;

    list-style: none;

    padding: 0;
    margin: 0;

    box-sizing: border-box;
}

.sidebar-menu li {
    width: 100%;

    margin: 0 0 8px;

    padding: 0;
}

.sidebar-menu .has-submenu {
    display: block;
}

.submenu {
    list-style: none;
    margin: 8px 0 0 18px;
    padding: 0;
    display: none;
}

.submenu li {
    margin: 0 0 6px;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    transition: background .2s ease, color .2s ease;
}

.submenu-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}


/* =====================================================
   SIDEBAR LINK
===================================================== */

.sidebar-link {
    width: 100%;

    min-height: 48px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 7px 10px;

    margin: 0;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: #fff;

    text-decoration: none;
    font-family: inherit;
    font-size: 14px;

    font-weight: 800;

    line-height: 1.1;

    box-sizing: border-box;

    transition:
        background .2s ease,
        transform .2s ease;

    text-align: left;
    cursor: pointer;
}


/* Hover */

.sidebar-link:hover {
    background: rgba(255,255,255,.08);

    color: #fff;
}


/* Active */

.sidebar-link.active {
    background: rgba(255,255,255,.10);

    color: #fff;

    box-shadow: none;
}


/* =====================================================
   MENU ICON
===================================================== */

.sidebar-link .menu-icon {
    flex: 0 0 36px;

    width: 36px;
    height: 36px;

    display: grid;

    place-items: center;

    background: #fff;

    color: #2861b3;

    border-radius: 6px;

    font-size: 16px;

    box-shadow:
        0 2px 6px
        rgba(0,0,0,.10);

    overflow: hidden;
}


/* Active icon */

.sidebar-link.active .menu-icon {
    background: #2867c7;

    color: #fff;
}


/* Icon images */

.sidebar-link .menu-icon img,
.sidebar-link .menu-icon svg {
    width: 18px;
    height: 18px;

    object-fit: contain;
}


/* =====================================================
   MENU TEXT
===================================================== */

.sidebar-link .menu-text {
    flex: 1;

    min-width: 0;

    color: #fff;

    display: block;

    line-height: 1.05;

    white-space: normal;

    overflow-wrap: break-word;

    word-break: normal;
}

.submenu-arrow {
    margin-left: auto;
    color: rgba(255,255,255,.75);
    font-size: 14px;
    transition: transform .2s ease;
}

.submenu-toggle[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}


/* =====================================================
   SIDEBAR BADGE
===================================================== */

.sidebar-link b {
    margin-left: auto;

    font-size: 25px;

    font-weight: normal;
}

.sidebar-link em {
    margin-left: auto;

    background: #ffc400;

    color: #111;

    border-radius: 20px;

    padding: 6px 10px;

    font-size: 11px;

    font-style: normal;

    white-space: nowrap;
}


/* Logout */

.logout {
    color: #ffdce0;
}


/* =====================================================
   MAIN CONTENT
===================================================== */

.main-content,
.main {
    width: calc(100% - 260px);

    min-height: 100vh;

    margin-left: 260px !important;

    box-sizing: border-box;

    transition:
        margin-left .3s ease,
        width .3s ease;
}


/* =====================================================
   TOP BAR
===================================================== */

.topbar {
    width: 100%;

    height: 85px;

    display: flex;

    align-items: center;

    background: #fff;

    border-bottom: 1px solid #ddd;

    padding: 0 35px;

    position: sticky;

    top: 0;

    z-index: 50;

    box-sizing: border-box;
}


/* Menu button */

.menu-button {
    border: none;

    background: none;

    font-size: 30px;

    color: #637590;

    cursor: pointer;
}


/* Space */

.top-space {
    flex: 1;
}


/* Clock */

.topbar #clock {
    margin-right: 25px;

    font-size: 17px;

    color: #637590;
}


/* Top icons */

.top-icon {
    border: none;

    background: none;

    font-size: 25px;

    color: #637590;

    margin-left: 15px;

    cursor: pointer;
}


/* =====================================================
   CONTENT
===================================================== */

.content {
    width: 100%;

    padding: 35px 32px;

    box-sizing: border-box;
}


/* Breadcrumb */

.breadcrumb {
    color: #5366e9;

    font-weight: bold;

    font-size: 18px;

    margin-bottom: 15px;
}


/* Page title */

.content > h1 {
    font-size: 42px;

    margin-top: 0;

    margin-bottom: 40px;
}


/* =====================================================
   STUDENT GRID
===================================================== */

.student-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, 1fr);

    gap: 30px;

    margin-bottom: 40px;
}


/* =====================================================
   CONTENT CARD
===================================================== */

.content-card {
    background: #fff;

    border: 1px solid #e0e5eb;

    border-radius: 20px;

    padding: 35px;

    box-shadow:
        0 2px 4px
        rgba(0,0,0,.04);

    box-sizing: border-box;
}

.content-card h2 {
    font-size: 27px;

    margin-top: 0;

    margin-bottom: 30px;
}


/* Student information */

.student-info {
    font-size: 19px;

    line-height: 1.35;
}

.student-info p {
    margin: 5px 0;
}


/* Adviser */

.adviser-card p {
    font-size: 18px;
}


/* =====================================================
   ANNOUNCEMENTS
===================================================== */

.announcements {
    min-height: 350px;
}

.announcement {
    border-top: 1px solid #e2e7ed;

    padding: 25px 5%;
}

.announcement small {
    color: #7687a0;
}

.announcement h3 {
    font-size: 21px;

    margin-bottom: 8px;
}

.announcement p {
    color: #4f6078;

    font-size: 17px;

    line-height: 1.6;
}


/* =====================================================
   STATISTICS GRID
===================================================== */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 22px;
}


/* Stat card */

.stat-card {
    background: #fff;

    border-radius: 12px;

    padding: 14px 16px;

    min-height: 82px;

    box-shadow:
        0 6px 18px
        rgba(7,24,58,0.06);

    border:
        1px solid
        rgba(13,30,63,0.06);

    box-sizing: border-box;
}


/* Stat header */

.stat-header {
    display: flex;

    align-items: center;

    gap: 12px;
}


/* Stat icon */

.stat-icon {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    border-radius: 10px;

    background: #eef5ff;

    display: grid;

    place-items: center;

    font-size: 20px;

    color: #25438f;
}


/* Stat meta */

.stat-meta {
    display: flex;

    flex-direction: column;

    min-width: 0;
}


/* Stat title */

.stat-title {
    font-size: 12px;

    color: #6b7b95;

    font-weight: 700;
}


/* Stat value */

.stat-value {
    font-size: 20px;

    font-weight: 800;

    color: #142746;

    margin-top: 6px;
}


/* Stat subtitle */

.stat-sub {
    font-size: 12px;

    color: #6b7b95;
}


/* =====================================================
   QUICK ACTIONS
===================================================== */

.quick-actions {
    margin-top: 18px;

    margin-bottom: 22px;

    display: flex;

    gap: 12px;

    flex-wrap: wrap;

    background: #fff;

    padding: 14px;

    border-radius: 10px;

    box-shadow:
        0 2px 6px
        rgba(7,24,58,0.04);
}

.quick-actions .btn {
    padding: 10px 14px;

    border-radius: 8px;

    font-weight: 700;

    color: #fff;

    border: none;

    cursor: pointer;
}


/* Buttons */

.btn-primary {
    background: #2563eb;
}

.btn-green {
    background: #10b981;
}

.btn-purple {
    background: #8b5cf6;
}

.btn-orange {
    background: #fb923c;
}

.btn-cyan {
    background: #06b6d4;
}

.btn-red {
    background: #ef4444;
}


/* =====================================================
   CHARTS
===================================================== */

.charts-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, 1fr);

    gap: 20px;

    align-items: start;
}

.left-chart {
    display: flex;

    flex-direction: column;
}

.right-column {
    display: flex;

    flex-direction: column;
}


/* Chart card */

.chart-card {
    background: #fff;

    padding: 20px;

    border-radius: 12px;

    box-shadow:
        0 6px 18px
        rgba(7,24,58,0.06);

    box-sizing: border-box;
}


/* Chart container */

.chart-container {
    width: 100%;

    height: 300px;
}


/* Donut */

.donut-card .chart-container {
    height: 200px;
}


/* =====================================================
   STATUS LIST
===================================================== */

.status-list {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.status-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    color: #455569;
}

.status-dot {
    width: 12px;
    height: 12px;

    border-radius: 50%;

    display: inline-block;

    margin-right: 8px;
}

.status-count {
    color: #556b89;

    font-weight: 700;
}


/* =====================================================
   PENDING ACTIONS
===================================================== */

.pending-actions {
    display: flex;

    flex-direction: column;

    gap: 10px;
}

.pending-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 10px 0;

    border-bottom:
        1px solid
        #eef3fb;
}

.pending-bullet {
    width: 28px;

    text-align: center;

    margin-right: 8px;
}

.pending-count {
    background: #eef3ff;

    color: #1e4aa0;

    padding: 6px 10px;

    border-radius: 16px;

    font-weight: 700;
}

.review-link {
    color: #2563eb;

    font-weight: 700;

    margin-left: 10px;

    text-decoration: none;
}


/* =====================================================
   SIDEBAR COLLAPSE
===================================================== */

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

.sidebar-hidden .main-content,
.sidebar-hidden .main {
    margin-left: 0 !important;

    width: 100%;
}


/* =====================================================
   LOADING OVERLAY
===================================================== */

.overlay {
    position: fixed;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #000;

    z-index: 99999;

    border-radius: 0 !important;
}

.loader {
    width: 100%;
    height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    background: transparent;

    padding: 0;
    margin: 0;
}

.spinner {
    width: 72px;
    height: 72px;

    border-radius: 50%;

    border:
        8px solid
        rgba(255,255,255,0.12);

    border-top-color: #66b3ff;

    animation:
        spin 1s linear infinite;
}

.loader-gif {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.loader-text {
    display: none;
}

.loader-continue {
    margin-top: 6px;

    background: #66b3ff;

    color: #04203a;

    border: none;

    padding: 10px 16px;

    border-radius: 8px;

    font-weight: 700;

    cursor: pointer;
}

.loader-continue:hover {
    opacity: .95;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =====================================================
   RESPONSIVE - TABLET
===================================================== */

@media (max-width: 1200px) {

    .stats-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .student-grid {
        grid-template-columns: 1fr;
    }

}


/* =====================================================
   RESPONSIVE - SMALL TABLET
===================================================== */

@media (max-width: 900px) {

    .sidebar {
        width: 250px !important;

        min-width: 250px !important;

        max-width: 250px !important;
    }

    .main-content,
    .main {
        width: calc(100% - 250px);

        margin-left: 250px !important;
    }

    .content {
        padding: 30px 20px;
    }

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* =====================================================
   RESPONSIVE - MOBILE
===================================================== */

@media (max-width: 700px) {

    /* Sidebar becomes overlay */

    .sidebar {
        width: 250px !important;

        min-width: 250px !important;

        max-width: 250px !important;

        transform: translateX(-100%);
    }

    /* Show sidebar when not hidden */

    body:not(.sidebar-hidden) .sidebar {
        transform: translateX(0);
    }

    /* Main */

    .main-content,
    .main {
        width: 100%;

        margin-left: 0 !important;
    }

    /* Content */

    .content {
        padding: 25px 15px;
    }

    .content > h1 {
        font-size: 32px;

        margin-bottom: 30px;
    }

    /* Cards */

    .content-card {
        padding: 25px;
    }

    /* Stats */

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Charts */

    .charts-grid {
        grid-template-columns: 1fr;
    }

    /* Login */

    .login-container {
        grid-template-columns: 1fr;
    }

    .login-right {
        display: none;
    }

    .login-left {
        padding: 50px 10%;
    }

}


/* =====================================================
   VERY SMALL MOBILE
===================================================== */

@media (max-width: 450px) {

    .sidebar {
        width: 235px !important;

        min-width: 235px !important;

        max-width: 235px !important;
    }

}

/* =====================================================
   CRAD LOGIN EXPERIENCE
===================================================== */

    .login-page {
        background: #f5f7fb;
    }

    .login-container {
        min-height: 100svh;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .login-left {
        padding: clamp(30px, 5vh, 58px) clamp(28px, 7vw, 104px);
    }

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

    .login-brand {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 44px;
    }

    .login-brand .login-logo {
        width: 62px;
        height: 62px;
        flex: 0 0 62px;
        margin: 0;
        animation: none;
    }

    .login-eyebrow,
    .login-brand-subtitle {
        display: block;
    }

    .login-eyebrow {
        color: #244984;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .15em;
    }

    .login-brand-subtitle {
        margin-top: 5px;
        color: #718096;
        font-size: 12px;
    }

    .login-kicker {
        margin: 0 0 10px;
        color: #4264a1;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .16em;
    }

    .login-left h1 {
        margin: 0;
        color: #172b4d;
        font-size: clamp(30px, 3vw, 39px);
        letter-spacing: -.04em;
        line-height: 1.15;
    }

    .login-intro {
        margin: 13px 0 27px;
        color: #68788f;
        font-size: 14px;
        line-height: 1.65;
    }

    .login-form label {
        margin: 0 0 8px;
        color: #263a59;
        font-size: 13px;
        font-weight: 700;
    }

    .login-form input {
        height: 54px;
        margin: 0 0 19px;
        padding: 0 15px;
        border-color: #d9e1ec;
        border-radius: 9px;
        background: #fff;
        color: #172b4d;
        font-size: 15px;
        transition: border-color .18s ease, box-shadow .18s ease;
    }

    .login-form input::placeholder {
        color: #9aa7b8;
    }

    .login-form input:focus {
        border-color: #426ad1;
        box-shadow: 0 0 0 3px rgba(66, 106, 209, .13);
    }

    .password-box input {
        padding-right: 75px;
    }

    .password-box .password-toggle {
        top: 4px;
        right: 8px;
        height: 44px;
        padding: 0 10px;
        border-radius: 6px;
        color: #38598b;
        font-size: 12px;
        font-weight: 700;
    }

    .password-box .password-toggle:hover,
    .password-box .password-toggle:focus-visible {
        background: #eff4fb;
        outline: none;
    }

    .login-button {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 54px;
        margin-top: 7px;
        padding: 0 19px;
        border-radius: 9px;
        background: #244b91;
        box-shadow: 0 8px 18px rgba(36, 75, 145, .2);
        font-size: 15px;
        transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
    }

    .login-button:hover {
        background: #1b3d79;
        box-shadow: 0 10px 22px rgba(36, 75, 145, .24);
        opacity: 1;
        transform: translateY(-1px);
    }

    .login-button:focus-visible {
        outline: 3px solid rgba(66, 106, 209, .35);
        outline-offset: 3px;
    }

    .error-message {
        margin: 0 0 20px;
        border: 1px solid #f4caca;
        font-size: 14px;
        line-height: 1.5;
    }

    .login-security-note {
        display: flex;
        align-items: flex-start;
        gap: 11px;
        margin-top: 24px;
        padding: 14px;
        border: 1px solid #e5ebf3;
        border-radius: 9px;
        background: #f8fafd;
    }

    .login-security-icon {
        display: grid;
        width: 23px;
        height: 23px;
        flex: 0 0 23px;
        place-items: center;
        border-radius: 50%;
        background: #e5f4ec;
        color: #28764d;
        font-size: 13px;
        font-weight: 800;
    }

    .login-security-note p {
        margin: 0;
        color: #66768c;
        font-size: 11px;
        line-height: 1.55;
    }

    .login-security-note strong {
        color: #344761;
        font-size: 12px;
    }

    .login-footer {
        margin: 22px 0 0;
        color: #8a97a8;
        font-size: 10px;
        text-align: center;
    }

    .login-footer span {
        padding: 0 4px;
    }

    .login-right {
        justify-content: center;
        padding: 56px clamp(34px, 6vw, 92px);
        background:
            radial-gradient(ellipse at 88% 12%, rgba(84, 135, 219, .32), transparent 36%),
            linear-gradient(145deg, #18396f 0%, #244b91 56%, #193d7b 100%);
    }

    .login-hero {
        width: min(100%, 520px);
    }

    .login-hero-label {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        margin-bottom: 20px;
        color: rgba(255, 255, 255, .77);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .16em;
    }

    .login-hero-label > span,
    .login-feature-status > span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #80e0b0;
        box-shadow: 0 0 0 4px rgba(128, 224, 176, .13);
    }

    .login-hero h2 {
        font-size: clamp(42px, 5vw, 63px);
        letter-spacing: -.045em;
        line-height: 1.04;
    }

    .login-hero h2 span {
        color: #9cc5ff;
    }

    .login-hero-copy {
        max-width: 380px;
        margin: 18px 0 25px;
        color: rgba(255, 255, 255, .76);
        font-size: 14px;
        font-weight: 400;
        line-height: 1.6;
    }

    .login-feature-card {
        padding: 19px;
        border: 1px solid rgba(255, 255, 255, .2);
        border-radius: 13px;
        background: rgba(10, 30, 68, .24);
        box-shadow: 0 20px 40px rgba(9, 26, 57, .15);
        backdrop-filter: blur(8px);
    }

    .login-feature-heading {
        display: flex;
        align-items: center;
        gap: 11px;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, .14);
    }

    .login-feature-icon {
        display: grid;
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        place-items: center;
        border-radius: 10px;
        background: rgba(151, 192, 255, .16);
        color: #c6ddff;
        font-size: 19px;
    }

    .login-feature-heading strong,
    .login-feature-heading small {
        display: block;
    }

    .login-feature-heading strong {
        color: #fff;
        font-size: 12px;
    }

    .login-feature-heading small {
        margin-top: 4px;
        color: rgba(255, 255, 255, .62);
        font-size: 10px;
    }

    .login-feature-status {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        margin-left: auto;
        color: #bdebd1;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: .09em;
    }

    .login-feature-status > span {
        width: 6px;
        height: 6px;
        box-shadow: none;
    }

    .login-feature-list {
        display: grid;
        gap: 11px;
        padding-top: 15px;
        color: rgba(255, 255, 255, .86);
        font-size: 11px;
    }

    .login-feature-list span {
        display: flex;
        align-items: center;
        gap: 9px;
    }

    .login-feature-list i {
        display: grid;
        width: 17px;
        height: 17px;
        place-items: center;
        border-radius: 50%;
        background: rgba(128, 224, 176, .15);
        color: #9aebbd;
        font-size: 10px;
        font-style: normal;
        font-weight: 800;
    }

    .login-hero-caption {
        margin: 19px 0 0;
        color: rgba(255, 255, 255, .52);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: .13em;
    }

    .login-loading {
        align-items: center;
        justify-content: center;
        padding: 28px;
        background:
            radial-gradient(ellipse at 50% 0%, rgba(57, 101, 171, .12), transparent 55%),
            #f4f7fb;
        color: #172b4d;
    }

    .login-loading-card {
        width: min(100%, 480px);
        padding: clamp(24px, 5vw, 42px);
        border: 1px solid #e5ebf3;
        border-radius: 17px;
        background: #fff;
        box-shadow: 0 24px 70px rgba(28, 53, 91, .12);
    }

    .login-loading-brand {
        margin-bottom: 28px;
    }

    .login-loading-logo {
        width: 48px;
        height: 48px;
        object-fit: contain;
    }

    .login-loading-indicator {
        display: grid;
        width: 52px;
        height: 52px;
        margin-bottom: 22px;
        place-items: center;
        border-radius: 14px;
        background: #edf3fc;
    }

    .login-loading-indicator .spinner {
        width: 26px;
        height: 26px;
        border-width: 3px;
        border-color: #d5e1f2;
        border-top-color: #315da3;
    }

    .login-loading-card .login-kicker {
        margin-bottom: 8px;
    }

    .login-loading-card h1 {
        margin: 0;
        font-size: clamp(23px, 5vw, 29px);
        letter-spacing: -.035em;
    }

    .login-loading-copy {
        margin: 10px 0 22px;
        color: #708098;
        font-size: 13px;
        line-height: 1.6;
    }

    .login-loading-account {
        display: flex;
        align-items: center;
        gap: 11px;
        padding: 12px;
        border: 1px solid #e8edf4;
        border-radius: 10px;
        background: #fafbfd;
    }

    .login-account-icon {
        display: grid;
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        place-items: center;
        border-radius: 50%;
        background: #e3ecfa;
        color: #244b91;
        font-size: 14px;
        font-weight: 800;
    }

    .login-account-details {
        display: grid;
        gap: 3px;
        min-width: 0;
    }

    .login-account-label {
        color: #8491a3;
        font-size: 10px;
    }

    .login-account-details strong {
        overflow: hidden;
        color: #2a3d59;
        font-size: 12px;
        text-overflow: ellipsis;
    }

    .login-account-ready {
        margin-left: auto;
        padding: 5px 8px;
        border-radius: 20px;
        background: #e8f6ed;
        color: #267247;
        font-size: 10px;
        font-weight: 700;
    }

    .login-progress-track {
        height: 5px;
        margin: 24px 0 17px;
        overflow: hidden;
        border-radius: 8px;
        background: #edf1f6;
    }

    .login-progress-track span {
        display: block;
        width: 0;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #315da3, #76a5ed);
        animation: loginProgress 2.75s ease-out forwards;
    }

    .login-loading-steps {
        display: grid;
        gap: 12px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .login-loading-steps li {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #a0abba;
        font-size: 11px;
        transition: color .2s ease;
    }

    .login-loading-steps li > span {
        display: grid;
        width: 21px;
        height: 21px;
        place-items: center;
        border: 1px solid #dfe5ed;
        border-radius: 50%;
        color: #8996a8;
        font-size: 10px;
        font-weight: 700;
    }

    .login-loading-steps li.is-complete {
        color: #315da3;
        font-weight: 700;
    }

    .login-loading-steps li.is-complete > span {
        border-color: #315da3;
        background: #315da3;
        color: #fff;
    }

    .login-loading-steps li.is-done {
        color: #59708f;
    }

    .login-loading-steps li.is-done > span {
        border-color: #cce8d5;
        background: #e8f6ed;
        color: #267247;
    }

    .login-loading-footnote {
        margin: 22px 0 0;
        padding-top: 15px;
        border-top: 1px solid #edf1f6;
        color: #7f8ca0;
        font-size: 10px;
    }

    @keyframes loginProgress {
        to {
            width: 100%;
        }
    }

    @media (max-width: 1200px) {
        .login-container {
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        }

        .login-left {
            padding: 42px clamp(28px, 8vw, 80px);
        }

        .login-right {
            display: flex;
            padding: 44px clamp(30px, 6vw, 68px);
        }
    }

    @media (max-width: 760px) {
        .login-container {
            grid-template-columns: 1fr;
        }

        .login-right {
            display: none;
        }

        .login-left {
            min-height: 100svh;
            padding: 32px 24px;
        }

        .login-brand {
            margin-bottom: 36px;
        }
    }

    @media (max-width: 450px) {
        .sidebar-link {
            font-size: 13px;

            gap: 8px;
        }

        .sidebar-link .menu-icon {
            width: 34px;
            height: 34px;

            flex-basis: 34px;
        }

        .topbar {
            height: 70px;

            padding: 0 15px;
        }

        .topbar #clock {
            display: none;
        }

        .content {
            padding: 20px 12px;
        }

        .content-card {
            padding: 20px;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .login-progress-track span {
            animation-duration: .01ms;
        }

        .login-loading-indicator .spinner {
            animation-duration: 2s;
        }
    }


/* =====================================================
   CRAD v2: ROLES, SECURITY, EXPORTS, DASHBOARD
===================================================== */

:root {
    --crad-navy: #173b78;
    --crad-navy-dark: #14346a;
    --crad-ink: #1f2a3d;
    --crad-muted: #5b6779;
    --crad-line: #dfe6ef;
    --crad-surface: #ffffff;
    --crad-soft: #f4f7fb;
    --crad-good: #1f8a5b;
    --crad-good-bg: #e6f6ee;
    --crad-warn: #a86400;
    --crad-warn-bg: #fff4dd;
    --crad-bad: #c2333f;
    --crad-bad-bg: #fde9eb;
    --crad-info: #2459b8;
    --crad-info-bg: #e8f0fd;
}

/* Sidebar signed-in user */
.sidebar-user {
    margin: 12px 14px 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.10);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}
.sidebar-user-name {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-role {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #14346a;
    background: #dfbd62;
    padding: 2px 8px;
    border-radius: 999px;
}

/* Login notices + OTP */
.login-notice {
    background: var(--crad-info-bg);
    color: var(--crad-info);
    padding: 14px 15px;
    border-radius: 8px;
    margin-bottom: 18px;
    line-height: 1.45;
}
.otp-input {
    font-size: 26px !important;
    letter-spacing: 12px;
    text-align: center;
    font-weight: 700;
}
.otp-timer {
    font-size: 13px;
    color: var(--crad-muted);
    margin: 4px 0 14px;
}
.otp-timer.is-expired { color: var(--crad-bad); }
.otp-resend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.otp-resend-btn {
    background: none;
    border: 0;
    color: var(--crad-navy);
    font-weight: 700;
    cursor: pointer;
    padding: 6px 0;
    font-size: 14px;
}
.otp-resend-btn:disabled { color: #9aa6b5; cursor: not-allowed; }
.otp-back { color: var(--crad-muted); font-size: 14px; }

/* Export buttons */
.crad-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.crad-export-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--crad-muted);
    margin-right: 2px;
}
.crad-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--crad-line);
    background: var(--crad-surface);
    color: var(--crad-ink);
    font: 700 12px/1 Arial, Helvetica, sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.crad-export-btn:hover,
.crad-export-btn:focus-visible { background: var(--crad-soft); border-color: #b9c7da; }
.crad-export-csv span { color: var(--crad-good); }
.crad-export-pdf span { color: var(--crad-bad); }
.crad-export-bar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 14px;
}

/* Inactivity dialog */
.crad-timeout {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 28, 52, .55);
    display: grid;
    place-items: center;
    padding: 16px;
}
.crad-timeout[hidden] { display: none; }
.crad-timeout-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--crad-ink);
}
.crad-timeout-icon { font-size: 36px; }
.crad-timeout-card h2 { margin: 8px 0; font-size: 20px; }
.crad-timeout-card p { color: var(--crad-muted); line-height: 1.5; margin: 0 0 20px; }
.crad-timeout-count { color: var(--crad-bad); font-size: 18px; }
.crad-timeout-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.crad-timeout-actions button {
    padding: 11px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--crad-line);
    background: #fff;
    color: var(--crad-ink);
}
.crad-timeout-actions .crad-timeout-stay { background: var(--crad-navy); border-color: var(--crad-navy); color: #fff; }

/* Admin pages (users, audit, settings) */
.crad-main { margin-left: 260px; min-height: 100vh; background: #eef2f7; transition: margin .3s ease; }
body.sidebar-hidden .crad-main { margin-left: 0; }
.crad-topbar { height: 55px; background: #fff; border-bottom: 1px solid var(--crad-line); display: flex; align-items: center; padding: 0 20px; position: sticky; top: 0; z-index: 50; }
.crad-topbar button { width: 36px; height: 36px; border: 0; background: transparent; font-size: 21px; cursor: pointer; border-radius: 7px; }
.crad-page { padding: 24px 28px 40px; max-width: 1400px; margin: 0 auto; font-family: Arial, Helvetica, sans-serif; color: var(--crad-ink); }
.crad-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.crad-page-head h1 { margin: 0; font-size: 26px; color: var(--crad-ink); }
.crad-page-head p { margin: 6px 0 0; color: var(--crad-muted); }
.crad-breadcrumb { font-size: 12px; color: var(--crad-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.crad-card { background: var(--crad-surface); border: 1px solid var(--crad-line); border-radius: 12px; padding: 18px; margin-bottom: 18px; box-shadow: 0 4px 14px rgba(23,59,120,.05); }
.crad-card h2 { margin: 0 0 4px; font-size: 17px; }
.crad-card .crad-sub { color: var(--crad-muted); font-size: 13px; margin: 0 0 14px; }
.crad-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.crad-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--crad-muted); }
.crad-field input, .crad-field select {
    padding: 9px 10px; border: 1px solid var(--crad-line); border-radius: 8px; font: 14px Arial, Helvetica, sans-serif; color: var(--crad-ink); background: #fff;
}
.crad-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: 8px; border: 1px solid var(--crad-navy); background: var(--crad-navy); color: #fff; font: 700 13px Arial, Helvetica, sans-serif; cursor: pointer; text-decoration: none; }
.crad-btn.secondary { background: #fff; color: var(--crad-navy); }
.crad-btn.danger { background: #fff; color: var(--crad-bad); border-color: #f0c2c7; }
.crad-btn.small { padding: 6px 10px; font-size: 12px; }
.crad-table-wrap { overflow-x: auto; }
.crad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.crad-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--crad-muted); padding: 10px; border-bottom: 1px solid var(--crad-line); background: var(--crad-soft); white-space: nowrap; }
.crad-table td { padding: 10px; border-bottom: 1px solid #edf1f6; vertical-align: top; }
.crad-table tr:hover td { background: #fafcff; }
.crad-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--crad-soft); color: var(--crad-muted); white-space: nowrap; }
.crad-badge.good { background: var(--crad-good-bg); color: var(--crad-good); }
.crad-badge.warn { background: var(--crad-warn-bg); color: var(--crad-warn); }
.crad-badge.bad { background: var(--crad-bad-bg); color: var(--crad-bad); }
.crad-badge.info { background: var(--crad-info-bg); color: var(--crad-info); }
.crad-alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; line-height: 1.45; }
.crad-alert.good { background: var(--crad-good-bg); color: var(--crad-good); }
.crad-alert.bad { background: var(--crad-bad-bg); color: var(--crad-bad); }
.crad-alert.warn { background: var(--crad-warn-bg); color: var(--crad-warn); }
.crad-pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.crad-pager a, .crad-pager span { padding: 6px 11px; border-radius: 7px; border: 1px solid var(--crad-line); font-size: 13px; text-decoration: none; color: var(--crad-ink); }
.crad-pager .current { background: var(--crad-navy); color: #fff; border-color: var(--crad-navy); }
.crad-matrix td, .crad-matrix th { text-align: center; }
.crad-matrix td:first-child, .crad-matrix th:first-child { text-align: left; }
.crad-yes { color: var(--crad-good); font-weight: 800; }
.crad-no { color: #c3cbd6; }
.crad-dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.crad-dialog::backdrop { background: rgba(15,28,52,.5); }
.crad-dialog form { padding: 22px; }
.crad-dialog h2 { margin: 0 0 14px; }
.crad-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Dashboard: clickable cards, scorecard, analytics, AI */
a.stat-card { display: block; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.stat-card:hover, a.stat-card:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23,59,120,.14); }
.stat-card .stat-open { display: block; margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--crad-navy); opacity: .75; }
.crad-dash-section { margin: 22px 0; }
.crad-dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.crad-dash-head h2 { margin: 0; font-size: 18px; color: var(--crad-ink); }
.crad-dash-head p { margin: 4px 0 0; font-size: 13px; color: var(--crad-muted); }
.crad-score-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.crad-score { display: block; background: #fff; border: 1px solid var(--crad-line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; border-top: 4px solid #c3cbd6; }
.crad-score:hover, .crad-score:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23,59,120,.12); }
.crad-score.good { border-top-color: var(--crad-good); }
.crad-score.warn { border-top-color: #e3a21a; }
.crad-score.bad { border-top-color: var(--crad-bad); }
.crad-score-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.crad-score-label { font-size: 12px; font-weight: 700; color: var(--crad-muted); }
.crad-score-value { font-size: 24px; font-weight: 800; margin: 6px 0 8px; color: var(--crad-ink); }
.crad-score-track { height: 6px; background: #edf1f6; border-radius: 999px; overflow: hidden; }
.crad-score-track span { display: block; height: 100%; border-radius: 999px; background: #9aa6b5; }
.crad-score.good .crad-score-track span { background: var(--crad-good); }
.crad-score.warn .crad-score-track span { background: #e3a21a; }
.crad-score.bad .crad-score-track span { background: var(--crad-bad); }
.crad-score-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--crad-muted); }
.crad-analytics-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.crad-metric { display: block; background: #fff; border: 1px solid var(--crad-line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.crad-metric:hover, .crad-metric:focus-visible { box-shadow: 0 10px 24px rgba(23,59,120,.12); }
.crad-metric-label { font-size: 12px; color: var(--crad-muted); font-weight: 700; }
.crad-metric-value { font-size: 21px; font-weight: 800; margin: 6px 0 4px; word-break: break-word; }
.crad-metric-note { font-size: 12px; color: var(--crad-muted); }
.crad-change { font-weight: 800; margin-right: 4px; }
.crad-change.up { color: var(--crad-good); }
.crad-change.down { color: var(--crad-bad); }
.crad-insights { display: grid; gap: 10px; }
.crad-insight { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--crad-line); border-left: 4px solid var(--crad-info); border-radius: 10px; padding: 12px 14px; }
.crad-insight.critical { border-left-color: var(--crad-bad); }
.crad-insight.warning { border-left-color: #e3a21a; }
.crad-insight.success { border-left-color: var(--crad-good); }
.crad-insight-icon { font-size: 18px; line-height: 1.2; }
.crad-insight-body { flex: 1; min-width: 0; }
.crad-insight-title { font-weight: 800; font-size: 14px; }
.crad-insight-detail { font-size: 13px; color: var(--crad-muted); margin-top: 3px; line-height: 1.45; }
.crad-insight a { flex-shrink: 0; align-self: center; font-size: 12px; font-weight: 700; color: var(--crad-navy); text-decoration: none; padding: 6px 10px; border: 1px solid var(--crad-line); border-radius: 7px; white-space: nowrap; }
.crad-insight a:hover { background: var(--crad-soft); }
.crad-ai-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: #6b3fb8; background: #f1eafd; padding: 3px 9px; border-radius: 999px; }
.crad-chart-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.crad-chart-card { background: #fff; border: 1px solid var(--crad-line); border-radius: 12px; padding: 16px; }
.crad-chart-card h3 { margin: 0; font-size: 15px; }
.crad-chart-card p { margin: 3px 0 10px; font-size: 12px; color: var(--crad-muted); }
.crad-chart-box { position: relative; height: 240px; }
.crad-two-col { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.crad-list-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf1f6; }
.crad-list-row:last-child { border-bottom: 0; }
.crad-list-title { font-weight: 700; font-size: 14px; }
.crad-list-meta { font-size: 12px; color: var(--crad-muted); margin-top: 2px; }

@media (max-width: 900px) {
    .crad-main { margin-left: 0; }
}
@media (max-width: 640px) {
    .crad-page { padding: 16px; }
    .crad-insight { flex-wrap: wrap; }
    .crad-insight a { align-self: flex-start; }
}
