/* DEV-2.07 | SET-03 Product Master */

.v2-theme .settings-product {
    margin-top: 18px;
}

.v2-theme .settings-product__toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
    padding: 16px 18px;
    border: 1px solid var(--v2-color-border);
    border-radius: var(--v2-radius-xl);
    background: var(--v2-color-surface);
    box-shadow: var(--v2-shadow-card);
}

.v2-theme .settings-product__toolbar h2 {
    margin: 0;
    color: var(--v2-color-ink-950);
    font-size: var(--v2-font-size-18);
    font-weight: var(--v2-font-weight-bold);
}

.v2-theme .settings-product__toolbar p {
    margin: 5px 0 0;
    max-width: 860px;
    color: var(--v2-color-ink-500);
    font-size: var(--v2-font-size-11);
    line-height: 1.55;
}

.v2-theme .settings-product__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.v2-theme .settings-product__panel {
    overflow: hidden;
    border: 1px solid var(--v2-color-border);
    border-radius: var(--v2-radius-xl);
    background: var(--v2-color-surface);
    box-shadow: var(--v2-shadow-card);
}

.v2-theme .settings-product__filters {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 150px 150px auto;
    align-items: end;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--v2-color-border-soft);
}

.v2-theme .settings-product__filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    color: var(--v2-color-ink-600);
    font-size: var(--v2-font-size-10);
    font-weight: var(--v2-font-weight-semibold);
}

.v2-theme .settings-product__count {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--v2-color-ink-500);
    font-size: var(--v2-font-size-11);
    white-space: nowrap;
}

.v2-theme .settings-product__table-wrap {
    max-height: calc(100vh - 390px);
    min-height: 350px;
    overflow: auto;
}

.v2-theme .settings-product__table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    color: var(--v2-color-ink-900);
    font-size: 11.5px;
}

.v2-theme .settings-product__table th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 36px;
    padding: 0 7px;
    border-bottom: 1px solid var(--v2-color-border);
    background: var(--v2-color-surface-muted);
    color: var(--v2-color-ink-600);
    text-align: left;
    font-size: 10px;
    font-weight: var(--v2-font-weight-bold);
    white-space: nowrap;
}

.v2-theme .settings-product__table td {
    padding: 8px 7px;
    overflow: hidden;
    border-bottom: 1px solid var(--v2-color-border-soft);
    text-overflow: ellipsis;
    vertical-align: middle;
}

.v2-theme .settings-product__table tbody tr:hover {
    background: var(--v2-color-brand-050);
}

.v2-theme .settings-product__table th:nth-child(1) { width: 4%; }
.v2-theme .settings-product__table th:nth-child(2) { width: 4%; }
.v2-theme .settings-product__table th:nth-child(3) { width: 8%; }
.v2-theme .settings-product__table th:nth-child(4) { width: 8%; }
.v2-theme .settings-product__table th:nth-child(5) { width: 9%; }
.v2-theme .settings-product__table th:nth-child(6) { width: 9%; }
.v2-theme .settings-product__table th:nth-child(7) { width: 8%; }
.v2-theme .settings-product__table th:nth-child(8) { width: 8%; }
.v2-theme .settings-product__table th:nth-child(9) { width: 7%; }
.v2-theme .settings-product__table th:nth-child(10) { width: 6%; }
.v2-theme .settings-product__table th:nth-child(11) { width: 10%; }
.v2-theme .settings-product__table th:nth-child(12) { width: 6%; }
.v2-theme .settings-product__table th:nth-child(13) { width: 4%; }
.v2-theme .settings-product__table th:nth-child(14) { width: 5%; }
.v2-theme .settings-product__table th:nth-child(15) { width: 10%; }

.v2-theme .settings-product__category {
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e6f0ff;
    color: #2257c8;
    font-size: 11px;
    font-weight: 800;
}

