.catalog-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 9px;
}

.catalog-summary-bar .stats { margin: 0; }
.table-tools { display: flex; align-items: flex-end; gap: 8px; }
.table-tools > button { min-height: 30px; padding: 4px 9px; font-size: 11px; }
.limit-control { min-width: 92px; gap: 3px; font-size: 10px; }
.limit-control select { width: 92px; height: 30px; font-size: 12px; }

.products-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    vertical-align: top;
    padding-top: 7px;
    padding-bottom: 7px;
    background: #fafbfc;
}

.quick-filter-row th {
    position: static;
    z-index: auto;
    padding: 8px 10px;
    background: #f4f7fa;
    border-bottom: 1px solid #dfe3e8;
}

.quick-filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(118px, 1fr));
    gap: 8px;
    align-items: end;
}

.quick-filter-bar label { min-width: 0; gap: 3px; color: #6b7280; font-size: 10px; }
.quick-filter-bar .header-filter { height: 32px; font-size: 12px; }
.quick-search-control { min-width: 260px; }
.product-header { min-width: 96px; }
.marketplace-column { min-width: 132px; }
.account-column { min-width: 180px; }
.product-column { min-width: 250px; }
.identifiers-column { min-width: 196px; }
.price-column { min-width: 146px; }
.buyer-price-column { min-width: 150px; }
.stock-combined-column { min-width: 150px; }
.status-column { min-width: 150px; }
.updated-column { min-width: 128px; }

.table-sort-button {
    width: 100%;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0 1px 5px;
    color: #7a8495;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .025em;
    text-align: left;
    text-transform: uppercase;
}

.table-sort-button:hover:not(:disabled) { color: #283241; background: transparent; }
.table-sort-button.active { color: #283241; }
.sort-indicator { min-width: 12px; color: #a4acb8; font-size: 9px; text-align: center; }
.table-sort-button.active .sort-indicator { color: #4b5563; }

.header-filter {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 0 7px;
    color: #374151;
    background: #fff;
    border-color: #dfe3e8;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.header-filter::placeholder { color: #a1a9b5; }
.header-filter-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.header-filter-pair .header-filter { padding-right: 3px; padding-left: 6px; }
.identifiers-column,
.stock-combined-column {
    position: sticky;
    overflow: visible;
    z-index: 5 !important;
}

.compact-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 50px;
    color: #7a8495;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.column-filter-menu {
    position: relative;
    flex: 0 0 auto;
}

.column-filter-menu > summary {
    list-style: none;
}

.column-filter-menu > summary::-webkit-details-marker {
    display: none;
}

.column-filter-trigger {
    min-height: 26px;
    padding: 3px 7px;
    color: #596579;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 5px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.column-filter-trigger::after {
    content: " ▾";
    color: #9aa3af;
}

.column-filter-menu[open] .column-filter-trigger,
.column-filter-trigger.active {
    color: #202938;
    border-color: #9aa3af;
    background: #f5f7f9;
}

.column-filter-menu[open] .column-filter-trigger::after {
    content: " ▴";
}

.column-filter-trigger.active::before {
    content: "● ";
    font-size: 7px;
}

.column-filter-popover {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    width: 250px;
    display: grid;
    gap: 10px;
    padding: 11px;
    color: #374151;
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 7px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, .14);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
}

.column-filter-popover-right {
    right: 0;
    left: auto;
}

.column-filter-popover label {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: #687386;
    font-size: 10px;
}

.column-filter-popover .header-filter {
    height: 32px;
    font-size: 12px;
}

.column-sort-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding-top: 2px;
}

.column-sort-actions > span {
    grid-column: 1 / -1;
    color: #7a8495;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.column-sort-button {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 4px 7px;
    color: #596579;
    background: #f7f8fa;
    border: 1px solid #e0e4e9;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
}

.column-sort-button:hover:not(:disabled),
.column-sort-button.active {
    color: #202938;
    background: #eef1f4;
}

.column-filter-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
    border-top: 1px solid #edf0f3;
}

.column-filter-actions button {
    min-height: 30px;
    padding: 4px 9px;
    color: #596579;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
}

.column-filter-actions button:hover:not(:disabled) {
    color: #202938;
    background: #f5f7f9;
}
.products-table tbody td { vertical-align: middle; }
.products-table tbody td:nth-child(2),
.products-table tbody td:nth-child(4),
.products-table tbody td:nth-child(6),
.products-table tbody td:nth-child(7),
.products-table tbody td:nth-child(8),
.products-table tbody td:nth-child(9) { white-space: normal; line-height: 1.3; overflow-wrap: anywhere; }
.products-table tbody td:nth-child(2) { max-width: 220px; }
.products-table tbody td:nth-child(4) { max-width: 210px; }
.products-table tbody td:nth-child(6) { max-width: 180px; }
.products-table tbody td:nth-child(7) { max-width: 180px; }
.products-table tbody td:nth-child(8) { max-width: 220px; }
.products-table tbody td:nth-child(9) { max-width: 160px; }

.buyer-price-cell strong,
.buyer-price-cell small {
    display: block;
}

.buyer-price-cell strong {
    color: #283241;
    font-size: 12px;
}

.buyer-price-cell small {
    margin-top: 2px;
    color: #7a8495;
    font-size: 9px;
    line-height: 1.2;
}

.product-identifiers {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.product-identifiers-cell {
    padding-right: 8px;
    padding-left: 8px;
}

.product-identifier-line {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 5px;
    align-items: baseline;
}

.product-identifier-label {
    color: #8a94a3;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.product-identifier-value {
    min-width: 0;
    color: #374151;
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.product-stocks {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.product-stocks-cell {
    padding-right: 8px;
    padding-left: 8px;
}

.product-stock-line {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 5px;
    align-items: baseline;
}

.product-stock-label {
    color: #8a94a3;
    font-size: 9px;
    font-weight: 700;
}

.product-stock-value {
    min-width: 0;
    color: #374151;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
}
.products-table .product-title {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    line-height: 1.3;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-clickable-row { cursor: pointer; }
.product-knowledge-modal .modal-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
}
.product-knowledge-modal .modal-header > div:first-child { min-width: 0; }
.product-knowledge-modal .modal-header h2 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-knowledge-header-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.marketplace-link-icon {
    width: 34px;
    min-width: 34px;
    height: 26px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 0;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.2px;
    text-decoration: none;
    cursor: pointer;
}
.marketplace-link-icon.ozon { background: #005bff; color: #fff; }
.marketplace-link-icon.wildberries { background: linear-gradient(135deg, #cb11ab, #7b2cbf); color: #fff; }
.marketplace-link-icon.yandex { background: #ffcc00; color: #2d2500; }
.marketplace-link-icon:hover { transform: translateY(-1px); filter: brightness(.97); }
.marketplace-link-icon:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.product-list-marketplace-link { flex: 0 0 30px; width: 30px; min-width: 30px; height: 24px; min-height: 24px; border-radius: 5px; }
.products-table .product-summary { min-width: 0; max-width: none; }

.product-summary-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 3px;
}

.product-feedback-counts {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    color: #687384;
    font-size: 9px;
    line-height: 1.25;
}

.product-feedback-count {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 5px;
    border: 1px solid #e0e5ea;
    border-radius: 999px;
    background: #f8fafc;
    color: #556170;
    white-space: nowrap;
}

.product-feedback-counts.complete .product-feedback-count {
    border-color: #d6e7db;
    background: #f3faf5;
}

.product-feedback-counts-scope {
    color: #8a94a1;
    font-size: 8px;
    white-space: nowrap;
}
.product-knowledge-header-actions .modal-close { flex: 0 0 auto; }
.product-clickable-row:focus { outline: 2px solid currentColor; outline-offset: -2px; }
.product-knowledge-modal { width: min(900px, calc(100vw - 32px)); max-height: min(86vh, 900px); overflow: hidden; }
.product-knowledge-body { display: grid; gap: 16px; max-height: calc(86vh - 96px); padding-right: 4px; overflow: auto; }
.knowledge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.knowledge-field { padding: 10px; border: 1px solid #e3e6ea; border-radius: 8px; background: #fafbfc; }
.knowledge-field strong { display: block; margin-bottom: 4px; font-size: 11px; text-transform: uppercase; color: #6b7280; }
.knowledge-field div { overflow-wrap: anywhere; }
.knowledge-section { border-top: 1px solid #e5e7eb; padding-top: 12px; }
.knowledge-section h3 { margin: 0 0 8px; }
.knowledge-section p { margin: 0; white-space: pre-wrap; line-height: 1.5; overflow-wrap: anywhere; }
.knowledge-attributes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.knowledge-attributes > div { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.2fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid #eef0f2; }
.knowledge-attributes strong, .knowledge-attributes span { overflow-wrap: anywhere; }

.product-feedback-history-head,
.product-feedback-history-actions,
.product-feedback-meta,
.product-feedback-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}
.product-feedback-history-head { justify-content: space-between; }
.product-feedback-history-head > div:first-child {
    display: grid;
    gap: 2px;
}
.product-feedback-history-head h3 { margin: 0; }

.product-feedback-heading-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-feedback-summary-counts {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border: 1px solid #dfe5eb;
    border-radius: 999px;
    background: #f8fafc;
    color: #4b5563;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

.product-feedback-completeness {
    display: block;
    max-width: 560px;
    font-size: 10px;
    line-height: 1.3;
}
.product-feedback-history-actions { flex-wrap: wrap; justify-content: flex-end; }
.product-feedback-history-actions button,
.product-feedback-pagination button { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.product-feedback-history-content { display: grid; gap: 12px; margin-top: 10px; }
.product-feedback-group { display: grid; gap: 7px; }
.product-feedback-group-title { font-weight: 700; font-size: 13px; color: #374151; }
.product-feedback-items { display: grid; gap: 6px; }
.product-feedback-item { padding: 8px 10px; border: 1px solid #e5e7eb; border-left: 3px solid #d1d5db; border-radius: 6px; background: #fff; }
.product-feedback-item.unanswered { border-left-color: #d59a2a; }
.product-feedback-item.answered { border-left-color: #4e9568; }
.product-feedback-meta { flex-wrap: wrap; font-size: 11px; }
.product-feedback-status { padding: 1px 5px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.product-feedback-status.unanswered { color: #8a5f16; background: #fff7df; }
.product-feedback-status.answered { color: #2f7047; background: #edf8f1; }
.product-feedback-text { margin: 5px 0 0; font-size: 12px; line-height: 1.4; white-space: pre-wrap; }
.product-feedback-answer { display: grid; gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px solid #eef0f2; font-size: 11px; line-height: 1.4; }
.product-feedback-answer strong { color: #596579; font-size: 10px; text-transform: uppercase; }
.product-feedback-empty { padding: 8px 0; font-size: 12px; }
.product-feedback-pagination { justify-content: flex-end; font-size: 11px; }

@media (min-width: 1280px) {
    #productsPage .table-wrap {
        position: relative;
        z-index: 2;
        overflow: visible;
    }

    .pagination {
        position: relative;
        z-index: 1;
    }

    .table-wrap .products-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .products-table .product-header {
        min-width: 0;
    }

    .products-col-marketplace { width: 7%; }
    .products-col-account { width: 11%; }
    .products-col-product { width: 20%; }
    .products-col-identifiers { width: 10%; }
    .products-col-price { width: 13%; }
    .products-col-buyer-price { width: 13%; }
    .products-col-stock { width: 10%; }
    .products-col-status { width: 9%; }
    .products-col-updated { width: 7%; }

    .marketplace-column,
    .account-column,
    .product-column,
    .identifiers-column,
    .price-column,
    .stock-combined-column,
    .status-column,
    .updated-column {
        min-width: 0;
    }
}

@media (max-width: 1100px) {
    #productsPage .table-wrap {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .quick-filter-bar { grid-template-columns: minmax(240px, 2fr) repeat(5, minmax(110px, 1fr)); min-width: 920px; }
}

@media (max-width: 760px) {
    .catalog-summary-bar { align-items: flex-start; flex-direction: column; }
    .table-tools { width: 100%; justify-content: space-between; }
    .quick-filter-bar { min-width: 920px; }
    .knowledge-grid, .knowledge-attributes { grid-template-columns: 1fr; }
    .knowledge-attributes > div { grid-template-columns: 1fr; }
}

.account-provider-column.provider-yandex {
    border-top-color: #ffcc00;
}
.account-provider-column.provider-yandex .account-provider-head strong {
    color: #5f4c00;
}
