/* HVB Business OS — modern mobile-first UI */

:root {
    --hvb-tap-min: 44px;
    --hvb-sidebar-bg: linear-gradient(180deg, #0f1729 0%, #0a1018 100%);
    --hvb-brand: #066fd1;
    --hvb-brand-glow: rgba(6, 111, 209, 0.35);
    --hvb-surface: #eef2f7;
    --hvb-radius: 1rem;
    --hvb-radius-sm: 0.75rem;
    --hvb-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
    --hvb-shadow-hover: 0 8px 28px rgba(15, 23, 42, 0.12);
    --hvb-glass: rgba(255, 255, 255, 0.88);
}

body.hvb-app {
    font-family: "Inter", var(--tblr-font-sans-serif);
    background: linear-gradient(165deg, #eef2f7 0%, #e8eef6 40%, #f5f7fb 100%);
    overflow-x: clip;
    max-width: 100%;
    -webkit-font-smoothing: antialiased;
}

html { overflow-x: clip; }

html.hvb-sidebar-open,
html.hvb-sidebar-open body.hvb-app {
    overflow: hidden;
    touch-action: none;
}

/* ── Desktop: full-width fluid layout + fixed sidebar ── */
@media (min-width: 992px) {
    body.hvb-app.layout-fluid .hvb-page,
    body.hvb-app.layout-fluid .page {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    body.hvb-app .hvb-sidebar.offcanvas-lg {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1035;
        width: 15rem !important;
        transform: none !important;
        visibility: visible !important;
        display: flex !important;
        flex-direction: column;
        border-right: 1px solid rgba(255, 255, 255, 0.06);
    }

    body.hvb-app .hvb-sidebar.offcanvas-lg ~ .page .page-wrapper {
        margin-left: 15rem !important;
        margin-right: 0 !important;
        width: calc(100% - 15rem) !important;
        max-width: calc(100% - 15rem) !important;
        min-height: 100vh;
        flex: 1;
    }

    body.hvb-app .hvb-page-container {
        width: 100%;
        max-width: 100%;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    body.hvb-app .page-header {
        padding-top: 1rem;
        padding-bottom: 0.5rem;
    }

    body.hvb-app .page-body {
        padding-top: 0.5rem;
    }
}

@media (min-width: 1400px) {
    body.hvb-app .hvb-page-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 991.98px) {
    body.hvb-app .page { max-width: 100%; overflow-x: clip; }

    body.hvb-app .navbar-vertical.hvb-sidebar {
        margin: 0 !important;
        padding: 0 !important;
        inset: auto !important;
    }

    body.hvb-app .hvb-sidebar.offcanvas-lg ~ .page .page-wrapper,
    body.hvb-app .hvb-sidebar.offcanvas-lg ~ .page .navbar,
    body.hvb-app .page .page-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: clip;
    }

    body.hvb-app .page-body .container-xl,
    body.hvb-app .page [class*="container"] {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100%;
    }

    body.hvb-app .row { --tblr-gutter-x: 0.75rem; }

    .page-header { display: none; }
    .page-body { padding-top: 0.25rem; }
}

.hvb-sidebar {
    background: var(--hvb-sidebar-bg) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 991.98px) {
    .hvb-sidebar.offcanvas {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        width: min(19rem, 88vw) !important;
        z-index: 1045 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden;
        background: var(--hvb-sidebar-bg) !important;
        border-right: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    }

    .hvb-sidebar.offcanvas .container-fluid {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto;
        height: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .hvb-sidebar.offcanvas .offcanvas-body {
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .hvb-sidebar .navbar-collapse,
    .hvb-sidebar .navbar-nav {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
    }

    .hvb-sidebar .hvb-sidebar-user {
        flex-shrink: 0;
    }

    .offcanvas-backdrop {
        z-index: 1040 !important;
    }
}

.hvb-sidebar .nav-section-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
}

.hvb-sidebar .hvb-nav-link {
    border-radius: var(--hvb-radius-sm);
    margin: 0.125rem 0.625rem;
    padding: 0.7rem 0.875rem;
    min-height: var(--hvb-tap-min);
    transition: background 0.2s, transform 0.15s;
}

.hvb-sidebar .hvb-nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(3px);
}

.hvb-sidebar .hvb-nav-link.active {
    background: linear-gradient(90deg, rgba(6, 111, 209, 0.35), rgba(6, 111, 209, 0.12));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--hvb-brand);
}

.hvb-sidebar .nav-link-icon {
    display: inline-flex !important;
    width: 1.5rem;
    margin-right: 0.625rem;
}

.hvb-brand-mark {
    background: linear-gradient(135deg, #066fd1, #38bdf8) !important;
    box-shadow: 0 4px 14px var(--hvb-brand-glow);
}

.hvb-brand-letter { font-weight: 700; color: #fff; }

.hvb-mobile-header {
    background: var(--hvb-glass);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    padding-top: env(safe-area-inset-top);
    z-index: 1030;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.hvb-mobile-header-inner {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    min-height: 3.75rem;
}

.hvb-menu-btn {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px var(--hvb-brand-glow);
}

.hvb-menu-btn svg { display: block; color: #fff; }

.hvb-mobile-pretitle {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tblr-secondary);
}

.hvb-mobile-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hvb-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 0.625rem;
}

.hvb-avatar-ring {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(6, 111, 209, 0.25);
}

.hvb-desktop-header {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.hvb-filter-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.125rem 0.25rem 0.25rem;
}

.hvb-filter-scroll::-webkit-scrollbar { display: none; }

.hvb-filter-pills {
    display: inline-flex;
    gap: 0.375rem;
    min-width: min-content;
}

.hvb-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.875rem;
    min-height: 2.5rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: #fff;
    color: var(--tblr-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--hvb-shadow);
}

/* Mobile: wrap pills — no clipping */
@media (max-width: 767.98px) {
    .hvb-filter-scroll {
        overflow: visible;
        padding: 0;
        margin: 0;
    }

    .hvb-filter-pills {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.5rem;
        width: 100%;
        min-width: 0;
    }

    .hvb-pill {
        width: 100%;
        min-width: 0;
        padding: 0.5rem 0.35rem;
        font-size: 0.75rem;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }

    .hvb-pill .ti {
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    .hvb-pill[data-range="today"],
    .hvb-pill[data-range="week"],
    .hvb-pill[data-range="month"] {
        grid-column: span 2;
    }

    .hvb-pill[data-range="lastmonth"],
    .hvb-pill[data-range="custom"] {
        grid-column: span 3;
    }
}

.hvb-pill.active {
    background: linear-gradient(135deg, #066fd1, #228be6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px var(--hvb-brand-glow);
}

.hvb-custom-range-inner {
    margin-top: 0.75rem;
    padding: 0.875rem;
    background: #fff;
    border-radius: var(--hvb-radius-sm);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--hvb-shadow);
}

.hvb-date-input { min-height: 2.5rem; }

.hvb-dashboard-hero {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(240,246,255,0.85));
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--hvb-radius);
    padding: 1rem;
    box-shadow: var(--hvb-shadow);
    overflow: visible;
}

.hvb-filter-bar {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

@media (min-width: 992px) {
    .hvb-dashboard-hero {
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}

.hvb-hero-greeting { font-size: 0.875rem; color: var(--tblr-secondary); }
.hvb-hero-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }

.hvb-stat-card,
.hvb-health-card,
.hvb-chart-card,
.hvb-welcome-card {
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--hvb-radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--hvb-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.hvb-stat-card:hover,
.hvb-health-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hvb-shadow-hover);
}

.hvb-stat-primary { border-top: 3px solid var(--tblr-primary); }
.hvb-stat-azure { border-top: 3px solid var(--tblr-azure); }
.hvb-stat-orange { border-top: 3px solid var(--tblr-orange); }
.hvb-stat-green { border-top: 3px solid var(--tblr-green); }
.hvb-stat-teal { border-top: 3px solid var(--tblr-teal); }
.hvb-stat-red { border-top: 3px solid var(--tblr-red); }
.hvb-stat-purple { border-top: 3px solid var(--tblr-purple); }
.hvb-stat-lime { border-top: 3px solid var(--tblr-lime); }

.hvb-stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tblr-secondary);
}

