/*
 * My Generators (unit and by-order views) and the generator detail page.
 *
 * Drawn to the approved issue #42 mockup. Scoped to .gam- classes so nothing
 * here reaches the rest of the dealer portal. The palette is a set of custom
 * properties on .gam-panel; fonts are inherited from the theme (Lato body,
 * Roboto Slab headings).
 *
 * The parent theme styles every table generically — red header cells, grey
 * borders, zebra rows (`main table th`, `main table tr:nth-of-type(odd) td`) —
 * so table rules here are written as `.gam-panel .gam-table …` to outrank
 * those without !important. See README → Dealer Asset Management → Styling note.
 *
 * Tables collapse to cards under 782px (WordPress's mobile breakpoint) using
 * the data-label attribute each cell carries.
 */

.gam-panel {
    --gam-panel: #ffffff;
    --gam-panel-2: #f7f7f8;
    --gam-line: #e4e4e6;
    --gam-line-2: #cfcfd3;
    --gam-fg: #000000;
    --gam-fg-2: #4b4b50;
    --gam-fg-3: #8a8a90;
    --gam-red: #ea0000;
    --gam-red-dark: #cc0000;
    --gam-red-tint: #fdeeee;
    --gam-black: #000000;
    --gam-head-bg: #eef1f4;
    --gam-head-fg: #1f2937;
    --gam-row-hover: #fbf4f4;
    --gam-ok-fg: #14532d;   --gam-ok-bg: #dcfce7;   --gam-ok-dot: #16a34a;
    --gam-warn-fg: #713f12; --gam-warn-bg: #fef3c7; --gam-warn-dot: #d97706;
    --gam-info-fg: #1e3a8a; --gam-info-bg: #dbeafe; --gam-info-dot: #2563eb;
    --gam-wait-fg: #374151; --gam-wait-bg: #e5e7eb; --gam-wait-dot: #6b7280;
    --gam-focus: #2563eb;

    margin-bottom: 2.5rem;
    color: var(--gam-fg);
    font-size: 15px;
    line-height: 1.45;
}

.gam-panel :focus-visible { outline: 2px solid var(--gam-focus); outline-offset: 2px; }

.gam-panel__title {
    margin: 0;
    font-weight: 300;
    font-size: 28.8px;
    line-height: 1.15;
}

.gam-panel__meta { margin: 0; color: var(--gam-fg-2); font-size: 13px; }

.gam-muted { color: var(--gam-fg-3); }

/* ── Page head ───────────────────────────────────────────────────────── */

.gam-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 20px;
    margin-bottom: 14px;
}

.gam-panel .gam-head__sub { margin: 2px 0 0; color: var(--gam-fg-2); font-size: 14px; }
.gam-head__sub b { color: var(--gam-fg); font-weight: 700; }
.gam-panel .gam-head__updated { margin: 0; font-size: 12.5px; color: var(--gam-fg-3); }

/* ── Staff dealer picker (templates/dealer-picker.php) ───────────────── */

/* Staff-only, so it sits quietly under the head: a slim amber band. */
.gam-dealer-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 0 0 12px;
    padding: 5px 8px 5px 10px;
    background: #fff8e5;
    border: 1px solid #f0d58c;
    border-radius: 4px;
    font-size: 13px;
    color: var(--gam-fg-2);
}

.gam-dealer-picker__label { font-weight: 700; }

.gam-dealer-picker select {
    min-width: 16rem;
    max-width: 100%;
    height: 28px;
    padding: 0 6px;
    font-size: 13px;
    border: 1px solid var(--gam-line-2);
    border-radius: 3px;
    background: #fff;
}

.gam-panel .gam-dealer-picker .button {
    padding: 0 10px;
    height: 28px;
    font-size: 12px;
    line-height: 28px;
    border-radius: 3px;
    background: var(--gam-black);
}

/* ── Status strip ────────────────────────────────────────────────────── */

.gam-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

