/* iPad layout — records (Jordan 11 Nov 2026, iPad Pro 12.9" landscape 1366 × 1024).
   Every rule starts with html.ed-touch. */

/* ── 1. Lists: Customers, Vehicles, Un-Invoiced Jobs fit the page, no lateral scroll ─────────
   Jordan 11 Nov 2026: "needs to be reconfigured for single page view, no horizontal scroll".
   The table is fixed to the page width. Each column gets its own width; the less important
   columns get NO width (they stay in the table, so the "Filtered" total rows under the list
   still line up, but they take no room and are not seen). The main column (Name, Vehicle,
   Customer) takes what is left. Names go to a second line at a space, never in the middle of a
   word; an email or reference that is too long ends in "…". */
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table,
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table,
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table { table-layout: fixed; width: 100%; }
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table :is(th, td),
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table :is(th, td),
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table :is(th, td) { overflow: hidden; overflow-wrap: normal; word-break: normal; }
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table td :is(.fi-ta-col-wrp, .fi-ta-col-wrp > a, .fi-ta-text, .fi-ta-text > div, .fi-ta-text > div > div, .fi-ta-text-item),
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table td :is(.fi-ta-col-wrp, .fi-ta-col-wrp > a, .fi-ta-text, .fi-ta-text > div, .fi-ta-text > div > div, .fi-ta-text-item),
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table td :is(.fi-ta-col-wrp, .fi-ta-col-wrp > a, .fi-ta-text, .fi-ta-text > div, .fi-ta-text > div > div, .fi-ta-text-item) { min-width: 0; max-width: 100%; }
/* The column headings: one line, "…" when there is no room. */
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table th .fi-ta-header-cell-label,
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table th .fi-ta-header-cell-label,
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table th .fi-ta-header-cell-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The tick box column. */
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table th.fi-ta-selection-cell,
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table th.fi-ta-selection-cell,
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table th.fi-ta-selection-cell { width: 48px; }
/* View · Edit · Delete: they go to a second line in their own column, not off the page. */
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table td.fi-ta-actions-cell .fi-ta-actions,
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table td.fi-ta-actions-cell .fi-ta-actions,
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table td.fi-ta-actions-cell .fi-ta-actions { flex-wrap: wrap; row-gap: 6px; column-gap: 14px; justify-content: flex-end; }
/* A text that must stay on one line ends in "…". */
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table td:is(.fi-table-cell-email, .fi-table-cell-phone) .fi-ta-text-item-label,
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table td.fi-table-cell-license-plate :is(.fi-badge, .fi-ta-text-item-label),
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table td.fi-table-cell-lead-passenger-name .fi-ta-text-item-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table td.fi-table-cell-license-plate .fi-badge { display: block; }
/* The main column goes to a second line at a space. */
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table td.fi-table-cell-name :is(.fi-ta-text-item-label, .fi-ta-text > p, .fi-ta-text > div),
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table td.fi-table-cell-display-name .fi-ta-text-item-label,
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table td.fi-table-cell-client\.name .fi-ta-text-item-label { white-space: normal; }

/* Hidden on the iPad (no width, no content): the columns the office reads least. */
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table :is(.fi-table-header-cell-id, .fi-table-cell-id, .fi-table-header-cell-display-code, .fi-table-cell-display-code, .fi-table-header-cell-account-type, .fi-table-cell-account-type, .fi-table-header-cell-sub-accounts-count, .fi-table-cell-sub-accounts-count, .fi-table-header-cell-tier, .fi-table-cell-tier, .fi-table-header-cell-is-vip, .fi-table-cell-is-vip, .fi-table-header-cell-accounts-count, .fi-table-cell-accounts-count, .fi-table-header-cell-company, .fi-table-cell-company, .fi-table-header-cell-city, .fi-table-cell-city, .fi-table-header-cell-is-regular, .fi-table-cell-is-regular, .fi-table-header-cell-do-not-auto-assign, .fi-table-cell-do-not-auto-assign, .fi-table-header-cell-customer-category, .fi-table-cell-customer-category),
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table :is(.fi-table-header-cell-samsara-id, .fi-table-cell-samsara-id, .fi-table-header-cell-probus-category, .fi-table-cell-probus-category, .fi-table-header-cell-is-magnetic, .fi-table-cell-is-magnetic, [class*="fi-table-header-cell-fuel-cards"], [class*="fi-table-cell-fuel-cards"]),
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table :is(.fi-table-header-cell-client-reference, .fi-table-cell-client-reference, .fi-table-header-cell-base-price, .fi-table-cell-base-price, .fi-table-header-cell-extras-total, .fi-table-cell-extras-total, .fi-table-header-cell-balance, .fi-table-cell-balance) { width: 0; padding: 0 !important; border: 0; visibility: hidden; }
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table :is(.fi-table-cell-display-code, .fi-table-cell-account-type, .fi-table-cell-sub-accounts-count, .fi-table-cell-tier, .fi-table-cell-is-vip, .fi-table-cell-accounts-count, .fi-table-cell-company, .fi-table-cell-city, .fi-table-cell-is-regular, .fi-table-cell-do-not-auto-assign, .fi-table-cell-customer-category, .fi-table-cell-id) > *,
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table :is(.fi-table-cell-samsara-id, .fi-table-cell-probus-category, .fi-table-cell-is-magnetic, [class*="fi-table-cell-fuel-cards"]) > *,
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table :is(.fi-table-cell-client-reference, .fi-table-cell-base-price, .fi-table-cell-extras-total, .fi-table-cell-balance) > * { display: none !important; }

