.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 99;
    transition: background 0.3s ease;
    pointer-events: none;
}

.drawer-overlay.open {
    background: rgba(14, 20, 35, 0.4);
    pointer-events: auto;
}

.drawer {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.7);
    border-right: 1px solid rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    z-index: 101;
    box-shadow: 10px 0 30px rgba(30, 55, 90, 0.14);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(125, 149, 186, 0.22);
    flex-shrink: 0;
}

.drawer-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #1e2f4d;
    font-size: 16px;
    transition: all 0.25s ease;
}

.drawer-close:hover {
    background: rgba(255, 255, 255, 0.92);
}

.drawer-close.drawer-header-logout {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(186, 151, 255, 0.45);
    background: linear-gradient(145deg, rgba(106, 80, 255, 0.36), rgba(159, 74, 255, 0.3));
    color: #efe9ff;
    text-decoration: none;
    box-shadow: 0 8px 16px rgba(40, 67, 112, 0.12);
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    position: relative;
}

.drawer-close.drawer-header-logout i {
    font-size: 16px;
    line-height: 1;
}

.drawer-close.drawer-header-logout:hover {
    background: linear-gradient(145deg, rgba(119, 93, 255, 0.5), rgba(171, 86, 255, 0.42));
    border-color: rgba(202, 172, 255, 0.64);
    color: #ffffff;
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 10px 18px rgba(60, 87, 170, 0.2);
}

.drawer-close.drawer-header-logout:active {
    transform: translateY(0);
}

.drawer-close.drawer-header-logout:focus-visible {
    outline: none;
    border-color: rgba(99, 123, 232, 0.85);
    box-shadow:
        0 0 0 3px rgba(102, 126, 234, 0.22),
        0 10px 18px rgba(60, 87, 170, 0.2);
}

.drawer-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.drawer-label {
    font-size: 11px;
    font-weight: 700;
    color: #6a7c9b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px 8px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #324362;
    text-decoration: none;
    transition: all 0.25s ease;
    font-size: 13px;
    font-weight: 600;
    margin: 4px 8px;
    border-radius: 12px;
    position: relative;
}

.drawer-link i {
    font-size: 16px;
    flex-shrink: 0;
}

.drawer-link:hover {
    background: rgba(255, 255, 255, 0.75);
    color: #4e63d9;
    transform: translateX(4px);
}

.drawer-link.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(245, 87, 108, 0.95));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.26);
}

.drawer-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #fff;
    border-radius: 0 2px 2px 0;
}

.header-balance-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border-radius: 999px;
    border: 1px solid rgba(186, 151, 255, 0.46);
    background: rgba(32, 27, 67, 0.82);
    color: #dfe4ff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(33, 58, 98, 0.12);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.header-balance-chip i {
    font-size: 12px;
}

.header-balance-chip span {
    line-height: 1;
}

.header-notif-wrap {
    position: relative;
    display: inline-flex;
}

.admin-desktop-notif-anchor {
    position: fixed;
    top: 10px;
    right: 18px;
    z-index: 220;
    display: inline-flex;
    align-items: center;
}

.header-notif-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(186, 151, 255, 0.46);
    background: rgba(32, 27, 67, 0.82);
    color: #dfe4ff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(33, 58, 98, 0.12);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.header-notif-btn i {
    font-size: 14px;
}

.header-notif-btn.active,
.header-notif-btn:hover {
    border-color: rgba(202, 172, 255, 0.64);
    color: #ffffff;
    background: rgba(46, 38, 88, 0.9);
}

.header-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef476f, #ff6b9a);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(214, 63, 108, 0.35);
}

.header-notif-badge.hidden {
    display: none;
}

.header-notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(92vw, 360px);
    border-radius: 16px;
    border: 1px solid rgba(166, 136, 255, 0.42);
    background: linear-gradient(170deg, rgba(22, 18, 48, 0.96), rgba(16, 13, 36, 0.94)) !important;
    background-color: rgba(20, 16, 44, 0.96) !important;
    box-shadow: 0 18px 36px rgba(4, 6, 18, 0.58);
    backdrop-filter: blur(14px) saturate(138%);
    -webkit-backdrop-filter: blur(14px) saturate(138%);
    padding: 10px;
    z-index: 160;
    display: none;
    isolation: isolate;
    opacity: 1;
}

.header-notif-panel.open {
    display: block;
}

body.client-notif-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 150;
    pointer-events: none;
    background: transparent;
}

body.client-notif-open main,
body.client-notif-open .drawer {
    filter: blur(6px) saturate(96%);
    transition: filter 0.18s ease;
}

