html {
    scrollbar-gutter: stable;
}

body {
    font-size: 0.94rem;
}

body.sidebar-open {
    overflow: hidden;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 18%, rgba(13, 110, 253, 0.16), transparent 42%),
        radial-gradient(circle at 86% 20%, rgba(32, 201, 151, 0.16), transparent 40%),
        radial-gradient(circle at 78% 88%, rgba(13, 202, 240, 0.14), transparent 38%),
        linear-gradient(135deg, #edf4ff 0%, #f5fbff 45%, #f1f8f7 100%);
    position: relative;
    overflow-x: hidden;
}

.login-page::before,
.login-page::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
    border-radius: 999px;
    filter: blur(2px);
}

.login-page::before {
    width: 360px;
    height: 360px;
    right: -110px;
    top: -80px;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.16) 0%, rgba(13, 110, 253, 0) 70%);
}

.login-page::after {
    width: 300px;
    height: 300px;
    left: -120px;
    bottom: -80px;
    background: radial-gradient(circle, rgba(25, 135, 84, 0.14) 0%, rgba(25, 135, 84, 0) 72%);
}

.login-card {
    max-width: 460px;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    box-shadow: 0 16px 45px rgba(13, 31, 67, 0.14) !important;
}

.login-card .card-body {
    position: relative;
}

.login-card .card-body::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #0d6efd, #20c997, #0dcaf0);
}

.login-brand {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.login-brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 1px solid rgba(13, 110, 253, 0.18);
    background: linear-gradient(180deg, #f8fbff 0%, #eff5ff 100%);
    box-shadow: 0 8px 22px rgba(13, 110, 253, 0.14);
    color: #0d6efd;
    font-size: 1.1rem;
    font-weight: 700;
    overflow: hidden;
    flex: 0 0 56px;
}

.login-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
}

.login-brand-copy {
    min-width: 0;
}

.login-title {
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: 0.01em;
    color: #0f172a;
    margin: 0 0 0.28rem 0;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.87rem;
    line-height: 1.4;
    margin: 0;
}

.login-password-wrap {
    position: relative;
    display: block;
}

.login-password-wrap .login-password-input {
    padding-right: 2.85rem;
}

.login-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.login-password-toggle:hover {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
}

.login-password-toggle:focus-visible {
    outline: 2px solid rgba(13, 110, 253, 0.45);
    outline-offset: 2px;
}

.login-password-wrap .login-password-input:focus {
    padding-right: 2.85rem;
}

.login-card .form-label {
    font-weight: 600;
    color: #334155;
}

.login-card .form-control {
    border-radius: 10px;
    border-color: #dbe4f0;
}

.login-card .form-control:focus {
    border-color: #8ab4ff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.login-card .btn-primary {
    border-radius: 10px;
    font-weight: 600;
    padding-top: 0.58rem;
    padding-bottom: 0.58rem;
}

.not-found-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 16% 16%, rgba(13, 110, 253, 0.16), transparent 40%),
        radial-gradient(circle at 84% 22%, rgba(32, 201, 151, 0.16), transparent 36%),
        radial-gradient(circle at 72% 88%, rgba(220, 53, 69, 0.12), transparent 38%),
        linear-gradient(135deg, #eef4ff 0%, #f8fbff 52%, #f4faf8 100%);
}

.not-found-card {
    max-width: 560px;
    width: 100%;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14) !important;
}

.not-found-brand {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    border: 1px solid rgba(13, 110, 253, 0.2);
    background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
    color: #0d6efd;
    font-size: 1.2rem;
    font-weight: 700;
    overflow: hidden;
}

.not-found-brand img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
}

.not-found-code {
    font-size: clamp(2.6rem, 7vw, 4.25rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #0d6efd;
    text-shadow: 0 10px 26px rgba(13, 110, 253, 0.22);
    margin-bottom: 0.3rem;
}

.not-found-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
}

#layoutWrapper {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow-x: clip;
}

#sideNav {
    flex: 0 0 260px;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    background: linear-gradient(180deg, #0b1220 0%, #0a2f66 55%, #0a3a7a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    row-gap: 8px;
    position: sticky;
    top: 0;
    overflow: hidden;
}

#sideNav .brand-area,
#sideNav .sidebar-close-btn,
#sideNav .sidebar-footer {
    flex-shrink: 0;
}

.sidebar-backdrop {
    display: none;
}