.hvb-stat-value {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hvb-stat-sub {
    font-size: 0.75rem;
    color: var(--tblr-secondary);
    margin-top: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hvb-stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    border-radius: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

@media (max-width: 575.98px) {
    .hvb-stat-sub { display: none; }
}

.hvb-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tblr-secondary);
}

.hvb-health-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hvb-health-value {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hvb-health-green { border-bottom: 3px solid var(--tblr-green); }
.hvb-health-yellow { border-bottom: 3px solid var(--tblr-yellow); }
.hvb-health-red { border-bottom: 3px solid var(--tblr-red); }

.hvb-chart-area {
    min-height: 260px;
    max-width: 100%;
    overflow: hidden;
}

.hvb-chart-toggle .btn {
    border-radius: 999px !important;
    padding: 0.25rem 0.875rem;
    font-weight: 600;
    font-size: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
}

.hvb-chart-toggle .btn.active {
    background: var(--tblr-dark);
    border-color: var(--tblr-dark);
    color: #fff;
}

.hvb-welcome-card {
    background: linear-gradient(160deg, #fff 0%, #edf4ff 100%);
}

.hvb-quick-links .list-group-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 0;
    border-radius: var(--hvb-radius-sm) !important;
    margin-bottom: 0.375rem;
    padding: 0.75rem;
    min-height: var(--hvb-tap-min);
    background: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    transition: all 0.15s;
}

.hvb-quick-links .list-group-item:hover {
    background: #fff;
    box-shadow: var(--hvb-shadow);
    transform: translateX(4px);
}

.hvb-quick-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.page-body { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
.pb-safe { padding-bottom: env(safe-area-inset-bottom); }
.card { border-radius: var(--hvb-radius); }

@keyframes hvbPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hvb-stat-value.is-updating { animation: hvbPulse 0.6s ease; }

.badge-notification {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    border: 2px solid #fff;
}

.badge-blink { animation: hvbBlink 2s infinite; }

@keyframes hvbBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.hvb-sidebar .hvb-nav-link,
.hvb-mobile-header .btn,
.hvb-quick-links .list-group-item {
    min-height: var(--hvb-tap-min);
}

/* Mobile FAB — add new */
.hvb-fab {
    position: fixed;
    right: 1.25rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--hvb-brand-glow);
    font-size: 1.35rem;
}

.hvb-form-stack .form-control,
.hvb-form-stack .form-select,
.hvb-form-stack .btn-lg {
    min-height: var(--hvb-tap-min);
}

.hvb-data-table td,
.hvb-data-table th {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .hvb-data-table { font-size: 0.875rem; }
}

/* ── Login page ── */
body.hvb-login-page {
    font-family: "Inter", var(--tblr-font-sans-serif);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: #f0f4fa;
    -webkit-font-smoothing: antialiased;
}

.hvb-login-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.hvb-login-brand {
    display: none;
    background: var(--hvb-sidebar-bg);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hvb-login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(6, 111, 209, 0.35) 0%, transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(99, 179, 237, 0.15) 0%, transparent 40%);
    pointer-events: none;
}

