/* ============================================================================
   ADS - wide-screen safety layer  (31-ads-wide-screens.css)
   ----------------------------------------------------------------------------
   LAYOUT ONLY. No markup, IDs, JS, roles or API calls are touched.
   Load LAST in Core/templates/_styles.html (after 30-ads-edit-ticket-compact.css).
   Roll back by deleting this file's <link> line.

   Why this exists
   1. .main-content is `flex:1` with no `min-width:0`. A flex item cannot shrink below its content, so any
      nowrap / min-width table (the tickets table has min-width:760px + nowrap cells) can push the whole
      page wider than the viewport. That is what makes the grid look "scrambled" instead of just wide.
   2. Larger screens are scaled with CSS zoom so they render exactly like the 1366px laptop layout.
   ========================================================================== */

/* 1. Shell: let the content column shrink instead of overflowing ------------ */
html body .main-content { min-width: 0 !important; }
html body .page-screen { min-width: 0 !important; max-width: 100% !important; }
html body .page-screen .page-body { min-width: 0 !important; box-sizing: border-box !important; }

/* Wide tables scroll inside their own wrapper, never the page */
html body #page-dashboard .tickets-table-wrap,
html body #page-dashboard #dash-exceptions-table-wrap,
html body #page-dashboard .dash-bottom-row .timesheet-table-wrap { max-width: 100% !important; overflow-x: auto !important; }

/* 2. Every screen larger than a laptop renders like the 1366px laptop view ---
   Browser zoom is what made 1920x1080 look right (150% zoom = 1280 CSS px). This reproduces that automatically
   with CSS zoom, in steps, so 1440 / 1536 / 1600 / 1680 / 1920 / 2560 wide screens all get the same effective
   width (about 1280-1340 CSS px) and therefore the same dashboard layout, text size and spacing as the laptop.
   Applies to every screen of the app, not only the dashboard. To tune: change a zoom value.
   To switch this off: delete section 2.  (CSS zoom: Chrome/Edge, Firefox 126+, Safari.) */
@media (min-width: 1400px) and (max-width: 1499px) { html { zoom: 1.1; } }
@media (min-width: 1500px) and (max-width: 1599px) { html { zoom: 1.2; } }
@media (min-width: 1600px) and (max-width: 1679px) { html { zoom: 1.25; } }
@media (min-width: 1680px) and (max-width: 1799px) { html { zoom: 1.3; } }
@media (min-width: 1800px) and (max-width: 2199px) { html { zoom: 1.5; } }
@media (min-width: 2200px) and (max-width: 2999px) { html { zoom: 2; } }
@media (min-width: 3000px)                         { html { zoom: 2.5; } }

/* the dashboard needs no width cap once the effective width is laptop-sized */
@media (min-width: 1400px) {
  html body #page-dashboard { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
}