.v2-theme .settings-product__model {
    max-width: 100%;
    padding: 4px 8px;
    overflow: hidden;
    border: 1px solid #cbe4e8;
    border-radius: 999px;
    background: #eef8f9;
    color: var(--v2-color-brand-900);
    font: inherit;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.v2-theme .settings-product__payment {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e4efff;
    color: #2459bf;
    font-size: 10px;
    font-weight: 700;
}

.v2-theme .settings-product__row-actions {
    display: flex;
    gap: 5px;
    white-space: nowrap;
}

.v2-theme .settings-product__muted,
.v2-theme .settings-product__empty {
    color: var(--v2-color-ink-500);
}

.v2-theme .settings-product__empty {
    padding: 28px;
    text-align: center;
}

.v2-theme .settings-product__state {
    margin-top: 10px;
    padding: 9px 12px;
    border: 1px solid var(--v2-color-border);
    border-radius: var(--v2-radius-md);
    background: var(--v2-color-surface-soft);
    color: var(--v2-color-ink-600);
    font-size: var(--v2-font-size-11);
}

.v2-theme .settings-product__state[data-level="error"] {
    border-color: #f2b6b6;
    background: #fff3f3;
    color: #9f2d2d;
}

.v2-theme .settings-product-editor[hidden] {
    display: none !important;
}

.v2-theme .settings-product-editor {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(21, 43, 58, 0.34);
}

.v2-theme .settings-product-editor .work-layer-modal-card {
    width: min(980px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 0;
}

.v2-theme .settings-product-editor__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--v2-color-border-soft);
    background: var(--v2-color-surface);
}

.v2-theme .settings-product-editor__eyebrow {
    color: var(--v2-color-brand-700);
    font-size: 10px;
    font-weight: 800;
}

.v2-theme .settings-product-editor__header h2 {
    margin: 4px 0 0;
    font-size: 20px;
}

.v2-theme .settings-product-editor__close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--v2-color-border);
    border-radius: 50%;
    background: var(--v2-color-surface);
    color: var(--v2-color-ink-600);
    font-size: 20px;
    cursor: pointer;
}

.v2-theme .settings-product-editor__form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    padding: 18px 20px;
}

.v2-theme .settings-product-editor__form label {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--v2-color-ink-600);
    font-size: 10px;
    font-weight: 700;
}

.v2-theme .settings-product-editor__wide {
    grid-column: 1 / -1;
}

.v2-theme .settings-product-editor__check {
    align-self: end;
    min-height: 38px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
}

.v2-theme .settings-product-editor__check input {
    width: auto;
}

.v2-theme .settings-product-editor__footer {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 13px 20px;
    border-top: 1px solid var(--v2-color-border-soft);
    background: var(--v2-color-surface);
}

@media (max-width: 1100px) {
    .v2-theme .settings-product__table th:nth-child(1),
    .v2-theme .settings-product__table td:nth-child(1),
    .v2-theme .settings-product__table th:nth-child(6),
    .v2-theme .settings-product__table td:nth-child(6),
    .v2-theme .settings-product__table th:nth-child(9),
    .v2-theme .settings-product__table td:nth-child(9) {
        display: none;
    }
}

@media (max-width: 760px) {
    .v2-theme .settings-product__toolbar,
    .v2-theme .settings-product__filters {
        grid-template-columns: 1fr;
    }

    .v2-theme .settings-product__toolbar {
        flex-direction: column;
    }

    .v2-theme .settings-product__filters {
        display: grid;
    }

    .v2-theme .settings-product-editor__form {
        grid-template-columns: 1fr;
    }

    .v2-theme .settings-product-editor__wide {
        grid-column: auto;
    }
}

/* ============================================================
   DEV-2.08 | SET-03 Package Settings
   ============================================================ */

.v2-theme .settings-package-editor[hidden] {
    display: none !important;
}

.v2-theme .settings-package-editor {
    position: fixed;
    inset: 0;
    z-index: 910;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(21, 43, 58, 0.34);
}

.v2-theme .settings-package-editor__card {
    width: min(1040px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow: hidden;
    padding: 0;
}

.v2-theme .settings-package-editor__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--v2-color-border-soft);
    background: var(--v2-color-surface);
}

.v2-theme .settings-package-editor__header h2 {
    margin: 4px 0 0;
    color: var(--v2-color-ink-950);
    font-size: 20px;
}

