﻿/* =========================
   BASE / DEFAULTS
   ========================= */

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* =========================
   BLAZOR ERROR UI
   ========================= */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzID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IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* =========================
   THEME + APP SHELL
   ========================= */

:root {
    /*--brand: #1F3A5F;*/
    --brand: #FFFFFF;
    --accent: #2563EB;
    /*--bg: #F5F7FA;*/
    --bg: #FFFFFF;
    --card: #FFFFFF;
    --border: #E5E7EB;
    --text: #111827;
    --muted: #6B7280;
    --appbar-h: 60px;
    --bottomnav-h: 64px;
    /* Android fallback for status bar spacing */
    --mobile-top-inset-fallback: 28px;
}

body {
    background: var(--bg);
    color: var(--text);
}

.app-shell {
    min-height: 100vh;
}

/* Top AppBar */
.appbar {
    background: var(--brand);
    color: #fff;
    height: var(--appbar-h);
    display: flex;
    align-items: center;
}

.appbar-sticky {
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Main content spacing so it never hides behind bottom nav */
.app-content {
    padding-bottom: calc(var(--bottomnav-h) + 16px);
}

/* =========================
   MOBILE SAFE AREA (MAUI)
   ========================= */

/* Default: hidden (Web won't show spacer) */
.status-bar-safe-area {
    display: none;
}

/* Mobile only: reserve space above appbar for OS status bar */
.platform-mobile .status-bar-safe-area {
    display: block;
    position: sticky;
    top: 0;
    z-index: 1021;
    background: var(--brand);
    /* iOS supplies env(safe-area-inset-top); Android often returns 0 */
    height: env(safe-area-inset-top);
    min-height: var(--mobile-top-inset-fallback);
}

/* =========================
   BOTTOM NAV (MOBILE)
   ========================= */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottomnav-h);
    background: #0b0f16;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: stretch;
    z-index: 1030;
}

    .bottom-nav .container-fluid {
        height: 100%;
    }

    /* UL: lock to one row, center vertically, avoid WebView baseline quirks */
    .bottom-nav .nav {
        height: 100%;
        width: 100%;
        display: flex;
        flex-wrap: nowrap !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        /* IMPORTANT: do NOT rely on nav-fill (Blazor <!--!--> nodes can count as items) */
        justify-content: space-between !important;
    }

        /* Make ONLY LI participate in the flex sizing (ignore Blazor marker nodes) */
        .bottom-nav .nav > li.nav-item {
            flex: 1 1 0 !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            line-height: 0 !important; /* prevents stair-step baseline differences */
            min-width: 0;
        }

        /* Any non-LI direct children: take up no space (covers WebView comment-node behavior) */
        .bottom-nav .nav > :not(li.nav-item) {
            flex: 0 0 0 !important;
            width: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
        }

    /* Normalize Bootstrap's nav-link box model */
    .bottom-nav .nav-link {
        padding: 0 !important;
        border: 0;
        line-height: 1 !important;
    }

    /* The pill itself: fixed height + explicitly restore line-height */
    .bottom-nav .bottom-link {
        color: rgba(255,255,255,.75);
        border-radius: 999px;
        margin: 0 !important;
        padding: 8px 6px;
        height: calc(var(--bottomnav-h) - 12px) !important;
        width: 100% !important;
        max-width: 160px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        line-height: 1 !important;
        transform: translateZ(0);
    }

        /* Active styles */
        .bottom-nav .nav-pills .nav-link.active,
        .bottom-nav .nav-pills .show > .nav-link,
        .bottom-nav .bottom-link.active {
            color: #fff !important;
            background: rgba(255,255,255,.12) !important;
        }

/* Icon box normalization */
.bottom-ico {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
}

    .bottom-ico i {
        font-size: 18px;
        line-height: 1 !important;
        display: block;
    }

.bottom-txt {
    font-size: 12px;
    line-height: 12px;
}

.bottom-hello {
    max-width: 160px;
}





/* =========================
   CARDS / SECTIONS
   ========================= */

.card-soft {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
}

.section-header {
    font-weight: 700;
    font-size: 1.05rem;
}

.money {
    font-weight: 800;
    letter-spacing: .2px;
}

.kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: .35rem 0;
}

    .kv .k {
        color: var(--muted);
        font-size: .9rem;
    }

    .kv .v {
        font-weight: 700;
    }

.disclosure {
    cursor: pointer;
    user-select: none;
    padding: .85rem 1rem;
}

    .disclosure:hover {
        background: rgba(0,0,0,.02);
    }

    .disclosure .chev {
        transition: transform 160ms ease-in-out;
    }

    .disclosure[aria-expanded="true"] .chev {
        transform: rotate(180deg);
    }

