/* BC_MOBILE_UX_V2_STABLE
   Conservative mobile layer. No blanket inline-style overrides. */

@media screen and (max-width: 991.98px) {
    html,
    body {
        max-width: 100%;
    }

    *, *::before, *::after {
        box-sizing: border-box;
    }

    img, svg, video, canvas {
        max-width: 100%;
        height: auto;
    }

    body.bc-v2-mobile .container,
    body.bc-v2-mobile .container-fluid {
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    body.bc-v2-mobile .row,
    body.bc-v2-mobile [class*="col-"] {
        min-width: 0;
    }

    body.bc-v2-mobile h1,
    body.bc-v2-mobile .h1 {
        font-size: clamp(1.4rem, 5.5vw, 1.8rem);
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    body.bc-v2-mobile h2,
    body.bc-v2-mobile .h2 {
        font-size: clamp(1.25rem, 5vw, 1.6rem);
        overflow-wrap: anywhere;
    }

    body.bc-v2-mobile h3,
    body.bc-v2-mobile .h3 {
        font-size: clamp(1.15rem, 4.5vw, 1.42rem);
        overflow-wrap: anywhere;
    }

    body.bc-v2-mobile .card {
        min-width: 0;
        max-width: 100%;
    }

    body.bc-v2-mobile .card-header,
    body.bc-v2-mobile .card-body,
    body.bc-v2-mobile .card-footer {
        overflow-wrap: anywhere;
    }

    body.bc-v2-mobile .bc-v2-action-row {
        flex-wrap: wrap !important;
        gap: .45rem !important;
        max-width: 100%;
    }

    body.bc-v2-mobile .bc-v2-action-row > * {
        min-width: 0;
        max-width: 100%;
    }

    body.bc-v2-mobile input.form-control,
    body.bc-v2-mobile select.form-select,
    body.bc-v2-mobile textarea.form-control {
        max-width: 100%;
        font-size: 16px;
    }

    body.bc-v2-mobile input[type="date"],
    body.bc-v2-mobile input[type="datetime-local"],
    body.bc-v2-mobile input[type="time"] {
        max-width: 100%;
    }

    body.bc-v2-mobile .modal-dialog,
    body.bc-v2-mobile .modal-dialog.modal-lg,
    body.bc-v2-mobile .modal-dialog.modal-xl {
        width: auto;
        max-width: calc(100vw - 20px);
        margin: 10px auto;
    }

    body.bc-v2-mobile .modal-content {
        max-height: calc(100dvh - 20px);
    }

    body.bc-v2-mobile .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.bc-v2-mobile .dropdown-menu {
        max-width: calc(100vw - 24px);
    }

    body.bc-v2-mobile pre,
    body.bc-v2-mobile code {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Reliable independent mobile sidebar drawer. */
    body.bc-v2-has-sidebar .bc-v2-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        z-index: 2147483602 !important;
        width: min(86vw, 310px) !important;
        max-width: 310px !important;
        height: 100dvh !important;
        margin: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        transform: translate3d(-105%,0,0) !important;
        transition: transform .2s ease !important;
        pointer-events: none !important;
        box-shadow: 12px 0 34px rgba(0,0,0,.28) !important;
    }

    body.bc-v2-has-sidebar.bc-v2-menu-open .bc-v2-sidebar {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: translate3d(0,0,0) !important;
        pointer-events: auto !important;
    }

    /* Content is allowed full mobile width only after a real sidebar is found. */
    body.bc-v2-has-sidebar .main-content,
    body.bc-v2-has-sidebar .content-wrapper,
    body.bc-v2-has-sidebar .page-content,
    body.bc-v2-has-sidebar .app-content,
    body.bc-v2-has-sidebar .app-main,
    body.bc-v2-has-sidebar main.main-content {
        margin-left: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    #bcV2MenuButton {
        position: fixed !important;
        left: 12px !important;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 2147483604 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 7px !important;
        min-width: 92px !important;
        min-height: 46px !important;
        border: 0 !important;
        border-radius: 999px !important;
        padding: 0 16px !important;
        background: #111827 !important;
        color: #fff !important;
        box-shadow: 0 8px 28px rgba(0,0,0,.3) !important;
        font: 700 14px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    #bcV2MenuButton .bc-v2-menu-icon {
        font-size: 19px;
        line-height: 1;
    }

    #bcV2MenuOverlay {
        position: fixed !important;
        inset: 0 !important;
        z-index: 2147483601 !important;
        display: block !important;
        background: rgba(15,23,42,.5) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity .18s ease, visibility .18s ease !important;
    }

    body.bc-v2-menu-open #bcV2MenuOverlay {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

@media screen and (max-width: 767.98px) {
    body.bc-v2-mobile .container,
    body.bc-v2-mobile .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    body.bc-v2-mobile .card-header {
        padding: .72rem .8rem;
    }

    body.bc-v2-mobile .card-body {
        padding: .8rem;
    }

    body.bc-v2-mobile .card-footer {
        padding: .72rem .8rem;
    }

    body.bc-v2-mobile .btn:not(.btn-sm):not(.btn-close) {
        min-height: 42px;
    }

    /* Complex/interactive tables stay intact and scroll only inside their box. */
    body.bc-v2-mobile .bc-v2-table-scroll {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x pan-y;
        border-radius: 10px;
    }

    body.bc-v2-mobile .bc-v2-table-scroll > table,
    body.bc-v2-mobile table.bc-v2-interactive-table {
        width: max-content;
        min-width: 100%;
        max-width: none;
    }

    /* Simple tables can safely become stacked cards. */
    body.bc-v2-mobile table.bc-v2-card-table {
        display: block;
        width: 100%;
        max-width: 100%;
        border: 0;
        background: transparent;
    }

    body.bc-v2-mobile table.bc-v2-card-table thead {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0,0,0,0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    body.bc-v2-mobile table.bc-v2-card-table tbody {
        display: grid;
        width: 100%;
        gap: 10px;
    }

    body.bc-v2-mobile table.bc-v2-card-table tbody tr {
        display: block;
        width: 100%;
        min-width: 0;
        border: 1px solid var(--bs-border-color,#dee2e6);
        border-radius: 12px;
        background: var(--bs-body-bg,#fff);
        box-shadow: 0 2px 8px rgba(15,23,42,.045);
    }

    body.bc-v2-mobile table.bc-v2-card-table tbody td {
        display: grid;
        grid-template-columns: minmax(92px,35%) minmax(0,1fr);
        gap: 10px;
        align-items: start;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: .62rem .72rem;
        border: 0;
        border-bottom: 1px solid var(--bs-border-color,#edf0f2);
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: break-word;
        text-align: left !important;
    }

    body.bc-v2-mobile table.bc-v2-card-table tbody td:last-child {
        border-bottom: 0;
    }

    body.bc-v2-mobile table.bc-v2-card-table tbody td::before {
        content: attr(data-bc-v2-label);
        display: block;
        font-size: .72rem;
        line-height: 1.25;
        font-weight: 800;
        letter-spacing: .025em;
        text-transform: uppercase;
        color: var(--bs-secondary-color,#6c757d);
        overflow-wrap: anywhere;
    }

    body.bc-v2-mobile table.bc-v2-card-table tbody td[data-bc-v2-full="1"] {
        display: block;
    }

    body.bc-v2-mobile table.bc-v2-card-table tbody td[data-bc-v2-full="1"]::before,
    body.bc-v2-mobile table.bc-v2-card-table tbody td[data-bc-v2-label=""]::before {
        display: none;
    }

    body.bc-v2-mobile table.bc-v2-card-table tbody td > * {
        min-width: 0;
        max-width: 100%;
    }

    body.bc-v2-mobile table.bc-v2-card-table .badge {
        white-space: normal;
    }

    body.bc-v2-mobile .pagination {
        flex-wrap: wrap;
        gap: .25rem;
    }
}

@media print {
    #bcV2MenuButton,
    #bcV2MenuOverlay {
        display: none !important;
    }
}