/* =============================================================================
 * Via Hive Admin - READABILITY LAYER (D-434, Founder FAIL of the served Admin candidate: "you can't read it")
 * -----------------------------------------------------------------------------
 * Loaded after vh2-style.css. Global, page-independent rules only: type floors, contrast, sidebar rhythm,
 * table cell / header legibility, chips, helper text and the generic tile / panel spacing.
 * It does NOT change the shell (topbar 60px, sidebar widths, content padding: vh2-shell.css / vh2-base.css stay frozen),
 * the font family (Inter) or the D-430 palette/components; it only lifts sizes and contrast that hurt reading.
 *
 * FLOORS (guarded by scripts/verify-admin-readability.js):
 *   table cell text >= 13px, table header >= 12px, chips / labels / badges >= 12px, helper / muted / sidebar group >= 12px,
 *   muted text colour >= 4.5:1 on its surface in light and dark, no `overflow: hidden` on .tile/.panel/.modal-content (popups clip).
 * Selectors are prefixed `:root body` to beat the legacy bridge (viahive-admin.css uses !important for the 10.5px header and chip sizes).
 * ========================================================================== */

/* ------------------------------------------------------------------ sidebar */
/* group headings were 11px with ~4px of air above them, so they read as part of the previous item */
:root body .vh2-sidebar__nav .vh2-sidebar__group {
  margin: 0; padding: 20px var(--vh2-s3) 6px;
  font-size: 12px; line-height: 16px; letter-spacing: .06em; font-weight: 700;
  color: var(--vh2-text-secondary);
}
:root body .vh2-sidebar__nav > div:first-child .vh2-sidebar__group { padding-top: 8px; }
:root body .vh2-sidebar__sub li a { font-size: 14px; padding: 7px var(--vh2-s2); color: var(--vh2-text-secondary); }
:root body .vh2-sidebar__sub li a:hover { color: var(--vh2-text-primary); }
:root body .vh2-topbar__search kbd { font-size: 12px; }

/* ----------------------------------------------------------- page structure */
:root body .page-breadcrumb li, :root body .page-breadcrumb li a, :root body .breadcrumb > li, :root body .breadcrumb > li > a { font-size: 14px; }
:root body .page-header small, :root body .pageheader small, :root body .help-block, :root body .vh-muted, :root body .vh-hint, :root body small, :root body .small {
  font-size: 12px;
}
:root body .text-muted, :root body .vh-muted, :root body .help-block, :root body small, :root body .vh-ops__hint, :root body .vh-ops__note, :root body .vh-ops__foot {
  color: var(--vh2-text-secondary) !important;
}
/* inline validation / error text written as style="color:red" (pure red is 4.0:1 on white) */
:root body [style*="color:red"], :root body [style*="color: red"], :root body [style*="color:#f00"], :root body [style*="color: rgb(255, 0, 0)"],
:root body .text-danger, :root body .has-error .help-block, :root body .has-error .control-label { color: var(--vh2-danger-fg) !important; }
:root body label, :root body .control-label { font-size: 14px; }

/* ------------------------------------------------------------------- tables */
/* INTEGRATION (D-434): the `inherit` rule below must not flatten the type scale of the list lane's cell pattern (.vhl-cell__primary 14px, __secondary 12.5px, chips 12.5px) or the booking lane's (.vhbk-*): both own their cell sizes. */
/* header: 10.5px uppercase grey -> 12px, strong enough to scan; cell: 12px -> 13.5px; cells keep a ~44px row without the 16px side padding */
:root body table thead th,
:root body .table > thead > tr > th,
:root body table.listtable > thead > tr > th,
:root body .custom-table thead th {
  font-size: 12px !important; line-height: 1.35; letter-spacing: .04em !important; font-weight: 700 !important;
  padding: 10px 12px !important;
  color: var(--vh2-text-secondary) !important;
}
:root body table thead th :is(span, a, strong, div, label) { font-size: inherit !important; letter-spacing: inherit !important; }
:root body .table > tbody > tr > td,
:root body table.listtable > tbody > tr > td,
:root body .custom-table tbody td {
  font-size: 14px !important; line-height: 1.45;
  padding: 10px 12px !important;
  color: var(--vh2-text-primary);
}
:root body .table > tbody > tr > td :is(span, div, a, p, strong, b, em, i):not(.label):not(.badge):not(.vh-badge):not(.vh2-badge):not(.btn):not(.fa):not(.vh-badge--sm):not(.text-muted):not(small):not([class*="vhl-"]):not([class*="vhbk-"]),
:root body table.listtable > tbody > tr > td :is(span, div, a, p, strong, b, em):not(.label):not(.badge):not(.vh-badge):not(.vh2-badge):not(.btn):not(.fa):not(.vh-badge--sm):not(.text-muted):not(small):not([class*="vhl-"]):not([class*="vhbk-"]) {
  font-size: inherit !important;
}
:root body .table > tbody > tr > td .text-muted, :root body .table > tbody > tr > td small, :root body table.listtable > tbody > tr > td .text-muted { font-size: 14px !important; }
:root body .table > tbody > tr > td.vh-num, :root body .table > tbody > tr > td .vh-num { font-variant-numeric: tabular-nums; }
:root body .table > tbody > tr > td > .btn, :root body table.listtable > tbody > tr > td .btn-xs, :root body table.listtable > tbody > tr > td .btn-sm { font-size: 12px; }
/* empty-state row ("No data available") reads as a message, not as a cell */
:root body .table > tbody > tr > td[colspan], :root body table.listtable > tbody > tr > td[colspan] { padding: 18px 12px !important; color: var(--vh2-text-secondary); text-align: center; }