.hvb-login-brand-inner {
    position: relative;
    z-index: 1;
    padding: 3rem 2.5rem;
    max-width: 28rem;
}

.hvb-login-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.hvb-login-logo {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 1.25rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.hvb-login-logo-sm {
    width: 72px;
    height: 72px;
    border-radius: 1rem;
    box-shadow: var(--hvb-shadow);
}

.hvb-login-logo-hint {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.hvb-login-brand-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.hvb-login-brand-tagline {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 2rem;
}

.hvb-login-brand-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hvb-login-brand-points li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

.hvb-login-brand-points .ti {
    font-size: 1.1rem;
    color: #6eb5ff;
}

.hvb-login-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 2rem;
    width: 100%;
}

.hvb-login-card {
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--hvb-radius);
}

.hvb-login-heading {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hvb-login-page .input-group-text {
    background: #f8fafc;
    border-color: var(--tblr-border-color);
    min-width: 2.75rem;
    justify-content: center;
}

.hvb-login-page .form-control-lg {
    min-height: var(--hvb-tap-min);
    font-size: 1rem;
}

.hvb-login-page .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    cursor: pointer;
}

.hvb-login-page .form-check-label {
    cursor: pointer;
    padding-left: 0.25rem;
    user-select: none;
    color: var(--tblr-body-color);
}

.hvb-login-submit {
    min-height: 3rem;
    font-weight: 600;
    box-shadow: 0 4px 14px var(--hvb-brand-glow);
}

