/* ── Full-width tabs ── */
.category-tabs .mud-tabs-tabbar-wrapper {
    width: 100%;
}

.category-tabs .mud-tab {
    flex: 1 !important;
    max-width: none !important;
    min-width: 0 !important;
    justify-content: center;
}

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
    padding: 16px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 32px !important;
    border-radius: 12px !important;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

/* ── Utility ── */
.flex-1 { flex: 1; }

/* ── Custom bottom navigation ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.12);
    display: flex;
    align-items: stretch;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: rgba(0,0,0,.6);
    font-size: .65rem;
    font-weight: 500;
    letter-spacing: .03em;
    transition: color .15s;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: #2e7d63;
}

.bottom-nav-center {
    flex: 1;
    pointer-events: none;
}

.bottom-nav-fab {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
}

/* ── Blazor default validations ── */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#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;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MTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.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;
}

/* ══════════════════════════════════════════
   Desktop layout (≥ 768px)
   ══════════════════════════════════════════ */
@media (min-width: 768px) {

    /* Shell */
    .app-shell {
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Header */
    .app-header {
        height: 52px;
        background: #1a3a2e;
        color: #fff;
        display: flex;
        align-items: center;
        padding: 0 4px 0 16px;
        flex-shrink: 0;
        gap: 8px;
    }

    .app-header-logo {
        width: 32px;
        height: 32px;
        border-radius: 7px;
        display: block;
    }

    .app-header-username {
        font-size: .8rem;
        opacity: .75;
        max-width: 220px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Body row */
    .app-body {
        flex: 1;
        display: flex;
        overflow: hidden;
    }

    /* Sidebar */
    .app-sidebar {
        width: 210px;
        background: #fff;
        border-right: 1px solid rgba(0,0,0,.08);
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        overflow: hidden;
        transition: width .2s ease;
    }

    .app-sidebar.is-collapsed {
        width: 56px;
    }

    /* Nav */
    .sidebar-nav {
        flex: 1;
        padding: 10px 8px 4px;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .sidebar-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 6px;
        color: rgba(0,0,0,.55);
        text-decoration: none;
        font-size: .8rem;
        font-weight: 500;
        cursor: pointer;
        border: none;
        background: none;
        margin: 0;
        width: 100%;
        text-align: left;
        transition: background .12s, color .12s;
        white-space: nowrap;
        overflow: hidden;
    }

    .sidebar-item:hover {
        background: rgba(0,0,0,.04);
        color: rgba(0,0,0,.85);
    }

    .sidebar-item.active {
        background: rgba(46,125,99,.08);
        color: #2e7d63;
    }

    .app-sidebar.is-collapsed .sidebar-item {
        justify-content: center;
        padding: 8px;
        gap: 0;
    }

    .sidebar-label {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-sidebar.is-collapsed .sidebar-label {
        display: none;
    }

    /* + action */
    .sidebar-action {
        color: rgba(0,0,0,.75) !important;
    }

    .sidebar-action-bubble {
        width: 20px;
        height: 20px;
        background: #2e7d63;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: 300;
        color: #fff;
        flex-shrink: 0;
        line-height: 1;
    }

    /* Divider */
    .sidebar-divider {
        height: 1px;
        background: rgba(0,0,0,.08);
        margin: 4px 2px;
        flex-shrink: 0;
    }

    /* Footer / collapse */
    .sidebar-footer {
        padding: 4px 8px 8px;
        border-top: 1px solid rgba(0,0,0,.08);
        flex-shrink: 0;
    }

    .app-sidebar.is-collapsed .sidebar-footer {
        padding: 4px 0 8px;
        display: flex;
        justify-content: center;
    }

    .sidebar-collapse {
        color: rgba(0,0,0,.3) !important;
    }

    /* Content area */
    .app-content {
        flex: 1;
        overflow-y: auto;
        background: #f5f6f8;
    }

    /* Hide mobile elements */
    .mobile-topbar,
    .bottom-nav,
    .bottom-nav-fab {
        display: none !important;
    }
}

/* ══════════════════════════════════════════
   Mobile (< 768px)
   ══════════════════════════════════════════ */
@media (max-width: 767px) {

    .app-header,
    .app-sidebar {
        display: none !important;
    }

    .app-body {
        display: block;
    }

    /* Push content below fixed topbar */
    .app-content {
        padding-top: 52px;
    }
}

/* ── Mobile topbar ── */
.mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: #1a3a2e;
    color: #fff;
    display: none;
    align-items: center;
    padding: 0 4px 0 12px;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

@media (max-width: 767px) {
    .mobile-topbar {
        display: flex;
    }
}

.mobile-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: block;
}

.mobile-title {
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: .3px;
}

.mobile-username {
    font-size: .75rem;
    opacity: .7;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}