#layoutWrapper main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#layoutWrapper main > .navbar {
    position: sticky;
    top: 0;
    z-index: 1025;
    min-height: 59px;
}

#layoutWrapper main > section {
    flex: 1 1 auto;
}

.brand-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 12px 10px 14px;
    min-width: 0;
    margin-bottom: 8px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
}

.brand-area::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -10px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.06) 60%, transparent 100%);
}

.brand-logo {
    width: 62px;
    height: 62px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    overflow: hidden;
    border-radius: 999px !important;
    flex: 0 0 62px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    border-radius: 999px;
    display: block;
}

.brand-text .fw-bold {
    font-size: 1rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.brand-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    width: 100%;
    align-items: center;
}

.sidebar-close-btn {
    display: none;
}

.brand-title {
    font-family: "Montserrat", "Poppins", "Segoe UI", "Inter", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    line-height: 1.22 !important;
    color: #eaf4ff;
    width: 100%;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
}

.brand-subtitle {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 0.26rem 0.58rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(86, 170, 255, 0.24) 0%, rgba(86, 170, 255, 0.1) 100%);
    border: 1px solid rgba(163, 211, 255, 0.32);
    color: #e4f2ff !important;
    font-size: 0.66rem !important;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    line-height: 1.2 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

#sidebarMenu {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap !important;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto !important;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    margin-top: 0 !important;
    padding: 6px 6px 10px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    scrollbar-gutter: stable;
}

#sidebarMenu::-webkit-scrollbar {
    width: 7px;
}

#sidebarMenu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
}

#sidebarMenu::-webkit-scrollbar-track {
    background: transparent;
}

#sidebarMenu .nav-link {
    color: rgba(255, 255, 255, 0.9);
    width: 100%;
    border-radius: 12px;
    padding: 0.72rem 0.9rem;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: flex-start;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 0.98rem;
    line-height: 1.2;
}

#sidebarMenu .menu-subitem {
    margin-left: 0.55rem;
    padding-left: 0.72rem;
    border-left: 2px solid rgba(255, 255, 255, 0.16);
    font-size: 0.92rem;
}

#sidebarMenu .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.active-link {
    background: rgba(13, 110, 253, 0.25);
    border: 1px solid rgba(13, 110, 253, 0.6);
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.22);
}

.sidebar-footer {
    padding-top: 10px;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar-footer .small {
    line-height: 1.35;
    word-break: break-word;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.22) !important;
    border-color: rgba(220, 53, 69, 0.65) !important;
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(13,110,253,.95) 0%, rgba(13,110,253,.65) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.profile-toggle {
    padding: 0.25rem 0.35rem;
    border-radius: 10px;
}

.profile-toggle:hover {
    background: rgba(13,110,253,.08);
}

.notification-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #47627f;
    background: transparent;
    border: none;
    transition: all 0.2s ease;
    position: relative;
}

.notification-btn:hover {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
    box-shadow: 0 8px 18px rgba(13, 110, 253, 0.1);
}

.notification-btn.show {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    box-shadow: 0 10px 24px rgba(13, 110, 253, 0.14);
}

.notification-btn.dropdown-toggle::after {
    display: none;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.28);
}

.notification-menu {
    width: min(360px, 92vw);
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    margin-top: 0.55rem !important;
}

.notification-list {
    max-height: 340px;
    overflow-y: auto;
}

.notification-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.95rem 1rem;
    background: linear-gradient(180deg, #f9fbff 0%, #f4f8ff 100%);
    border-bottom: 1px solid rgba(13, 110, 253, 0.08);
}

.notification-count-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 0.7rem;
    font-weight: 700;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    color: inherit;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f8fbff;
}

.notification-dot {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex: 0 0 34px;
}

.notification-copy {
    min-width: 0;
}

.notification-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.12rem;
}

.notification-meta {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.3;
}

.notification-footer {
    padding: 0.85rem 1rem;
    text-align: center;
    background: #fcfdff;
}

.notification-footer a {
    color: #0d6efd;
}

.notification-time {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
}

.app-alert-stack {
    position: fixed;
    top: 76px;
    right: 1rem;
    z-index: 1060;
    width: min(430px, calc(100vw - 1.5rem));
}

