/* Halo operational grid: shared identity, provenance, owner, urgency and status recipes. */
    /* Shared table adapter for the Halo operational layer. */
    .halo-operational-grid {
        border: none;
        background: transparent;
    }

    .halo-operational-grid .mud-table-container {
        overflow: auto;
        max-height: min(72dvh, 760px);
        scrollbar-color: rgb(var(--halo-tone-neutral) / .30) transparent;
    }

    .halo-operational-grid table {
        min-width: 1040px;
        border-spacing: 0;
    }

    .halo-operational-grid .mud-table-head {
        background: var(--halo-surface);
    }

    .halo-operational-grid .mud-table-head .mud-table-cell {
        height: 38px;
        padding-top: 0;
        padding-bottom: 0;
        font-size: var(--halo-text-caption);
        font-weight: 600;
        letter-spacing: var(--halo-tracking-wide);
        text-transform: uppercase;
        color: var(--halo-text-secondary);
        border-bottom: 1px solid var(--halo-hairline);
        white-space: nowrap;
    }

    .halo-operational-grid .mud-table-head .mud-table-sort-label-icon,
    .halo-operational-grid .mud-table-head .mud-menu-icon,
    .halo-operational-grid .column-options-button { display: none !important; }

    .halo-operational-grid .mud-table-body .mud-table-cell {
        position: relative;
        height: 56px;
        padding-top: 8px;
        padding-bottom: 8px;
        color: var(--halo-text);
        border-bottom: 1px solid var(--halo-hairline);
        transition: background-color var(--halo-duration-1) var(--halo-ease-out), border-color var(--halo-duration-1) var(--halo-ease-out);
    }

    .halo-operational-grid.halo-grid--condensed .mud-table-body .mud-table-cell {
        height: 42px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .halo-operational-grid .mud-table-body .mud-table-row:last-child .mud-table-cell {
        border-bottom: none;
    }

    /* Rows step in as a 30ms cascade; hover answers in 120ms. */
    .halo-grid-row {
        transition: background-color var(--halo-duration-1) var(--halo-ease-out);
        animation: halo-grid-row-in var(--halo-duration-3) var(--halo-ease-out) both;
        animation-delay: calc(var(--halo-row, 0) * 30ms + 60ms);
    }
    .halo-grid-row:nth-child(1) { --halo-row: 0; } .halo-grid-row:nth-child(2) { --halo-row: 1; }
    .halo-grid-row:nth-child(3) { --halo-row: 2; } .halo-grid-row:nth-child(4) { --halo-row: 3; }
    .halo-grid-row:nth-child(5) { --halo-row: 4; } .halo-grid-row:nth-child(6) { --halo-row: 5; }
    .halo-grid-row:nth-child(7) { --halo-row: 6; } .halo-grid-row:nth-child(8) { --halo-row: 7; }
    .halo-grid-row:nth-child(9) { --halo-row: 8; } .halo-grid-row:nth-child(10) { --halo-row: 9; }
    .halo-grid-row:nth-child(11) { --halo-row: 10; } .halo-grid-row:nth-child(n + 12) { --halo-row: 11; }
    @keyframes halo-grid-row-in { from { opacity: 0; transform: translateY(6px); } }

    .halo-operational-grid .mud-table-body .mud-table-row.halo-grid-row:hover {
        background: var(--halo-surface-hover) !important;
    }

    /* Row actions surface on hover or keyboard focus; the column keeps its width. */
    .halo-operational-grid .mud-table-body .mud-table-row .halo-col-actions > * {
        opacity: 0;
        transform: translateX(6px);
        transition: opacity var(--halo-duration-2) var(--halo-ease-out), transform var(--halo-duration-2) var(--halo-ease-out);
    }
    .halo-operational-grid .mud-table-body .mud-table-row:is(:hover, :focus-within) .halo-col-actions > *,
    .halo-operational-grid .mud-table-body .mud-table-row.halo-row-selected .halo-col-actions > * {
        opacity: 1;
        transform: none;
    }
    @media (hover: none) {
        .halo-operational-grid .mud-table-body .mud-table-row .halo-col-actions > * { opacity: 1; transform: none; }
    }

    .halo-operational-grid .mud-table-body .mud-table-row.halo-grid-row .mud-table-cell:first-child {
        border-left: 0;
        padding-left: 16px;
    }

    .halo-operational-grid .mud-checkbox .mud-icon-root {
        color: var(--halo-text-tertiary);
        font-size: var(--halo-text-title);
    }

    .halo-operational-grid .mud-checkbox:hover {
        background: rgb(var(--halo-tone-brand) / .08);
    }

    .halo-operational-grid .mud-checkbox.mud-checked .mud-icon-root {
        color: var(--halo-action-brand);
    }
    .halo-operational-grid .mud-checkbox .mud-icon-root {
        transition: color var(--halo-duration-2) var(--halo-ease-spring), transform var(--halo-duration-2) var(--halo-ease-spring);
    }
    .halo-operational-grid .mud-checkbox.mud-checked .mud-icon-root { transform: scale(1.06); }

    .halo-grid-id {
        font-family: var(--halo-font-mono);
        font-size: var(--halo-text-sm);
        color: var(--halo-text-secondary);
        font-weight: 600;
    }

    .halo-grid-email {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Customer cell — identity plus secondary contact context. */
    .halo-record-identity {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .halo-record-avatar {
        flex-shrink: 0;
        width: 30px;
        height: 30px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: var(--halo-text-caption);
        font-weight: 700;
        color: var(--halo-ink-brand);
        letter-spacing: 0.02em;
        background: linear-gradient(135deg, rgb(var(--halo-tone-brand) / .18), rgb(var(--halo-tone-pipeline) / .22));
        box-shadow: inset 0 0 0 1px rgb(var(--halo-tone-brand) / .12);
    }

    .halo-record-name {
        font-weight: 600;
        color: var(--halo-text);
    }

    .halo-record-details, .halo-record-source, .halo-record-owner, .halo-record-attention {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .halo-record-name small, .halo-record-contact, .halo-record-source small,
    .halo-record-owner small, .halo-record-attention small {
        color: var(--halo-text-secondary);
        font-size: var(--halo-text-caption);
        font-weight: 500;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 260px;
    }

    .halo-record-channel { color: var(--halo-text-secondary); font-size: var(--halo-text-caption); font-weight: 500; }
    .halo-record-source-name { color: var(--halo-text); font-size: var(--halo-text-sm); font-weight: 600; }
    .halo-record-ownership { color: var(--halo-text-secondary); font-size: var(--halo-text-caption); font-weight: 500; width: fit-content; }
    .halo-record-ownership--managerreview, .halo-record-ownership--recycling,
    .halo-record-ownership--unassigned, .halo-record-ownership--released { color: var(--halo-ink-warning); font-weight: 600; }

    .halo-record-attention { border-left: 3px solid rgb(var(--halo-tone-neutral) / .45); padding-left: 8px; }
    .halo-record-attention--5 { border-color: rgb(var(--halo-tone-critical)); color: var(--halo-ink-critical); }
    .halo-record-attention--4 { border-color: rgb(var(--halo-tone-warning)); color: var(--halo-ink-warning); }
    .halo-record-attention--3 { border-color: rgb(var(--halo-tone-brand)); color: var(--halo-ink-brand); }
    .halo-record-attention--2 { border-color: var(--halo-hairline); color: var(--halo-text); }
    .halo-record-attention--1 { border-color: rgb(var(--halo-tone-warning)); color: var(--halo-ink-warning); }


    /* Operational emphasis is carried by one attention indicator. */

    /* Native semantic status control. No Mud input or popover participates. */
    .halo-grid-status {
        --status-tone: var(--halo-tone-neutral);
        min-width: 118px;
        max-width: 150px;
    }
    .halo-grid-status .halo-native-select-wrap::before {
        content: "";
        position: absolute;
        z-index: 1;
        left: 11px;
        top: 50%;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgb(var(--status-tone));
        transform: translateY(-50%);
        pointer-events: none;
    }
    .halo-grid-status .halo-native-select {
        padding-left: 25px;
        padding-right: 30px;
        border-color: var(--halo-hairline);
        color: var(--halo-text);
        background: var(--halo-surface);
        font-size: var(--halo-text-sm);
        font-weight: 600;
        box-shadow: none;
    }
    .halo-grid-status .halo-native-select__chevron { right: 8px; color: rgb(var(--status-tone)); }
    .halo-grid-status.halo-status-new { --status-tone: var(--halo-tone-brand); }
    .halo-grid-status.halo-status-contacted { --status-tone: var(--halo-tone-info); }
    .halo-grid-status.halo-status-quoted { --status-tone: var(--halo-tone-warning); }
    .halo-grid-status.halo-status-negotiation { --status-tone: var(--halo-tone-pipeline); }
    .halo-grid-status.halo-status-won { --status-tone: var(--halo-tone-success); }
    .halo-grid-status.halo-status-lost { --status-tone: var(--halo-tone-critical); }
    .halo-grid-status.halo-status-donotcall { --status-tone: var(--halo-tone-neutral); }


/* Header glass is isolated from the solid reading surface. */
.halo-operational-grid .mud-table-head .mud-table-cell {
    position: sticky; top: 0; z-index: 2;
    background: color-mix(in srgb, var(--halo-surface-sunken) 90%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.halo-operational-grid .mud-table-body { background: var(--halo-surface); }
.halo-operational-grid .halo-grid-number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.halo-record-attention small, .halo-grid-id { font-variant-numeric: tabular-nums; }
.halo-operational-grid .mud-table-body .mud-table-row.halo-row-selected > .mud-table-cell {
    background: color-mix(in srgb, var(--halo-surface) 91%, rgb(var(--halo-tone-brand))) !important;
}
.halo-operational-grid .mud-table-body .mud-table-row.halo-row-selected > .mud-table-cell:first-child { box-shadow: inset 3px 0 var(--halo-ink-brand); }
.halo-operational-grid .mud-table-body .mud-table-row:focus-within > .mud-table-cell { background: rgb(var(--halo-tone-brand) / .045); }
.halo-grid-status .halo-native-select:focus-visible { box-shadow: var(--halo-focus-ring-field); border-color: rgb(var(--halo-tone-brand) / .70); }
@media (prefers-reduced-motion: reduce) {
    .halo-operational-grid .mud-table-cell, .halo-grid-row { transition: none !important; animation: none !important; }
    .halo-operational-grid .mud-table-body .mud-table-row .halo-col-actions > * { opacity: 1; transform: none; }
}

.halo-operational-grid .mud-table-cell { font-variant-numeric: tabular-nums; }
