/* Shared shell typography and responsive navigation. No remote font dependency. */
body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.app-shell { line-height: 1.55; }
.app-shell h1, .app-shell h2, .app-shell h3 { letter-spacing: -.025em; }
.app-shell input, .app-shell select, .app-shell textarea, .app-shell button { font: inherit; }
.app-shell .btn { font-size: .88rem; font-weight: 600; border-radius: 9px; }
.app-shell .form-control, .app-shell .form-select { border-color: #dbe5de; border-radius: 9px; min-height: 42px; }
.app-shell .form-label { color: #52695e; font-size: .84rem; font-weight: 600; }
.app-shell .page-card { box-shadow: 0 3px 14px #243e2c04; }
.app-shell .page-heading h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.app-shell .sidebar {
    width: 246px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    /* Bootstrap makes responsive offcanvas transparent on desktop. Keep the sidebar surface. */
    background: var(--bs-body-bg) !important;
    --bs-offcanvas-width: min(320px, 88vw);
}

.app-shell .sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0;
    min-height: 0;
    padding: 0;
}

.app-shell .sidebar .brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    margin: 0 0 26px;
    flex: none;
}

.app-shell .sidebar .brand img {
    width: 118px;
    height: 72px;
}

.app-shell .sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-x: visible;
    white-space: normal;
}

.app-shell .sidebar nav a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: none;
    min-height: 44px;
    padding: 10px 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.app-shell .sidebar nav small {
    display: block;
    color: var(--bs-secondary-color);
    line-height: 1.4;
}

.app-shell .sidebar nav a[aria-current="page"] {
    background: var(--pale);
    color: var(--green);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--green);
}

.app-shell .sidebar a:focus-visible,
.app-shell .sidebar summary:focus-visible,
.app-shell .navigation-toggle:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.navigation-label {
    padding: 0 13px 7px;
    color: var(--bs-secondary-color);
    font-size: .73rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.navigation-group {
    padding-top: 5px;
    margin-top: 4px;
    border-top: 1px solid var(--line);
}

.navigation-group summary {
    min-height: 44px;
    padding: 12px 13px;
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.4;
}

.navigation-group summary::marker {
    color: var(--green);
}

.navigation-group summary:hover {
    background: var(--pale);
}

.navigation-group-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 0 5px 10px;
}

.app-shell .navigation-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    color: var(--green);
    border-color: var(--line);
    flex: none;
}

.app-shell .topbar .top-user {
    min-width: 0;
    overflow-wrap: anywhere;
}

.app-shell .topbar .logout {
    min-height: 44px;
}

@media (min-width: 992px) {
    .app-shell.is-navigation-collapsed .sidebar { display: none !important; }
    .app-shell.is-navigation-collapsed .main-column { width: 100%; }
    .app-shell .navigation-desktop-toggle { font-size: .78rem; padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .app-shell *, .app-shell *::before, .app-shell *::after { scroll-behavior: auto !important; }
}

@media (min-width: 992px) {
    .app-shell .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
    }

    .app-shell .sidebar .offcanvas-body {
        overflow-y: auto;
        scrollbar-gutter: stable;
    }

    /* The overview uses the reference's compact navigation; forms keep their existing layout. */
    .app-shell:has(.cash-dashboard) .sidebar {
        width: 210px;
        padding: 21px 12px;
        background: linear-gradient(180deg, #fff 58%, #f2f6f3) !important;
    }

    .app-shell:has(.cash-dashboard) .sidebar .brand {
        margin-bottom: 25px;
        gap: 6px;
    }

    .app-shell:has(.cash-dashboard) .sidebar .brand img {
        width: 110px;
        height: 67px;
    }

    .app-shell:has(.cash-dashboard) .sidebar .brand strong {
        font-size: .7rem;
        letter-spacing: .07em;
    }

    .app-shell:has(.cash-dashboard) .sidebar nav {
        gap: 3px;
    }

    .app-shell:has(.cash-dashboard) .sidebar nav a {
        min-height: 41px;
        padding: 9px 12px;
        font-size: .82rem;
    }

    .app-shell:has(.cash-dashboard) .sidebar nav a[aria-current="page"] {
        background: var(--green);
        color: #fff;
        box-shadow: 0 3px 8px #245c4914;
    }

    .app-shell:has(.cash-dashboard) .navigation-label {
        padding: 0 12px 8px;
        font-size: .7rem;
    }

    .app-shell:has(.cash-dashboard) .navigation-group summary {
        min-height: 41px;
        padding: 11px 12px;
        font-size: .81rem;
    }

    .app-shell:has(.cash-dashboard) .topbar {
        gap: 14px;
        min-height: 59px;
        padding: 8px 24px;
        background: #fcfdfc;
    }

    .app-shell:has(.cash-dashboard) .topbar .test-banner {
        color: #547060;
        background: #edf4ef;
        font-size: .7rem;
    }

    .app-shell:has(.cash-dashboard) .topbar .sender {
        font-size: .76rem;
    }

    .app-shell:has(.cash-dashboard) .content {
        max-width: 1480px;
        padding: 24px 24px 50px;
    }
}

@media (max-width: 991.98px) {
    .app-shell .sidebar {
        width: var(--bs-offcanvas-width);
        max-width: 100%;
        padding: 14px 16px 20px;
    }

    .app-shell .sidebar .offcanvas-header {
        padding: 0 0 14px;
        gap: 12px;
    }

    .app-shell .sidebar .offcanvas-title {
        margin: 0;
        font-size: 1rem;
    }

    .app-shell .sidebar .btn-close {
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        margin: 0;
        background-size: 16px;
    }

    .app-shell .sidebar .offcanvas-body {
        overflow-y: auto;
    }

    .app-shell .sidebar .brand {
        margin-bottom: 18px;
    }

    .app-shell .topbar {
        gap: 10px;
    }
}