body.client-notif-open .header-notif-panel {
    background: linear-gradient(170deg, rgba(22, 18, 48, 0.96), rgba(16, 13, 36, 0.94)) !important;
    background-color: rgba(20, 16, 44, 0.96) !important;
    border-color: rgba(166, 136, 255, 0.42);
    backdrop-filter: blur(14px) saturate(138%);
    -webkit-backdrop-filter: blur(14px) saturate(138%);
}

@media (max-width: 767px) {
    .header-notif-panel {
        position: fixed;
        left: 50%;
        top: calc(env(safe-area-inset-top, 0px) + 94px);
        right: auto;
        transform: translateX(-50%);
        width: min(94vw, 380px);
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - 112px);
        z-index: 260;
        overflow: hidden;
        box-shadow:
            0 20px 38px rgba(24, 46, 80, 0.2),
            0 0 0 100vmax rgba(15, 24, 41, 0.28);
    }

    .header-notif-list {
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - 194px);
    }
}

@media (max-width: 1023px) {
    .admin-desktop-notif-anchor {
        display: none !important;
    }
}

.header-notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 2px;
}

.header-notif-head strong {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    color: #eef1ff;
}

.header-notif-clear {
    border: 1px solid rgba(186, 151, 255, 0.48);
    border-radius: 9px;
    background: rgba(39, 32, 78, 0.86);
    color: #d9defd;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 8px;
    cursor: pointer;
}

.header-notif-list {
    max-height: 330px;
    overflow: auto;
    display: grid;
    gap: 7px;
    padding-right: 1px;
}

.header-notif-empty {
    border-radius: 12px;
    border: 1px dashed rgba(166, 136, 255, 0.5);
    background: rgba(30, 24, 62, 0.78);
    color: #b4bde9;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    padding: 14px 10px;
}

.header-notif-item {
    border-radius: 12px;
    border: 1px solid rgba(166, 136, 255, 0.36);
    background: rgba(34, 28, 69, 0.78);
    padding: 9px 10px;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
}

.header-notif-item.unread {
    border-color: rgba(186, 151, 255, 0.62);
    box-shadow: 0 8px 15px rgba(54, 36, 120, 0.36);
}

.header-notif-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 13px;
}

.header-notif-item.info .header-notif-icon {
    background: rgba(77, 112, 206, 0.22);
    color: #9ec5ff;
}

.header-notif-item.success .header-notif-icon {
    background: rgba(60, 172, 116, 0.22);
    color: #93f1c3;
}

.header-notif-item.warning .header-notif-icon {
    background: rgba(217, 162, 58, 0.22);
    color: #ffd38a;
}

.header-notif-item.danger .header-notif-icon {
    background: rgba(203, 83, 112, 0.24);
    color: #ffb5c8;
}