.v2-theme .settings-package-editor__header p {
    margin: 6px 0 0;
    max-width: 760px;
    color: var(--v2-color-ink-500);
    font-size: 11px;
    line-height: 1.5;
}

.v2-theme .settings-package-editor__body {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    min-height: 470px;
    max-height: calc(100vh - 190px);
    overflow: hidden;
    background: var(--v2-color-surface);
}

.v2-theme .settings-package__nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px;
    overflow: auto;
    border-right: 1px solid var(--v2-color-border-soft);
    background: var(--v2-color-surface-muted);
}

.v2-theme .settings-package__nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 48px;
    padding: 9px 10px;
    border: 1px solid var(--v2-color-border);
    border-radius: var(--v2-radius-lg);
    background: var(--v2-color-surface);
    color: var(--v2-color-ink-700);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.v2-theme .settings-package__nav-item:hover {
    border-color: var(--v2-color-brand-300);
    background: var(--v2-color-brand-050);
}

.v2-theme .settings-package__nav-item.is-active {
    border-color: var(--v2-color-brand-500);
    box-shadow: inset 3px 0 0 var(--v2-color-brand-600);
    color: var(--v2-color-brand-900);
}

.v2-theme .settings-package__workspace {
    min-width: 0;
    padding: 18px 20px;
    overflow: auto;
}

.v2-theme .settings-package__workspace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.v2-theme .settings-package__label {
    color: var(--v2-color-ink-500);
    font-size: 10px;
    font-weight: 700;
}

.v2-theme .settings-package__workspace-head h3 {
    margin: 3px 0 0;
    color: var(--v2-color-ink-950);
    font-size: 22px;
}

.v2-theme .settings-package__active {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--v2-color-ink-700);
    font-size: 12px;
    font-weight: 800;
}

.v2-theme .settings-package__active input {
    width: auto;
}

.v2-theme .settings-package__hint {
    margin-top: 13px;
    padding: 9px 11px;
    border: 1px solid #d8e8ea;
    border-radius: var(--v2-radius-md);
    background: #f4fafb;
    color: var(--v2-color-ink-600);
    font-size: 11px;
    line-height: 1.5;
}

.v2-theme .settings-package__fields {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 14px;
}

.v2-theme .settings-package__field {
    display: grid;
    grid-template-columns: 120px minmax(250px, 1fr) 92px auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--v2-color-border-soft);
    border-radius: var(--v2-radius-lg);
    background: var(--v2-color-surface-soft);
}

.v2-theme .settings-package__field--quantity-only {
    grid-template-columns: minmax(250px, 1fr) 92px;
}

.v2-theme .settings-package__field-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.v2-theme .settings-package__field-copy strong {
    color: var(--v2-color-ink-900);
    font-size: 12px;
}

.v2-theme .settings-package__field-copy span,
.v2-theme .settings-package__selection {
    color: var(--v2-color-ink-500);
    font-size: 10px;
}

.v2-theme .settings-package__product-picker {
    position: relative;
    min-width: 0;
}

.v2-theme .settings-package__selection {
    min-height: 16px;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-theme .settings-package__quantity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--v2-color-ink-600);
    font-size: 10px;
    font-weight: 700;
}

.v2-theme .settings-package__candidates {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 80;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--v2-color-border);
    border-radius: var(--v2-radius-md);
    box-shadow: var(--v2-shadow-card);
}

.v2-theme .settings-package__candidate-name {
    margin-top: 2px;
    color: var(--v2-color-ink-500);
    font-size: 10px;
}

.v2-theme .settings-package-editor__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 13px 20px;
    border-top: 1px solid var(--v2-color-border-soft);
    background: var(--v2-color-surface);
}

@media (max-width: 820px) {
    .v2-theme .settings-package-editor__body {
        grid-template-columns: 1fr;
    }

    .v2-theme .settings-package__nav {
        flex-direction: row;
        border-right: 0;
        border-bottom: 1px solid var(--v2-color-border-soft);
    }

    .v2-theme .settings-package__nav-item {
        min-width: 130px;
    }

    .v2-theme .settings-package__field,
    .v2-theme .settings-package__field--quantity-only {
        grid-template-columns: 1fr;
    }
}