.app-alert-stack .alert {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.notification-page-list .notification-item {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    margin-bottom: 0.75rem;
}

.notification-page-details {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.45;
    margin-top: 0.3rem;
}

.notification-view-body {
    background: #f8fbff;
    border: 1px solid rgba(13, 110, 253, 0.08);
    border-radius: 14px;
    padding: 1rem;
    color: #334155;
    line-height: 1.6;
}

.profile-role-text {
    font-size: 0.68rem !important;
    letter-spacing: 0.08em;
    line-height: 1.1;
}

.nav-tabs,
.nav-pills {
    flex-wrap: wrap;
    row-gap: 0.4rem;
}

@media (min-width: 768px) {
    .profile-dropdown:hover > .dropdown-menu {
        display: block;
    }
}

.chart-box {
    height: 280px;
}

.table-sticky-head thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.08);
}

@media (max-width: 991.98px) {
    .login-card {
        border-radius: 16px;
    }

    .login-brand-logo {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .login-title {
        font-size: 1.02rem;
    }

    #sideNav.sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(86vw, 300px);
        max-width: 300px;
        flex: none;
        z-index: 1045;
        transform: translateX(-100%);
        transition: transform 0.25s ease, visibility 0.25s ease;
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        overflow: hidden;
        overscroll-behavior: contain;
        box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
        visibility: hidden;
        pointer-events: none;
        top: 0;
        bottom: 0;
    }

    #sideNav.sidebar.open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1040;
        display: none;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    #layoutWrapper {
        display: block;
    }

    #layoutWrapper main {
        width: 100%;
    }

    #layoutWrapper main > .navbar {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    #layoutWrapper main > section {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    #mobileMenuBtn {
        min-width: 92px;
        font-weight: 600;
    }

    .notification-menu {
        width: min(94vw, 360px);
        max-width: calc(100vw - 1rem);
        position: fixed !important;
        top: 64px !important;
        right: 0.5rem !important;
        left: auto !important;
        transform: none !important;
        margin-top: 0 !important;
        border-radius: 18px;
        max-height: calc(100vh - 84px);
        overflow: hidden;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    }

    .notification-menu-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 0.9rem 0.9rem 0.8rem;
    }

    .notification-item {
        padding: 0.85rem 0.9rem;
        gap: 0.65rem;
        align-items: flex-start;
    }

    .notification-page-list .notification-item {
        margin-bottom: 0.6rem;
    }

    .app-alert-stack {
        top: 72px;
        right: 0.5rem;
        width: min(96vw, 360px);
    }

    .notification-list {
        max-height: calc(100vh - 220px);
    }

    .notification-title {
        font-size: 0.84rem;
        line-height: 1.25;
    }

    .notification-meta {
        font-size: 0.73rem;
        line-height: 1.35;
    }

    .notification-footer {
        padding: 0.8rem 0.9rem;
    }

    .brand-text .fw-bold {
        font-size: 0.95rem;
    }

    .brand-area {
        align-items: center;
        padding: 8px 8px 10px 8px;
        gap: 8px;
        border-radius: 14px;
        margin-bottom: 6px;
    }

    .brand-title {
        font-size: 0.88rem;
        line-height: 1.18 !important;
        letter-spacing: 0.01em;
        max-width: 100%;
        word-break: break-word;
    }

    .brand-subtitle {
        font-size: 0.64rem !important;
        padding: 0.22rem 0.48rem;
    }

    .sidebar-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: static;
        align-self: flex-end;
        width: 38px;
        height: 38px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        font-size: 1.45rem;
        line-height: 1;
        z-index: 2;
        margin-bottom: 8px;
    }

    #sidebarMenu .nav-link {
        white-space: normal;
        line-height: 1.2;
        padding: 0.66rem 0.78rem;
        font-size: 0.93rem;
    }

    #sidebarMenu .menu-subitem {
        margin-left: 0.35rem;
        padding-left: 0.58rem;
        font-size: 0.88rem;
    }

    #sidebarMenu {
        height: 100%;
        min-height: 0;
        max-height: 100%;
        padding-right: 3px;
        scrollbar-gutter: stable;
    }

    .sidebar-footer {
        gap: 8px;
    }
}

@media (max-width: 575.98px) {
    #sideNav.sidebar {
        width: min(88vw, 280px);
        max-width: 280px;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .brand-area {
        padding: 8px 7px 9px;
    }

    .brand-title {
        font-size: 0.82rem;
    }

    .brand-subtitle {
        font-size: 0.6rem !important;
        padding: 0.18rem 0.4rem;
    }

    .sidebar-close-btn {
        width: 34px;
        height: 34px;
        font-size: 1.25rem;
        margin-bottom: 6px;
    }
}

