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-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

/* Main Layout */
/* ===== Base Page Structure ===== */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Maintain your existing main flex behavior */
main { flex: 1; }

/* ===== Desktop (≥641px): fixed sidebar layout ===== */
@media (min-width: 641px) {
    .page { flex-direction: row; }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
        left: 0;
        transform: none !important; /* sidebar is visible on desktop */
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    }

    /* push main content right of sidebar */
    main {
        width: calc(100% - 250px);
        margin-left: 250px;
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .mobile-topbar,
    .backdrop {
        display: none;
    }

    .top-row,
    article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* ===== Mobile (≤640.98px): off-canvas pattern ===== */
@media (max-width: 640.98px) {
    /* top header bar */
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 12px;
        background: #1d212b; /* match sidebar color */
        color: #fff;
        position: sticky;
        top: 0;
        z-index: 1002;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .sidebar-header {
        height: 0;
        overflow: hidden;
    }

    .mobile-logo-wrap {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none; /* keep clicks on hamburger */
    }

    .mobile-logo {
        max-height: 28px;
        width: auto;
        filter: drop-shadow(0 0 5px rgba(255,255,255,0.1));
    }

    .mobile-right-spacer { width: 32px; } /* balances the hamburger width */

    /* hamburger button */
    .hamburger {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 32px;
        height: 32px;
        cursor: pointer;
    }
    .hamburger span {
        display: block;
        height: 2px;
        width: 22px;
        background: #fff;
        border-radius: 2px;
        transition: transform .2s ease, opacity .2s ease;
    }

    /* off-canvas sidebar styles */
    .sidebar {
        width: 260px;
        background: #1d212b;
        color: #fff;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);   /* hidden by default */
        transition: transform .3s ease;
        z-index: 1001;
        display: flex;
        flex-direction: column;
    }

    /* show when toggled */
    .sidebar-toggler:checked ~ .sidebar {
        transform: translateX(0);
    }

    /* backdrop */
    .backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 1000;
    }
    .sidebar-toggler:checked ~ .backdrop {
        opacity: 1;
        pointer-events: auto;
        z-index: 1;
    }

    /* prevent accidental scroll behind menu */
    .sidebar-toggler:checked ~ main {
        /* optional: lock scroll visually by offsetting if needed */
    }

    /* main content: no desktop margin on mobile */
    main {
        padding: 1rem;
    }

    .container.py-4 {
        margin-left: -1em;
        width: -webkit-fill-available;
        margin-right: -1em;
        margin-top: -1em;
    }

    .btn-group, .btn-group-vertical {
        width: 100%;
        padding-top: 1em;
    }

    .col-md-3 {
        padding-top: 10px;
    }

    h3 {
        justify-self: center;
    }

    #paymentsChart {
        margin-top: 1em;
        filter: hue-rotate(300deg);
    }

    .payments-table {
        font-size: small;
    }

    .total-container {
        margin-right: 0 !important;
    }
}

/* ===== Shared Sidebar Styling (yours, with minor tweaks) ===== */
.sidebar {
    background: #1d212b;
    color: #fff;
}
.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2c313a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar .logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

/* Your custom link styles kept */
a.nav-link-custom {
    margin-top: 1em !important;
    margin-left: 1em !important;
    border: 1px #006bb7 solid !important;
    padding: 11px !important;
    text-decoration: none !important;
    margin-right: 1em !important;
    font-weight: bold;
    border-radius: 16px;
    background: #232835;
}
a.nav-link-custom:hover {
    filter: brightness(1.2);
    transition: .3s ease;
}

/* ===== Error UI (unchanged, trimmed) ===== */
#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: 1100;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ===== Optional: animate hamburger to “X” when open ===== */
@media (max-width: 640.98px) {
    .sidebar-toggler:checked ~ .mobile-topbar .hamburger span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    .sidebar-toggler:checked ~ .mobile-topbar .hamburger span:nth-child(2) {
        opacity: 0;
    }
    .sidebar-toggler:checked ~ .mobile-topbar .hamburger span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}

/* Navigation Menu */
.sidebar {
    width: 250px;
    background: #1d212b;
    color: #fff;
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2c313a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar .logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #cfcfcf;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease-in-out, color 0.2s;
}

.sidebar-link i {
    margin-right: 1rem;
    font-size: 1.25rem;
    color: #ffce45;
    /* bee yellow */
    transition: color 0.2s ease-in-out;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: #343a46;
    color: #fff;
}

.sidebar-link:hover i,
.sidebar-link.active i {
    color: #ffd700;
}

.sidebar-toggler {
    display: none;
}

a.nav-link-custom {
    margin-top: 1em !important;
    margin-left: 1em !important;
    border: 1px #006bb7 solid !important;
    padding: 11px !important;
    text-decoration: none !important;
    margin-right: 1em !important;
    font-weight: bold;
    border-radius: 16px;
    background: #232835;
}

a.nav-link-custom:hover {
    filter: brightness(1.2);
    transition: .3s ease;
}