/* ─── Products admin – full UI kit ─────────────────────────────────────────── */

/* ══════════════════════════════════════════════════════
   TOOLBAR  (single horizontal row of filters)
   ══════════════════════════════════════════════════════ */
.prd-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.125rem;
}

/* Search box ─ grows but caps at 280px */
.prd-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 260px;
    min-width: 160px;
}

.prd-search-wrap > i {
    position: absolute;
    left: .7rem;
    font-size: .8125rem;
    color: #94a3b8;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
    z-index: 1;
}

/* Override global .admin-ui input { width:100%; height:2.75rem } */
.prd-search-input,
.admin-ui .prd-search-input {
    width: 100% !important;
    height: 36px !important;
    padding: 0 .75rem 0 2rem !important;
    font-size: .8125rem !important;
    color: #0f172a;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    outline: none;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s;
}

.prd-search-input::placeholder { color: #94a3b8; }

.prd-search-input:focus,
.admin-ui .prd-search-input:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .1) !important;
}

/* Filter selects — override global .admin-ui select { width:100% } */
.prd-filter-select,
.admin-ui .prd-filter-select,
.admin-ui select.prd-filter-select {
    width: auto !important;
    height: 36px !important;
    padding: 0 2rem 0 .7rem !important;
    font-size: .8125rem !important;
    color: #374151;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right .6rem center !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s;
}

.prd-filter-select:focus,
.admin-ui .prd-filter-select:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .1) !important;
}

/* Clear-filters badge */
.prd-filter-clear {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    height: 36px;
    padding: 0 .75rem;
    border-radius: 10px;
    font-size: .8125rem;
    font-weight: 500;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .12s;
    line-height: 1;
}