@media (min-width: 992px) {
    .hvb-login-shell {
        flex-direction: row;
    }

    .hvb-login-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42%;
        max-width: 520px;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .hvb-login-main {
        flex: 1;
        padding: 2rem;
    }

    .hvb-login-card {
        max-width: 440px;
    }
}

@media (min-width: 1200px) {
    .hvb-login-brand {
        width: 45%;
        max-width: 560px;
    }
}

.hvb-login-shell-single .hvb-login-brand {
    display: none;
}

/* ——— Client-side loading / skeletons ——— */
.hvb-page-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 2000;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hvb-page-progress.is-active {
    opacity: 1;
}

.hvb-page-progress-bar {
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg, var(--tblr-primary), #4299e1);
    animation: hvbProgressSlide 1.1s ease-in-out infinite;
}

@keyframes hvbProgressSlide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

.hvb-panel[data-hvb-panel].is-loading {
    position: relative;
    pointer-events: none;
}

.hvb-panel[data-hvb-panel].is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    border-radius: inherit;
    z-index: 2;
}

.hvb-skeleton-line {
    display: block;
    height: 0.85em;
    border-radius: 6px;
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
    background-size: 200% 100%;
    animation: hvbShimmer 1.2s ease-in-out infinite;
    color: transparent !important;
    user-select: none;
}

.hvb-skeleton-line.lg { height: 1.75rem; width: 70%; }
.hvb-skeleton-line.sm { height: 0.65rem; width: 55%; margin-top: 0.35rem; }

.hvb-stat-value.hvb-skeleton-line { min-width: 5rem; }

@keyframes hvbShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.hvb-chart-panel {
    position: relative;
    min-height: 260px;
}

.hvb-chart-panel .hvb-chart-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.85);
    z-index: 3;
    border-radius: inherit;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.hvb-chart-panel.is-ready .hvb-chart-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hvb-chart-panel .hvb-chart-area {
    min-height: 260px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.hvb-chart-panel.is-ready .hvb-chart-area {
    opacity: 1;
}

.hvb-dashboard-error {
    display: none;
}

.hvb-dashboard-error.is-visible {
    display: block;
}

.hvb-list-error {
    display: none;
}

.hvb-list-error.is-visible {
    display: block;
}

.hvb-list-content.is-loading {
    position: relative;
    min-height: 12rem;
}

.hvb-list-content.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--tblr-border-radius);
    z-index: 2;
    pointer-events: none;
}

/* ——— Mobile-first forms ——— */
.hvb-form-page {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
    overflow-x: clip;
}

.hvb-form-mobile,
.hvb-form-mobile .card,
.hvb-form-mobile .card-body {
    max-width: 100%;
    min-width: 0;
}

.hvb-form-mobile .row > [class*="col-"] {
    min-width: 0;
}

.hvb-form-mobile .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.hvb-form-mobile .form-control,
.hvb-form-mobile .form-select,
.hvb-form-mobile .input-group-lg > .form-control,
.hvb-form-mobile .input-group-lg > .input-group-text {
    min-height: var(--hvb-tap-min, 48px);
    font-size: 1rem;
    max-width: 100%;
}

.hvb-form-mobile .form-select,
.hvb-form-mobile .hvb-select-trigger {
    background-size: 1.1rem;
    padding-right: 2.5rem;
}

.hvb-form-mobile .card {
    overflow: hidden;
}

.hvb-form-mobile .card-header {
    background: transparent;
    border-bottom: 1px solid var(--tblr-border-color);
    padding-top: 1rem;
    padding-bottom: 0.75rem;
}

.hvb-form-mobile .card-body {
    padding: 1rem;
}

@media (max-width: 767.98px) {
    .hvb-form-mobile .card-body.row {
        --tblr-gutter-x: 0.875rem;
        --tblr-gutter-y: 0.875rem;
    }

    .hvb-form-mobile .card + .card {
        margin-top: 0.75rem;
    }

    .hvb-form-mobile textarea.form-control {
        min-height: 5rem;
    }
}

