.management-products [hidden] {
    display: none !important;
}
.product-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) minmax(150px, 1fr);
    gap: 1rem;
}
.product-filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.product-group {
    border: 1px solid #e4e9f2;
    box-shadow: none;
    overflow: hidden;
}
.product-group-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.5rem;
    border: 0;
    background: #f1f3fc;
    color: #33445b;
    text-align: left;
}
.product-group-toggle:hover {
    background: #e9edfb;
}
.product-group-toggle:focus-visible {
    outline: 2px solid #727cf5;
    outline-offset: -3px;
}
.product-chevron {
    font-size: 1.4rem;
    transition: transform 0.15s;
}
.product-group-toggle[aria-expanded='false'] .product-chevron {
    transform: rotate(-90deg);
}
.product-group-name {
    font-size: 1rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.product-group-count {
    margin-left: auto;
    color: #687b93;
    font-size: 0.8rem;
    white-space: nowrap;
    font-weight: 400;
}
.product-table {
    width: 100%;
    table-layout: fixed;
}
.product-table th {
    color: #758297;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
}
.product-table th:nth-child(1) {
    width: 40%;
}
.product-table th:nth-child(2) {
    width: 18%;
}
.product-table th:nth-child(3) {
    width: 14%;
}
.product-table th:nth-child(4) {
    width: 28%;
}
.product-table td {
    vertical-align: middle;
    padding: 1.15rem 1.5rem;
}
.product-table tbody tr:last-child td {
    border-bottom: 0;
}
.product-identity {
    position: relative;
    padding-left: 3rem !important;
}
.product-identity::before {
    content: '';
    position: absolute;
    left: 1.6rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e4e9f2;
}
.product-identity::after {
    content: '';
    position: absolute;
    left: 1.6rem;
    top: 1.8rem;
    width: 0.75rem;
    height: 1px;
    background: #d4dcec;
}
.product-table tbody tr:last-child .product-identity::before {
    bottom: calc(100% - 1.8rem);
}
.product-name-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
}
.product-name {
    color: #33445b;
    font-weight: 600;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}
a.product-name:hover {
    color: #5b65dc;
    text-decoration: underline;
}
.product-driver,
.product-meta {
    color: #758297;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}
.product-meta {
    margin-top: 0.25rem;
}
.product-meta span {
    display: block;
}
.product-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.78rem;
    background: #f0f2f6;
    color: #526076;
}
.product-status::before {
    content: '';
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: currentColor;
}
.product-status.is-active {
    background: #e8f7f1;
    color: #167450;
}
.product-status.is-draft {
    background: #fff4df;
    color: #936017;
}
.product-status.is-archived {
    color: #6c7789;
}
.product-actions > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}
.product-actions .btn {
    white-space: nowrap;
}
@media (max-width: 1199px) {
    .product-table th,
    .product-table td {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .product-table th:nth-child(1) {
        width: 37%;
    }
    .product-table th:nth-child(2) {
        width: 20%;
    }
    .product-table th:nth-child(4) {
        width: 29%;
    }
}
@media (max-width: 767px) {
    .product-filter-grid {
        grid-template-columns: 1fr 1fr;
    }
    .product-filter-grid > div:first-child {
        grid-column: 1 / -1;
    }
    .product-group-toggle {
        padding: 1rem;
        gap: 0.5rem;
    }
    .product-table,
    .product-table tbody {
        display: block;
    }
    .product-table thead {
        display: none;
    }
    .product-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        border-top: 1px solid #e4e9f2;
        padding: 1rem;
        gap: 0.75rem;
    }
    .product-table td {
        display: block;
        padding: 0;
        border: 0;
    }
    .product-table .product-identity {
        grid-column: 1 / -1;
        padding-left: 1.25rem !important;
    }
    .product-identity::before {
        left: 0;
        top: 0.3rem;
        bottom: 0.3rem !important;
    }
    .product-identity::after {
        left: 0;
        top: 0.75rem;
    }
    .product-status-cell {
        align-self: center;
    }
    .product-actions {
        grid-column: 1 / -1;
    }
    .product-actions > div {
        justify-content: flex-start;
    }
}
@media (max-width: 479px) {
    .product-filter-grid {
        grid-template-columns: 1fr;
    }
}

.product-category {
    overflow: hidden;
    border: 1px solid #e4e9f2;
}
.product-category-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
}
.product-category-heading h4 {
    margin: 0;
    font-size: 1.15rem;
    color: #33445b;
}
.product-category .product-group {
    margin: 0;
    border: 0;
    border-top: 1px solid #e4e9f2;
    border-radius: 0;
}
.product-category .product-group-toggle {
    padding-left: 2rem;
}
.product-category-direct .product-group-toggle {
    background: #fff;
    padding-left: 1.5rem;
}
.product-category-direct .product-group-name {
    font-size: 1.15rem;
}
@media (max-width: 767px) {
    .product-category-heading {
        padding: 1rem;
    }
    .product-category .product-group-toggle {
        padding-left: 1rem;
    }
}

.catalog-group-heading {
    display: flex;
    align-items: center;
    background: #f1f3fc;
    gap: 0.5rem;
    padding-right: 1rem;
}
.catalog-group-heading > .product-group-toggle {
    flex: 1;
    min-width: 0;
}
.catalog-group-heading > .btn {
    flex-shrink: 0;
}
.product-group .product-group {
    border-left-width: 3px;
    margin-left: 1rem;
}
.catalog-dialog {
    width: min(580px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 1.5rem;
    border: 1px solid #e4e9f2;
    border-radius: 6px;
    color: #6c757d;
    box-shadow: 0 12px 40px #26364d33;
}
.catalog-dialog::backdrop {
    background: #26364d70;
}
.catalog-dialog [hidden] {
    display: none !important;
}
.catalog-action-menu {
    display: grid;
    gap: 0.5rem;
}
.catalog-action-menu .btn {
    text-align: left;
}
@media (max-width: 767px) {
    .catalog-group-heading {
        padding-right: 0.5rem;
    }
    .product-group .product-group {
        margin-left: 0.25rem;
    }
    .catalog-dialog {
        padding: 1rem;
    }
}