.prd-filter-clear:hover { background: #fee2e2; }

.prd-cat-filter {
    position: relative;
    flex-shrink: 0;
}

.prd-cat-filter .cat-select {
    min-width: 130px;
    max-width: 220px;
}

.prd-cat-filter .cat-select-trigger {
    height: 36px;
    min-height: 36px;
    padding: 0 .65rem 0 .75rem;
    font-size: .8125rem;
    border-width: 1px;
    border-color: #e2e8f0;
}

.prd-cat-filter .cat-select-trigger:hover { border-color: #c4b5fd; }

.prd-cat-filter .cat-select--open .cat-select-trigger {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

.prd-cat-filter .cat-select-trigger:has(.cat-select-value:not(.cat-select-value--ph)) {
    color: #6d28d9;
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.prd-cat-filter .cat-select-dd {
    min-width: 280px;
    width: max(100%, 280px);
}

/* ─── Searchable select widget ──────────────────────────────────────────────── */
.prd-ss {
    position: relative;
    flex-shrink: 0;
}

.prd-ss-trigger {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    height: 36px;
    padding: 0 .65rem 0 .75rem;
    font-size: .8125rem;
    color: #374151;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, box-shadow .15s;
    user-select: none;
    min-width: 130px;
    max-width: 220px;
}

.prd-ss-trigger:hover { border-color: #c4b5fd; }

.prd-ss-trigger.is-open,
.prd-ss-trigger:focus-visible {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,.1);
    outline: none;
}

.prd-ss-trigger.has-value {
    color: #6d28d9;
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.prd-ss-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    font-size: .8125rem;
}

.prd-ss-caret {
    font-size: .65rem;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform .15s;
    line-height: 1;
}

.prd-ss-trigger.is-open .prd-ss-caret { transform: rotate(180deg); }

.prd-ss-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    max-width: 320px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(15,23,42,.13);
    z-index: 400;
    overflow: hidden;
    display: none;
}

.prd-ss-panel.is-open { display: block; }

.prd-ss-search-wrap {
    padding: .5rem .625rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfd;
}

.prd-ss-search {
    width: 100%;
    height: 32px;
    padding: 0 .65rem;
    font-size: .8125rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
}

.prd-ss-search:focus { border-color: #7c3aed; }

.prd-ss-list {
    max-height: 240px;
    overflow-y: auto;
    padding: .3rem 0;
}

.prd-ss-opt {
    padding: .45rem .875rem;
    font-size: .8125rem;
    color: #374151;
    cursor: pointer;
    transition: background .08s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prd-ss-opt:hover { background: #f5f3ff; color: #7c3aed; }
.prd-ss-opt.is-sel { font-weight: 600; color: #6d28d9; }
.prd-ss-opt.is-hidden { display: none; }

.prd-ss-empty {
    padding: .75rem 1rem;
    font-size: .8rem;
    color: #94a3b8;
    text-align: center;
    display: none;
}

.pe-supplier-row {
    display: flex;
    align-items: stretch;
    gap: .5rem;
    width: 100%;
}

.pe-supplier-dd {
    flex: 1;
    min-width: 0;
}

.pe-supplier-trigger {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 42px;
    border-radius: 12px;
}

.pe-supplier-panel {
    left: 0;
    right: 0;
    min-width: 100%;
    max-width: none;
    width: 100%;
}

.pe-supplier-add {
    flex: none;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #7c3aed;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.pe-supplier-add:hover {
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.pe-supplier-add i {
    font-size: .95rem;
    line-height: 1;
}

.pe-supplier-modal[hidden] { display: none !important; }

.pe-supplier-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pe-supplier-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
}

.pe-supplier-modal-panel {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .2);
    overflow: hidden;
}

.pe-supplier-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .875rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: .9375rem;
    font-weight: 700;
    color: #0f172a;
}

.pe-supplier-modal-x {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pe-supplier-modal-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.pe-supplier-modal-error {
    font-size: .8125rem;
    color: #dc2626;
}

/* ══════════════════════════════════════════════════════
   TABLE  (wrapped in .chart-premium)
   ══════════════════════════════════════════════════════ */

/* Sort links in column headers */
.prd-sort-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.prd-sort-link:hover { color: #7c3aed; }

/* Table rows */
.orders-premium-table tbody tr:hover {
    background: rgba(124, 58, 237, .03);
}

.orders-premium-table thead th {
    background: #f8fafc;
    padding: .625rem .75rem;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.orders-premium-table tbody td {
    border-bottom: 1px solid #f1f5f9;
    padding: .625rem .75rem;
    vertical-align: middle;
}

/* Product thumbnail */
.prd-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    border: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.prd-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: .875rem;
    flex-shrink: 0;
}

/* Product name + sku */
.prd-name {
    font-size: .875rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.prd-sku {
    font-size: .72rem;
    color: #94a3b8;
    margin-top: 1px;
}

/* Stock pills */
.stock-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: .18rem .55rem;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .01em;
}

.stock-pill--ok   { background: #f0fdf4; color: #059669; }
.stock-pill--low  { background: #fff7ed; color: #d97706; }
.stock-pill--zero { background: #fef2f2; color: #dc2626; }

/* ══════════════════════════════════════════════════════
   ACTIVE TOGGLE  (checkbox → visual slider)
   ══════════════════════════════════════════════════════ */
.prd-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.prd-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.prd-toggle-track {
    width: 32px;
    height: 17px;
    border-radius: 999px;
    background: #e2e8f0;
    position: relative;
    transition: background .18s;
    flex-shrink: 0;
    display: block;
}

.prd-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    transition: transform .18s;
}

.prd-toggle input[type="checkbox"]:checked ~ .prd-toggle-track {
    background: #7c3aed;
}

.prd-toggle input[type="checkbox"]:checked ~ .prd-toggle-track::after {
    transform: translateX(15px);
}

.prd-toggle.is-loading .prd-toggle-track {
    opacity: .5;
    cursor: wait;
}

/* ══════════════════════════════════════════════════════
   ACTION BUTTONS  (edit / delete)
   ══════════════════════════════════════════════════════ */
.prd-action-btn {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .3rem .625rem;
    border-radius: 7px;
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .13s;
    white-space: nowrap;
    line-height: 1;
    background: none;
}

.prd-action-btn--edit {
    color: #7c3aed;
    border-color: rgba(124, 58, 237, .22);
    background: rgba(124, 58, 237, .06);
}

.prd-action-btn--edit:hover {
    background: rgba(124, 58, 237, .12);
    border-color: rgba(124, 58, 237, .38);
}

.prd-action-btn--delete {
    color: #dc2626;
    border-color: rgba(220, 38, 38, .18);
    background: rgba(220, 38, 38, .04);
}

.prd-action-btn--delete:hover {
    background: rgba(220, 38, 38, .1);
    border-color: rgba(220, 38, 38, .32);
}

/* ══════════════════════════════════════════════════════
   CENTERED MODAL  (add-product dialog)
   .prd-panel is a child of .prd-backdrop on purpose: .prd-backdrop is the
   fixed full-viewport positioned ancestor, so .prd-panel's `position:
   absolute; top/left 50%` centers against the *viewport*, not whatever
   `position:relative` wrapper happens to sit above it in the page layout.
   ══════════════════════════════════════════════════════ */
.prd-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
}

.prd-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.prd-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(560px, 94vw);
    max-height: min(92vh, 880px);
    background: #fff;
    border: 1px solid #e8edf5;
    box-shadow: 0 32px 80px rgba(15, 23, 42, .32);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    transform: translate(-50%, -50%) scale(.96);
    opacity: 0;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1), opacity .18s;
    overflow: hidden;
    border-radius: 22px;
    pointer-events: none;
}

@media (min-width: 720px) {
    .prd-panel { width: min(680px, 92vw); }
}

@media (min-width: 980px) {
    .prd-panel { width: min(980px, 90vw); }
}

.prd-panel.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

.prd-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
}

.prd-panel-title {
    font-size: .9375rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.01em;
}

.prd-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 1rem;
    line-height: 1;
    transition: background .15s, color .13s;
}

.prd-panel-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.prd-panel-body {
    position: relative;
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.75rem 1.75rem;
    overscroll-behavior: contain;
}

/* Form (left) + live preview (right) layout */
.prd-modal-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 1.5rem;
}

@media (min-width: 980px) {
    .prd-modal-grid {
        flex-direction: row;
        align-items: flex-start;
    }
    .prd-modal-form {
        flex: 1;
        min-width: 0;
    }
    .prd-modal-preview {
        width: 260px;
        flex-shrink: 0;
        position: sticky;
        top: 0;
    }
}

/* Compact section headers inside the modal form */
.prd-subhead {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    font-weight: 700;
    color: #0f172a;
    margin: 1.375rem 0 .75rem;
}

.prd-subhead:first-child { margin-top: 0; }
.prd-subhead i { color: #7c3aed; font-size: .875rem; }

/* Two-column field pairs inside add-panel (category/supplier, price/sku, ...) */
.prd-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

@media (max-width: 560px) {
    .prd-field-grid {
        grid-template-columns: 1fr;
    }
}

/* Stock grid inside add-panel */
.prd-stock-grid {
    display: grid;
    gap: .625rem;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.prd-stock-field {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: .625rem .75rem;
    background: #f8fafc;
}

.prd-stock-label {
    font-size: .75rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: .375rem;
    line-height: 1.25;
}

/* Local photo upload (add-product modal) */
.prd-upload-input {
    display: none;
}

.prd-upload-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    height: 168px;
    border: 2px dashed #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s, background .15s;
}

.prd-upload-drop:hover {
    border-color: #a78bfa;
    background: #f5f3ff;
}

.prd-upload-drop.has-image {
    border-style: solid;
    padding: 0;
}

.prd-upload-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prd-upload-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    color: #94a3b8;
    font-size: .8125rem;
    text-align: center;
    padding: 0 1rem;
}

.prd-upload-placeholder i {
    font-size: 1.5rem;
    color: #a78bfa;
}

.prd-upload-edit {
    position: absolute;
    bottom: .5rem;
    right: .5rem;
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .6rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, .68);
    color: #fff;
    font-size: .6875rem;
    font-weight: 600;
    backdrop-filter: blur(2px);
}

/* Crop dialog — an overlay confined to the panel itself */
.prd-crop-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, .98);
}

