/* /../E-Charity/Components/Layout/LoginLayout.razor.rz.scp.css */
/* Layout handled by Tailwind utility classes in LoginLayout.razor */
/* /../E-Charity/Components/Layout/MainLayout.razor.rz.scp.css */
.page[b-kcx2cpmlbm] {
    position: relative;
    display: flex;
    flex-direction: column;
}

main[b-kcx2cpmlbm] {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar[b-kcx2cpmlbm] {
    background-image: linear-gradient(180deg, #003969 0%, #1A5A5A 70%);
    flex-shrink: 0;
    /* Thin, unobtrusive scrollbar (Firefox) — auto-hides when there's nothing to scroll */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.16) transparent;
}

/* ── Minimal modern sidebar scrollbar (WebKit / Blink: Chromium, Android WebView, WebView2) ── */
.sidebar[b-kcx2cpmlbm]::-webkit-scrollbar {
    width: 5px;
}

.sidebar[b-kcx2cpmlbm]::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar[b-kcx2cpmlbm]::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.16);
    border-radius: 999px;
}

    /* Thumb grows slightly more visible when the user is over the sidebar / hovering it */
    .sidebar:hover[b-kcx2cpmlbm]::-webkit-scrollbar-thumb {
        background-color: rgba(255,255,255,0.30);
    }

    .sidebar[b-kcx2cpmlbm]::-webkit-scrollbar-thumb:hover {
        background-color: rgba(255,255,255,0.45);
    }

