/* Tabulator в стиле .pf-table */

.pf-table-host.pf-table-wrap {
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    border: 1px solid var(--pf-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--pf-bg);
}

.pf-table-host .tabulator-col .tabulator-col-content {
    padding: 10px 12px 10px 16px;
}

.pf-table-host .tabulator-col-title-holder {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 1.25rem;
    width: 100%;
}

.pf-table-host .tabulator-col-title {
    flex: 1;
    min-width: 0;
    order: 1;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: normal;
    font-stretch: normal;
    color: var(--pf-text-muted);
    padding: 0;
    border: none;
}

.pf-table-host .pf-col-header-tools {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    flex-shrink: 0;
}

.pf-table-host .tabulator-col-sorter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.pf-table-host .tabulator-col-sorter .tabulator-arrow {
    display: none !important;
}

.pf-table-host .pf-col-sort-icon {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
    color: var(--pf-text-muted);
    opacity: 0.65;
    cursor: pointer;
    user-select: none;
}

.pf-table-host .pf-col-sort-icon__letter {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.pf-table-host .pf-col-header-tools .tabulator-header-popup-button,
.pf-table-host .pf-col-header-tools .tabulator-col-popup-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.pf-table-host .pf-col-header-tools .tabulator-header-popup-button:hover,
.pf-table-host .pf-col-header-tools .tabulator-col-popup-button:hover {
    background: var(--pf-surface-hover);
}

.pf-table-host .pf-col-header-tools .pf-col-filter-icon svg {
    width: 12px;
    height: 12px;
}

.pf-table-host .pf-col-sort-icon__arrow::before {
    content: "↕";
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
}

.pf-table-host .pf-col-sort-icon--asc,
.pf-table-host .pf-col-sort-icon--desc {
    color: var(--pf-accent-blue);
    opacity: 1;
}

.pf-table-host .pf-col-sort-icon--asc .pf-col-sort-icon__arrow::before {
    content: "↑";
}

.pf-table-host .pf-col-sort-icon--desc .pf-col-sort-icon__arrow::before {
    content: "↓";
}

.pf-table-host .pf-col-filter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    color: var(--pf-text-muted);
    opacity: 0.38;
}

.pf-table-host .tabulator-header-popup-button:hover .pf-col-filter-icon,
.pf-table-host .tabulator-col-popup-button:hover .pf-col-filter-icon {
    opacity: 0.58;
}

.pf-table-host .tabulator-col.pf-col-filter-active .pf-col-filter-icon,
.pf-table-host .tabulator-header-popup-button.is-active .pf-col-filter-icon,
.pf-table-host .tabulator-col-popup-button.is-active .pf-col-filter-icon {
    color: var(--pf-accent-blue);
    opacity: 1;
}

.pf-table-host .tabulator-header-popup-button.is-active,
.pf-table-host .tabulator-col-popup-button.is-active {
    background: rgba(91, 143, 185, 0.12);
}

.pf-table-host .tabulator-header-filter,
.pf-table-host .pf-col-filter-hidden {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
}

.pf-col-filter-popup {
    min-width: 200px;
    padding: 2px 0;
}

.pf-col-filter-popup__input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--pf-border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.88rem;
    font-family: var(--pf-font);
    background: var(--pf-bg);
    color: var(--pf-text);
}

.pf-col-filter-popup__input:focus {
    outline: none;
    border-color: var(--pf-accent-blue);
    box-shadow: 0 0 0 3px rgba(91, 143, 185, 0.12);
}

.pf-col-filter-popup__input::placeholder {
    color: var(--pf-text-muted);
    opacity: 0.85;
}

.pf-col-filter-popup--checks {
    min-width: 240px;
    max-height: 340px;
    overflow-y: auto;
    padding: 4px 2px;
}

.pf-col-filter-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 4px;
    font-size: 0.86rem;
    line-height: 1.3;
    color: var(--pf-text);
    cursor: pointer;
    border-radius: 4px;
}

.pf-col-filter-check:hover {
    background: rgba(0, 0, 0, 0.04);
}