/* Mobile custom select */
.hvb-select {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.hvb-select-native {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .hvb-select-native {
        position: absolute !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 1px !important;
        height: 1px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        clip: rect(0, 0, 0, 0);
        overflow: hidden;
    }

    .hvb-select-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
        min-height: var(--hvb-tap-min, 48px);
        padding: 0.65rem 0.875rem;
        padding-right: 2.5rem;
        font-size: 1rem;
        font-weight: 500;
        text-align: left;
        color: var(--tblr-body-color);
        background-color: var(--tblr-bg-forms, #fff);
        border: 1px solid var(--tblr-border-color);
        border-radius: var(--tblr-border-radius-lg, 0.5rem);
        box-shadow: none;
        cursor: pointer;
        transition: border-color 0.15s, box-shadow 0.15s;
    }

    .hvb-select-trigger:focus,
    .hvb-select-trigger:focus-visible {
        outline: 0;
        border-color: var(--tblr-primary);
        box-shadow: 0 0 0 0.2rem rgba(6, 111, 209, 0.15);
    }

    .hvb-select-trigger:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        background-color: var(--tblr-gray-100, #f3f4f6);
    }

    .hvb-select-trigger.is-placeholder .hvb-select-trigger-text {
        color: var(--tblr-secondary);
        font-weight: 400;
    }

    .hvb-select-trigger-text {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hvb-select-trigger-icon {
        flex-shrink: 0;
        font-size: 1.1rem;
        color: var(--tblr-secondary);
        position: absolute;
        right: 0.875rem;
        pointer-events: none;
    }

    .hvb-select {
        position: relative;
    }

    .hvb-select .hvb-select-trigger {
        position: relative;
    }
}

@media (min-width: 768px) {
    .hvb-select-trigger {
        display: none !important;
    }

    .hvb-form-mobile .form-select {
        text-overflow: ellipsis;
    }
}

/* Bottom sheet picker */
.hvb-select-sheet {
    position: fixed;
    inset: 0;
    z-index: 2050;
    pointer-events: none;
    visibility: hidden;
}

.hvb-select-sheet.is-open {
    pointer-events: auto;
    visibility: visible;
}

.hvb-select-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hvb-select-sheet.is-open .hvb-select-sheet-backdrop {
    opacity: 1;
}

.hvb-select-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(75vh, 32rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.hvb-select-sheet.is-open .hvb-select-sheet-panel {
    transform: translateY(0);
}

.hvb-select-sheet-handle {
    width: 2.5rem;
    height: 0.25rem;
    margin: 0.5rem auto 0;
    border-radius: 999px;
    background: var(--tblr-gray-300, #d1d5db);
    flex-shrink: 0;
}

.hvb-select-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid var(--tblr-border-color);
    flex-shrink: 0;
}

.hvb-select-sheet-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hvb-select-sheet-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: 1;
    min-height: 0;
}

.hvb-select-sheet-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.hvb-select-option {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.875rem 1rem;
    min-height: var(--hvb-tap-min, 48px);
    cursor: pointer;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: background 0.12s;
}

.hvb-select-option:last-child {
    border-bottom: 0;
}

.hvb-select-option:active:not(.is-disabled) {
    background: var(--tblr-gray-100, #f3f4f6);
}

.hvb-select-option.is-selected {
    background: rgba(6, 111, 209, 0.08);
}

.hvb-select-option.is-selected .hvb-select-option-label {
    color: var(--tblr-primary);
    font-weight: 600;
}

.hvb-select-option.is-selected .hvb-select-option-label::after {
    content: " ✓";
    font-weight: 700;
}

.hvb-select-option.is-disabled {
    opacity: 0.45;
    cursor: default;
}

.hvb-select-option-label {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    word-break: break-word;
}

.hvb-select-option-sub {
    font-size: 0.8125rem;
    color: var(--tblr-secondary);
    line-height: 1.35;
    word-break: break-word;
}

body.hvb-sheet-open {
    position: fixed;
    top: var(--hvb-lock-top, 0);
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
    touch-action: none;
}

/* Mobile date picker */
.hvb-date {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .hvb-date-native {
        position: absolute !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 1px !important;
        height: 1px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        clip: rect(0, 0, 0, 0);
        overflow: hidden;
    }

    .hvb-date-trigger {
        display: flex;
        align-items: center;
        gap: 0.625rem;
        width: 100%;
        min-height: var(--hvb-tap-min, 48px);
        padding: 0.65rem 0.875rem;
        font-size: 1rem;
        font-weight: 500;
        text-align: left;
        color: var(--tblr-body-color);
        background-color: var(--tblr-bg-forms, #fff);
        border: 1px solid var(--tblr-border-color);
        border-radius: var(--tblr-border-radius-lg, 0.5rem);
        cursor: pointer;
        transition: border-color 0.15s, box-shadow 0.15s;
    }

    .hvb-date-trigger:focus,
    .hvb-date-trigger:focus-visible {
        outline: 0;
        border-color: var(--tblr-primary);
        box-shadow: 0 0 0 0.2rem rgba(6, 111, 209, 0.15);
    }

    .hvb-date-trigger:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        background-color: var(--tblr-gray-100, #f3f4f6);
    }

    .hvb-date-trigger.is-placeholder .hvb-date-trigger-text {
        color: var(--tblr-secondary);
        font-weight: 400;
    }

    .hvb-date-trigger-icon {
        flex-shrink: 0;
        font-size: 1.15rem;
        color: var(--tblr-primary);
    }

    .hvb-date-trigger-text {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (min-width: 768px) {
    .hvb-date-trigger {
        display: none !important;
    }
}

.hvb-date-sheet {
    position: fixed;
    inset: 0;
    z-index: 2050;
    pointer-events: none;
    visibility: hidden;
}

.hvb-date-sheet.is-open {
    pointer-events: auto;
    visibility: visible;
}

.hvb-date-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hvb-date-sheet.is-open .hvb-date-sheet-backdrop {
    opacity: 1;
}

.hvb-date-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.hvb-date-sheet.is-open .hvb-date-sheet-panel {
    transform: translateY(0);
}

.hvb-date-sheet-handle {
    width: 2.5rem;
    height: 0.25rem;
    margin: 0.5rem auto 0;
    border-radius: 999px;
    background: var(--tblr-gray-300, #d1d5db);
    flex-shrink: 0;
}

.hvb-date-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.5rem;
    flex-shrink: 0;
}

.hvb-date-sheet-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hvb-date-sheet-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.75rem;
}

.hvb-date-month-label {
    flex: 1;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hvb-date-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: 0.75rem;
    background: #fff;
    color: var(--tblr-body-color);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.hvb-date-nav-btn:active {
    background: var(--tblr-gray-100, #f3f4f6);
}

.hvb-date-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    padding: 0 0.75rem 0.35rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tblr-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hvb-date-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.35rem;
    padding: 0 0.75rem 0.75rem;
}

.hvb-date-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    aspect-ratio: 1;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tblr-body-color);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.hvb-date-cell:active:not(:disabled) {
    background: var(--tblr-gray-100, #f3f4f6);
}

.hvb-date-cell.is-muted {
    color: var(--tblr-gray-400, #9ca3af);
    font-weight: 500;
}

.hvb-date-cell.is-today:not(.is-selected) {
    box-shadow: inset 0 0 0 2px rgba(6, 111, 209, 0.35);
}

.hvb-date-cell.is-selected {
    background: var(--tblr-primary, #066fd1);
    color: #fff;
}

.hvb-date-cell.is-disabled,
.hvb-date-cell:disabled {
    opacity: 0.35;
    cursor: default;
}

.hvb-date-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid var(--tblr-border-color);
    flex-shrink: 0;
}

.hvb-date-footer .btn-link {
    min-height: var(--hvb-tap-min, 44px);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
}

/* Filter forms — mobile stack */
@media (max-width: 767.98px) {
    [data-hvb-filter-form] .col-6,
    [data-hvb-filter-form] .col-md-2,
    [data-hvb-filter-form] .col-md-3,
    [data-hvb-filter-form] .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    [data-hvb-filter-form] .form-label {
        font-size: 0.8125rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    [data-hvb-filter-form] .form-control,
    [data-hvb-filter-form] .form-select,
    [data-hvb-filter-form] .hvb-date-trigger {
        min-height: var(--hvb-tap-min, 44px);
        font-size: 1rem;
        max-width: 100%;
    }

    [data-hvb-filter-form] .row > [class*="col-"] {
        min-width: 0;
    }

    [data-hvb-filter-form] .card-body {
        padding: 0.875rem;
    }
}

.hvb-form-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1025;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--tblr-border-color);
    backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
    .hvb-form-page {
        padding-bottom: 0;
    }

    .hvb-form-actions {
        position: static;
        flex-direction: row;
        padding: 0;
        background: transparent;
        border-top: none;
        backdrop-filter: none;
        margin-top: 1rem;
    }

    .hvb-form-actions .btn-lg {
        flex: 1;
        max-width: 16rem;
    }
}
