﻿/* ============================================================================
   Shared data table
   ----------------------------------------------------------------------------
   Base table card, toolbar, search, headings, rows, cells, actions, pager,
   focus, hover, fit-page, and mobile behavior.

   Source: Pasted text(20260903-154552).txt:97-429.
   ============================================================================ */

.store-data-card {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.store-data-card--content {
    flex: 0 1 auto;
}

.store-data-table {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    color: var(--store-text-main);
    background: var(--store-white);
}

    .store-data-table .mud-table-container {
        flex: 1 1 auto;
        height: auto !important;
        min-height: 0;
        overflow: auto;
        scrollbar-gutter: stable;
    }

    .store-data-table .mud-table-toolbar {
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
        padding: 0;
        background: var(--store-white);
        border-bottom: 1px solid var(--store-border);
    }

.store-data-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    min-width: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient( 135deg, color-mix( in srgb, var(--store-main-color) 10%, transparent ), var(--store-white) 95% );
}

.store-data-toolbar-heading {
    flex: 1 1 auto;
    min-width: 0;
}

.store-data-title {
    color: var(--store-text-main);
    font-weight: 800;
    line-height: 1.3;
}

.store-data-description {
    display: block;
    margin-top: 0.1rem;
    color: var(--store-text-muted);
    line-height: 1.4;
}

.store-data-search-wrapper {
    flex: 0 1 26rem;
    width: min(100%, 26rem);
    min-width: 13rem;
    margin-left: auto;
}

.store-data-search {
    width: 100%;
}

.store-data-table .mud-table-head {
    background: var(--store-surface-subtle);
}

    .store-data-table .mud-table-head .mud-table-cell {
        padding: 0.65rem 0.85rem;
        color: var(--store-text-secondary);
        font-size: 0.75rem;
        font-weight: 850;
        letter-spacing: 0.035em;
        text-transform: uppercase;
        background: var(--store-surface-subtle);
        border-bottom: 1px solid var(--store-border);
    }

.store-data-table .mud-table-sort-label {
    color: inherit;
    font: inherit;
    text-transform: inherit;
}

.store-data-table .mud-table-sort-label-icon {
    color: var(--store-main-color);
}

.store-data-table .mud-table-body .mud-table-row {
    background: var(--store-white);
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.store-data-table .mud-table-body .mud-table-cell {
    padding: 0.65rem 0.85rem;
    color: var(--store-text-main);
    line-height: 1.4;
    vertical-align: top;
    border-bottom: 1px solid var(--store-divider);
}

.store-data-cell {
    min-width: 0;
    overflow-wrap: anywhere;
}

.store-data-cell-primary {
    font-weight: 750;
}

.store-data-cell-wrap {
    min-width: 16rem;
    white-space: normal;
}

.store-data-actions-column, .store-data-actions-cell {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.store-data-actions-cell {
    vertical-align: middle !important;
}

.store-data-row-action {
    min-width: 0;
    min-height: 2.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
}

.store-data-action-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.store-data-id-column, .store-data-id-cell {
    min-width: 5rem;
    text-align: center !important;
    font-variant-numeric: tabular-nums;
}

    .store-data-id-column .mud-table-sort-label {
        justify-content: center;
        width: 100%;
    }

.store-data-table .mud-table-pagination {
    flex: 0 0 auto;
    min-height: 3rem;
    color: var(--store-text-secondary);
    background: var(--store-white);
    border-top: 1px solid var(--store-border);
}

.store-data-empty {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: clamp(2rem, 6vw, 4rem) 1rem;
    color: var(--store-text-secondary);
    text-align: center;
}

    .store-data-empty .mud-icon-root {
        color: var(--store-text-muted);
    }

@media (hover: hover) and (pointer: fine) {
    .store-data-table .mud-table-body .mud-table-row:hover {
        background: var(--store-main-color-pale);
    }
}

.store-data-table :where( button, input, [role="button"], [tabindex]:not([tabindex="-1"]) ):focus-visible {
    outline: 3px solid var(--store-main-color);
    outline-offset: 2px;
}

@media screen and (max-width: 959.98px) {
    .store-data-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .store-data-search-wrapper {
        flex-basis: auto;
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }
}

@media screen and (max-width: 599.98px) {
    .store-data-toolbar {
        gap: 0.65rem;
        padding: 0.65rem 0.75rem;
    }

    .store-data-table .mud-table-body .mud-table-cell {
        padding: 0.55rem 0.75rem;
    }

    .store-data-actions-cell {
        width: auto;
        text-align: left;
    }

        .store-data-actions-cell .store-data-row-action {
            width: 100%;
        }

    .store-data-action-group {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .store-data-cell-wrap {
        min-width: 0;
    }
}

.store-data-table--fit-page .mud-table-container {
    max-height: none;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.store-data-card--content .store-data-table {
    flex: 0 1 auto;
}

.store-data-card--content .store-data-table--fit-page .mud-table-container {
    flex: 0 1 auto;
    max-height: clamp(12rem, calc(100dvh - 20rem), 30rem);
}

@media (prefers-reduced-motion: reduce) {
    .store-data-table .mud-table-row, .store-data-row-action {
        transition: none !important;
        animation: none !important;
    }
}
