/* S-V (2026-10-28, Eric) — phone & tablet layout for every page. The PC layout (992 px and wider) is not changed.
 *  1. Bottom bar (includes/lms_mobile.php): Add · Orders · Loads · Clock (or Customers) · More — below 992 px, where the sidebar hides.
 *  2. Phones (below 576 px): every Bootstrap window is full screen, with Save / Cancel pinned at the bottom.
 *  3. Phones and small tablets (below 768 px): 16 px text in every box (stops the iPhone zooming in) and at least 44 px tall.
 */
.lms-bb-bar, .lms-bb-sheet, .lms-bb-sheet-bg { display: none; }

@media (max-width: 991.98px) {
  body.lms-bb { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body.lms-bb .page-footer { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .lms-bb-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035; background: #fff;
                border-top: 1px solid #d5dce6; box-shadow: 0 -2px 10px rgba(0,0,0,.10); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .lms-bb-bar a, .lms-bb-bar button { flex: 1 1 0; min-width: 0; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
                                      color: #5d6b7c; font-size: .74rem; font-weight: 600; border: 0; background: none; text-decoration: none; padding: 0 2px; }
  .lms-bb-bar i, .lms-bb-bar svg { font-size: 1.3rem; }
  .lms-bb-bar .on { color: #214373; box-shadow: inset 0 3px 0 #1fa9e1; }
  .lms-bb-bar .lms-bb-add i, .lms-bb-bar .lms-bb-add svg { color: #fff; background: #1ab33c; border-radius: 50%; width: 30px; height: 30px; line-height: 30px; font-size: 1rem; text-align: center; padding: 0; box-sizing: border-box; }
  .lms-bb-bar .lms-bb-add svg { padding: 7px; }
  .lms-bb-bar .lms-bb-dot { position: absolute; margin-left: 16px; margin-top: -26px; width: 9px; height: 9px; border-radius: 50%; }
  .lms-bb-bar .lms-bb-due { background: #d93025; box-shadow: 0 0 0 2px #fff; }   /* T16: tonight's count not done */
  /* things that sat on the bottom edge move up above the bar */
  body.lms-bb #oc_page .oc-float, body.lms-bb #lc_page .lc-float, body.lms-bb #cc_page .cc-float { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  body.lms-bb #ao_page .ao-bar { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  body.lms-bb #toast-container.toast-bottom-right, body.lms-bb #toast-container.toast-bottom-center { bottom: 76px; }
  /* Clock panel */
  .lms-bb-sheet-bg.open { display: block; position: fixed; inset: 0; background: rgba(20,30,45,.45); z-index: 1040; }
  .lms-bb-sheet.open { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1041; background: #fff;
                       border-radius: 14px 14px 0 0; max-height: 80vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .lms-bb-sheet .lms-bb-hd { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid #e3e8ef; color: #214373; font-size: 1.05rem; }
  .lms-bb-sheet .lms-bb-hd button { width: 44px; height: 44px; border: 0; background: none; font-size: 1.4rem; color: #5d6b7c; }
  .lms-bb-sheet .lms-bb-bd { padding: .9rem 1rem 1.1rem; overflow-y: auto; font-size: 1rem; }
  .lms-bb-sheet .lms-bb-btns { display: flex; flex-direction: column; gap: .55rem; margin-top: .8rem; }
  .lms-bb-sheet .lms-bb-btns .btn { min-height: 56px; font-size: 1.1rem; }
}

@media (max-width: 767.98px) {
  .page-content input.form-control, .page-content select.form-control, .page-content textarea.form-control, .page-content .custom-select,
  .modal input.form-control, .modal select.form-control, .modal textarea.form-control, .modal .custom-select,
  .dataTables_filter input, .dataTables_length select, .select2-container .select2-selection, .select2-search__field,
  .ui-autocomplete-input { font-size: 16px !important; }
  .page-content input.form-control:not([type=checkbox]):not([type=radio]), .page-content select.form-control, .page-content .custom-select,
  .modal input.form-control:not([type=checkbox]):not([type=radio]), .modal select.form-control, .modal .custom-select,
  .dataTables_filter input { min-height: 44px; }
  .select2-container .select2-selection--single { min-height: 44px; }
  .select2-container .select2-selection--single .select2-selection__rendered { line-height: 42px; }
  .custom-control-label { padding-top: 2px; }
  .custom-control-label::before, .custom-control-label::after { width: 1.25rem; height: 1.25rem; }
}

@media (max-width: 575.98px) {
  .modal-dialog, .modal-dialog.modal-sm, .modal-dialog.modal-md, .modal-dialog.modal-lg, .modal-dialog.modal-xl { margin: 0; max-width: 100%; width: 100%; min-height: 100%; }
  .modal-dialog-centered { align-items: stretch; min-height: 100%; }
  .modal-dialog-scrollable { max-height: 100%; height: 100%; }
  .modal-dialog-scrollable .modal-content { max-height: 100vh; }
  .modal-content { min-height: 100vh; min-height: 100dvh; border-radius: 0; border: 0; }
  .modal-header { position: sticky; top: 0; z-index: 3; border-radius: 0; }
  .modal-footer { position: sticky; bottom: 0; z-index: 3; background: #fff; margin-top: auto; flex-wrap: nowrap; padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }
  .modal-footer > .btn, .modal-footer > a.btn { flex: 1 1 0; min-height: 50px; font-size: 1rem; }
  .modal-header .close { min-width: 44px; min-height: 44px; }
  /* payments window: each payment as a small card instead of a wide table */
  #lms-payment-summary-table thead { display: none; }
  #lms-payment-summary-table, #lms-payment-summary-table tbody { display: block; width: 100%; }
  #lms-payment-summary-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .5rem; border: 1px solid #dce2ea; border-radius: 8px; margin-bottom: .5rem; padding: .35rem .5rem; }
  #lms-payment-summary-table td { border: 0 !important; padding: .15rem 0 !important; }
  #lms-payment-summary-table td:nth-child(1) { font-weight: 700; font-size: 1.05rem; }
  #lms-payment-summary-table td:nth-child(5), #lms-payment-summary-table td:nth-child(6) { flex: 1 1 100%; text-align: left !important; }
  #lms-payment-summary-table td:nth-child(6) .btn { min-height: 38px; padding: .3rem .8rem; font-size: .85rem; }
  #lms-payment-summary-table tr.lms-rc-hiderow td { flex: 1 1 100%; }
}

@media print { .lms-bb-bar, .lms-bb-sheet, .lms-bb-sheet-bg { display: none !important; } body.lms-bb { padding-bottom: 0; } }