@media (max-width: 1100px) { .gam-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .gam-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.gam-panel .gam-tile {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 10px 12px 9px;
    color: var(--gam-fg);
    text-decoration: none;
    background: var(--gam-panel);
    border: 1px solid var(--gam-line);
    border-radius: 6px;
}

.gam-panel a.gam-tile:hover,
.gam-panel a.gam-tile:focus { color: var(--gam-fg); text-decoration: none; border-color: var(--gam-line-2); }
.gam-panel .gam-tile.is-on,
.gam-panel a.gam-tile.is-on:hover { border-color: var(--gam-red); box-shadow: inset 0 0 0 1px var(--gam-red); }
.gam-tile.is-empty { cursor: default; }
.gam-tile.is-empty .gam-tile__n { color: var(--gam-fg-3); }

.gam-tile__lbl { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--gam-fg-2); }
.gam-tile__n { font-size: 24px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.gam-tile__hint { font-size: 11.5px; color: var(--gam-fg-3); }

.gam-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gam-wait-dot); }
.gam-dot--wait { background: var(--gam-wait-dot); }
.gam-dot--warn { background: var(--gam-warn-dot); }
.gam-dot--info { background: var(--gam-info-dot); }
.gam-dot--ok   { background: var(--gam-ok-dot); }

/* ── Toolbar ─────────────────────────────────────────────────────────── */

.gam-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.gam-seg {
    display: inline-flex;
    overflow: hidden;
    background: var(--gam-panel);
    border: 1px solid var(--gam-line-2);
    border-radius: 4px;
}

.gam-panel .gam-seg__btn {
    padding: 6px 13px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 20px;
    color: var(--gam-fg-2);
    text-decoration: none;
    white-space: nowrap;
}

.gam-seg__btn + .gam-seg__btn { border-left: 1px solid var(--gam-line-2); }
.gam-panel .gam-seg__btn:hover,
.gam-panel .gam-seg__btn:focus { color: var(--gam-fg); text-decoration: none; background: var(--gam-panel-2); }
.gam-panel .gam-seg__btn.is-on,
.gam-panel .gam-seg__btn.is-on:hover { color: #fff; background: var(--gam-black); }

.gam-search { flex: 1 1 240px; min-width: 0; margin: 0; }

.gam-search__field {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    margin: 0;
    padding: 0 10px;
    background: var(--gam-panel);
    border: 1px solid var(--gam-line-2);
    border-radius: 4px;
}

.gam-search__field:focus-within { border-color: var(--gam-fg-3); }
.gam-search__icon { flex: none; width: 15px; height: 15px; color: var(--gam-fg-3); }

.gam-panel .gam-search__field input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0;
    font: inherit;
    font-size: 14px;
    color: var(--gam-fg);
    background: transparent;
    border: 0;
    outline: none;
    box-shadow: none;
}

/* A toolbar dropdown's summary, drawn as the mockup's filter button. */
.gam-panel .gam-filter__toggle.gam-fbtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 11px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gam-fg);
    white-space: nowrap;
    background: var(--gam-panel);
    border: 1px solid var(--gam-line-2);
    border-radius: 4px;
    box-sizing: border-box;
}

.gam-panel .gam-filter__toggle.gam-fbtn:hover { background: var(--gam-panel-2); }
.gam-fbtn__v { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; font-weight: 400; color: var(--gam-fg-2); }
.gam-fbtn__chev { width: 12px; height: 12px; color: var(--gam-fg-3); }
.gam-panel .gam-fbtn.is-set { border-color: var(--gam-red); }
.gam-fbtn.is-set .gam-fbtn__v { font-weight: 700; color: var(--gam-red-dark); }
.gam-filter[open] > .gam-fbtn .gam-fbtn__chev { transform: rotate(180deg); }

.gam-panel .gam-toolbar__clear {
    padding: 0 4px;
    font-size: 13px;
    color: var(--gam-fg-2);
    text-decoration: underline;
}

.gam-panel .gam-toolbar__clear:hover { color: var(--gam-fg); }

/* ── Tables ──────────────────────────────────────────────────────────── */