.prd-crop-overlay.open { display: flex; }

.prd-crop-head {
    padding: 1rem 1.375rem;
    font-size: .875rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.prd-crop-stage {
    flex: 1;
    min-height: 0;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
}

.prd-crop-stage .prd-crop-image-el {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.prd-crop-actions {
    display: flex;
    gap: .625rem;
    padding: 1rem 1.375rem;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.prd-crop-actions .ta-btn,
.prd-crop-actions .ta-btn-secondary {
    flex: 1;
}

.ta-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .625rem 1rem;
    border-radius: 10px;
    font-size: .8125rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    border: none;
    cursor: pointer;
    transition: background .15s;
}

.ta-btn-secondary:hover { background: #e2e8f0; }

/* Live product-card preview (mirrors the mobile app card) */
.prd-preview-label {
    font-size: .75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .625rem;
    text-align: center;
}

@media (min-width: 980px) {
    .prd-preview-label { text-align: left; }
}

.prd-preview-card {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    background: #1e1e1e;
    border-radius: 16px;
    padding: 10px;
}

@media (min-width: 980px) {
    .prd-preview-card { max-width: none; }
}

.prd-preview-imgwrap {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #3a3a3a;
}

.prd-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.prd-preview-img-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e6e;
    font-size: 1.75rem;
}

.prd-preview-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    padding: .3rem .5rem;
    border-top-left-radius: 10px;
    border-bottom-right-radius: 12px;
    background: #c9005e;
    color: #fff;
    font-size: .6875rem;
    font-weight: 800;
    letter-spacing: .02em;
    display: none;
}

.prd-preview-body { padding-top: .5rem; }

.prd-preview-name {
    color: #f5f5f5;
    font-size: .8125rem;
    line-height: 1rem;
    height: 2rem;
    margin-bottom: .3rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.prd-preview-meta {
    display: flex;
    align-items: center;
    gap: .375rem;
    height: .875rem;
    font-size: .625rem;
    color: #9a9a9a;
    margin-bottom: .5rem;
    overflow: hidden;
    white-space: nowrap;
}

.prd-preview-meta .prd-preview-strength {
    flex-shrink: 0;
    color: #c9005e;
    font-weight: 700;
}

.prd-preview-price-new {
    color: #f5f5f5;
    font-weight: 800;
    font-size: .9375rem;
}

.prd-preview-price-old {
    color: #6e6e6e;
    font-size: .75rem;
    text-decoration: line-through;
    margin-left: .375rem;
}

/* ══════════════════════════════════════════════════════
   BULK SELECTION BAR
   ══════════════════════════════════════════════════════ */
.prd-bulk-check {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #7c3aed;
    cursor: pointer;
    flex-shrink: 0;
}

.prd-bulk-check-cell {
    width: 44px;
    text-align: center;
    vertical-align: middle;
}

.orders-premium-table tbody tr.is-bulk-selected {
    background: rgba(124, 58, 237, .06);
}

.orders-premium-table tbody tr.is-bulk-selected:hover {
    background: rgba(124, 58, 237, .09);
}

body.prd-has-bulk-bar #admin-main {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

.prd-bulk-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .94);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, .12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1), opacity .18s;
}

.prd-bulk-bar.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.prd-bulk-bar__meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.prd-bulk-bar__count {
    font-size: .875rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.prd-bulk-bar__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.prd-bulk-bar__cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #475569;
    font-size: .8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .12s;
}

