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

/* Override Sidebar2 styles */
:root {
    /* Titlebar */
    --bb-sidebar2-top-row-background-color: var(--bs-primary);
    --bb-sidebar2-top-row-border-color: var(--bs-primary);
    --bb-sidebar2-title-text-color: #fff;
    --bb-sidebar2-brand-icon-color: #fff;
    --bb-sidebar2-brand-image-width: 28px;
    --bb-sidebar2-brand-image-height: 28px;
    /* Sidebar body background */
    --bb-sidebar2-background-color: var(--bs-secondary-bg-subtle);
    --bb-sidebar2-content-border-color: var(--bs-secondary-border-subtle);
    /* Nav item text */
    --bb-sidebar2-nav-item-text-color: var(--bs-body-color);
    /* Active / hover: bg = light secondary tint, text = primary */
    --bb-sidebar2-nav-item-background-hover-color: rgba(var(--bs-secondary-rgb), 0.15);
    --bb-sidebar2-nav-item-group-background-color: rgba(var(--bs-secondary-rgb), 0.08);
    --bb-sidebar2-nav-item-text-active-color: var(--bs-primary);
    --bb-sidebar2-nav-item-text-hover-color: var(--bs-primary);
}

/* DataTables Responsive child row – always left-align regardless of column className */
table.dataTable > tbody > tr.child ul.dtr-details > li,
table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-data,
table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-title {
    text-align: left !important;
    float: none !important;
    justify-content: flex-start !important;
}

table.dataTable > tbody > tr.child ul.dtr-details > li {
    border-bottom: 1px solid var(--bs-border-color);
    padding: .35rem 0;
    display: flex;
    align-items: baseline;
    gap: .5rem;
}

table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-title {
    min-width: 110px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--bs-secondary-color);
    font-size: .78rem;
}

table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-data {
    font-size: .82rem;
    flex: 1;
}

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

/* DataTables pagination alignment */
.dataTables_wrapper .dataTables_info {
    float: left !important;
}

.dataTables_wrapper .dataTables_paginate {
    float: right !important;
    text-align: right !important;
}

.dataTables_wrapper .row:last-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.dataTables_wrapper .row:last-child > div {
    flex: 0 0 auto !important;
}

.dataTables_wrapper .row:last-child > div:last-child {
    margin-left: auto !important;
}

/* Global DataTables: prevent focus ring clipping on search/filter controls across all pages */
.table-responsive,
.so-list-wrap,
.dataTables_wrapper {
    overflow: visible !important;
}

.table-responsive .dataTables_wrapper,
.so-list-wrap .dataTables_wrapper,
.dataTables_wrapper,
.dataTables_wrapper .row,
.dataTables_wrapper .dt-search,
.dataTables_wrapper .dataTables_filter {
    overflow: visible !important;
}

/* Focus ring styles for all DataTables search/filter controls */
.dataTables_wrapper .dt-search input:focus,
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dt-search button:focus,
.dataTables_wrapper .dataTables_filter button:focus,
[id$="FilterBtn"]:focus,
[id$="FilterBtn"]:active:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.2rem #258cfb !important;
    outline: none;
}

/* Ensure table wrapper doesn't clip overflows on desktop */
@media (min-width: 992px) {
    .table-responsive,
    .so-list-wrap {
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
}

/* Mobile: allow horizontal scroll on small screens */
@media (max-width: 991.98px) {
    .table-responsive,
    .so-list-wrap {
        overflow-x: auto !important;
        overflow-y: visible !important;
    }
}
/* Offcanvas styles */
.offcanvas {
    width: 520px !important;
    max-width: 100vw !important;
}

.offcanvas-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
}

.offcanvas.show {
    transform: none;
}

/* Sidebar primary color theme */
:root {
    --bb-sidebar-background-color: #ced4da;
    --bb-sidebar-top-row-background-color: #1b6ec2;
    --bb-sidebar-top-row-border-color: #1861ac;
    --bb-sidebar-title-text-color: #ffffff;
    --bb-sidebar-brand-icon-color: #ffffff;
    --bb-sidebar-title-badge-text-color: #ffffff;
    --bb-sidebar-title-badge-background-color: rgba(255, 255, 255, 0.2);
    --bb-sidebar-navbar-toggler-icon-color: #ffffff;
    --bb-sidebar-navbar-toggler-background-color: rgba(255, 255, 255, 0.1);
    --bb-sidebar-content-border-color: rgba(0, 0, 0, 0.08);
    --bb-sidebar-nav-item-text-color: #1a1a2e;
    --bb-sidebar-nav-item-text-active-color-rgb: 27, 110, 194;
    --bb-sidebar-nav-item-text-hover-color: rgba(27, 110, 194, 1);
    --bb-sidebar-nav-item-text-active-color: rgba(27, 110, 194, 1);
    --bb-sidebar-nav-item-background-hover-color: rgba(27, 110, 194, 0.08);
    --bb-sidebar-nav-item-group-background-color: rgba(0, 0, 0, 0.03);
}

/* SO View offcanvas – items table */
.so-view-table {
    font-size: .8rem;
}
.so-view-table th {
    white-space: nowrap;
    font-size: .75rem;
    padding: .3rem .4rem;
}
.so-view-table td {
    padding: .3rem .4rem;
    vertical-align: middle;
}

/* SO View offcanvas – totals card */
.so-view-totals {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    font-size: .85rem;
}

/* ── Hide top navbar on mobile (content is already hidden there) ── */
@media (max-width: 991.98px) {
    .bb-top-row {
        display: none !important;
    }
}
@media (max-width: 767.98px) {
    .dataTables_wrapper .dt-search, 
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        margin-top: 0.5rem;
    }
    .dataTables_wrapper .dt-search input,
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
    }
    .dataTables_wrapper .dataTables_length {
        text-align: left !important;
    }
    div.dataTables_wrapper div.dataTables_paginate ul.pagination {
        justify-content: center !important;
        margin-top: 1rem;
    }
}