.header-notif-body {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.header-notif-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.header-notif-row strong {
    color: #eef1ff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
}

.header-notif-row time {
    color: #9eabdf;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.header-notif-body p {
    color: #b6bfe9;
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

:where(
    .glass-title,
    .section-title,
    .wallet-title,
    .category-section-title,
    .stocks-section-title,
    .profits-chart-card h3,
    .profits-table-card h3
) > i:first-child {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    background: linear-gradient(135deg, #6a82fb 0%, #ff5f8f 100%);
    border: 1px solid rgba(255, 255, 255, 0.58);
    box-shadow: 0 8px 16px rgba(67, 93, 182, 0.28);
}

:where(
    .glass-title,
    .section-title,
    .wallet-title,
    .category-section-title,
    .stocks-section-title,
    .profits-chart-card h3,
    .profits-table-card h3
) > i:first-child.fa-solid,
:where(
    .glass-title,
    .section-title,
    .wallet-title,
    .category-section-title,
    .stocks-section-title,
    .profits-chart-card h3,
    .profits-table-card h3
) > i:first-child.fa-regular,
:where(
    .glass-title,
    .section-title,
    .wallet-title,
    .category-section-title,
    .stocks-section-title,
    .profits-chart-card h3,
    .profits-table-card h3
) > i:first-child.fa-brands {
    font-size: 12px;
}

:where(.profits-kpi-label) > i:first-child {
    width: 20px;
    height: 20px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 10px;
    line-height: 1;
    background: linear-gradient(135deg, #6a82fb 0%, #ff5f8f 100%);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: 0 5px 11px rgba(67, 93, 182, 0.24);
}

@media (max-width: 1023px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .drawer {
        transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .drawer-scroll .drawer-label,
    .drawer-scroll .drawer-link {
        opacity: 0;
        transform: translateX(-14px);
    }

    .drawer.open .drawer-scroll .drawer-label,
    .drawer.open .drawer-scroll .drawer-link {
        animation: drawerItemIn 0.62s ease-out forwards;
        animation-delay: var(--drawer-item-delay, 0s);
    }
}

@media (min-width: 1024px) {
    body {
        flex-direction: row;
        width: 100%;
        overflow-x: hidden;
    }

    header.site-header {
        display: none;
    }

    .drawer {
        position: fixed;
        left: 0;
        top: 0;
        width: 260px;
        min-width: 260px;
        height: 100vh;
        transform: none;
        flex-shrink: 0;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 100;
    }

    .drawer-overlay {
        display: none;
    }

    main {
        flex: 1;
        display: flex;
        flex-direction: column;
        width: calc(100% - 260px);
        max-width: calc(100% - 260px);
        min-width: 0;
        margin-left: 260px;
        overflow-x: hidden;
    }
}

@media (min-width: 1024px) {
    body.desktop-client-header header.site-header {
        display: block;
        position: fixed;
        top: 0;
        left: 260px;
        right: 0;
        width: auto;
        margin-left: 0;
        padding: 10px 16px 0;
        background: transparent;
        z-index: 140;
    }

    body.desktop-client-header .menu-btn {
        display: none;
    }

    body.desktop-client-header main {
        padding-top: 72px;
    }

    body.desktop-admin-header header.site-header {
        display: block;
        position: fixed;
        top: 0;
        left: 260px;
        right: 0;
        width: auto;
        margin-left: 0;
        padding: 10px 16px 0;
        background: transparent;
        z-index: 140;
    }

    body.desktop-admin-header .menu-btn {
        display: none;
    }

    body.desktop-admin-header main {
        padding-top: 72px;
    }
}

@keyframes drawerItemIn {
    from {
        opacity: 0;
        transform: translateX(-14px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Neon dark sidebar pass */
.drawer-overlay.open {
    background: rgba(5, 7, 18, 0.65);
}

.drawer {
    background: rgba(13, 15, 34, 0.9);
    border-right: 1px solid rgba(159, 129, 255, 0.24);
    box-shadow: 10px 0 34px rgba(2, 4, 15, 0.65);
}

.drawer-header {
    border-bottom: 1px solid rgba(151, 132, 255, 0.2);
}

.drawer-label {
    color: #8c93cf;
}

.drawer-link {
    color: #dce0ff;
}

.drawer-link:hover {
    background: rgba(118, 95, 255, 0.18);
    color: #f0f1ff;
}

.drawer-link.active {
    background: linear-gradient(135deg, rgba(101, 75, 255, 0.92), rgba(161, 73, 255, 0.9));
    box-shadow: 0 10px 24px rgba(86, 62, 222, 0.4);
}

.drawer-link.active::before {
    background: rgba(255, 255, 255, 0.92);
}

.drawer-close {
    background: rgba(114, 93, 255, 0.16);
    color: #dde2ff;
}

.drawer-close:hover {
    background: rgba(129, 108, 255, 0.26);
}

/* Final sidebar color balancing */
.drawer {
    background: linear-gradient(180deg, rgba(11, 16, 44, 0.96), rgba(8, 12, 34, 0.98));
    border-right-color: rgba(111, 108, 164, 0.36);
}

.drawer-link {
    color: #d8dbef;
}

.drawer-link:hover {
    background: rgba(107, 101, 156, 0.24);
    color: #f0f2ff;
}

.drawer-link.active {
    background: linear-gradient(135deg, rgba(110, 89, 216, 0.92), rgba(147, 90, 206, 0.9));
    box-shadow: 0 8px 18px rgba(76, 60, 156, 0.34);
}

.drawer-link[data-logout="1"] {
    border: 1px solid rgba(186, 151, 255, 0.28);
    background: rgba(34, 28, 69, 0.55);
}

.drawer-link[data-logout="1"]:hover {
    border-color: rgba(202, 172, 255, 0.48);
    background: rgba(54, 43, 102, 0.72);
}

.drawer-label {
    color: #97a0d0;
}

/* Global SweetAlert dark-neon theme */
.swal2-popup {
    background: linear-gradient(165deg, rgba(22, 18, 48, 0.96), rgba(16, 13, 36, 0.94)) !important;
    border: 1px solid rgba(166, 136, 255, 0.42) !important;
    border-radius: 20px !important;
    box-shadow: 0 28px 52px rgba(4, 6, 18, 0.62) !important;
    color: #eef1ff !important;
}

.swal2-title {
    color: #eef1ff !important;
}

.swal2-html-container {
    color: #b9c2eb !important;
}

.swal2-input,
.swal2-select,
.swal2-textarea {
    background: rgba(22, 18, 45, 0.88) !important;
    border: 1px solid rgba(166, 136, 255, 0.36) !important;
    color: #eef1ff !important;
    box-shadow: none !important;
}

.swal2-input::placeholder,
.swal2-textarea::placeholder {
    color: #96a0ce !important;
}

.swal2-cancel {
    background: rgba(70, 74, 98, 0.9) !important;
    color: #eef1ff !important;
}