/* wide tables: scroll INSIDE their own container (never overflow:hidden on .tile/.panel/.modal-content), thin but visible scrollbar */
:root body custom-table .tile-body, :root body .table-responsive, :root body .vh-table-scroll {
  scrollbar-width: thin; scrollbar-color: var(--vh2-border-strong) transparent;
}
:root body custom-table .tile-body::-webkit-scrollbar, :root body .table-responsive::-webkit-scrollbar { height: 10px; }
:root body custom-table .tile-body::-webkit-scrollbar-thumb, :root body .table-responsive::-webkit-scrollbar-thumb { background: var(--vh2-border-strong); border-radius: var(--vh2-r-pill); }

/* --------------------------------------------------- status chips / badges */
:root body .label, :root body .badge, :root body .vh-badge, :root body .vh2-badge, :root body .vh-badge--sm {
  font-size: 12px !important; line-height: 1.35 !important; padding-top: 3px !important; padding-bottom: 3px !important;
  white-space: nowrap; letter-spacing: 0;
}

/* ------------------------------------------------------ stat tiles / cards */
:root body .vh-stat__label, :root body .vh2-stat__label, :root body .vh2-kpi__label { font-size: 12px; }
:root body .vh-stat__meta, :root body .vh2-stat__meta, :root body .vh2-kpi__meta { font-size: 12px; }
:root body .feature-box-container .card .front span { font-size: 14px; }
/* generic small count tiles (.tile.list-task, e.g. Financial Alerts) sat edge to edge with no gutter and no padding */
/* INTEGRATION (D-434): .tile.list-task is ALSO the card that wraps whole tables (Bookings, Earnings, Financial Alerts sections); the count-tile rules below must only reach a tile that holds no table / header, otherwise every span in a table cell became display:block (Bookings rows 50px -> 68px) */
:root body .tile.list-task:not(:has(table, custom-table, .tile-header)) { padding: 14px 10px; margin-bottom: 16px; }
:root body .col-md-2point4 { padding-left: 8px; padding-right: 8px; box-sizing: border-box; }
:root body .tile.list-task:not(:has(table, custom-table, .tile-header)) h1 { margin: 0 0 4px; }
:root body .tile.list-task:not(:has(table, custom-table, .tile-header)) span { font-size: 14px; line-height: 1.3; display: block; }
/* body copy / descriptions placed straight inside a panel or tile were flush with the card edge */
:root body .tile > p, :root body .panel > p, :root body .tile-body > p:not([class]), :root body .panel-body > p:not([class]) { font-size: 14px; line-height: 1.5; }
:root body .tile > p, :root body .panel > p { padding: 10px 20px 0; margin: 0; }
:root body .tile > .vh-muted, :root body .tile > .vh-ops__hint { display: block; padding: 10px 20px 0; }

/* --------------------------------------------------------- modals / toasts */
:root body .modal-body { font-size: 14px; line-height: 1.5; }
:root body .modal-title { font-size: 18px; }
:root body #toast-container > div, :root body .toast { font-size: 14px; line-height: 1.45; opacity: 1; }