.pf-col-filter-check input[type="checkbox"] {
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: var(--pf-accent-blue);
}

.pf-col-filter-check span {
    flex: 1;
}

.tabulator-popup-container .tabulator-popup {
    border: 1px solid var(--pf-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 10px 12px;
    background: var(--pf-bg);
    font-family: var(--pf-font);
}

.pf-table-host .tabulator {
    width: 100%;
    border: none;
    border-radius: 0;
    background: var(--pf-bg);
    font-family: var(--pf-font);
    font-size: 0.92rem;
    font-stretch: normal;
    letter-spacing: normal;
    color: var(--pf-text);
}

.pf-table-host .tabulator-tableholder {
    border: none;
}

.pf-table-host .tabulator-header {
    background: var(--pf-surface);
    border: none;
    border-bottom: 1px solid var(--pf-border);
    border-top: none;
    font-weight: inherit;
}

.pf-table-host .tabulator-headers {
    border: none;
}

.pf-table-host .tabulator-header .tabulator-col {
    background: var(--pf-surface);
    border: none;
    border-right: 1px solid var(--pf-border);
}

.pf-table-host .tabulator-header .tabulator-col:last-child {
    border-right: none;
}

.pf-table-host .tabulator-col-resize-handle {
    width: 6px;
}

.pf-table-host .tabulator-col-resize-handle:hover {
    background: var(--pf-accent-blue);
    opacity: 0.35;
}

.pf-table-host .tabulator-header-filter {
    padding: 0;
    margin: 0;
    border: none;
}

.pf-table-host .tabulator-header-filter input {
    width: 100% !important;
    max-width: none;
    box-sizing: border-box;
    border: 1px solid var(--pf-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--pf-bg);
    color: var(--pf-text);
}

.pf-table-host .tabulator-header-filter input:focus {
    outline: none;
    border-color: var(--pf-accent-blue);
    box-shadow: 0 0 0 3px rgba(91, 143, 185, 0.12);
}

.pf-table-host .tabulator-header-filter input::placeholder {
    color: var(--pf-text-muted);
    opacity: 0.85;
}

.pf-table-host .tabulator-row {
    background: var(--pf-bg);
    border: none;
    border-bottom: 1px solid var(--pf-border);
    min-height: 48px;
}

.pf-table-host .tabulator-row.tabulator-row-even {
    background: var(--pf-bg);
}

.pf-table-host .tabulator-row:hover {
    background: var(--pf-surface-hover);
}

.pf-table-host .tabulator-row .tabulator-cell {
    padding: 12px 16px;
    border: none;
    border-bottom: none;
    vertical-align: middle;
    box-sizing: border-box;
}

.pf-table-host .tabulator-cell.pf-cell-wrap {
    white-space: normal !important;
    overflow: visible;
}

.pf-table-host .pf-cell-wrap__inner {
    display: block;
    width: 100%;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
    font-size: 0.9rem;
}

.pf-table-host .tabulator-row:last-child {
    border-bottom: none;
}

.pf-table-host .pf-product-name-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--pf-link, #0969da);
    text-decoration: none;
    max-width: 100%;
}

.pf-table-host .pf-product-name-link:hover {
    text-decoration: underline;
}

.pf-table-host .pf-product-name-link__text {
    white-space: normal;
    word-break: break-word;
}

.pf-table-host .pf-product-name-link__icon {
    flex-shrink: 0;
    display: inline-flex;
    opacity: 0.75;
}

.pf-table-host .pf-product-name-link:hover .pf-product-name-link__icon {
    opacity: 1;
}

.pf-table-host .tabulator-placeholder {
    padding: 28px 16px;
    color: var(--pf-text-muted);
    font-size: 0.95rem;
}

.pf-table-host .tabulator-placeholder span {
    border: none;
    background: transparent;
}

.pf-table-host .tabulator-responsive-collapse {
    border-top: 1px solid var(--pf-border);
    background: var(--pf-surface);
}