.child-row {
    padding: .6rem 1rem;
    border-top: 1px solid var(--border);
}

/* =========================
   WEB TOP NAV + SIDEBAR
   ========================= */

:root {
    --web-topnav-h: 88px; /* set the desktop header height you want */
}

/* apply only to your WebTopNav */
.web-topnav {
    height: var(--web-topnav-h);
    padding-top: 0;
    padding-bottom: 0;
}

    /* keep the logo from making the navbar taller than the set height */
    .web-topnav .navbar-brand img {
        max-height: calc(var(--web-topnav-h) - 16px) !important;
        height: auto;
        width: auto;
    }

/* sidebar starts below the top nav */
.web-sidebar {
    position: fixed;
    top: var(--web-topnav-h);
    left: 0;
    width: 16.6667%; /* col-lg-2 */
    height: calc(100vh - var(--web-topnav-h));
    overflow-y: auto;
    z-index: 1010;
}

.web-sidebar-dark {
    background: #0b0f16 !important;
}

    .web-sidebar-dark .sidebar-nav .sidebar-link {
        color: rgba(255,255,255,.75);
    }

        .web-sidebar-dark .sidebar-nav .sidebar-link:hover {
            background: rgba(255,255,255,.10);
            color: #fff;
        }


/* =========================
   SIDEBAR NAV (uses bottom-link look, but row-style)
   ========================= */

.sidebar-nav .sidebar-link {
    display: flex; /* row layout */
    flex-direction: row; /* override bottom nav's column layout */
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin: 0; /* sidebar uses list gap */
    border-radius: 12px;
    color: rgba(0,0,0,.70); /* default for white sidebar */
    background: transparent;
}

/* icon sizing for sidebar */
.sidebar-nav .bottom-ico {
    width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 16px;
}

/* label */
.sidebar-nav .bottom-txt {
    font-size: 14px;
    line-height: 14px;
}

/* Hover */
.sidebar-nav .sidebar-link:hover {
    background: rgba(0,0,0,.05);
    color: rgba(0,0,0,.85);
}

/* Active pill state (match your bottom nav vibe) */
.sidebar-nav .sidebar-link.active {
    background: var(--accent);
    color: #fff !important;
    font-weight: 700;
}

    .sidebar-nav .sidebar-link.active .bottom-ico,
    .sidebar-nav .sidebar-link.active .bottom-txt,
    .sidebar-nav .sidebar-link.active i {
        color: #fff !important;
    }

    /* Active styles */
    .sidebar-nav .nav-pills .nav-link.active,
    .sidebar-nav .nav-pills .show > .nav-link,
    .sidebar-nav .bottom-link.active {
        color: #fff !important;
        background: rgba(255,255,255,.12) !important;
    }

/* Inactive icons inherit */
.sidebar-nav i {
    color: currentColor;
}


@media (min-width: 992px) {
    .navbar {
        min-height: 56px;
    }
}


:root {
    --mobile-bottom-inset-fallback: 34px; /* increase to 34px if still blocked */
}

/* Always lift the bottom nav on Mobile */
.platform-mobile .bottom-nav {
    padding-bottom: var(--mobile-bottom-inset-fallback);
    height: calc(var(--bottomnav-h) + var(--mobile-bottom-inset-fallback));
}

/* Ensure content clears the taller nav */
.platform-mobile .app-content {
    padding-bottom: calc(var(--bottomnav-h) + var(--mobile-bottom-inset-fallback) + 16px);
}

/* iOS (or any env-capable UA with non-zero inset): prefer env() */
@supports (padding: env(safe-area-inset-bottom)) {
    .platform-mobile .bottom-nav {
        padding-bottom: max(env(safe-area-inset-bottom), var(--mobile-bottom-inset-fallback));
        height: calc(var(--bottomnav-h) + max(env(safe-area-inset-bottom), var(--mobile-bottom-inset-fallback)));
    }

    .platform-mobile .app-content {
        padding-bottom: calc(var(--bottomnav-h) + max(env(safe-area-inset-bottom), var(--mobile-bottom-inset-fallback)) + 16px);
    }
}


.app-toast-host {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 16px;
    display: flex;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 560px;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.app-toast-body {
    flex: 1;
}

.app-toast-close {
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 18px;
    padding: 2px 6px;
    cursor: pointer;
    opacity: .7;
}

    .app-toast-close:hover {
        opacity: 1;
    }

/* Level styles */
.app-toast-info {
    background: #111827;
    color: #fff;
}

.app-toast-success {
    background: #064e3b;
    color: #fff;
}

.app-toast-warning {
    background: #78350f;
    color: #fff;
}

.app-toast-error {
    background: #7f1d1d;
    color: #fff;
}