.prd-bulk-bar__cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.prd-bulk-bar__cancel:active {
    transform: scale(.98);
}

.prd-bulk-bar__delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 42px;
    padding: 0 1rem;
    border: none;
    border-radius: 12px;
    background: #dc2626;
    color: #fff;
    font-size: .8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, transform .12s;
}

.prd-bulk-bar__delete:hover {
    background: #b91c1c;
}

.prd-bulk-bar__delete:active {
    transform: scale(.98);
}

@media (min-width: 768px) {
    .prd-bulk-bar {
        left: var(--admin-sidebar-width, 290px);
    }
}

/* ══════════════════════════════════════════════════════
   LEGACY ALIASES (kept for backward compat)
   ══════════════════════════════════════════════════════ */
.product-stock-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.product-stock-field { border: 1px solid #e5e7eb; border-radius: .75rem; padding: .75rem; background: #fff; }
.product-stock-field-name { font-size: .8125rem; font-weight: 600; color: #111827; margin-bottom: .5rem; line-height: 1.25; }

/* ══════════════════════════════════════════════════════
   PRODUCT EDIT PAGE
   ══════════════════════════════════════════════════════ */
.prod-edit-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 1100px) {
    .prod-edit-layout { grid-template-columns: 1fr; }
}

.prod-section {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 4px rgba(15,23,42,.05);
}
.prod-section + .prod-section { margin-top: 1rem; }
.prod-section-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid #f8fafc;
}
.prod-section-title { font-size: .875rem; font-weight: 700; color: #0f172a; }
.prod-section-body { padding: 1.25rem; }

.prod-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem; }
@media (max-width: 640px) { .prod-field-grid { grid-template-columns: 1fr; } }
.prod-field-full { grid-column: 1 / -1; }

.prod-price-markup-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .875rem;
    align-items: end;
}
@media (max-width: 640px) { .prod-price-markup-row { grid-template-columns: 1fr; } }
.prod-markup-badge { display: flex; flex-direction: column; align-items: center; min-width: 84px; }
.prod-markup-value {
    padding: .5rem .75rem;
    border-radius: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #059669;
    font-size: .9375rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}
