/* VisionPb: Orders list. Filters in a pressed groove, the grid on one cotton sheet. */

/* Filter panel: a groove above the sheet. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces > .filter-panel {
    background: var(--color-surface-2);
    border: 0;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-press-groove);
}

/* The sheet: grid paper (and the prerender preview) on cotton, lit edge, soft cast. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces > .mud-paper:has(> .orders-grid-wrap),
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces > .mud-paper:has(> table.table-sm) {
    background: var(--vpb-cotton);
    border: 0;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

/* MudDataGrid draws its own surface; the cotton sheet replaces it. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid.mud-table,
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-container {
    background: transparent;
    box-shadow: none;
}

/* Quiet heads: muted, 500, sentence case, untracked, one line. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-head .mud-table-cell,
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-head .mud-table-cell .column-header,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces > .mud-paper > table.table-sm th {
    background: var(--vpb-cotton);
    color: var(--color-ink-2);
    font-family: var(--vpb-font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

/* Horizontal hairlines only. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-cell,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces > .mud-paper > table.table-sm :is(th, td) {
    border-inline: 0;
    border-block-start: 0;
    border-block-end: 1px solid var(--color-rule);
}

.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-head .mud-table-cell {
    border-block-end-color: var(--color-rule-strong);
}

.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-block-end: 0;
}

/* Hover: a faint warm wash. Selected rows take the blue tint. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-body .mud-table-row:hover > .mud-table-cell {
    background: var(--vpb-paper-3);
}

.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-body .mud-table-row.selected > .mud-table-cell {
    background: var(--vpb-accent-soft);
}

.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-cell {
    color: var(--color-ink);
    font-family: var(--vpb-font-body);
}

/* Secondary lines (date, city) and the order id. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .text-muted {
    color: var(--color-ink-2);
}

.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .grid-party-name {
    font-weight: 500;
}

.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-link {
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-link:hover {
    color: var(--vpb-accent-2);
    text-decoration: underline;
}

/* Order id link reads as an ID: mono, tabular. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid [data-testid^="order-url"],
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-link[href*="/orders/"] {
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
}

/* Row action buttons stay quiet until hovered. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .grid-row-actions .mud-icon-button {
    color: var(--color-ink-2);
}

.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .grid-row-actions .mud-icon-button:hover {
    color: var(--color-accent);
    background: var(--vpb-accent-soft);
}

/* Header-row order count. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-header-meta .mud-text-secondary {
    color: var(--color-ink-2);
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
}

/* Pager: muted, tabular. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-pagination-toolbar {
    color: var(--color-ink-2);
    font-variant-numeric: tabular-nums;
}

.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-pagination {
    border-block-start: 1px solid var(--color-rule);
}

/* Hover and focus motion: colour only, never all. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-row > .mud-table-cell,
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .grid-row-actions .mud-icon-button {
    transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
    .vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-table-row > .mud-table-cell,
    .vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .grid-row-actions .mud-icon-button {
        transition: none;
    }
}

/* Focus stays visible. */
.vision-theme-scope[data-vision-theme="visionpb"] .orders-grid :is(.mud-link, .mud-icon-button, .mud-checkbox, button, a):focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* Touch: 44px targets. */
@media (any-pointer: coarse) {
    .vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .grid-row-actions .mud-icon-button,
    .vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .mud-checkbox,
    .vision-theme-scope[data-vision-theme="visionpb"] .orders-select-toggle,
    .vision-theme-scope[data-vision-theme="visionpb"] .filter-panel .mud-chip,
    .vision-theme-scope[data-vision-theme="visionpb"] .filter-panel .mud-button-root {
        min-width: var(--tap-target, 44px);
        min-height: var(--tap-target, 44px);
    }

    .vision-theme-scope[data-vision-theme="visionpb"] .orders-grid .grid-row-actions .mud-icon-button {
        padding: var(--space-xs, 8px);
    }
}