/* `position: relative` is load-bearing: the theme's `.screen-reader-text` is
   `position:absolute` with no offsets, and with a static wrapper its
   containing block was the theme's `main`, which put header labels far off to
   the right and pushed the whole page into horizontal scroll. An overflow
   ancestor only clips absolute descendants in its containing-block chain. */
.gam-table-wrap {
    position: relative;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--gam-panel);
    border: 1px solid var(--gam-line);
    border-radius: 4px;
}

.gam-panel .gam-table {
    width: 100%;
    margin: 0;
    table-layout: fixed;
    border-collapse: collapse;
    border: 0;
}

.gam-panel .gam-table--units,
.gam-panel .gam-table--orders { min-width: 900px; }

/* The theme paints every header white-on-red and squashes its padding; set
   colour, background and padding explicitly. */
.gam-panel .gam-table thead th {
    padding: 10px 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--gam-head-fg);
    background: var(--gam-head-bg);
    border: 0;
    border-bottom: 1px solid var(--gam-line-2);
}

.gam-th__inner { display: flex; align-items: center; gap: 6px; }
.gam-table__num .gam-th__inner { justify-content: flex-end; }

.gam-panel .gam-table thead th a.gam-th__label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--gam-head-fg);
    text-decoration: none;
}

/* Sort direction, as the mockup draws it: a small triangle after the label,
   faint on hover, solid on the sorted column, flipped for ascending. */
.gam-panel .gam-table thead th a.gam-th__label::after {
    content: "";
    width: 0;
    height: 0;
    border: 4px solid transparent;
    border-top-color: var(--gam-head-fg);
    opacity: 0;
    transform: translateY(2px);
}

.gam-panel .gam-table thead th a.gam-th__label:hover::after,
.gam-panel .gam-table thead th a.gam-th__label:focus::after { opacity: 0.45; }
.gam-panel .gam-table thead th.sort-asc a.gam-th__label::after,
.gam-panel .gam-table thead th.sort-desc a.gam-th__label::after { opacity: 1; }
.gam-panel .gam-table thead th.sort-asc a.gam-th__label::after { transform: translateY(-2px) rotate(180deg); }

/* A secondary sort beside a header label — "MODEL  kW" — for a fact stacked
   under the column. Muted until it is the active sort. */
.gam-panel .gam-table thead th a.gam-th__also {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding-left: 6px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--gam-fg-3);
    text-decoration: none;
    border-left: 1px solid var(--gam-line-2);
}

.gam-panel .gam-table thead th a.gam-th__also:hover,
.gam-panel .gam-table thead th a.gam-th__also:focus,
.gam-panel .gam-table thead th a.gam-th__also.sort-asc,
.gam-panel .gam-table thead th a.gam-th__also.sort-desc { color: var(--gam-head-fg); }

.gam-panel .gam-table thead th a.gam-th__also::after {
    content: "";
    width: 0;
    height: 0;
    border: 4px solid transparent;
    border-top-color: var(--gam-head-fg);
    opacity: 0;
    transform: translateY(2px);
}

.gam-panel .gam-table thead th a.gam-th__also.sort-desc::after { opacity: 1; }
.gam-panel .gam-table thead th a.gam-th__also.sort-asc::after  { opacity: 1; transform: translateY(-2px) rotate(180deg); }

.gam-panel .gam-table tbody td {
    padding: 9px 7px;
    font-size: 14px;
    text-align: left;
    vertical-align: top;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--gam-line);
}

.gam-panel .gam-table tbody:last-child tr:last-child td { border-bottom: 0; }
.gam-panel .gam-table .gam-table__num,
.gam-panel .gam-table .gam-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.gam-panel .gam-table tr.gam-unit { cursor: pointer; }
.gam-panel .gam-table tr.gam-unit:hover td,
.gam-panel .gam-table tr.gam-unit:focus-within td { background: var(--gam-row-hover); }

.gam-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--gam-fg-3); white-space: nowrap; }
.gam-date { white-space: nowrap; font-variant-numeric: tabular-nums; }

