/* LAYOUT-STABLE-1 — stop pages and tables from shifting while they load. Loaded after aeux-theme.css. Presentation only.
   Causes fixed: (1) the scrollbar appearing/disappearing between pages moved all content ~15px sideways; (2) the back pill is
   injected by JS after first paint and pushed the title right; (3) fallback font -> Inter swap changed text width/height;
   (4) table columns re-flowed when real rows replaced the skeleton; (5) skeleton rows were taller than real rows;
   (6) the category filter changed width once categories loaded. */

/* (3) fallback face with Inter-like metrics, so the swap to Inter barely moves text */
@font-face { font-family: 'Inter Fallback'; src: local('Arial'), local('Helvetica Neue'), local('Helvetica'); size-adjust: 107.4%; ascent-override: 90.2%; descent-override: 22.48%; line-gap-override: 0%; }
:root { --font: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

@media screen and (min-width: 861px) {
  /* (1) the canvas panel is the scroller: always reserve the scrollbar lane so short pages and long pages share one content width */
  .main { scrollbar-gutter: stable; }

  /* (2) reserve the back pill's slot (36px + 10px margin) until js/aeux-shell.js inserts it; same width, so nothing moves */
  .page-head:not(:has(.ax-back))::before { content: ""; flex: none; width: 46px; height: 32px; }

  /* (4) Products + Orders: fixed column grid in the default (lean) view. "All columns" keeps the automatic layout. */
  .dt-products:not(.show-all), .dt-orders:not(.show-all) { table-layout: fixed; width: 100%; min-width: 760px; }
  .dt-products:not(.show-all) tbody td, .dt-orders:not(.show-all) tbody td { overflow: hidden; text-overflow: ellipsis; }
  /* Products: select | Product (fills) | Status | Inventory | Category | Price | (Date added hidden) | Actions */
  #view-products .dt-products:not(.show-all) thead th:nth-child(3) { width: 130px; }
  #view-products .dt-products:not(.show-all) thead th:nth-child(4) { width: 190px; }
  #view-products .dt-products:not(.show-all) thead th:nth-child(5) { width: 170px; }
  #view-products .dt-products:not(.show-all) thead th:nth-child(6) { width: 130px; }
  /* Orders: select | Order | (Channel hidden) | Customer (fills) | (Phone, Items hidden) | Total | (Delivery, Method hidden) | Payment status | Order status | Date | Actions */
  #view-orders .dt-orders:not(.show-all) thead th:nth-child(2) { width: 120px; }
  #view-orders .dt-orders:not(.show-all) thead th:nth-child(7) { width: 130px; }
  #view-orders .dt-orders:not(.show-all) thead th:nth-child(10),
  #view-orders .dt-orders:not(.show-all) thead th:nth-child(11),
  #view-orders .dt-orders:not(.show-all) thead th:nth-child(12) { width: 150px; }
  #view-orders .dt-orders:not(.show-all) thead th:first-child { width: 40px; }

  /* (5) skeleton rows = the height of a real row (48px + 1px hairline), so swapping them in does not change the table height per row */
  .sk-tr, .sk-tr > td { height: 49px; }
  .sk-trow { height: 48px; padding: 0 12px; box-sizing: border-box; }
  .sk-trow .sk-trow-ico { width: 32px; height: 32px; }

  /* (6) filter selects: fixed widths (long names ellipsize) so loading categories does not resize the toolbar */
  #prodStatusFilter { width: 120px; }
  #prodCategoryFilter { width: 150px; text-overflow: ellipsis; }
  #prodStockFilter { width: 112px; }
}
