/* =============================================================================
 * Via Hive Admin - PHONE LAYER (web click-through 2026-10-22, P3)
 * -----------------------------------------------------------------------------
 * Loaded LAST (after vh2-lists.css). Same approach as the round-2 rules in vh2-readability.css (topbar) and
 * vh2-booking.css (Bookings): layout only, phone widths only, never overflow:hidden on .tile/.panel/.modal-content,
 * and the shell (topbar 60px, sidebar, content padding: D-430) is untouched.
 *
 * Scope: pages that opt in with the class .vh-phone-page on their root - Clients list, Providers list, Provider detail,
 * Transactions list, Messenger Safety, General Settings.
 *   - wide tables scroll sideways INSIDE their own container (.vhl-scroll); the page itself never scrolls sideways.
 *     The fixed-layout lists (Clients / Providers / Transactions) shared 266px between 7-8 columns at 390px: 10-20px
 *     columns, one letter per line, rows 290-460px tall. Below 768px they keep a readable width and scroll instead.
 *   - the page-bar (breadcrumb + toolbar buttons) wraps instead of floating next to the content (the floats pushed the
 *     summary tiles into a 178px column), and the toolbar buttons show their label again.
 *   - buttons, selects, text fields and pagination links are at least 44px high (touch target); selects were 20px.
 * ========================================================================== */

/* Every page, every width <= 992px: main.css hides the page-toolbar button label with display:none, which also removed
   the button's accessible name ("Export clients", "Deleted accounts", "Add provider" ... became unnamed icon buttons).
   The label stays visually hidden there but is read out. */
@media only screen and (max-width: 992px) {
  :root body .page-bar .page-toolbar .btn span {
    display: inline-block !important; position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
}

@media (max-width: 767px) {
  /* ---------------------------------------------------------------- page bar */
  :root body .vh-phone-page .pageheader .page-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  :root body .vh-phone-page .pageheader .page-bar .page-breadcrumb { flex: 1 1 100%; width: auto; }
  :root body .vh-phone-page .pageheader .page-bar .page-breadcrumb > li { display: inline-block; padding-left: 0; }
  :root body .vh-phone-page .pageheader .page-bar .page-toolbar { float: none; display: inline-flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
  :root body .vh-phone-page .pageheader .page-bar .page-toolbar .btn {
    width: auto; min-height: 44px; margin: 0; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  }
  :root body .vh-phone-page .pageheader .page-bar .page-toolbar .btn span {
    position: static !important; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; display: inline !important;
  }
  :root body .vh-phone-page .pagecontent { clear: both; }

  /* ------------------------------------------------------------- summary strip */
  :root body .vh-phone-page .vhl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* ------------------------------------------------------------------- tables */
  /* position: relative makes the scroller the containing block of the .sr-only spans in the cells (position: absolute):
     without it they escaped the scroller and made the whole page scroll sideways by ~80px once the table was wider than the screen */
  :root body .vh-phone-page .vhl-scroll, :root body .vh-phone-page .table-responsive { position: relative; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  :root body .vh-phone-page .vhl-scroll > table.vhl-table--fixed { min-width: 760px; }

  /* ----------------------------------------------------------------- toolbars */
  :root body .vh-phone-page custom-table .vhl-toolbar__search { min-width: 0; }
  :root body .vh-phone-page custom-table .vhl-toolbar__bulk select.form-control { min-width: 0; max-width: 100%; }
  :root body .vh-phone-page .vhl-filters__actions { flex-wrap: wrap; }
  :root body .vh-phone-page .vhl-footer, :root body .vh-phone-page .vhl-footer__pages { flex-wrap: wrap; max-width: 100%; }

  /* ------------------------------------------------------------ touch targets */
  :root body .vh-phone-page .btn,
  :root body .vh-phone-page button,
  :root body .vh-phone-page select.form-control,
  :root body .vh-phone-page select,
  :root body .vh-phone-page input.form-control:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    min-height: 44px;
  }
  :root body .vh-phone-page .vhl-rowact__more { min-width: 44px; }
  :root body .vh-phone-page .vhl-search .form-control { height: 44px; }
  /* the round "clear search" button keeps its look but gets a 44px hit area at the right edge of the field */
  :root body .vh-phone-page .vhl-search__clear { width: 44px; height: 44px; right: 0; background: transparent; }
  :root body .vh-phone-page ul.pagination > li > a,
  :root body .vh-phone-page ul.pagination > li > span {
    min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center;
  }

  /* ---------------------------------------------------- General Settings / forms */
  /* the on/off rows (Rest time, Wallet recharge, Cash ...) were floated at width:10% (24px): label and switch spilled out */
  :root body .vh-phone-page .form-group-6 { display: block; width: 100%; }
  :root body .vh-phone-page .tile-widget.p-20.cash-opt, :root body .vh-phone-page .tile-widget.p-20.wallet-switch {
    float: none; width: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  }
  /* the four image pickers (logo, light logo, favicon ...) shared one flex row: 58px each */
  :root body .vh-phone-page .form-group-3 { flex-wrap: wrap; }
  :root body .vh-phone-page .form-group-3 > .form-group { flex: 1 1 100%; max-width: 100%; }
  :root body .vh-phone-page .bootstrap-filestyle.input-group { display: flex; flex-wrap: wrap; max-width: 100%; }
  :root body .vh-phone-page .bootstrap-filestyle.input-group > .form-control { flex: 1 1 140px; min-width: 0; width: auto; }
  :root body .vh-phone-page .bootstrap-filestyle.input-group > .input-group-btn { width: auto; flex: 0 0 auto; }
  /* brand polish 2026-10-25: main.css keeps .form-group-1 / -2 fields at 24% / 49% width, so on a phone Site title, Email, Support number ...
     were 55px boxes with the values cut off and three-line labels: one field per row */
  :root body .vh-phone-page .form-group-1 .form-group, :root body .vh-phone-page .form-group-2 .form-group { display: block; width: 100%; float: none; }
  :root body .vh-phone-page .form-group-2 { flex-wrap: wrap; }
}