/* Customers: Name · Email · Phone · Bookable · Bookings · buttons. */
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table th.fi-table-header-cell-email { width: 180px; }
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table th.fi-table-header-cell-phone { width: 150px; }
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table th.fi-table-header-cell-is-active { width: 112px; }
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table th.fi-table-header-cell-jobs-count { width: 112px; }
html.ed-touch .fi-main:has(.ed-hdr-list-clients) .fi-ta-table th.fi-ta-actions-header-cell { width: 150px; }

/* Vehicles: Vehicle · Reg · Seats · Active · Status · buttons. */
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table th.fi-table-header-cell-license-plate { width: 200px; }
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table th.fi-table-header-cell-capacity { width: 96px; }
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table th.fi-table-header-cell-is-active-fleet { width: 100px; }
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table th.fi-table-header-cell-status { width: 120px; }
html.ed-touch .fi-main:has(.ed-hdr-list-vehicles) .fi-ta-table th.fi-ta-actions-header-cell { width: 160px; }

/* Un-Invoiced Jobs: Job ID · Date · Customer · Ref · Total · Paid · View. */
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table th.fi-table-header-cell-job-id-display { width: 92px; }
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table th.fi-table-header-cell-pickup-time { width: 156px; }
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table th.fi-table-header-cell-lead-passenger-name { width: 150px; }
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table th.fi-table-header-cell-billable-total { width: 110px; }
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table th.fi-table-header-cell-paid-state { width: 84px; }
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-ta-table th.fi-ta-actions-header-cell { width: 80px; }

/* ── 2. Un-Invoiced Jobs: the From and To boxes keep their normal size ─────────────────────
   Jordan 11 Nov 2026: "reduce the size of customer and search boxes to accommodate normal size
   date range box". The two date boxes have a set width; Customer and Search share the rest. */
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-page .flex.flex-wrap.items-end:has(input[type="date"]) { flex-wrap: nowrap; }
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-page .flex.flex-wrap.items-end:has(input[type="date"]) > div:has(> input[type="date"]) { flex: 0 0 180px; min-width: 180px; }
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-page .flex.flex-wrap.items-end:has(input[type="date"]) > div:has(> input[type="date"]) > input { width: 100%; min-width: 0; }
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-page .flex.flex-wrap.items-end:has(input[type="date"]) > div.flex-1 { flex: 1 1 0; min-width: 0; max-width: 240px; }
html.ed-touch .fi-main:has(.ed-hdr-un-invoiced) .fi-page .flex.flex-wrap.items-end:has(input[type="date"]) > button { flex: 0 0 auto; }

/* ── 3. Customer and Vehicle pages: Back + ONE "Actions" list ─────────────────────────────
   Jordan 11 Nov 2026: "the top right action buttons should be in an Actions drop down menu. So
   it's just the back button and action drop down." The Actions list is the phone's one
   (resources/views/vendor/filament-panels/components/header/index.blade.php, 9 Nov 2026); on the
   iPad Back stays out of it. Each button keeps its own confirmation window. */
html.ed-touch :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.ed-has-menu { display: flex; align-items: center; gap: 0; position: relative; margin-left: auto; }
html.ed-touch :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.ed-has-menu > .ed-page-btns { display: contents; }
html.ed-touch :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.ed-has-menu .ed-back-btn { order: -1; height: 44px !important; padding-left: 16px !important; padding-right: 16px !important; }
html.ed-touch :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.ed-has-menu > .ed-actions-toggle {
    display: flex; order: 0; min-height: 44px; align-items: center; justify-content: center; gap: 6px; padding: 0 16px;
    border: 1px solid #2563eb; border-radius: 8px; background: #2563eb; color: #ffffff;
    font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
}
html.ed-touch :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.is-open > .ed-actions-toggle svg { transform: rotate(180deg); }
/* Closed: only Back and Actions are seen. */
html.ed-touch :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.ed-has-menu:not(.is-open) > .ed-page-btns > :not(.ed-back-btn) { display: none !important; }
/* Open: the page's buttons in one white list under Actions, one button per line. */
html.ed-touch :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.ed-has-menu.is-open > .ed-page-btns > :not(.ed-back-btn) {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 280px;
    display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px;
    background: #ffffff; border: 1px solid #cdd2d8; border-radius: 10px; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}
html.ed-touch.dark :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.ed-has-menu.is-open > .ed-page-btns > :not(.ed-back-btn) { background: var(--ed-d-box, #1e293b); border-color: #34425c; }
html.ed-touch :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.ed-has-menu.is-open > .ed-page-btns :is(.fi-btn, .fi-dropdown, .fi-dropdown-trigger) { width: 100%; margin: 0 !important; }
html.ed-touch :is(.ed-hdr-view-client, .ed-hdr-view-vehicle) .ed-page-actions.ed-has-menu.is-open > .ed-page-btns .fi-btn { min-height: 44px; justify-content: flex-start; }