.pf-table-host .tabulator-responsive-collapse-toggle {
    color: var(--pf-accent-blue);
    font-weight: 700;
}

.pf-table-host .tabulator-responsive-collapse-toggle:hover {
    color: var(--pf-accent-blue-dark);
}

.pf-table-host .tabulator-footer {
    display: none;
}

.pf-table-host .pf-table-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.pf-table-host .pf-table-actions form {
    margin: 0;
    display: inline-flex;
}

.pf-table-host .pf-table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--pf-border);
    border-radius: 6px;
    background: var(--pf-bg);
    color: var(--pf-text-muted);
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    line-height: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pf-table-host .pf-table-action-btn:hover {
    background: var(--pf-surface-hover);
    color: var(--pf-accent-blue);
    border-color: var(--pf-accent-blue);
}

.pf-table-host .pf-table-action-btn--danger:hover {
    color: var(--pf-danger);
    border-color: #e8c4c4;
    background: var(--pf-danger-bg);
}

.pf-table-host .pf-table-action-btn.is-busy {
    opacity: 0.55;
    pointer-events: none;
    cursor: wait;
}

.pf-table-host .tabulator .tabulator-alert {
    background: rgba(255, 255, 255, 0.9);
}

.pf-table-host .tabulator-loader {
    border-color: var(--pf-accent-blue);
}

.pf-table-host .pf-sku-copy-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    cursor: pointer;
    user-select: none;
}

.pf-table-host .pf-sku-copy-cell__text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.pf-table-host .pf-sku-copy-cell__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--pf-border);
    border-radius: 4px;
    background: var(--pf-bg);
    color: var(--pf-text-muted);
    cursor: pointer;
    line-height: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pf-table-host .pf-sku-copy-cell:hover .pf-sku-copy-cell__btn,
.pf-table-host .pf-sku-copy-cell__btn:hover {
    background: var(--pf-surface-hover);
    color: var(--pf-accent-blue);
    border-color: var(--pf-accent-blue);
}

/* Статическая HTML-таблица в pf-table-host — как список поставок (Tabulator) */
.pf-table-host.pf-table-wrap--scroll {
    overflow-x: auto;
}

.pf-table-host table.pf-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--pf-font);
    font-size: 0.92rem;
    color: var(--pf-text);
    background: var(--pf-bg);
}

.pf-table-host table.pf-table thead {
    background: var(--pf-surface);
}

.pf-table-host table.pf-table th {
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: normal;
    color: var(--pf-text-muted);
    background: var(--pf-surface);
    border-bottom: 1px solid var(--pf-border);
    border-right: 1px solid var(--pf-border);
    vertical-align: middle;
    text-align: left;
}

.pf-table-host table.pf-table th:last-child {
    border-right: none;
}

.pf-table-host table.pf-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--pf-border);
    vertical-align: middle;
    background: var(--pf-bg);
    font-size: 0.92rem;
    line-height: 1.45;
}

.pf-table-host table.pf-table tbody tr {
    min-height: 48px;
}

.pf-table-host table.pf-table tbody tr:hover td {
    background: var(--pf-surface-hover);
}

.pf-table-host table.pf-table tbody tr:last-child td {
    border-bottom: none;
}

.pf-table-host table.pf-table .pf-table__num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pf-table-host table.pf-table th.pf-table__actions,
.pf-table-host table.pf-table td.pf-table__actions {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
}

.pf-table-host table.pf-table td.pf-table__actions > form,
.pf-table-host table.pf-table td.pf-table__actions > button,
.pf-table-host table.pf-table td.pf-table__actions > a,
.pf-table-host table.pf-table td.pf-table__actions > span {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 4px;
}

.pf-table-host table.pf-table td.pf-table__actions > *:last-child {
    margin-right: 0;
}

.pf-table-host table.pf-table td.pf-table__actions form {
    margin: 0;
}

.pf-table-host table.pf-table .pf-input--qty-sm {
    width: 100%;
    max-width: 100px;
    min-width: 56px;
    flex: 0 1 100px;
}
