/* Keep the desktop workspace unchanged; improve small-screen forms and navigation. */
.mobile-quick-actions { display: none; }
@media screen and (max-width: 767px) {
    html { zoom: 1; }
    body { min-width: 0; font-size: 14px; line-height: 1.5; }
    #app_wrapper, #content, .content-con { min-width: 0; max-width: 100%; }
    .lt { width: 100%; table-layout: fixed; }
    .lt td.content-con { width: 100%; min-width: 0; }
    #content { padding: 12px; }
    #header .navbar-brand { height: auto; min-height: 44px; padding: 10px 12px; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
    #header .btn-group.visible-xs { display: flex !important; float: none !important; justify-content: center; width: 100%; margin: 0; }
    #header .btn-group.visible-xs > .btn { min-width: 42px; min-height: 44px; margin: 0; padding: 10px; }
    #sidebar-left, #sidebar-left.minified { position: absolute; left: 0; top: 0; width: 320px; max-width: 90vw; padding: 0; z-index: 1030; }
    #sidebar_menu { width: 100%; max-height: 75vh; overflow-y: auto; overscroll-behavior: contain; }
    #sidebar_menu.in { padding: 10px; overflow-y: auto; box-shadow: 3px 5px 12px rgba(0, 0, 0, .25); }
    #sidebar_menu a { min-height: 44px; line-height: 1.5; }
    #sidebar-search-input { height: 44px; font-size: 16px; }
    .mobile-quick-actions { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin-bottom: 12px; padding: 10px 14px; text-align: left; }
    #admin-quick-links { display: none; }
    #admin-quick-links.is-open { display: block; }
    #admin-quick-links .btn { min-height: 44px; height: auto; white-space: normal; }
    #content .box .box-content { padding: 14px; }
    #content .box .box-header { height: auto; min-height: 48px; }
    #content .box .box-header h2 { float: none; font-size: 17px; line-height: 1.5; margin-right: 0; }
    #content .box .box-header .box-icon { float: none; display: flex; flex-wrap: wrap; }
    input.form-control, select.form-control, textarea.form-control,
    .modal input.form-control, .modal select.form-control { font-size: 16px; }
    input.form-control, select.form-control { min-height: 44px; }
    textarea.form-control { min-height: 96px; }
    .input-group { width: 100%; }
    .input-group .form-control { min-width: 0; }
    .input-group .input-group-addon, .input-group .btn { min-width: 42px; }
    .select2-container { max-width: 100%; }
    .select2-container .select2-choice { min-height: 44px; line-height: 42px; font-size: 16px; }
    .select2-container .select2-choice .select2-arrow b { background-position-y: 8px; }
    .select2-search input { min-height: 44px; font-size: 16px; }
    .select2-results .select2-result-label { min-height: 44px; padding: 10px; }
    .table-controls, .table-responsive, .dataTables_scrollBody, .mobile-table-scroll {
        display: block; width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    }
    .table-controls:focus-visible, .mobile-table-scroll:focus-visible { outline: 2px solid #1686c7; outline-offset: 2px; }
    .table-controls table.items { min-width: 700px; }
    .table-controls table.items th, .table-controls table.items td { padding: 9px 8px; vertical-align: middle; }
    .table-controls table.items th:first-child { min-width: 160px; }
    .table-controls table.items input { min-height: 40px; min-width: 64px; font-size: 16px; }
    #bottom-total { position: static !important; bottom: auto !important; width: 100% !important; margin-top: 16px; padding: 8px; }
    #bottom-total table, #bottom-total tbody { display: block; width: 100%; }
    #bottom-total tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #bottom-total td { display: flex; flex-wrap: wrap; gap: 4px; justify-content: space-between; min-width: 0; padding: 10px 8px; font-size: 14px; white-space: normal; }
    #bottom-total td:last-child { grid-column: 1 / -1; font-weight: bold; background: #eaf5ff; }
    .form-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 0; }
    .form-actions .btn, input[type="submit"], button[type="submit"] { min-height: 44px; white-space: normal; }
    .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_length { float: none; text-align: left; margin: 8px 0; }
    .dataTables_wrapper .dataTables_filter input { max-width: 100%; font-size: 16px; min-height: 40px; }
    .dataTables_wrapper .pagination { display: flex; flex-wrap: wrap; gap: 2px; }
    .dataTables_wrapper .pagination > li > a { min-width: 40px; min-height: 40px; }
    .mobile-table-scroll .btn-group.open > .dropdown-menu {
        position: fixed; top: auto !important; left: 12px !important; right: 12px !important; bottom: 12px;
        width: auto; max-height: 65dvh; overflow-y: auto; z-index: 1060;
    }
    .mobile-table-scroll .dropdown-menu > li > a { min-height: 44px; padding: 11px 16px; }
    .modal-dialog { width: auto !important; max-width: calc(100% - 20px); margin: 10px auto; }
    .modal-content { max-width: 100%; }
    .modal-header, .modal-footer { padding: 14px; }
    .modal-body { max-height: calc(100dvh - 170px); overflow-y: auto; padding: 14px; }
    .modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
    .modal-footer .btn { min-height: 44px; margin: 0; }
    .redactor_toolbar { display: flex; flex-wrap: wrap; }
    .nav-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
    .nav-tabs > li { flex: 0 0 auto; float: none; }
    .nav-tabs > li > a { min-height: 44px; }
    body.login-page { min-width: 0; }
    .login-page .page-back { padding: 24px 0; min-height: 100dvh; }
    .login-page .page-back > .container { width: 100%; max-width: 440px; padding: 0 16px; }
    .login-page .login-info-panel { display: none !important; }
    .login-page .login-form-panel { width: 100%; float: none; padding: 0; }
    .login-page .login-form-div { max-width: 100%; }
    .login-page .login-form .form-control { min-height: 48px; font-size: 16px; }
    .login-page img { max-width: min(100%, 220px); height: auto; }
}
@media screen and (min-width: 768px) and (max-width: 1023px) {
    html { zoom: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .login-page .flowers { display: none; }
}

/* Purchase search stays anchored inside its input group at every CSS zoom. */
#sticker.purchase-item-search { position: sticky; float: none; clear: both; }
.purchase-product-suggestions { box-sizing: border-box; overflow-y: auto; overflow-x: hidden; z-index: 1050; }
.purchase-product-suggestions .ui-menu-item a { white-space: normal; overflow-wrap: anywhere; }