.gam-panel .gam-id-link { font-weight: 700; color: var(--gam-red); text-decoration: none; white-space: nowrap; }
.gam-panel .gam-id-link:hover,
.gam-panel .gam-id-link:focus { color: var(--gam-red); text-decoration: underline; }

/* ── Column widths and wrapping ──────────────────────────────────────────
 *
 * Nine columns in about 1000px, so every cell has a rule for what happens
 * when its text is longer than its share. The short, fixed-shape columns
 * never wrap and declare a width; the two free-text columns (Model, Ship To)
 * take the slack and clamp to two lines; the identifiers that can run long
 * (PO #, Dealer Rep) clip with an ellipsis. Everything clipped or clamped
 * carries the full text in a title attribute, and the detail page has it all.
 *
 * Widths are on the `.gam-col--<key>` header class, never by position (see
 * GAM_Table::header()), and the table is `table-layout: fixed`: an auto
 * layout hands the slack to whichever column has the longest single value,
 * which is how Dealer Rep ended up wider than Model. Fixed layout makes the
 * widths below the widths, full stop, with the 900px floor so phones scroll
 * the table rather than crushing it. */
.gam-model { font-weight: 700; }
.gam-cust  { font-weight: 400; }

.gam-panel .gam-table th.gam-col--order_date { width: 112px; }
.gam-panel .gam-table th.gam-col--order_no   { width: 92px; }
.gam-panel .gam-table th.gam-col--po         { width: 88px; }
.gam-panel .gam-table th.gam-col--dealer_rep { width: 128px; }
.gam-panel .gam-table th.gam-col--model      { width: 136px; }
.gam-panel .gam-table th.gam-col--type       { width: 80px; }
.gam-panel .gam-table th.gam-col--status     { width: 134px; }
.gam-panel .gam-table th.gam-col--units      { width: 96px; }
.gam-panel .gam-table th.gam-col--serial     { width: 102px; }
.gam-panel .gam-table th.gam-col--invoiced   { width: 104px; }
.gam-panel .gam-table th.gam-col--total      { width: 112px; }
/* Ship To has no width: under `table-layout: fixed` it takes whatever the
   declared columns leave, so the table always fills its box exactly. */

/* Fixed-shape columns: a date, a badge, a serial, an invoice number. Type
   is left out: "Transfer Switch" is allowed its second line. */
.gam-col--order_date,
.gam-col--po,
.gam-col--dealer_rep,
.gam-col--units,
.gam-col--serial,
.gam-col--invoiced,
.gam-col--status .gam-sub { white-space: nowrap; }

/* Identifiers that can run long clip rather than wrap: "26036-011-BS" fits,
   a longer PO shows an ellipsis and its full text on hover. */