/* ----------------------------------------------- topbar: language / profile (AD-3) */
:root body .vh2-topbar__lang {
  height: var(--vh2-control-h); padding: 0 var(--vh2-s3) !important; border-radius: var(--vh2-r-pill) !important;
  border: 1px solid var(--vh2-border-default) !important; background: var(--vh2-surface) !important; color: var(--vh2-text-primary) !important;
  font-size: 14px; font-weight: 600; width: auto; min-width: 0; line-height: normal;
}
:root body .vh2-topbar__profile { color: var(--vh2-text-primary); font-weight: 600; }
:root body .vh2-topbar__profile:hover { color: var(--vh2-brand-text); text-decoration: underline; }
:root body .vh2-sidebar__visit { display: block; margin: 12px var(--vh2-s3) 0; padding: 8px var(--vh2-s3); font-size: 14px; font-weight: 600; color: var(--vh2-text-secondary); border-top: 1px solid var(--vh2-border-subtle); }
:root body .vh2-sidebar__visit:hover { color: var(--vh2-brand-text); }
:root body .vh2-shell--rail .vh2-sidebar__visit { display: none; }

/* list tables: a column never collapses below a readable width (date / phone / "Not available" were squeezed to 3-line wraps, rows 128px tall) */
/* INTEGRATION (D-434): not for the list lane's tables (.vhl-table): they own their column budgets; a 7.5em floor made Amount / Updated / Payment 101px each and pushed the Bookings list into sideways scroll at 1366-1440 */
:root body table.listtable:not(.vhl-table) > tbody > tr > td:not(:first-child) { min-width: 7.5em; }
:root body table.listtable > tbody > tr > td .label + .label { margin-top: 4px; }
/* row-action cells (Manage / Suspend / Delete ...) stay on one line instead of stacking three 38px buttons (row 132px -> ~58px) */
/* INTEGRATION (D-434): white-space inherits, so the one-line rule is limited to cells that actually hold legacy action buttons; plain text, links and the list lane's cell pattern wrap / truncate by their own rules */
:root body table.listtable > tbody > tr > td content-item:has(.btn) { white-space: nowrap; }
:root body table.listtable > tbody > tr > td content-item .btn + .btn { margin-left: 4px; }

/* INTEGRATION (D-434): when General Settings > Theme returns fixed_header / fixed_aside = "true" the legacy bridge turns #content into
   position:absolute (top 45px, left 250px, bottom 0), which takes it out of .vh2-shell__content's scroll area: the page then CANNOT scroll in
   the V2 shell (reproduced with the mocked value; the real DEV value could not be read, the database being down). The V2 shell positions
   content itself, so the legacy offsets never apply. */
html[data-vh2="on"] .vh2-shell__content #content { position: static !important; inset: auto !important; width: auto !important; }

/* INTEGRATION (D-434): bootstrap-filestyle keeps the real <input type=file> visually clipped (clip: rect(0,0,0,0)) but at its 301px form-control width.
   On General Settings the fourth (Favicon) input sat 20px past the right edge of the tile at 1366px, so the tile-body (overflow-x:auto) showed a
   sideways scrollbar for an invisible control. The clipped input needs no width: the visible "Select file" button opens the picker. */
html[data-vh2="on"] .vh2-shell__content .tile-body input[type="file"].filestyle { max-width: 1px; }

/* ----------------------------------------------- topbar at phone width (web click-through 2026-10-22, R9)
   At 390px the right-hand group (pending, language, theme, user, sign-out) was wider than the space left, so the sign-out icon was cut off
   at the right edge. Below 480px the group packs tighter: the pending pill shows its count only (the link keeps an aria-label with the word),
   the language select and the user name are capped (the name ellipsises), and the search and sign-out icons never shrink. The topbar box
   itself (60px, padding) is untouched (D-430). */
@media (max-width: 480px) {
  :root body .vh2-topbar__search { flex: 0 0 auto; }
  :root body .vh2-topbar__right { gap: var(--vh2-s2); min-width: 0; }
  :root body .vh2-topbar__pending { padding: 0 var(--vh2-s2); gap: var(--vh2-s1); }
  :root body .vh2-topbar__pending-word { display: none; }
  :root body .vh2-topbar__lang { max-width: 64px; padding: 0 var(--vh2-s2) !important; }
  :root body .vh2-topbar__user { min-width: 0; }
  :root body .vh2-topbar__user > a.vh2-topbar__profile, :root body .vh2-topbar__user > span { display: inline-block; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
  :root body .vh2-topbar__logout { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; }
}
/* brand polish 2026-10-25: form selects outside the list toolbars collapsed to their 21px text line (the zero vertical padding in vh2-style.css
   + height:auto), so Gender / Status / filter selects sat as thin strips next to 40px inputs. Give a single select the input height; the list
   toolbars keep their own fixed 34-36px selects. */
:root body select.form-control:not([multiple]) { min-height: 40px; }
:root body custom-table select.form-control, :root body .vh2-topbar select { min-height: 0; }
