/*!
 * Responsive layer for the admin (AdminLTE 2 + Bootstrap 3).
 * Loaded LAST (after Addition.css). Every rule that changes layout lives inside
 * a max-width media query, so the desktop (>= 992px) UI is unchanged.
 *   <= 991px  tablet / small laptop
 *   <= 767px  phone (AdminLTE off-canvas sidebar breakpoint)
 *   <= 479px  small phone
 */

/* Hint bar + scroll wrappers are inert on desktop */
.scroll-hint { display: none; }

/* Desktop fix: header/footer action buttons are written with an inline width:130px, which cuts
   off longer labels ("Print Undertakin"). Let them grow to fit; 130px stays the minimum so
   short ones (Print) keep their current size. */
.pull-right > .btn[style*="width: 130px"],
.pull-right > .btn[style*="width:130px"] {
    width: auto !important;
    min-width: 130px;
    white-space: nowrap;
    padding-left: 14px;
    padding-right: 14px;
}

/* ------------------------------------------------------------------
   TABLET AND BELOW
------------------------------------------------------------------- */
@media (max-width: 991px) {
    .content-wrapper { min-width: 0; }

    /* Tables get a touch-scrolling container (added by responsive.js) */
    .table-scroll,
    .table-responsive {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-scroll > .table { margin-bottom: 0; }

    img, canvas, svg, video { max-width: 100%; }
    .modal-body img { height: auto; }

    /* Modals: never wider than the viewport, body scrolls */
    body .modal-dialog { max-width: calc(100vw - 20px); }
    .modal-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Pickers / dropdown widgets stay on screen */
    .ymd-picker { max-width: calc(100vw - 20px); }
    .bootstrap-datetimepicker-widget,
    .select2-container--open .select2-dropdown { max-width: calc(100vw - 20px); }
}

/* ------------------------------------------------------------------
   PHONE
------------------------------------------------------------------- */
@media (max-width: 767px) {

    /* --- Page frame ------------------------------------------------ */
    .content-wrapper { padding: 10px; }
    .content { padding: 10px 0; }
    .content-header {
        padding: 12px;
        border-radius: 6px;
    }
    .content-header > h1 {
        font-size: 20px;
        line-height: 1.25;
        word-break: break-word;
    }
    .content-header .breadcrumb {
        padding: 6px 0 0;
        font-size: 12px;
        white-space: normal;
    }
    /* Page-level action buttons: one wrapping row instead of a right float */
    .content-header .pull-right,
    .content-header .btn-group-page {
        float: none !important;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 8px;
    }
    .content-header .pull-right > .btn,
    .content-header .pull-right > a.btn,
    .content-header .pull-right > .btn-group,
    .content-header .pull-right > form {
        flex: 1 1 auto;
        width: auto !important;   /* fixed width:130px print buttons */
        margin: 0 !important;
    }
    .content-header .pull-right > .btn-group > .btn { width: 100%; }

    .box { margin-bottom: 12px; }
    .box-header, .box-body, .box-footer { padding: 10px; }
    .box-header > .box-tools { position: static; margin-top: 6px; }
    .box-footer .pull-right { float: none !important; display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
    .box-footer .pull-right > .pull-right { float: none !important; display: contents; }
    .box-footer .pull-right .btn { flex: 1 1 auto; margin: 0 !important; }
    .panel-body { padding: 10px; }
    .row { margin-left: -8px; margin-right: -8px; }
    .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }

    /* --- Header bar & off-canvas sidebar --------------------------- */
    .main-header .navbar-custom-menu .nav > li.hidden-sm { display: none; }   /* session / branch / fiscal year */
    .main-header .navbar-custom-menu > .navbar-nav > li > a { padding-left: 10px; padding-right: 10px; }
    .main-header > .navbar > img { max-height: 36px; margin: 7px 0 0 52px; }
    .fbr-status {
        position: static !important;
        display: inline-flex !important;
        margin: 8px 0 0 52px;
        padding: 3px 8px !important;
        font-size: 11px !important;
        gap: 6px !important;
        max-width: calc(100vw - 150px);
        overflow: hidden;
    }
    .fbr-status .status-text { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
    .main-header .sidebar-toggle { min-width: 48px; min-height: 50px; }
    .navbar-nav > .user-menu > .dropdown-menu { width: 240px; max-width: calc(100vw - 20px); right: 0; left: auto; }

    .main-sidebar, .left-side {
        position: fixed;
        top: 0; bottom: 0;
        padding-top: 50px;            /* header is a single 50px bar here */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 85vw;
        z-index: 1040;
    }
    .sidebar-menu > li > a,
    .sidebar-menu .treeview-menu > li > a { padding-top: 12px; padding-bottom: 12px; }
    /* modify.css gives the sidebar/wrapper a 10px side shadow; with the drawer parked
       off-canvas that shadow leaked onto the left edge of the screen as a strip. */
    .skin-blue .wrapper,
    .skin-blue .main-sidebar,
    .skin-blue .left-side { box-shadow: none; }
    .sidebar-open .main-sidebar { box-shadow: 4px 0 14px rgba(0, 0, 0, .35); }
    /* Dim the page while the drawer is open */
    .sidebar-open .content-wrapper:before {
        content: "";
        position: fixed; inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 1035;
    }

    /* --- Touch-friendly controls ---------------------------------- */
    .form-control,
    .select2-container--default .select2-selection--single,
    .select2-container--default .select2-selection--multiple {
        min-height: 40px;
        font-size: 16px;               /* prevents iOS zoom-on-focus */
    }
    .select2-container--default .select2-selection--single { height: 40px; }
    .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 26px; }
    .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
    textarea.form-control { min-height: 80px; }
    .btn { min-height: 38px; padding: 8px 12px; }
    .btn-xs, .btn-sm { min-height: 34px; padding: 6px 10px; font-size: 13px; }
    .input-group-btn > .btn { min-height: 40px; }
    .form-group { margin-bottom: 12px; }
    label { margin-bottom: 4px; }
    .checkbox label, .radio label { padding-top: 6px; padding-bottom: 6px; }

    /* --- Tabs: single scrollable row ------------------------------ */
    .nav-tabs {
        display: flex; flex-wrap: nowrap;
        overflow-x: auto; overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .nav-tabs > li { float: none; flex: 0 0 auto; }
    .nav-tabs > li > a { white-space: nowrap; padding: 10px 14px; }

    /* --- Tables --------------------------------------------------- */
    .table > tbody > tr > td, .table > tbody > tr > th,
    .table > tfoot > tr > td, .table > tfoot > tr > th,
    .table > thead > tr > td, .table > thead > tr > th { font-size: 13px; }
    .table-scroll, .table-responsive { border: 1px solid #ddd; margin-bottom: 10px; }
    /* Line-item grids: headers are centered in 100-350px columns, so while swiping a label
       ends up over the neighbouring column's input. Pin each label to its column's left edge. */
    .table-responsive .table:not(.dataTable) > thead > tr > td,
    .table-responsive .table:not(.dataTable) > thead > tr > th,
    .table-scroll .table:not(.dataTable) > thead > tr > td,
    .table-scroll .table:not(.dataTable) > thead > tr > th {
        text-align: left;
        vertical-align: middle;
        white-space: nowrap;
        padding-left: 8px;
    }
    /* Line-item grids (sale / purchase / vouchers): bigger targets, same markup */
    .table-responsive td .form-control,
    .table-scroll td .form-control { min-height: 38px; }
    .table-responsive td .btn,
    .table-scroll td .btn { min-width: 38px; }
    .scroll-hint {
        display: none;
        margin: 0 0 4px; padding: 4px 8px;
        font-size: 12px; color: #6b7a86;
        background: #f4f7f9; border-radius: 4px; text-align: center;
    }
    .scroll-hint.on { display: block; }

    /* --- DataTables chrome ---------------------------------------- */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate { text-align: center; float: none; display: block; }
    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label { display: block; width: 100%; margin-bottom: 8px; text-align: left; }
    .dataTables_wrapper .dataTables_filter input {
        display: block; width: 100% !important; margin: 4px 0 0 !important;
    }
    .dataTables_wrapper .dataTables_length select { width: auto; display: inline-block; }
    .dataTables_wrapper .dataTables_paginate ul.pagination {
        display: flex; flex-wrap: wrap; justify-content: center; margin: 6px 0;
    }
    .pagination > li > a, .pagination > li > span { padding: 8px 12px; }
    .dataTables_wrapper .dataTables_info { white-space: normal; padding-top: 4px; }

    /* --- Modals ---------------------------------------------------- */
    .modal.in { text-align: left; }
    body .modal-dialog,
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl,
    .modal .modal-dialog {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 10px !important;
    }
    .modal-content {
        display: flex; flex-direction: column;
        max-height: calc(100vh - 20px);
    }
    .modal-body { flex: 1 1 auto; overflow: auto; padding: 12px; }
    .modal-header, .modal-footer { padding: 10px 12px; flex: 0 0 auto; }
    .modal-footer .btn { min-width: 0; }

    /* --- Pickers --------------------------------------------------- */
    .ymd-picker { min-width: 0; width: calc(100vw - 20px); left: 10px !important; }

    /* --- Dashboard ------------------------------------------------- */
    .small-box h3 { font-size: 26px; }
    .small-box .icon { font-size: 56px; }
    /* chart areas take only the space a rendered chart needs; empty ones (no data / chart disabled) collapse */
    #container:empty, #container1:empty { display: none; }
    .row:has(> #container:empty), .row:has(> #container1:empty) { display: none; }
    .content hr { margin: 10px 0; }
    .content-wrapper .content > .row + hr { display: none; }

    /* --- Misc ------------------------------------------------------ */
    .profile-user-img { width: 160px; max-width: 100%; }
    .alert { padding: 10px 12px; }
    h2 { font-size: 22px; }
    h3 { font-size: 18px; }
    pre, code { white-space: pre-wrap; word-break: break-word; }

    /* Login */
    .login-box, .register-box { width: 92%; margin: 20px auto; }
    .login-box-body, .register-box-body { padding: 16px; }
}

/* ------------------------------------------------------------------
   SMALL PHONE
------------------------------------------------------------------- */
@media (max-width: 479px) {
    .content-wrapper { padding: 8px; }
    .content-header > h1 { font-size: 18px; }
    .main-header .navbar-custom-menu .user-menu > a > .hidden-xs { display: none !important; }
    /* Pagination: first / prev / current / next / last only */
    .dataTables_paginate .paginate_button:not(.active):not(.previous):not(.next):not(.first):not(.last) { display: none; }
    .btn { font-size: 13px; }
    .small-box .inner { padding: 8px 10px; }
}

/* The right-hand control sidebar has no reachable toggle in this app; its fixed,
   off-screen background widens the layout viewport on phones. */
@media (max-width: 991px) {
    .control-sidebar, .control-sidebar-bg { display: none !important; }
}

/* Collapsed desktop/tablet sidebar is also parked at -230px: don't let its shadow show. */
@media (min-width: 768px) {
    .skin-blue.sidebar-collapse .main-sidebar,
    .skin-blue.sidebar-collapse .left-side { box-shadow: none; }
}

/* Filter selects carry an inline min-width:300px (meant for grid cells); on a 320px phone
   that pushes the quick-search button off-screen. Grid cells (inside td) keep it. */
@media (max-width: 479px) {
    .input-group > select.form-control:not(td *),
    .input-group > .select2-container:not(td *) { min-width: 0 !important; }
}

/* The native <select> behind a select2 is collapsed to 1px; the touch-size min-height above
   must not re-inflate it (it floats and pushed the visible select2 box into the wrong column). */
@media (max-width: 767px) {
    select.select2-hidden-accessible,
    .select2-hidden-accessible.form-control { min-height: 0 !important; }
}

/* ==================================================================
   MOBILE VISUAL POLISH (phones only)
   One spacing scale (4/8/12/16), one radius (10 cards, 8 controls),
   one flat shadow. Selectors are as specific as modify.css
   (".box .box-body") so they win without touching desktop.
================================================================== */
@media (max-width: 767px) {
    :root {
        --p-bg: #f2f5f9;
        --p-line: #dde4ec;
        --p-text: #1f2d3d;
        --p-muted: #5d6c7e;
        --p-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    }

    /* --- Page + cards ------------------------------------------- */
    body, .content-wrapper { background: var(--p-bg); }
    .content-wrapper { padding: 12px 12px 4px; }
    .content-wrapper .content { padding: 0; }
    .content-wrapper .content > .row { margin-left: 0; margin-right: 0; }
    .content-wrapper .content > .row > [class*="col-"] { padding-left: 0; padding-right: 0; }

    .content-wrapper .box,
    .content-wrapper .panel,
    .content-wrapper .nav-tabs-custom {
        background: #fff;
        border: 0;
        border-radius: 10px;
        box-shadow: var(--p-shadow);
        margin-bottom: 12px;
    }
    .content-wrapper .box .box-header,
    .content-wrapper .panel > .panel-heading {
        padding: 12px 14px;
        border-radius: 10px 10px 0 0;
        box-shadow: none;
        border-bottom: 1px solid var(--p-line);
        background: #fff;
    }
    .content-wrapper .box .box-header.is-empty { display: none; }
    .content-wrapper .box .box-body,
    .content-wrapper .panel > .panel-body { padding: 14px; }
    .content-wrapper .box .box-footer { padding: 12px 14px; border-top: 1px solid var(--p-line); background: #fff; border-radius: 0 0 10px 10px; }
    .box-body .row, .panel-body .row { margin-left: -6px; margin-right: -6px; }
    .box-body .row > [class*="col-"],
    .panel-body .row > [class*="col-"] { padding-left: 6px; padding-right: 6px; }

    /* Page title card */
    .content-wrapper .content-header {
        padding: 14px;
        margin: 0 0 12px;
        border-radius: 10px;
        background: #fff;
        box-shadow: var(--p-shadow);
    }
    .content-header > h1 { font-size: 19px; font-weight: 600; color: var(--p-text); margin: 0; }
    .content-header .breadcrumb { padding: 4px 0 0; margin: 0; background: transparent; font-size: 12px; line-height: 1.5; }
    .content-header > .row { margin: 0; }
    .content-header > .row > [class*="col-"] { padding: 0; }

    /* Page action buttons: equal-width grid under the title */
    .content-header .pull-right,
    .content-header .btn-group-page {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
        gap: 8px;
        margin: 12px 0 0;
        width: 100%;
    }
    .content-header .pull-right > * { margin: 0 !important; width: 100% !important; }
    .content-header .pull-right .btn { width: 100%; }
    .content-header .btn-group.open > .dropdown-menu { width: 100%; }

    /* --- Buttons -------------------------------------------------- */
    .content-wrapper .btn,
    .content-wrapper .btn:focus {
        border-radius: 8px !important;
        box-shadow: 0 1px 2px rgba(16, 24, 40, .14) !important;
        min-height: 42px;
        padding: 9px 14px;
        font-size: 14px;
        line-height: 1.3;
        display: inline-flex; align-items: center; justify-content: center; gap: 6px;
        white-space: nowrap;
    }
    .content-wrapper .btn-block { display: flex; width: 100%; }
    .content-wrapper .form-control.btn { margin: 0; }
    .content-wrapper .input-group-btn > .btn { border-radius: 0 8px 8px 0 !important; min-height: 44px; }
    .content-wrapper .box-footer .btn,
    .content-wrapper .modal-footer .btn { min-width: 110px; }

    /* --- Forms ----------------------------------------------------- */
    .form-group { margin-bottom: 14px; }
    .form-group > label,
    .box-body label:not(.radio-inline):not(.checkbox-inline):not(.error),
    .box-header label:not(.radio-inline):not(.checkbox-inline):not(.error),
    .panel-body label:not(.radio-inline):not(.checkbox-inline):not(.error) {
        display: block;
        margin: 0 0 6px;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.35;
        color: var(--p-muted);
    }
    label.radio-inline, label.checkbox-inline, .radio label, .checkbox label {
        font-size: 14px; font-weight: 500; color: var(--p-text);
        display: inline-flex; align-items: center; gap: 6px;
    }
    .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { margin-left: 16px; }
    label .required, .required { color: #e0453a; }

    .content-wrapper .form-control:not(.btn),
    .content-wrapper .select2-container--default .select2-selection--single,
    .content-wrapper .select2-container--default .select2-selection--multiple {
        height: 44px;
        min-height: 44px;
        padding: 9px 12px;
        font-size: 16px;
        line-height: 1.35;
        color: var(--p-text);
        background-color: #fff;
        border: 1px solid #cdd6e1;
        border-radius: 8px;
        box-shadow: none;
    }
    .content-wrapper textarea.form-control { height: auto; min-height: 88px; }
    .content-wrapper .select2-container--default .select2-selection--multiple { height: auto; padding: 4px 8px; }
    .content-wrapper .form-control:not(.btn):focus,
    .content-wrapper .select2-container--default.select2-container--focus .select2-selection--single,
    .content-wrapper .select2-container--default.select2-container--open .select2-selection--single {
        border-color: var(--m-primary);
        box-shadow: 0 0 0 3px rgba(30, 128, 185, .15);
        outline: 0;
    }
    .content-wrapper .form-control:not(.btn)[readonly],
    .content-wrapper .form-control:not(.btn)[disabled] { background-color: #f1f4f8; color: var(--p-muted); }
    .content-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
        padding: 0 22px 0 0; line-height: 24px; color: var(--p-text);
    }
    .content-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; right: 6px; }
    .content-wrapper select.select2-hidden-accessible,
    .content-wrapper .select2-hidden-accessible.form-control { height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; }
    .input-group { width: 100%; }
    .content-wrapper .input-group .form-control:first-child,
    .content-wrapper .input-group .select2-container:first-child .select2-selection--single { border-top-right-radius: 0; border-bottom-right-radius: 0; }
    .input-group-addon { border-radius: 8px 0 0 8px; border-color: #cdd6e1; min-width: 44px; }
    .input-group .input-group-btn .btn { border: 0 !important; }
    label.error { display: block; margin-top: 4px; font-size: 12px; color: #e0453a; }

    /* --- Tabs ------------------------------------------------------ */
    .nav-tabs { border-bottom: 1px solid var(--p-line); margin-bottom: 0; }
    .nav-tabs > li > a { margin: 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 14px; font-weight: 600; color: var(--p-muted); }
    .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { border: 0; border-bottom: 2px solid var(--m-primary); color: var(--m-primary); background: transparent; }

    /* --- Tables ---------------------------------------------------- */
    .table-scroll, .table-responsive {
        border: 1px solid var(--p-line);
        border-radius: 8px;
        margin: 0 0 12px;
        background: #fff;
    }
    .table-scroll > .table, .table-responsive > .table { margin: 0 !important; border: 0; }
    .table > thead > tr > td, .table > thead > tr > th {
        background: #f5f7fa;
        color: #34445a;
        font-size: 12.5px;
        font-weight: 600;
        line-height: 1.3;
        padding: 10px 8px;
        border-bottom: 1px solid var(--p-line);
        vertical-align: middle;
    }
    .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td {
        padding: 9px 8px;
        font-size: 13px;
        line-height: 1.4;
        vertical-align: middle;
        color: var(--p-text);
    }
    .table-striped > tbody > tr:nth-of-type(odd) { background: #fafbfd; }
    .table-bordered, .table-bordered > thead > tr > th, .table-bordered > thead > tr > td,
    .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border-color: #e8edf3; }
    table.dataTable thead .sorting,
    table.dataTable thead .sorting_asc,
    table.dataTable thead .sorting_desc,
    table.dataTable thead .sorting_asc_disabled,
    table.dataTable thead .sorting_desc_disabled { padding-right: 22px; white-space: nowrap; }
    table.dataTable thead .sorting:after,
    table.dataTable thead .sorting_asc:after,
    table.dataTable thead .sorting_desc:after { right: 6px; top: 50%; margin-top: -7px; bottom: auto; }

    /* Row action buttons: uniform square icon buttons, two per row */
    .table td > a.btn, .table td > button.btn {
        width: 34px; height: 34px; min-height: 34px; min-width: 34px;
        padding: 0; margin: 2px; font-size: 13px;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .table td:first-child { min-width: 82px; }

    /* --- DataTables chrome ---------------------------------------- */
    .dataTables_wrapper { padding: 0; }
    .dataTables_wrapper > .row { margin: 0; }
    .dataTables_wrapper > .row > [class*="col-"] { padding: 0; }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter { margin: 0 0 10px; text-align: left; }
    .dataTables_wrapper .dataTables_length label {
        display: flex; align-items: center; gap: 8px; margin: 0;
        font-size: 13px; font-weight: 500; color: var(--p-muted); white-space: nowrap;
    }
    .dataTables_wrapper .dataTables_length select.form-control,
    .dataTables_wrapper .dataTables_length select { width: 76px; height: 40px; min-height: 40px; padding: 6px 8px; }
    .dataTables_wrapper .dataTables_filter label {
        display: block; margin: 0; font-size: 13px; font-weight: 600; color: var(--p-muted);
    }
    .dataTables_wrapper .dataTables_filter input.form-control,
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important; margin: 6px 0 0 !important; border: 1px solid #cdd6e1 !important;
    }
    .dataTables_wrapper .dataTables_info { padding: 6px 0 4px; font-size: 12.5px; color: var(--p-muted); text-align: center; }
    .dataTables_wrapper .dataTables_paginate { text-align: center; }
    .dataTables_wrapper .dataTables_paginate ul.pagination { margin: 4px 0 2px; }
    .pagination > li > a, .pagination > li > span { min-width: 40px; height: 40px; padding: 9px 10px; font-size: 13px; text-align: center; line-height: 20px; box-shadow: none !important; }
    .pagination > li:first-child > a, .pagination > li:first-child > span { border-radius: 8px 0 0 8px; }
    .pagination > li:last-child > a, .pagination > li:last-child > span { border-radius: 0 8px 8px 0; }

    .scroll-hint {
        background: none; padding: 0; margin: 0 0 6px;
        font-size: 11.5px; color: var(--p-muted); text-align: right;
    }

    /* --- Modals ---------------------------------------------------- */
    .modal-content { border: 0; border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 24, 40, .25); }
    .modal-header { padding: 14px 16px; border-bottom: 1px solid var(--p-line); }
    .modal-title { font-size: 17px; font-weight: 600; }
    .modal-body { padding: 14px 16px; }
    .modal-footer { padding: 12px 16px; border-top: 1px solid var(--p-line); display: flex; gap: 8px; justify-content: flex-end; }

    /* --- Footer ---------------------------------------------------- */
    .main-footer {
        margin-left: 0; padding: 14px 16px; font-size: 12.5px; line-height: 1.5;
        box-shadow: none; border-top: 1px solid var(--p-line); background: #fff;
    }

    /* --- Dashboard ------------------------------------------------- */
    .small-box { border-radius: 10px; margin-bottom: 12px; box-shadow: var(--p-shadow); }
    .small-box > .inner { padding: 14px; }
    .panel-body a { display: inline-block; padding: 4px 0; }
}

/* modify.css styles inputs with !important (square, neumorphic shadow, blue underline);
   on phones use one flat, rounded control style everywhere. */
@media (max-width: 767px) {
    .content-wrapper .form-control:not(.btn),
    .content-wrapper .form-control:not(.btn):focus,
    .content-wrapper .select2-container--default .select2-selection--single,
    .content-wrapper .select2-container--default .select2-selection--multiple {
        border-radius: 8px !important;
        box-shadow: none !important;
        border: 1px solid #cdd6e1 !important;
        background: #fff !important;
    }
    .content-wrapper .form-control:not(.btn):focus,
    .content-wrapper .select2-container--default.select2-container--open .select2-selection--single,
    .content-wrapper .select2-container--default.select2-container--focus .select2-selection--single {
        border-color: var(--m-primary) !important;
        box-shadow: 0 0 0 3px rgba(30, 128, 185, .15) !important;
    }
    .content-wrapper .form-control:not(.btn)[readonly],
    .content-wrapper .form-control:not(.btn)[disabled] { background: #f1f4f8 !important; }
    .content-wrapper .input-group .form-control:not(.btn):first-child,
    .content-wrapper .input-group .select2-container:first-child .select2-selection--single {
        border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important;
        border-right-width: 1px !important;
    }
    .content-wrapper .input-group .form-control:not(.btn):last-child { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
    .input-group .input-group-addon {
        border: 1px solid #cdd6e1 !important; border-right: 0 !important;
        border-radius: 8px 0 0 8px !important; background: #f1f4f8;
    }
    .dataTables_wrapper .dataTables_length select.form-control { border: 1px solid #cdd6e1 !important; }
}

@media (max-width: 767px) {
    /* Percent widths written inline on list tables (e.g. style="width:150%") stretch one
       column into a wide empty cell; let columns size to their content instead. */
    .table-scroll > table[style*="%"],
    .table-responsive > table[style*="%"] { width: auto !important; min-width: 100% !important; }
    /* Page action buttons may wrap their label instead of clipping it */
    .content-header .pull-right { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
    .content-wrapper .content-header .btn { white-space: normal; text-align: center; }
}

@media (max-width: 767px) {
    /* Header actions: one wrapping flex row (icon buttons share a line with text buttons) */
    .content-header .pull-right,
    .content-header .btn-group-page {
        display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; width: 100%;
    }
    .content-header .pull-right > * { flex: 1 1 auto; width: auto !important; min-width: 46px; }
    .content-header .pull-right > .btn-group { flex: 1 1 100%; }
}

@media (max-width: 767px) {
    /* List cells wrap (instead of one long name widening its whole column); long codes break. */
    table.dataTable > tbody > tr > td { white-space: normal !important; overflow-wrap: anywhere; min-width: 70px; }
    table.dataTable > tbody > tr > td:first-child { min-width: 82px; }
    table.dataTable > tbody > tr > td:has(> input[type="checkbox"]) { min-width: 0; text-align: center; }
}

@media (max-width: 767px) {
    .table > tbody > tr > td:first-child:has(> a.btn) { text-align: left; }
}

@media (max-width: 767px) {
    /* Tab panes sit inside a .box-body already: don't pad twice */
    .tab-content > .tab-pane > .panel-body { padding: 14px 0 0; }
    .tab-content > .tab-pane > .panel > .panel-body { padding: 14px; }
}

/* The native <select> behind a select2 must never take part in layout (keep it last: it has to
   beat the control-style rules above and the inline min-width:300px used in grid cells). */
@media (max-width: 767px) {
    .content-wrapper select.select2-hidden-accessible,
    .content-wrapper select.form-control.select2-hidden-accessible:not(.btn) {
        position: absolute !important;
        width: 1px !important; min-width: 0 !important;
        height: 1px !important; min-height: 0 !important;
        margin: -1px !important; padding: 0 !important; border: 0 !important;
        overflow: hidden !important; clip: rect(0 0 0 0) !important;
    }
}

@media (max-width: 767px) {
    /* Grid cells: the visible select2 now carries the 300px minimum the hidden select used to */
    .table td .input-group .select2-container { min-width: 300px; }
}

@media (max-width: 767px) {
    /* Row action buttons: 30px (still above WCAG 2.2's 24px minimum) with 6px between them */
    .table td > a.btn, .table td > button.btn {
        width: 30px; height: 30px; min-height: 30px; min-width: 30px;
        margin: 3px; font-size: 12px; border-radius: 6px !important;
    }
    .table td:first-child { min-width: 78px; }
    .pagination > li > a, .pagination > li > span { min-width: 36px; height: 36px; padding: 7px 8px; }
}

@media (max-width: 767px) {
    /* Icon-only header actions (+, delete) stay square and sit on the right; text buttons still fill the row */
    .content-header .pull-right { justify-content: flex-end; }
    .content-header .pull-right > .btn-icon { flex: 0 0 44px; min-width: 44px; width: 44px !important; padding: 0; }
}

@media (max-width: 767px) {
    .content-header .pull-right > a.btn.btn-icon,
    .content-header .pull-right > button.btn.btn-icon { flex: 0 0 44px; min-width: 44px; width: 44px !important; padding: 0; }
}

@media (max-width: 767px) {
    .content-header .static-col { position: static; }
    .content-header .pull-right.icon-actions {
        position: absolute; top: 12px; right: 12px; width: auto; margin: 0; gap: 8px; flex-wrap: nowrap;
    }
    .content-header.has-icon-actions > h1 { padding-right: 110px; }
}

/* ---- Header bar: everything vertically centred in the 50px bar ---- */
@media (max-width: 767px) {
    .main-header > .navbar > .fbr-status,
    .fbr-status {
        position: absolute !important;
        top: 10px; left: 58px;
        height: 30px; margin: 0 !important; padding: 0 10px !important;
        display: inline-flex !important; align-items: center;
        font-size: 12px !important; font-weight: 600; line-height: 1;
        gap: 6px !important; border-radius: 15px !important;
        animation: none !important; box-shadow: none !important;
        max-width: calc(100% - 128px);
    }
    .fbr-status .status-dot { width: 8px; height: 8px; flex: 0 0 8px; }
    .main-header > .navbar > img { position: absolute; top: 7px; left: 58px; margin: 0; }
    .main-header .navbar-custom-menu > .navbar-nav > .user-menu > a {
        display: flex; align-items: center; height: 50px; padding: 0 12px;
    }
    .navbar-nav > .user-menu > .dropdown-toggle .user-image {
        float: none; margin: 0; width: 30px; height: 30px; border: 2px solid rgba(255, 255, 255, .5);
    }
}

/* ---- Pagination: separate, evenly sized, readable buttons ---- */
@media (max-width: 767px) {
    .dataTables_wrapper .dataTables_paginate ul.pagination {
        display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 2px; padding: 0;
    }
    .dataTables_wrapper .dataTables_paginate ul.pagination > li { float: none; margin: 0; }
    .dataTables_wrapper .dataTables_paginate ul.pagination > li > a,
    .dataTables_wrapper .dataTables_paginate ul.pagination > li > span {
        float: none; display: flex; align-items: center; justify-content: center;
        min-width: 38px; height: 38px; margin: 0; padding: 0 12px; line-height: 1;
        font-size: 13px; font-weight: 600; color: #34445a;
        background: #fff; border: 1px solid #cdd6e1; border-radius: 8px;
    }
    .dataTables_wrapper .dataTables_paginate ul.pagination > li.active > a,
    .dataTables_wrapper .dataTables_paginate ul.pagination > li.active > a:hover {
        background: var(--m-primary); border-color: var(--m-primary); color: #fff;
    }
    .dataTables_wrapper .dataTables_paginate ul.pagination > li.disabled > a,
    .dataTables_wrapper .dataTables_paginate ul.pagination > li.disabled > a:hover {
        color: #9aa7b6; background: #f6f8fa; border-color: #e3e8ee; cursor: default;
    }
}

@media (max-width: 767px) {
    .dataTables_wrapper .dataTables_paginate ul.pagination > li > a { transform: none !important; box-shadow: none !important; }
}

/* ---- Tighter row actions + cleaner DataTables toolbar (phones) ---- */
@media (max-width: 767px) {
    .table td > a.btn, .table td > button.btn { margin: 2px; }
    .table td:first-child { min-width: 84px; }
    .table > tbody > tr > td:first-child { padding-left: 6px; padding-right: 6px; }

    /* Toolbar: search first (full width, with icon), then "Show N entries" */
    .dataTables_wrapper > .row:first-child { display: flex; flex-direction: column; margin: 0 0 4px; }
    .dataTables_wrapper > .row:first-child > [class*="col-"] { width: 100%; padding: 0; float: none; }
    .dataTables_wrapper > .row:first-child > [class*="col-"]:has(.dataTables_filter) { order: 1; }
    .dataTables_wrapper > .row:first-child > [class*="col-"]:has(.dataTables_length) { order: 2; }
    .dataTables_wrapper .dataTables_filter { margin: 0 0 10px; }
    .dataTables_wrapper .dataTables_filter label { font-size: 0; line-height: 0; }   /* hides the "Search:" caption, keeps the input */
    .dataTables_wrapper .dataTables_filter input.form-control,
    .dataTables_wrapper .dataTables_filter input {
        margin: 0 !important; font-size: 16px; padding-left: 40px;
        background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235d6c7e' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 13px center !important;
    }
    .dataTables_wrapper .dataTables_length { margin: 0 0 10px; }
    .dataTables_wrapper .dataTables_length label { font-size: 12.5px; font-weight: 500; gap: 6px; }
    .dataTables_wrapper .dataTables_length select.form-control,
    .dataTables_wrapper .dataTables_length select { width: 64px; height: 34px; min-height: 34px; padding: 4px 6px; font-size: 14px; }
}

/* ---- Sidebar drawer header with close button (phones only) ---- */
.sidebar-head { display: none; }
@media (max-width: 767px) {
    .sidebar-head {
        display: flex; align-items: center; justify-content: space-between;
        position: sticky; top: 0; z-index: 3;
        height: 50px; margin-top: -50px; padding: 0 8px 0 16px;
        background: var(--m-bg-header2); border-bottom: 1px solid rgba(255, 255, 255, .12);
    }
    .sidebar-head-title { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .3px; }
    .sidebar-close {
        width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
        display: inline-flex; align-items: center; justify-content: center;
        background: rgba(255, 255, 255, .14); color: #fff; font-size: 18px; line-height: 1;
        box-shadow: none; outline: none; cursor: pointer;
    }
    .sidebar-close:active, .sidebar-close:hover { background: rgba(255, 255, 255, .26); }
}

@media (max-width: 767px) {
    /* The drawer now owns its top strip, so drop the reserved header-height padding */
    .main-sidebar, .left-side { padding-top: 0 !important; }
    .sidebar-head { margin-top: 0; }
}

/* ---- Buttons keep their geometry in every state (phones) ----
   modify.css scales some controls on :hover/:focus; on touch screens :hover sticks after a tap,
   which made tapped buttons look enlarged. Colour feedback stays, size never changes. */
@media (max-width: 767px) {
    .btn:hover, .btn:focus, .btn:active, .btn.active, .btn.focus,
    .pagination li a:hover, .pagination li a:focus, .pagination li span:hover, .pagination li span:focus,
    .input-group .input-group-addon {
        transform: none !important;
    }
    .table td > a.btn:hover, .table td > a.btn:focus, .table td > a.btn:active,
    .table td > button.btn:hover, .table td > button.btn:focus, .table td > button.btn:active {
        width: 30px; height: 30px; min-width: 30px; min-height: 30px; padding: 0; margin: 2px;
    }
    .content-wrapper .btn:active { filter: brightness(.92); }
}
@media (hover: none) {
    /* no sticky hover colours after a tap */
    .btn-primary:hover { background: var(--m-primary) !important; }
    .btn-danger:hover { background: var(--m-danger) !important; }
    .btn-success:hover { background: var(--m-success) !important; }
    .btn-warning:hover { background: var(--m-warning) !important; }
    .btn-info:hover { background: var(--m-info) !important; }
    .btn-default:hover { background: var(--m-default) !important; }
}

/* ---- One layout for every action-button group (header + form footer) ----
   2 equal columns; an odd last button spans the row. Groups that contain icon-only
   buttons keep the compact flex layout above. */
@media (max-width: 767px) {
    .content-wrapper .content-header .pull-right:not(:has(> .btn-icon)),
    .content-wrapper .box-footer > .pull-right:not(:has(> .btn-icon)) {
        display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px;
        float: none !important; width: 100%; margin: 12px 0 0; justify-content: stretch;
    }
    .content-wrapper .box-footer > .pull-right:not(:has(> .btn-icon)) { margin: 0; }
    .content-wrapper .content-header .pull-right:not(:has(> .btn-icon)) > .btn,
    .content-wrapper .box-footer > .pull-right:not(:has(> .btn-icon)) > .btn {
        width: 100% !important; min-width: 0; margin: 0 !important; padding: 9px 6px;
        min-height: 44px; white-space: nowrap; font-size: 13px; gap: 6px; text-align: center; flex: none;
    }
    .content-wrapper .content-header .pull-right:not(:has(> .btn-icon)) > .btn:nth-last-child(1):nth-child(odd),
    .content-wrapper .box-footer > .pull-right:not(:has(> .btn-icon)) > .btn:nth-last-child(1):nth-child(odd) {
        grid-column: 1 / -1;
    }
    /* 3+ actions (Print, Print Undertaking, Cancel, Save): a single row. Icons are dropped so the
       labels fit; the row wraps only on very narrow screens. */
    .content-wrapper .content-header .pull-right:not(:has(> .btn-icon)):has(> .btn:nth-child(3)),
    .content-wrapper .box-footer > .pull-right:not(:has(> .btn-icon)):has(> .btn:nth-child(3)) {
        display: flex !important; flex-wrap: wrap; gap: 6px;
    }
    .content-wrapper .content-header .pull-right:not(:has(> .btn-icon)):has(> .btn:nth-child(3)) > .btn,
    .content-wrapper .box-footer > .pull-right:not(:has(> .btn-icon)):has(> .btn:nth-child(3)) > .btn {
        flex: 1 1 auto; width: auto !important; padding: 9px 7px; font-size: 13px;
    }
    .content-wrapper .box .box-footer:has(> .pull-right > .btn:nth-child(3)) { padding-left: 8px; padding-right: 8px; }
    .content-wrapper .content-header .pull-right:not(:has(> .btn-icon)):has(> .btn:nth-child(3)) > .btn > .fa,
    .content-wrapper .box-footer > .pull-right:not(:has(> .btn-icon)):has(> .btn:nth-child(3)) > .btn > .fa { display: none; }
    /* sale-invoice style print buttons carry a fixed 130px width and 18px icon */
    .pull-right > .btn > .fa { font-size: 16px !important; }
    /* hover tooltips make no sense on touch and inject nodes into button groups */
    .tooltip { display: none !important; }
}

/* ---- Dashboard tidy (phones) ---- */
@media (max-width: 767px) {
    /* link panels: modify.css pads .panel-collapse 15px on top of .panel-body */
    .content-wrapper .panel .panel-collapse { padding: 0; }
    .content-wrapper .panel > .panel-heading .panel-title a { font-size: 17px !important; }
    .panel-body > .row > [class*="col-md-3"] { padding: 5px 6px; line-height: 1.4; }
    .panel-body > .row > [class*="col-md-3"] > .fa { width: 22px; text-align: left; }
    .panel-body > .row { margin: 0; }
    /* "Latest ..." cards: title left, collapse tool right, one line */
    .content-wrapper .box-header.with-border { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .box-header .box-title { font-size: 16px; font-weight: 600; line-height: 1.3; margin-right: auto; text-align: left; }
    .box-header > .box-tools { position: static; margin: 0; float: none !important; }
    .box-header .btn-box-tool { min-height: 36px; min-width: 36px; padding: 0; box-shadow: none !important; background: transparent; }
    .box-footer.clearfix { display: flex; gap: 8px; }
    .box-footer.clearfix > .btn { float: none !important; flex: 1 1 0; margin: 0; }
    .box-footer.clearfix::before, .box-footer.clearfix::after { display: none; }
}

/* ---- Login + session picker (both use .login-page) ---- */
@media (max-width: 767px) {
    .login-page, .register-page { background: var(--p-bg, #f2f5f9); min-height: 100vh; }
    .login-box, .register-box { width: 100%; max-width: 420px; margin: 0 auto; padding: 32px 16px 24px; }
    .login-logo { margin-bottom: 18px; font-size: 30px; }
    .login-logo a { color: var(--p-text, #1f2d3d); }
    .login-box-body, .register-box-body {
        padding: 22px 18px; border: 0; border-radius: 12px;
        box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .08);
    }
    .login-box-msg, .register-box-msg { padding: 0 0 18px; font-size: 14px; color: var(--p-muted, #5d6c7e); }
    .login-box .form-group, .register-box .form-group { margin-bottom: 14px; }
    .login-box label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--p-muted, #5d6c7e); }
    .login-box .form-control:not(.btn), .register-box .form-control:not(.btn) {
        height: 46px; font-size: 16px; padding: 10px 12px; color: var(--p-text, #1f2d3d);
        border: 1px solid #cdd6e1 !important; border-radius: 8px !important;
        box-shadow: none !important; background: #fff !important;
    }
    .login-box .form-control:not(.btn):focus {
        border-color: var(--m-primary) !important; box-shadow: 0 0 0 3px rgba(30, 128, 185, .15) !important;
    }
    .login-box .has-feedback .form-control { padding-right: 44px; }
    .login-box .form-control-feedback { height: 46px; line-height: 46px; width: 44px; color: #8a99ab; }
    /* Sign-in / Submit: full-width primary action */
    .login-box .row > [class*="col-"] { width: 100%; margin-left: 0; float: none; padding: 0; }
    .login-box .row { margin: 0; }
    .login-box .btn-block { min-height: 46px; font-size: 15px; border-radius: 8px !important; margin-top: 4px; }
    .login-box select.form-control { appearance: auto; }
}

/* ==================================================================
   MODALS (phones): shared #_modal, static modals and bootbox dialogs.
   They live outside .content-wrapper, so the page-level control styles
   don't reach them; this block gives them the same look.
================================================================== */
@media (max-width: 767px) {
    .modal-backdrop.in { opacity: .5; }
    .modal { padding: 0 !important; }
    body .modal-dialog, .modal .modal-dialog, .bootbox .modal-dialog {
        margin: 12px !important;
        width: auto !important; max-width: none !important; min-width: 0 !important;
        display: block !important;
    }
    .modal-content {
        display: flex; flex-direction: column;
        max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
        border: 0; border-radius: 14px; overflow: hidden;
        box-shadow: 0 12px 32px rgba(16, 24, 40, .28);
    }

    /* Header: title + a proper 44px close target */
    .modal-header {
        display: flex; align-items: center; justify-content: space-between; gap: 8px;
        flex: 0 0 auto; padding: 12px 8px 12px 16px;
        background: #fff !important; color: var(--p-text, #1f2d3d) !important;
        border-bottom: 1px solid var(--p-line, #dde4ec);
        box-shadow: none; border-radius: 0;
    }
    .modal-header:before, .modal-header:after { display: none; }
    .modal-header .modal-title {
        flex: 1 1 auto; margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3;
        color: var(--p-text, #1f2d3d); min-width: 0; overflow-wrap: anywhere;
    }
    .modal-header .close {
        order: 2; float: none; flex: 0 0 44px; width: 44px; height: 44px; margin: 0; padding: 0;
        display: inline-flex; align-items: center; justify-content: center;
        font-size: 26px; font-weight: 400; line-height: 1; color: #5d6c7e; opacity: 1;
        text-shadow: none; border-radius: 50%; background: transparent;
    }
    .modal-header .close:active, .modal-header .close:hover { background: #eef2f6; color: #1f2d3d; }

    /* Body scrolls; footer stays pinned */
    .modal-body {
        flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
        padding: 14px 16px;
    }
    .modal-footer {
        flex: 0 0 auto; display: flex; gap: 8px; justify-content: flex-end;
        padding: 12px 16px; margin: 0; background: #fff;
        border-top: 1px solid var(--p-line, #dde4ec);
    }
    .modal-footer:before, .modal-footer:after { display: none; }
    .modal-footer .btn { flex: 1 1 0; margin: 0 !important; min-width: 0; }
    .modal-footer .btn + .btn { margin-left: 0 !important; }

    /* Controls in modals match the page controls */
    .modal .form-group { margin-bottom: 14px; }
    .modal label:not(.radio-inline):not(.checkbox-inline):not(.error) {
        display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--p-muted, #5d6c7e);
    }
    .modal .form-control:not(.btn),
    .modal .form-control:not(.btn):focus,
    .modal .select2-container--default .select2-selection--single {
        height: 44px; min-height: 44px; padding: 9px 12px; font-size: 16px; line-height: 1.35;
        color: var(--p-text, #1f2d3d);
        border: 1px solid #cdd6e1 !important; border-radius: 8px !important;
        box-shadow: none !important; background: #fff !important;
    }
    .modal textarea.form-control:not(.btn) { height: auto; min-height: 88px; }
    .modal .form-control:not(.btn):focus {
        border-color: var(--m-primary) !important; box-shadow: 0 0 0 3px rgba(30, 128, 185, .15) !important;
    }
    .modal .form-control:not(.btn)[readonly], .modal .form-control:not(.btn)[disabled] { background: #f1f4f8 !important; }
    .modal .btn, .modal .btn:focus {
        border-radius: 8px !important; box-shadow: 0 1px 2px rgba(16, 24, 40, .14) !important;
        min-height: 44px; padding: 9px 16px; font-size: 14px; line-height: 1.3;
        display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
    }
    .modal .table td > a.btn, .modal .table td > button.btn {
        width: 38px; height: 38px; min-height: 38px; min-width: 38px; padding: 0; margin: 2px;
    }
    .modal .btn:hover, .modal .btn:focus, .modal .btn:active { transform: none !important; }

    /* Tables / DataTables inside a modal (product quick-search, ledger, FBR log) */
    .modal .table-scroll, .modal .table-responsive { margin-bottom: 8px; }
    .modal .dataTables_wrapper .dataTables_filter { margin-bottom: 10px; }
    .modal .table > tbody > tr > td { font-size: 13px; }
    .modal table.dataTable > tbody > tr > td { white-space: normal !important; }

    /* modify.css pads header/body/footer 25px with a selector this specific; match it to win */
    .modal .modal-dialog .modal-content .modal-header { padding: 10px 6px 10px 16px; border-bottom: 1px solid var(--p-line, #dde4ec); }
    .modal .modal-dialog .modal-content .modal-body { padding: 14px 16px; }
    .modal .modal-dialog .modal-content .modal-footer { padding: 12px 16px; border-top: 1px solid var(--p-line, #dde4ec); background: #fff !important; }
    .bootbox.modal .modal-dialog .modal-content .modal-body { padding: 16px; }

    /* Bootbox dialogs (delete / print confirm, FBR log): message + two equal buttons */
    .bootbox .modal-body { padding: 18px 16px; font-size: 15px; line-height: 1.5; color: var(--p-text, #1f2d3d); }
    .bootbox .bootbox-close-button { position: static; margin: 0; }
    .bootbox .modal-footer .btn { min-height: 46px; font-weight: 600; }
    .bootbox .modal-footer .btn:only-child { flex: 1 1 100%; }

    /* The search box carries a placeholder, so drop the separate "Search:" caption (page + modal) */
    .dataTables_wrapper .dataTables_filter label { font-size: 0 !important; line-height: 0 !important; }
    .dataTables_wrapper .dataTables_filter label input { font-size: 16px !important; line-height: 1.35 !important; }

    /* Static wide modal (gl/module_setting scenario dashboard): its inner tabs/tables scroll, not the page */
    #testScenariosModal .modal-body { overflow: auto; }
    #testScenariosModal .nav-tabs { overflow-x: auto; }
}
