.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.productsCell {
    position: relative;
    max-width: 280px;
}

.productOne {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.productToggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    cursor: pointer;
}

.productMenu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    max-width: 320px;
    padding: 8px;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: #fff;
}

:global(.dark) .productMenu {
    border-color: #334155;
    background: #0e1726;
}

.productMenuItem {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    border-top: 1px solid #f1f5f9;
}

.productMenuItem:first-child {
    border-top: 0;
}

:global(.dark) .productMenuItem {
    border-top-color: #1e293b;
}

.wrapper {
    --po-order-width: 132px;
    --po-product-width: 260px;
    --po-metric-width: 112px;
    --po-date-width: 156px;
    --po-cell-padding-x: 10px;
    --po-cell-padding-y: 8px;
    --po-header-font-size: 12px;

    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    position: relative;
}

:global(.dark) .wrapper {
    border-color: #334155;
    background: #0e1726;
}

.tableScroll {
    overflow: auto;
    max-height: 520px;
}

.table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    table-layout: auto;
}

.thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8f9fa;
}

:global(.dark) .thead {
    background: #1e293b;
}

.th {
    padding: var(--po-cell-padding-y) var(--po-cell-padding-x);
    font-size: var(--po-header-font-size);
    font-weight: 500;
    color: #5f6368;
    border-bottom: 1px solid #e8eaed;
    white-space: nowrap;
    user-select: none;
    text-align: left;
}

.thSortable {
    cursor: pointer;
}

.thMetric {
    text-align: right;
    width: var(--po-metric-width);
}

.thDate {
    width: var(--po-date-width);
}

.thFrozen {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f8f9fa;
    box-shadow: 2px 0 6px -2px rgb(0 0 0 / 10%);
    width: var(--po-order-width);
    min-width: var(--po-order-width);
}

:global(.dark) .th {
    color: #94a3b8;
    border-bottom-color: #334155;
}

:global(.dark) .thFrozen {
    background: #1e293b;
}

.sortIcon {
    margin-left: 4px;
    color: #1a73e8;
    font-size: 11px;
}

.tr {
    border-bottom: 1px solid #f1f3f4;
}

:global(.dark) .tr {
    border-bottom-color: #334155;
}

.td {
    padding: var(--po-cell-padding-y) var(--po-cell-padding-x);
    color: #202124;
    vertical-align: middle;
}

.tdMetric {
    text-align: right;
    font-variant-numeric: tabular-nums;
    width: var(--po-metric-width);
}

.tdDate {
    width: var(--po-date-width);
    white-space: nowrap;
}

.tdProduct {
    width: var(--po-product-width);
    max-width: var(--po-product-width);
}

.tdFrozen {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 2px 0 6px -2px rgb(0 0 0 / 8%);
    width: var(--po-order-width);
    min-width: var(--po-order-width);
}

:global(.dark) .td {
    color: #e2e8f0;
}

:global(.dark) .tdFrozen {
    background: #0e1726;
}

.empty {
    padding: 32px 16px;
    text-align: center;
    color: #5f6368;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid #e8eaed;
    background: #fafafa;
    font-size: 12px;
    color: #5f6368;
}

:global(.dark) .footer {
    border-top-color: #334155;
    background: #1a2332;
    color: #94a3b8;
}

.footerBtns {
    display: flex;
    gap: 6px;
}

.select {
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: #fff;
    color: #202124;
}

:global(.dark) .select {
    border-color: #475569;
    background: #0e1726;
    color: #e2e8f0;
}

.pageBtn {
    height: 28px;
    padding: 0 10px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
}

.pageBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

:global(.dark) .pageBtn {
    border-color: #475569;
    background: #0e1726;
    color: #e2e8f0;
}

.refreshOverlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.55);
}

:global(.dark) .refreshOverlay {
    background: rgba(14, 23, 38, 0.55);
}

.refreshSpinner {
    width: 28px;
    height: 28px;
    border: 3px solid #c6dafc;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: po-spin 0.7s linear infinite;
}

@keyframes po-spin {
    to {
        transform: rotate(360deg);
    }
}