.prod-markup-value.is-negative { background: #fef2f2; border-color: #fecaca; color: #dc2626; }

.prod-status-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}
.prod-status-row-label { font-size: .875rem; color: #334155; flex: 1; }

.prod-image-wrap {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .875rem;
    transition: border-color .15s;
}
.prod-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.prod-image-wrap-empty { text-align: center; color: #cbd5e1; }
.prod-image-wrap-empty i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.prod-image-wrap-empty span { font-size: .75rem; }

.prod-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8125rem;
    padding: .4rem 0;
    border-bottom: 1px solid #f8fafc;
}
.prod-info-row:last-child { border-bottom: 0; padding-bottom: 0; }
.prod-info-row-label { color: #94a3b8; }
.prod-info-row-val { font-weight: 600; color: #0f172a; }

.prod-danger {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 1.125rem 1.25rem;
    margin-top: 1.25rem;
}
.prod-danger-title { font-size: .8125rem; font-weight: 700; color: #dc2626; margin-bottom: .25rem; }
.prod-danger-desc { font-size: .8125rem; color: #f87171; margin-bottom: .875rem; }

.prod-extra-cats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.prod-extra-cats__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
}
.prod-extra-cats__chips:empty {
    display: none;
}
.prod-extra-cats__chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 7px 8px 7px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #faf8ff 0%, #f5f3ff 100%);
    border: 1.5px solid #ddd6fe;
    box-shadow: 0 1px 0 rgba(124, 58, 237, 0.06);
    color: #5b21b6;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}
.prod-extra-cats__chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    flex-shrink: 0;
}
.prod-extra-cats__chip-icon i {
    font-size: 11px;
    line-height: 1;
}
.prod-extra-cats__chip-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.prod-extra-cats__chip-x {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
}
.prod-extra-cats__chip-x:hover {
    background: #7c3aed;
    color: #fff;
}
.prod-extra-cats__chip-x i {
    font-size: 14px;
    line-height: 1;
}
.prod-extra-cats__add .cat-select-trigger {
    border-style: dashed;
    background: #fafafa;
}
.prod-extra-cats__add .cat-select--open .cat-select-trigger {
    background: #fff;
    border-style: solid;
}
.prd-cat-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.prd-cat-cell__primary {
    font-size: .8125rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.prd-cat-cell__extras {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.prd-cat-cell__extra {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    color: #6d28d9;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Warehouse override cards (catalog product edit) ─────────────────────── */
.prod-wh-body { padding: .9rem 1.15rem 1.2rem !important; }
.prod-wh-count {
    font-size: .65rem;
    font-weight: 700;
    background: rgba(122, 3, 170, .1);
    color: #7A03AA;
    padding: .18rem .55rem;
    border-radius: 999px;
    white-space: nowrap;
}
.prod-wh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    align-items: start;
}
.prod-wh-card {
    border: none;
    border-radius: 14px;
    background: transparent;
    overflow: hidden;
    transition: box-shadow .2s ease;
}
.prod-wh-card.is-open {
    grid-column: 1 / -1;
    z-index: 3;
    overflow: visible;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .10);
}
.prod-wh-card.is-row-peer {
    display: none !important;
}
.prod-wh-face {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    border: 0 !important;
    border-width: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 14px;
    cursor: pointer;
    font: inherit;
    color: #fff !important;
    background: #7c3aed !important;
    display: block;
    overflow: hidden;
    transition: border-radius .18s ease, min-height .18s ease, background .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.prod-wh-face:hover,
.prod-wh-face:focus,
.prod-wh-face:focus-visible {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: #6d28d9 !important;
    color: #fff !important;
}
.prod-wh-card.is-open .prod-wh-face,
.prod-wh-card.is-open .prod-wh-face:hover {
    aspect-ratio: auto;
    min-height: 52px;
    height: 52px;
    border-radius: 14px 14px 0 0;
    background: #7c3aed !important;
}
.prod-wh-card.tone-set .prod-wh-face { background: #7c3aed !important; }
.prod-wh-card.tone-idle .prod-wh-face { background: #7c3aed !important; }
.prod-wh-card.tone-warn .prod-wh-face { background: #7c3aed !important; }
.prod-wh-card.tone-warn .prod-wh-face:hover { background: #6d28d9 !important; }
.prod-wh-face-name {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 2.2rem;
    text-align: center;
    font-size: .92rem;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: .01em;
    z-index: 1;
}
.prod-wh-card.is-open .prod-wh-face-name {
    padding: 0 2rem;
    font-size: .85rem;
}
.prod-wh-face-err {
    position: absolute;
    left: 12px;
    bottom: 10px;
    z-index: 2;
    font-size: .68rem;
    font-weight: 800;
    color: #fff !important;
    background: #dc2626 !important;
    padding: .2rem .5rem;
    border-radius: 6px;
    line-height: 1.1;
    box-shadow: 0 1px 4px rgba(185, 28, 28, .35);
}
.prod-wh-face-err[hidden] { display: none !important; }
.prod-wh-card.is-open .prod-wh-face-err { display: none !important; }
.prod-wh-face-price {
    position: absolute;
    right: 12px;
    bottom: 10px;
    z-index: 2;
    font-size: .72rem;
    font-weight: 750;
    opacity: .95;
    font-variant-numeric: tabular-nums;
}
.prod-wh-face-price[hidden],
.prod-wh-face-sup[hidden] { display: none !important; }
.prod-wh-card.is-open .prod-wh-face-price,
.prod-wh-card.is-open .prod-wh-face-sup { display: none !important; }
.prod-wh-face-sup {
    position: absolute;
    left: 12px;
    top: 10px;
    z-index: 2;
    max-width: calc(100% - 40px);
    font-size: .65rem;
    font-weight: 650;
    opacity: .9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.prod-wh-face-chevron {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
    font-size: .85rem;
    opacity: .85;
    line-height: 1;
    transition: transform .18s ease;
}
.prod-wh-card.is-open .prod-wh-face-chevron {
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
}
.prod-wh-panel {
    background: #fff;
    border: none;
    border-top: 1px solid rgba(122, 3, 170, .08);
    border-radius: 0 0 14px 14px;
    padding: 14px 14px 16px;
}
.prod-wh-panel[hidden] { display: none !important; }
.prod-wh-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}
.prod-wh-field-full { grid-column: 1 / -1; }
.prod-wh-hint {
    color: #94a3b8;
    font-weight: 400;
    font-size: .68rem;
}
.prod-wh-markup { position: relative; }
.prod-wh-markup input { padding-right: 1.6rem !important; text-align: right; }
.prod-wh-markup span {
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .7rem;
    color: #94a3b8;
    pointer-events: none;
}
.prod-wh-card .pe-supplier-row { width: 100%; }
.prod-wh-card .pe-supplier-dd { flex: 1; min-width: 0; }
.prod-wh-card .prd-ss-trigger {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 40px;
}
.prod-wh-card .prd-ss-panel {
    min-width: 100%;
    max-width: none;
    width: 100%;
    left: 0;
    right: 0;
    z-index: 50;
}
@media (max-width: 640px) {
    .prod-wh-grid { grid-template-columns: 1fr; }
    .prod-wh-fields { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   PRODUCT EDIT v2 (standalone + catalog manager panel)
══════════════════════════════════════════════════════ */
.pe2 {
    container-type: inline-size;
    max-width: 1120px;
    margin: 0 auto;
    color: #0f172a;
}
.pe2 form { margin: 0; }

.pe2 input[type="number"]::-webkit-outer-spin-button,
.pe2 input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pe2 input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* Header */
.pe2-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.pe2--embed .pe2-head {
    position: sticky;
    top: -12px;
    z-index: 30;
    box-shadow: 0 0 0 8px #f8fafc, 0 -12px 0 8px #f8fafc;
}
.pe2-head-main { flex: 1; min-width: 0; }
.pe2-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pe2-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 2px;
    font-size: 11px;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.pe2-meta span + span::before {
    content: "·";
    margin-right: 10px;
    color: #cbd5e1;
}

/* Status toggle */
.pe2 .pe2-head .pe2-status,
.pe2 .pe2-head .pe2-save,
.pe2 .pe2-head .adm-back {
    box-sizing: border-box;
    flex: none;
    align-self: center;
    height: 34px;
    min-height: 34px;
    margin: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}
.pe2 .pe2-head .adm-back {
    padding: 0 12px 0 2px;
    border-radius: 999px;
}
.pe2 .pe2-head .pe2-status {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px 0 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    user-select: none;
}
.pe2 .pe2-status input.pe2-status-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.pe2 .pe2-status > span { font-size: 12px; line-height: 1; font-weight: 700; }
.pe2-status-track {
    position: relative;
    width: 30px;
    height: 18px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background .15s;
}
.pe2-status-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s;
}
.pe2-status-on { display: none; color: #7c3aed; }
.pe2-status-off { color: #dc2626; }
.pe2 .pe2-head .pe2-status:has(.pe2-status-input:checked) { border-color: #ddd6fe; background: #f5f3ff; }
.pe2-status-input:checked ~ .pe2-status-track { background: #7c3aed; }
.pe2-status-input:checked ~ .pe2-status-track .pe2-status-knob { transform: translateX(12px); }
.pe2-status-input:checked ~ .pe2-status-on { display: inline; }
.pe2-status-input:checked ~ .pe2-status-off { display: none; }
.pe2-status-input:focus-visible ~ .pe2-status-track { outline: 2px solid #c4b5fd; outline-offset: 2px; }

/* Save */
.pe2 .pe2-head .pe2-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    border: 1px solid #7c3aed;
    background: #7c3aed;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
}
.pe2 .pe2-head .pe2-save:hover { background: #6d28d9; border-color: #6d28d9; color: #fff; }
.pe2 .pe2-head .pe2-save:disabled { opacity: .6; cursor: default; }
.pe2-save i { font-size: 12px; line-height: 1; }

/* Errors */
.pe2-alert {
    margin-bottom: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.45;
}
.pe2-alert[hidden] { display: none; }

/* KPI strip */
.pe2-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.pe2-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 12px;
    min-width: 0;
}
.pe2-kpi + .pe2-kpi { border-left: 1px solid #f1f5f9; }
.pe2-kpi-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
}
.pe2-kpi-val {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pe2-kpi-val.is-pos { color: #059669; }
.pe2-kpi-val.is-neg { color: #dc2626; }

/* Cards */
.pe2-card {
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.pe2-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
}
.pe2-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f5f3ff;
    color: #7c3aed;
    font-size: 10px;
    font-weight: 800;
}

/* Основное */
.pe2-main {
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    gap: 16px;
    padding: 12px 14px 14px;
}
.pe2-photo-drop.prd-upload-drop {
    height: 148px;
    border-width: 1.5px;
    border-radius: 10px;
    background: #f8fafc;
}
.pe2-photo-drop.prd-upload-drop.has-image { background: #fff; border-color: #e2e8f0; }
.pe2-photo-drop .prd-upload-preview { object-fit: contain; padding: 8px; box-sizing: border-box; }
.pe2-photo-drop .prd-upload-placeholder { font-size: 11px; }
.pe2-photo-drop .prd-upload-placeholder i { font-size: 1.25rem; }
.pe2-photo-drop .prd-upload-edit {
    left: 6px;
    right: 6px;
    bottom: 6px;
    justify-content: center;
    background: rgba(124, 58, 237, .92);
    backdrop-filter: none;
    opacity: 0;
    transition: opacity .15s;
}
.pe2-photo-drop:hover .prd-upload-edit { opacity: 1; }

.pe2-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    align-content: start;
}
.pe2-f { min-width: 0; }
.pe2-f--wide { grid-column: 1 / -1; }
.pe2 .pe2-f .ta-label { margin-bottom: 4px; }

.pe2 .pe-supplier-row { gap: 6px; }
.pe2 .pe-supplier-trigger {
    height: 32px;
    border-radius: 8px;
    border-width: 1.5px;
    background: #f8fafc;
    font-size: 12px;
    padding: 0 8px 0 10px;
}
.pe2 .pe-supplier-trigger.has-value { background: #f5f3ff; border-color: #ddd6fe; }
.pe2 .pe-supplier-trigger.is-open,
.pe2 .pe-supplier-trigger:focus-visible { box-shadow: none; border-color: #7c3aed; }
.pe2 .pe-supplier-trigger .prd-ss-label { font-size: 12px; }
.pe2 .pe-supplier-add {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border-width: 1.5px;
}
.pe2 .pe-supplier-add i { font-size: .8rem; }
.pe2 .pe-supplier-panel { min-width: 220px; }

.pe2-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pe2-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}
.pe2-chip:has(input:checked) { border-color: #c4b5fd; background: #f5f3ff; color: #6d28d9; }

/* Склады */
.pe2-wh-table { padding: 4px 0; }
.pe2-wh-thead,
.pe2-wh-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.9fr) 60px repeat(4, minmax(64px, 1fr)) minmax(140px, 1.5fr);
    gap: 8px;
    align-items: center;
    padding: 0 14px;
}
.pe2-wh-thead {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
}
.pe2-wh { border-top: 1px solid #f1f5f9; }
.pe2-wh-row { padding-top: 8px; padding-bottom: 8px; }
.pe2-wh.tone-warn .pe2-wh-row { box-shadow: inset 3px 0 0 #dc2626; }
.pe2-wh-name {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title btn" "err btn";
    align-items: center;
    column-gap: 6px;
    row-gap: 2px;
    min-width: 0;
}
.pe2-wh-name .pe2-wh-title { grid-area: title; }
.pe2-wh-name .pe2-wh-err { grid-area: err; justify-self: start; }
.pe2-wh-name .pe2-wh-rename { grid-area: btn; }
.pe2-wh-title {
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pe2-wh-err {
    color: #dc2626;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.pe2-wh-err[hidden] { display: none; }
.pe2-wh-rename {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}
.pe2-wh-rename:hover { background: #f5f3ff; color: #7c3aed; }
.pe2-wh-rename.is-on { background: #f5f3ff; border-color: #ddd6fe; color: #7c3aed; }
.pe2-wh-rename i { font-size: 11px; line-height: 1; }

.pe2-wh-cell { min-width: 0; }
.pe2-wh-lbl {
    display: none;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
}
.pe2-wh-lbl--always { display: block; }
.pe2 .pe2-num { text-align: right; font-variant-numeric: tabular-nums; padding: 0 8px !important; }
.pe2 .pe2-price { font-weight: 700; color: #0f172a; }
.pe2 .pe2-price:not(:placeholder-shown) { border-color: #ddd6fe !important; background: #faf8ff !important; }
.pe2-suffix { position: relative; }
.pe2-suffix .pe2-num { padding-right: 20px !important; }
.pe2-suffix span {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #94a3b8;
    pointer-events: none;
}
.pe2-wh-extra {
    padding: 0 14px 10px;
    max-width: 520px;
}
.pe2-wh-extra[hidden] { display: none; }

/* Описание / характеристики */
.pe2-desc {
    display: grid;
    gap: 10px;
    padding: 12px 14px 14px;
}
.pe2 .pe2-desc textarea.ta-input { min-height: 84px; resize: vertical; }
.pe2-attrs { padding: 12px 14px 14px; }

/* Удаление */
.pe2-danger.prod-danger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 4px 2px 0;
    background: none;
    border: 0;
    border-radius: 0;
}
.pe2-danger form { margin: 0; }
.pe2-danger-meta { font-size: 11px; color: #94a3b8; }
.pe2-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.pe2-delete:hover { background: #fef2f2; }
.pe2-delete i { font-size: 11px; line-height: 1; }

/* App card preview (mirrors src/components/ProductCard.tsx) */
.pe2-pv { min-width: 0; }
.pe2-pv-bar {
    position: relative;
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.pe2-pv-wh { flex: 1; min-width: 0; }
.pe2 .pe2-pv-wh-btn {
    box-sizing: border-box;
    width: 100%;
    height: 30px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px 0 9px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s;
}
.pe2 .pe2-pv-wh-btn:hover { border-color: #c4b5fd; }
.pe2 .pe2-pv-wh-btn.is-open { border-color: #7c3aed; }
.pe2-pv-wh-btn > i { flex: none; font-size: 12px; line-height: 1; color: #7c3aed; }
.pe2-pv-wh-btn > span { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe2-pv-wh-btn .pe2-pv-caret { font-size: 14px; color: #94a3b8; transition: transform .15s; }
.pe2-pv-wh-btn.is-open .pe2-pv-caret { transform: rotate(180deg); color: #7c3aed; }
.pe2-pv-wh-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 288px;
    overflow-y: auto;
    padding: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
    z-index: 60;
    scrollbar-width: thin;
}
.pe2-pv-wh-menu[hidden] { display: none; }
.pe2 .pe2-pv-wh-opt {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 14px;
    grid-template-areas: "name check" "meta check";
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #0f172a;
    text-align: left;
    line-height: 1.2;
    cursor: pointer;
}
.pe2 .pe2-pv-wh-opt + .pe2-pv-wh-opt { margin-top: 1px; }
.pe2 .pe2-pv-wh-opt:hover,
.pe2 .pe2-pv-wh-opt:focus-visible { background: #f8fafc; outline: none; }
.pe2 .pe2-pv-wh-opt.is-sel { background: #f5f3ff; }
.pe2-pv-wh-opt-name {
    grid-area: name;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pe2-pv-wh-opt.is-sel .pe2-pv-wh-opt-name { color: #7c3aed; font-weight: 700; }
.pe2-pv-wh-opt-meta {
    grid-area: meta;
    display: flex;
    gap: 8px;
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.pe2-pv-wh-opt-meta [data-pv-wh-opt-price] { color: #475569; font-weight: 600; }
.pe2-pv-wh-opt-meta [data-pv-wh-opt-stock].is-in { color: #16a34a; font-weight: 600; }
.pe2-pv-wh-opt-meta [data-pv-wh-opt-stock].is-out { color: #dc2626; }
.pe2-pv-wh-opt-check { grid-area: check; font-size: 12px; line-height: 1; color: #7c3aed; visibility: hidden; }
.pe2-pv-wh-opt.is-sel .pe2-pv-wh-opt-check { visibility: visible; }
.pe2-pv-theme {
    flex: none;
    display: flex;
    height: 30px;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.pe2 .pe2-pv-theme button {
    width: 30px;
    height: 28px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
}
.pe2-pv-theme button i { font-size: 12px; line-height: 1; }
.pe2 .pe2-pv-theme button.is-on { background: #7c3aed; color: #fff; }

.pe2-pv-stage {
    --app-bg: #ffffff;
    --app-name: #1e1e1e;
    --app-img: #e8e8ea;
    --app-details: #6e6e6e;
    --app-muted: #9a9a9a;
    --app-cart-bg: #fe006e;
    --app-cart-border: #fe006e;
    --app-cart-icon: #ffffff;
    --app-cart-text: #ffffff;
    display: flex;
    justify-content: center;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: var(--app-bg);
    transition: background .15s;
}
.pe2-pv-stage.is-dark {
    --app-bg: #1e1e1e;
    --app-name: #f5f5f5;
    --app-img: #3a3a3a;
    --app-details: #c8c8c8;
    --app-cart-bg: #2a3038;
    --app-cart-border: #3a3a3a;
    --app-cart-icon: #fe006e;
    border-color: #1e1e1e;
}

.pe2-app {
    width: 112px;
    flex: none;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-align: left;
}
.pe2-app-img {
    position: relative;
    display: block;
    width: 112px;
    height: 112px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--app-img);
    cursor: pointer;
    margin: 0;
}
.pe2-app-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .88;
}
.pe2-app-img img[hidden] { display: none; }
.pe2-app-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    padding: 5px 8px;
    border-top-left-radius: 10px;
    border-bottom-right-radius: 12px;
    background: #c9005e;
    color: #fff;
    font-size: 11px;
    line-height: 13px;
    font-weight: 800;
    letter-spacing: .25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .28);
}
.pe2-app-badge[hidden] { display: none; }
.pe2-app-heart {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 22px;
    height: 22px;
    fill: #fe006e;
}
.pe2-app-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 8px;
}
.pe2-app-name {
    height: 32px;
    color: var(--app-name);
    font-size: 13px;
    line-height: 16px;
    letter-spacing: .1px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.pe2-app-meta {
    height: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
}
.pe2-app-strength {
    flex: none;
    color: #c9005e;
    font-size: 10px;
    line-height: 12px;
    font-weight: 700;
    letter-spacing: .2px;
}
.pe2-app-details {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--app-details);
    font-size: 10px;
    line-height: 12px;
    letter-spacing: .15px;
}
.pe2-app-details.is-dim { color: var(--app-muted); }
.pe2-app-strength[hidden],
.pe2-app-details[hidden] { display: none; }
.pe2-app-stock {
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--app-muted);
    font-size: 11px;
    line-height: 14px;
    letter-spacing: .1px;
}
.pe2-app-qty { color: #22c55e; font-weight: 600; }
.pe2-app-footer {
    padding-top: 8px;
    min-height: 34px;
    display: flex;
    align-items: flex-end;
}
.pe2-app-cart {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 7px 8px;
    box-sizing: border-box;
    border: 1px solid var(--app-cart-border);
    border-radius: 16px;
    background: var(--app-cart-bg);
}
.pe2-app-cart[hidden] { display: flex; visibility: hidden; }
.pe2-app-cart-ic {
    flex: none;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    fill: var(--app-cart-icon);
}
.pe2-app-price {
    flex: 1;
    min-width: 0;
    text-align: center;
    color: var(--app-cart-text);
    font-size: 12px;
    line-height: 14px;
    font-weight: 700;
    letter-spacing: .1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pe2-pv-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    margin: 8px 0 0;
    border: 1.5px dashed #ddd6fe;
    border-radius: 8px;
    background: #faf8ff;
    color: #7c3aed;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.pe2-pv-upload:hover { background: #f5f3ff; border-color: #c4b5fd; }
.pe2-pv-upload img { display: none !important; }
.pe2-pv-upload span { display: inline-flex; align-items: center; gap: 6px; }
.pe2-pv-upload i { font-size: 12px; line-height: 1; }

@container (max-width: 760px) {
    .pe2-wh-thead { display: none; }
    .pe2-wh-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .pe2-wh-name { grid-column: 1 / -1; grid-template-columns: auto auto 1fr; grid-template-areas: "title err btn"; }
    .pe2-wh-name .pe2-wh-rename { justify-self: start; }
    .pe2-wh-cell--sup { grid-column: 1 / -1; }
    .pe2-wh-lbl { display: block; }
}

@container (max-width: 560px) {
    .pe2-main { grid-template-columns: 1fr; }
    .pe2-photo-drop.prd-upload-drop { height: 180px; }
    .pe2-fields { grid-template-columns: 1fr; }
    .pe2-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pe2-kpi:nth-child(3) { border-left: 0; }
    .pe2-kpi:nth-child(n+3) { border-top: 1px solid #f1f5f9; }
    .pe2-wh-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pe2-status-on, .pe2-status-off { display: none !important; }
    .pe2-save span { display: none; }
}

@container (max-width: 400px) {
    .pe2-wh-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pe2-head { flex-wrap: wrap; }
}