.gam-clip {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Free text takes at most two lines. A Sage description ("250 KW 120/208V 3
   PH, 60 HZ, T") or a long customer name wraps once and then clips, so a row
   is never taller than its neighbours by more than one line. */
.gam-model,
.gam-cust {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.gam-col--ship_to .gam-sub,
.gam-col--model .gam-sub { white-space: normal; }

.gam-startup {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.gam-startup svg { width: 12px; height: 12px; flex: none; }
.gam-startup.is-done { color: var(--gam-ok-fg); }
.gam-startup.is-due  { color: var(--gam-warn-fg); }

/* ── Status badges ───────────────────────────────────────────────────── */

.gam-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px 2px 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    border-radius: 10px;
}

.gam-badge i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.gam-badge.s-ordered,
.gam-badge.s-notstarted { color: var(--gam-wait-fg); background: var(--gam-wait-bg); }
.gam-badge.s-ordered i,
.gam-badge.s-notstarted i { background: var(--gam-wait-dot); }
.gam-badge.s-progress   { color: var(--gam-warn-fg); background: var(--gam-warn-bg); }
.gam-badge.s-progress i { background: var(--gam-warn-dot); }
.gam-badge.s-ready      { color: var(--gam-info-fg); background: var(--gam-info-bg); }
.gam-badge.s-ready i    { background: var(--gam-info-dot); }
.gam-badge.s-invoiced   { color: var(--gam-ok-fg); background: var(--gam-ok-bg); }
.gam-badge.s-invoiced i { background: var(--gam-ok-dot); }
.gam-badge.s-unknown    { color: var(--gam-wait-fg); background: #f3f4f6; }
.gam-badge.s-unknown i  { background: var(--gam-wait-dot); }

/* The detail page's badges, keyed by GAM_Account::status_class(). */
.gam-badge--inline { margin-left: 0.4rem; font-size: 11px; vertical-align: middle; }
.gam-badge.is-complete { color: var(--gam-ok-fg); background: var(--gam-ok-bg); }
.gam-badge.is-progress { color: var(--gam-warn-fg); background: var(--gam-warn-bg); }
.gam-badge.is-pending  { color: var(--gam-wait-fg); background: var(--gam-wait-bg); }
.gam-badge.is-unknown  { color: var(--gam-wait-fg); background: #f3f4f6; }

/* ── By-order view ───────────────────────────────────────────────────── */

.gam-panel .gam-table tr.order-row td { font-weight: 700; background: var(--gam-panel-2); }
.gam-panel .gam-table tr.order-row[data-gam-toggle] { cursor: pointer; }
.gam-panel .gam-table tr.order-row[data-gam-toggle]:hover td { background: var(--gam-row-hover); }
.gam-panel .gam-table tr.order-row td .gam-sub,
.gam-panel .gam-table tr.order-row .gam-cust { font-weight: 400; }

.gam-chev {
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 6px;
    border: 5px solid transparent;
    border-left-color: var(--gam-fg-2);
    transform: translateY(1px);
    transition: transform 0.15s;
}

.gam-order.is-open .gam-chev { transform: rotate(90deg) translateX(1px); }

@media (prefers-reduced-motion: reduce) { .gam-chev { transition: none; } }

.gam-panel .gam-table tr.in-order td { padding-left: 34px; font-size: 14px; }
.gam-panel .gam-table tr.in-order td:first-child { position: relative; }
.gam-panel .gam-table tr.in-order td:first-child::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: var(--gam-line);
}

/* ── Footer, pagination, empty state, notices ────────────────────────── */

.gam-tfoot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 2px;
    font-size: 13px;
    color: var(--gam-fg-2);
}

.gam-pager { display: inline-flex; flex-wrap: wrap; gap: 4px; }

.gam-panel .gam-pager__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    font-size: 13px;
    color: var(--gam-fg);
    text-decoration: none;
    background: var(--gam-panel);
    border: 1px solid var(--gam-line-2);
    border-radius: 4px;
    box-sizing: border-box;
}

.gam-panel a.gam-pager__item:hover { color: var(--gam-fg); text-decoration: none; background: var(--gam-panel-2); }
.gam-panel .gam-pager__item.is-on { color: #fff; background: var(--gam-black); border-color: var(--gam-black); }

.gam-empty {
    padding: 36px 16px;
    text-align: center;
    color: var(--gam-fg-2);
    background: var(--gam-panel);
    border: 1px solid var(--gam-line);
    border-radius: 4px;
}

.gam-empty p { margin: 0 0 6px; }
.gam-empty a { margin-left: 4px; color: var(--gam-fg-2); text-decoration: underline; }
.gam-empty__hint { font-size: 13px; color: var(--gam-fg-3); }

.gam-live-count { margin: 0; padding: 8px 10px; }
.gam-live-count:empty { display: none; }

.gam-notice {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    background: var(--gam-panel-2, #f7f7f8);
    border-left: 4px solid #999;
    border-radius: 0 3px 3px 0;
}

.gam-notice--success { border-left-color: #16a34a; background: #f0fdf4; }
.gam-notice--error   { border-left-color: #dc2626; background: #fef2f2; }
.gam-notice--info    { border-left-color: #2563eb; background: #eff6ff; }

.gam-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.3rem;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--gam-fg-2);
    background: var(--gam-wait-bg);
    border-radius: 2px;
}

/* ── Mobile: rows become cards ───────────────────────────────────────── */

@media screen and (max-width: 782px) {

    .gam-table-wrap { overflow-x: visible; }

    .gam-panel .gam-table,
    .gam-panel .gam-table--units,
    .gam-panel .gam-table--orders { min-width: 0; table-layout: auto; }

    .gam-panel .gam-table thead { display: none; }

    .gam-panel .gam-table,
    .gam-panel .gam-table tbody,
    .gam-panel .gam-table tr,
    .gam-panel .gam-table td { display: block; width: 100%; box-sizing: border-box; }

    .gam-panel .gam-table tr[hidden] { display: none; }

    .gam-panel .gam-table tbody tr {
        padding: 10px 12px;
        border-bottom: 1px solid var(--gam-line);
    }

    .gam-panel .gam-table tbody:last-child tr:last-child { border-bottom: 0; }

    /* Label on the left, the cell's lines stacked on the right: a grid, so
       a value and its subline stack instead of sitting side by side. The
       label spans the rows; every child (and the bare text, which lands in
       the first free cell) goes in the second column. */
    .gam-panel .gam-table tbody td {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 12px;
        justify-items: end;
        align-items: start;
        padding: 2px 0;
        font-size: 14px;
        text-align: right;
        border: 0;
    }

    /* The data-label attribute on every cell becomes its row heading. */
    .gam-panel .gam-table tbody td::before {
        content: attr(data-label);
        grid-column: 1;
        grid-row: 1 / span 4;
        justify-self: start;
        padding-top: 2px;
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        text-align: left;
        color: var(--gam-fg-3);
    }

    .gam-panel .gam-table tbody td > * { grid-column: 2; }
    .gam-panel .gam-table td[data-label=""]::before { content: none; }

    .gam-sub,
    .gam-model,
    .gam-clip,
    .gam-id-link { white-space: normal; }
    .gam-clip { overflow: visible; text-overflow: clip; }
    .gam-model,
    .gam-cust { display: block; -webkit-line-clamp: unset; }
    .gam-col--order_date,
    .gam-col--po,
    .gam-col--dealer_rep,
    .gam-col--serial,
    .gam-col--invoiced,
    .gam-col--status .gam-sub { white-space: normal; }
    .gam-panel .gam-table th.gam-col--model,
    .gam-panel .gam-table th.gam-col--ship_to { min-width: 0; }
    .gam-startup { justify-content: flex-end; }

    .gam-panel .gam-table tr.order-row { background: var(--gam-panel-2); }
    .gam-panel .gam-table tr.order-row td { background: transparent; }
    .gam-panel .gam-table tr.in-order { padding-left: 24px; }
    .gam-panel .gam-table tr.in-order td { padding-left: 0; }
    .gam-panel .gam-table tr.in-order td:first-child::before { content: attr(data-label); position: static; width: auto; background: none; }
    .gam-chev { display: none; }

    .gam-dealer-picker select { min-width: 0; flex: 1 1 10rem; }
    .gam-fbtn__v { max-width: 9rem; }
}

/* ── Layout fix on the table page ────────────────────────────────────────
 *
 * The theme lays My Account out as `.account-row { display:flex }` with the
 * content as a flex item, and a flex item's default `min-width:auto` grows it
 * to its content's intrinsic width. That defeats the `overflow-x:auto` on
 * .gam-table-wrap: instead of scrolling inside its box, a wide table pushes
 * the content column past the page edge. `min-width:0` is the fix.
 *
 * Scoped to `.gam-table-page`, which GAM_Account::body_class() adds on this
 * page only. The page no longer widens the theme's 1400px measure: the
 * nine-column table fits it.
 */
.gam-table-page .woocommerce-MyAccount-content {
    min-width: 0;
    flex: 1 1 auto;
}

/* Sample data: an account not yet linked to a dealer. Amber, like the staff picker band. */
.gam-notice--sample { background: #fff8e5; border: 1px solid #f0c36d; color: #5c4500; padding: .75rem 1rem; margin: 0 0 1rem; border-radius: 4px; }

/* Model column: the base SKU on one line. */
.gam-col--model .gam-model { white-space: nowrap; }