.top-row[b-kcx2cpmlbm] {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 3rem;
    height: calc(3rem + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .top-row[b-kcx2cpmlbm]  a, .top-row[b-kcx2cpmlbm]  .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
        text-decoration: none;
    }

    .top-row[b-kcx2cpmlbm]  a:hover, .top-row[b-kcx2cpmlbm]  .btn-link:hover {
        text-decoration: underline;
    }

    .top-row[b-kcx2cpmlbm]  a:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* Mobile-only elements (hidden on desktop) */
.mobile-menu-toggle[b-kcx2cpmlbm],
.mobile-app-title[b-kcx2cpmlbm] {
    display: none !important;
}

/* Desktop-only user info */
.desktop-user-info[b-kcx2cpmlbm] {
    display: inline;
}

/* Sidebar overlay backdrop */
.sidebar-overlay[b-kcx2cpmlbm] {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
}

@media (max-width: 640.98px) {
    .mobile-menu-toggle[b-kcx2cpmlbm] {
        display: inline-flex !important;
    }

    .mobile-app-title[b-kcx2cpmlbm] {
        display: inline !important;
    }

    .desktop-user-info[b-kcx2cpmlbm] {
        display: none !important;
    }

    .top-row[b-kcx2cpmlbm] {
        gap: 0.4rem;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .top-row[b-kcx2cpmlbm]  a, .top-row[b-kcx2cpmlbm]  .btn-link {
        margin-left: 0;
    }

    article[b-kcx2cpmlbm] {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Sidebar: fixed off-screen, slides in when open */
    .sidebar[b-kcx2cpmlbm] {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* momentum touch scroll on Android/iOS WebView */
        overscroll-behavior: contain;
        padding-top: env(safe-area-inset-top, 0px);
        /* Clear the device's bottom system/nav bar so the last nav items (Settings,
           etc.) are reachable — without this they were cut off on Android. */
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 2.5rem);
    }

    .sidebar.open[b-kcx2cpmlbm] {
        transform: translateX(0);
    }

    /* Show all nav items when sidebar overlay is open */
    .sidebar.open[b-kcx2cpmlbm]  .nav-scrollable {
        display: block;
    }

    /* Hide the checkbox toggler in overlay mode */
    .sidebar.open[b-kcx2cpmlbm]  .navbar-toggler {
        display: none;
    }
}

@media (min-width: 641px) {
    .page[b-kcx2cpmlbm] {
        flex-direction: row;
    }

    .sidebar[b-kcx2cpmlbm] {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
        overflow-y: auto;
    }

    .sidebar-overlay[b-kcx2cpmlbm] {
        display: none;
    }

    .top-row[b-kcx2cpmlbm] {
        z-index: 1;
    }

    .top-row.auth[b-kcx2cpmlbm]  a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row[b-kcx2cpmlbm], article[b-kcx2cpmlbm] {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

.content[b-kcx2cpmlbm] {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* Ensure content can scroll fully past bottom safe area */
    min-height: 0;
}

/* RTL overrides for sidebar layout */
:global([dir="rtl"]) .page[b-kcx2cpmlbm] {
    direction: rtl;
}

:global([dir="rtl"]) .top-row[b-kcx2cpmlbm] {
    justify-content: flex-end;
}

:global([dir="rtl"]) .top-row[b-kcx2cpmlbm]  a,
:global([dir="rtl"]) .top-row[b-kcx2cpmlbm]  .btn-link {
    margin-left: 0;
    margin-right: 1.5rem;
}

:global([dir="rtl"]) .top-row[b-kcx2cpmlbm], :global([dir="rtl"]) article[b-kcx2cpmlbm] {
    padding-right: 2rem !important;
    padding-left: 1.5rem !important;
}

/* RTL mobile: sidebar slides from right */
@media (max-width: 640.98px) {
    :global([dir="rtl"]) .sidebar[b-kcx2cpmlbm] {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    :global([dir="rtl"]) .sidebar.open[b-kcx2cpmlbm] {
        transform: translateX(0);
    }

    :global([dir="rtl"]) .top-row[b-kcx2cpmlbm] {
        padding-right: 0.75rem !important;
        padding-left: 0.75rem !important;
    }

    :global([dir="rtl"]) article[b-kcx2cpmlbm] {
        padding-right: 0.75rem !important;
        padding-left: 0.75rem !important;
    }
}

/* Top-of-window progress bar shown while a navigation is in flight, so the
   user gets feedback in <100ms instead of staring at a frozen page during
   data loads. Hidden as soon as the new page renders or after a short cap. */
.nav-progress[b-kcx2cpmlbm] {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 9999;
    background: rgba(0, 57, 105, 0.08);
    overflow: hidden;
    pointer-events: none;
}

.nav-progress-bar[b-kcx2cpmlbm] {
    height: 100%;
    width: 30%;
    background-image: linear-gradient(90deg, #003969 0%, #1A5A5A 100%);
    animation: navProgressSlide-b-kcx2cpmlbm 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes navProgressSlide-b-kcx2cpmlbm {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}
/* /../E-Charity/Components/Layout/NavMenu.razor.rz.scp.css */
.navbar-toggler[b-a2aidouitp] {
    appearance: none;
    cursor: pointer;
    width: 3.5rem;
    height: 2.5rem;
    color: white;
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
}

.navbar-toggler:checked[b-a2aidouitp] {
    background-color: rgba(255, 255, 255, 0.5);
}

/* ── Brand header (horizontal white logo-chip + stacked title) ──
   The uploaded logo is a square image with a baked-in white background, so it
   lives inside a white rounded chip — the white blends into one deliberate tile
   instead of a stray box floating on the navy. Row layout auto-mirrors in RTL. */
.top-row[b-a2aidouitp] {
    min-height: 3.75rem;
    padding: 0.55rem 0.75rem;
    background-color: rgba(0,0,0,0.4);
    background-image: linear-gradient(90deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 62%);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
}

.navbar-brand[b-a2aidouitp] {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
    max-width: 100%;
    text-decoration: none;
    border-radius: 10px;
    padding: 0.2rem;
    margin: -0.2rem;
    transition: background-color 0.18s ease;
}

    .navbar-brand:hover[b-a2aidouitp] {
        background-color: rgba(255,255,255,0.06);
    }

    .navbar-brand:hover .brand-logo[b-a2aidouitp] {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(0,0,0,0.05);
    }

/* White chip containing the logo (or a brand-initial avatar when no logo). */
.brand-logo[b-a2aidouitp] {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    background: #ffffff;
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

    .brand-logo img[b-a2aidouitp] {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
    }

.brand-initial[b-a2aidouitp] {
    font-size: 1.35rem;
    font-weight: 800;
    color: #003969;
    line-height: 1;
    user-select: none;
}

/* Text column — min-width:0 lets the title clamp/ellipsis instead of overflowing. */
.brand-text[b-a2aidouitp] {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.05rem;
    min-width: 0;
    line-height: 1.2;
}

.brand-title[b-a2aidouitp] {
    font-size: 0.84rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.005em;
    line-height: 1.15;
    /* wrap to a maximum of 2 lines, then ellipsis — long names never break layout */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.brand-subtitle[b-a2aidouitp] {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(140, 200, 255, 0.9);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile only: reserve room for the absolutely-positioned hamburger toggle.
   On desktop the toggle is display:none, so the brand can use the full width. */
@media (max-width: 640px) {
    .navbar-brand[b-a2aidouitp] {
        max-width: calc(100% - 4.75rem);
    }

    .brand-title[b-a2aidouitp] {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
}

/* ── Nav icon styling (Tabler Icons font) ──
   Selectors target `.ti` since the project migrated from Bootstrap Icons.
   Without this fixed-width / margin / opacity setup, sidebar icons rendered
   at variable widths with no alignment between rows (the visible bug). */
.nav-item[b-a2aidouitp]  .nav-link .ti {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
    margin-right: 0.6rem;
    opacity: 1;
    color: #ffffff;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}

/* ── Nav items ── */
.nav-item[b-a2aidouitp] {
    font-size: 0.85rem;
    padding-bottom: 0.2rem;
}

    .nav-item:first-of-type[b-a2aidouitp] {
        padding-top: 1rem;
    }

    .nav-item:last-of-type[b-a2aidouitp] {
        padding-bottom: 1rem;
    }

    .nav-item[b-a2aidouitp]  .nav-link {
        /* Maximum contrast: pure white label on the navy sidebar. */
        color: #ffffff;
        background: none;
        border: none;
        border-radius: 9px;
        /* min-height (not fixed height) lets a long label wrap to 2 lines and grow the
           row instead of overlapping the next item; line-height 1.3 (not the old
           row-height 2.45rem trick) keeps wrapped lines tight — flex align-items:center
           already vertical-centres single-line labels, so appearance is unchanged. */
        min-height: 2.45rem;
        display: flex;
        align-items: center;
        line-height: 1.3;
        width: 100%;
        padding: 0.32rem 0.8rem;
        font-weight: 600;
        /* GPU-friendly: only background-color, color (paint) + transform (composite) animate */
        transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
    }

/* ── Active state — HIGH-CONTRAST highlight + bright accent bar ── */
.nav-item[b-a2aidouitp]  a.active {
    background-color: rgba(255,255,255,0.26);
    color: #ffffff;
    font-weight: 700;
    box-shadow: inset 4px 0 0 0 #aed8ff;
}

    .nav-item[b-a2aidouitp]  a.active .ti {
        opacity: 1;
        color: #d4ecff;
    }

/* ── Hover state ── */
.nav-item[b-a2aidouitp]  .nav-link:hover {
    background-color: rgba(255,255,255,0.12);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-item[b-a2aidouitp]  a.active:hover {
    background-color: rgba(255,255,255,0.30);
}

    .nav-item[b-a2aidouitp]  .nav-link:hover .ti {
        opacity: 1;
    }

/* ── Section headings ── */
.nav-section-heading[b-a2aidouitp] {
    /* Maximum-contrast sub-section label — bright warm gold on the navy so it clearly
       stands out as a divider between the white menu items and the blue group headers. */
    color: #ffd27a;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.75rem 0.9rem 0.3rem;
    margin-top: 0.35rem;
    border-top: 1px solid rgba(255,255,255,0.22);
    pointer-events: none;
    user-select: none;
}

    .nav-section-heading:first-of-type[b-a2aidouitp] {
        border-top: none;
    }

/* ── Collapsible group header (accordion) ──
   Replaces the static section heading with a bold, clickable toggle.
   Uses @onclick:stopPropagation in the markup so toggling a group does NOT
   bubble up to the .nav-scrollable click handler that closes the mobile menu. */
.nav-group-header[b-a2aidouitp] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: calc(100% - 1rem);
    margin: 0.5rem 0.5rem 0.15rem;
    padding: 0.45rem 0.6rem;
    background: none;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    /* High-contrast bright light-blue — clearly visible on the navy, distinct from items */
    color: #a9dbff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    text-align: start;
    transition: background-color 0.22s ease, color 0.22s ease;
    user-select: none;
}

    .nav-group-header:hover[b-a2aidouitp] {
        background-color: rgba(255,255,255,0.10);
        color: #ffffff;
    }

    .nav-group-header > span[b-a2aidouitp] {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.nav-chevron[b-a2aidouitp] {
    font-size: 1rem;
    opacity: 0.55;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.15s ease;
}

.nav-group-header:hover .nav-chevron[b-a2aidouitp] {
    opacity: 0.9;
}

.nav-chevron.open[b-a2aidouitp] {
    transform: rotate(180deg);
}

.nav-scrollable[b-a2aidouitp] {
    display: none;
}

.navbar-toggler:checked ~ .nav-scrollable[b-a2aidouitp] {
    display: block;
}

@media (min-width: 641px) {
    .navbar-toggler[b-a2aidouitp] {
        display: none;
    }

    .nav-scrollable[b-a2aidouitp] {
        display: block;
    }
}

/* ── RTL overrides ── */
:global([dir="rtl"]) .nav-item[b-a2aidouitp]  .nav-link .ti {
    margin-right: 0;
    margin-left: 0.6rem;
}

:global([dir="rtl"]) .nav-item[b-a2aidouitp]  a.active {
    box-shadow: inset -4px 0 0 0 #aed8ff;
}

:global([dir="rtl"]) .nav-item[b-a2aidouitp]  .nav-link:hover {
    transform: translateX(-2px);
}

:global([dir="rtl"]) .navbar-toggler[b-a2aidouitp] {
    right: auto;
    left: 1rem;
}

/* Brand row is flex-row, so logo chip + text auto-mirror; just flip the
   gradient sheen to the new leading (right) edge and align the text. */
:global([dir="rtl"]) .top-row[b-a2aidouitp] {
    background-image: linear-gradient(270deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 62%);
}

:global([dir="rtl"]) .brand-text[b-a2aidouitp] {
    text-align: right;
}
