/* ========================================
   셀러K — 매입상품 리스트 전용 스타일
   ======================================== */

/* ── Table Header Groups ── */
.th-group-purchase {
    background: rgba(79, 110, 247, 0.08) !important;
    color: var(--primary) !important;
    border-bottom: 2px solid var(--primary) !important;
}

.th-group-sales {
    background: rgba(34, 197, 94, 0.08) !important;
    color: var(--success) !important;
    border-bottom: 2px solid var(--success) !important;
}

.th-group-settle {
    background: rgba(245, 158, 11, 0.08) !important;
    color: var(--warning) !important;
    border-bottom: 2px solid var(--warning) !important;
}

.th-group-label {
    text-align: center !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
}

/* Sub-header row */
.data-table thead tr:nth-child(2) th {
    font-size: 10px;
    padding: 5px 8px;
    background: var(--gray-50);
}

/* ── KPI Cards — Seller K ── */
.kpi-strip-sk {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.kpi-icon.kpi-items { background: var(--primary-muted); color: var(--primary); }
.kpi-icon.kpi-purchase { background: rgba(79, 110, 247, 0.10); color: #4f6ef7; }
.kpi-icon.kpi-sales-total { background: var(--success-muted); color: var(--success); }
.kpi-icon.kpi-profit { background: var(--warning-muted); color: var(--warning); }

/* ── Add Button ── */
.btn-add-product {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
    white-space: nowrap;
}

.btn-add-product:hover {
    background: var(--primary-hover);
}

.btn-add-product i {
    font-size: 16px;
}

/* ── Modal Form Layout ── */
.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-form-grid .fg-full {
    grid-column: 1 / -1;
}

.modal-form-grid .fg {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.modal-form-grid .fg > label:first-child {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.2;
}

.modal-form-grid .fg input,
.modal-form-grid .fg select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 500;
    outline: none;
    transition: all var(--transition-fast);
    background: var(--surface);
    color: var(--gray-800);
    width: 100%;
}

.modal-form-grid .fg input:focus,
.modal-form-grid .fg select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2.5px var(--primary-muted);
}

/* ── Modal Section Dividers ── */
.modal-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 0 4px;
    margin: 4px 0 0;
    border-bottom: 1px solid var(--gray-100);
    grid-column: 1 / -1;
}

.modal-section-title.section-purchase {
    color: var(--primary);
}

.modal-section-title.section-sales {
    color: var(--success);
}

.modal-section-title.section-settle {
    color: var(--warning);
}

/* ── Preview / Auto-calc fields ── */
.calc-preview {
    background: var(--gray-50) !important;
    font-weight: 600 !important;
    color: var(--gray-600) !important;
    cursor: default;
}

.calc-preview.positive {
    color: var(--success) !important;
}

.calc-preview.negative {
    color: var(--danger) !important;
}

/* ── VAT Inline Chip (modal) ── */
.vat-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: var(--primary-muted);
    border: 1px solid var(--primary);
    border-radius: 12px;
    font-size: 9px;
    font-weight: 700;
    color: var(--primary);
    margin-left: 4px;
    white-space: nowrap;
    vertical-align: middle;
}

.vat-inline.vat-included {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--danger);
    color: var(--danger);
}

/* ── Shipping basis auxiliary input ── */
.shipping-aux {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.shipping-aux input {
    width: 70px !important;
    flex-shrink: 0;
}

.shipping-aux span {
    font-size: 11px;
    color: var(--gray-500);
    white-space: nowrap;
}

/* ── Table compact number cells ── */
.data-table .col-num-sm {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 11.5px;
    white-space: nowrap;
}

/* ── Action column for seller-k ── */
.col-action-sk {
    width: 90px;
    text-align: center;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    font-weight: 500;
}

.empty-state .hint {
    font-size: 12px;
    margin-top: 6px;
}

/* ── Modal footer ── */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .kpi-strip-sk {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .modal-form-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
}
