/* ============================================
   PCP System - Naver SmartStore Seller Center Style
   완전히 새로운 네이버 스마트스토어 판매자센터 UI
   v2.0 - Tree Navigation + Separated Menu
   ============================================ */

:root {
    /* Naver SmartStore Color System */
    --nv-green: #03c75a;
    --nv-green-dark: #02b350;
    --nv-green-light: #e9f8ef;
    --nv-blue: #0078ff;
    --nv-red: #ff3b3b;
    --nv-orange: #ff6f00;
    --nv-yellow: #ffb800;
    --nv-purple: #7c4dff;

    /* Header */
    --header-bg: #03c75a;
    --header-height: 48px;

    /* Sidebar - Lighter Gray Theme for better visibility */
    --sidebar-bg: #3d4452;
    --sidebar-width: 230px;
    --sidebar-text: #b0b8c4;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(3, 199, 90, 0.18);
    --sidebar-section-text: #8892a0;
    --sidebar-icon: #8a94a6;

    /* Main */
    --bg-main: #f2f4f6;
    --bg-white: #ffffff;
    --border-color: #e5e8eb;
    --border-light: #f0f2f4;

    /* Text */
    --text-primary: #191f28;
    --text-secondary: #4e5968;
    --text-tertiary: #8b95a1;
    --text-disabled: #b0b8c1;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);

    /* Radius */
    --radius: 6px;
    --radius-lg: 10px;
    --radius-sm: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', 'Noto Sans KR', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============ TOP HEADER (Green bar like SmartStore) ============ */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.logo i { font-size: 20px; }

.logo span {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: 24px;
}

.header-nav-item {
    padding: 6px 14px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    cursor: pointer;
}

.header-nav-item:hover,
.header-nav-item.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    color: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

.user-info i { font-size: 16px; }

.header-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* ============ SIDEBAR (Dark, Tree Menu like SmartStore) ============ */
.app-container {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #3d4452 0%, #363d4a 100%);
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sidebar-nav {
    padding: 8px 0 20px;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 16px 10px;
    font-size: 14px;
    font-weight: 800;
    color: #e8ecf2;
    letter-spacing: 0.2px;
    text-transform: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 4px;
}

.sidebar-nav .section-title-icon {
    font-size: 12px;
    color: var(--nv-green);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

/* Sidebar divider */
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 10px 14px;
}

/* ====== Single nav items (Dashboard, etc.) ====== */
.nav-item-single {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px 8px 19px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item-single:hover {
    color: #fff;
    background: rgba(255,255,255,0.10);
}

.nav-item-single.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(3, 199, 90, 0.28) 0%, rgba(3, 199, 90, 0.12) 100%);
    border-left-color: var(--nv-green);
    font-weight: 700;
    box-shadow: inset 0 0 12px rgba(3, 199, 90, 0.06);
}

.nav-item-single i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--sidebar-icon);
    transition: color 0.15s;
}

.nav-item-single:hover i {
    color: var(--sidebar-text-hover);
}

.nav-item-single.active i {
    color: #4ae68a;
}

/* ====== TREE MENU STRUCTURE ====== */
.nav-tree {
    margin-bottom: 1px;
}

/* Parent (collapsible header) */
.nav-tree-parent {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px 8px 19px;
    color: var(--sidebar-text);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    user-select: none;
}

.nav-tree-parent:hover {
    color: #fff;
    background: rgba(255,255,255,0.10);
}

.nav-tree-parent.open {
    color: var(--sidebar-text-hover);
}

.tree-icon {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--sidebar-icon);
    transition: color 0.15s;
}

.nav-tree-parent:hover .tree-icon {
    color: var(--sidebar-text-hover);
}

.nav-tree-parent.open .tree-icon {
    color: #4ae68a;
}

/* Arrow icon rotation */
.tree-arrow {
    margin-left: auto;
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    transition: transform 0.25s ease, color 0.15s;
}

.nav-tree-parent:hover .tree-arrow {
    color: rgba(255,255,255,0.35);
}

.nav-tree-parent.open .tree-arrow {
    transform: rotate(90deg);
    color: rgba(255,255,255,0.45);
}

/* Children (collapsible content) */
.nav-tree-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.12);
}

.nav-tree-children.open {
    max-height: 500px;
}

/* Child items */
.nav-child {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 16px 6px 48px;
    color: #8a94a4;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    cursor: pointer;
    position: relative;
}

.nav-child::before {
    content: '';
    position: absolute;
    left: 34px;
    top: 50%;
    width: 5px;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.nav-child:hover {
    color: #fff;
    background: rgba(255,255,255,0.10);
}

.nav-child:hover .child-icon {
    color: #a0aab4;
}

.nav-child.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(3, 199, 90, 0.30) 0%, rgba(3, 199, 90, 0.10) 100%);
    border-left-color: var(--nv-green);
    font-weight: 700;
}

.nav-child.active .child-icon {
    color: #4ae68a;
}

.child-icon {
    width: 14px;
    text-align: center;
    font-size: 10px;
    color: #5e6b7a;
    flex-shrink: 0;
    transition: color 0.15s;
}


/* ============ MAIN CONTENT ============ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 20px 24px;
    min-height: calc(100vh - var(--header-height));
}

.page { display: none; }
.page.active { display: block; }

/* ============ PAGE HEADER ============ */
.page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-header h1 i {
    font-size: 16px;
}

.page-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ============ DASHBOARD - SmartStore Style ============ */
.dashboard-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-title-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.section-title-icon.green { background: var(--nv-green); }
.section-title-icon.red { background: var(--nv-red); }
.section-title-icon.blue { background: var(--nv-blue); }
.section-title-icon.orange { background: var(--nv-orange); }
.section-title-icon.purple { background: var(--nv-purple); }

.section-more {
    font-size: 12px;
    color: var(--text-tertiary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.section-more:hover { color: var(--text-secondary); }

/* Stats row */
.stats-row {
    display: flex;
    border-top: 1px solid var(--border-light);
}

.stat-cell {
    flex: 1;
    padding: 16px 20px;
    text-align: center;
    border-right: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.stat-cell:last-child { border-right: none; }
.stat-cell:hover { background: #fafbfc; }

.stat-cell-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 8px;
}

.stat-cell-icon.green { background: var(--nv-green-light); color: var(--nv-green); }
.stat-cell-icon.blue { background: #e8f2ff; color: var(--nv-blue); }
.stat-cell-icon.orange { background: #fff3e0; color: var(--nv-orange); }
.stat-cell-icon.red { background: #ffe8e8; color: var(--nv-red); }
.stat-cell-icon.purple { background: #f0e8ff; color: var(--nv-purple); }

.stat-cell-label {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-cell-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.stat-cell-value.highlight { color: var(--nv-green); }

.stat-cell-unit {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-left: 2px;
}

/* Bottom row of stats */
.stats-bottom-row {
    display: flex;
    border-top: 1px solid var(--border-light);
    background: #fafbfc;
}

.stat-bottom-cell {
    flex: 1;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-tertiary);
    border-right: 1px solid var(--border-light);
}

.stat-bottom-cell:last-child { border-right: none; }

.stat-bottom-value {
    font-weight: 700;
    color: var(--text-primary);
}

/* Dashboard grid */
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* Info card */
.info-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.info-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-light);
}

.info-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-card-title-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.info-card-body {
    padding: 14px 16px;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.info-row-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.info-row-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-row-value.red { color: var(--nv-red); }
.info-row-value.green { color: var(--nv-green); }
.info-row-value.blue { color: var(--nv-blue); }

/* ============ ALERT / NOTICE BAR ============ */
.notice-bar {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.notice-bar i {
    color: var(--text-tertiary);
    font-size: 14px;
}

.notice-bar .notice-text {
    flex: 1;
}

.notice-bar .notice-link {
    color: var(--nv-blue);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

/* ============ CONTENT TOOLBAR ============ */
.content-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 12px;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 10px;
    color: var(--text-disabled);
    font-size: 13px;
}

.search-box input {
    padding: 7px 10px 7px 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 12px;
    width: 240px;
    font-family: inherit;
    transition: border-color 0.15s;
    background: var(--bg-white);
}

.search-box input:focus {
    outline: none;
    border-color: var(--nv-green);
    box-shadow: 0 0 0 2px rgba(3,199,90,0.1);
}

.filter-group {
    display: flex;
    gap: 6px;
}

.filter-select {
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 12px;
    font-family: inherit;
    background: var(--bg-white);
    cursor: pointer;
    color: var(--text-secondary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--nv-green);
}

/* ============ CATEGORY TABS ============ */
.category-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 3px;
    width: fit-content;
}

.category-tab {
    padding: 6px 14px;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-tab:hover { color: var(--text-secondary); background: var(--bg-main); }

.category-tab.active {
    color: white;
    background: var(--nv-green);
    font-weight: 600;
}

.tab-count {
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 8px;
    background: rgba(0,0,0,0.06);
    color: var(--text-tertiary);
}

.category-tab.active .tab-count {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* ============ DATA TABLE ============ */
.data-table-wrapper {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(180deg, #f1f3f5 0%, #e9ecef 100%);
}

.data-table th {
    padding: 10px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    color: #495057;
    border-bottom: 2px solid #ced4da;
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-transform: none;
    position: relative;
}

.data-table th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: #d5d8dc;
}

.data-table td {
    padding: 8px 10px;
    font-size: 12.5px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    color: var(--text-secondary);
    border-right: 1px solid #f3f3f3;
}

.data-table td:last-child { border-right: none; }

/* Zebra striping */
.data-table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:nth-child(odd) { background: #fff; }
.data-table tbody tr:hover { background: #eef6ff !important; transition: background 0.12s; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ====== Base Product Table (balanced readable layout) ====== */
.bp-table { table-layout: fixed; width: 100%; min-width: 960px; }
.bp-table .col-checkbox { width: 36px; text-align: center; }
.bp-table .col-checkbox input[type="checkbox"] { cursor: pointer; }

/* BP column widths — percentage-based for fluid fill
   cat(6.5%) + sub(7%) + img(8%) + name(auto) + vendor(7.5%) + price(8.5%) + rate(4.5%) + fprice(9.5%) + weight(5%) + moq(5%) + date(8%) ≈ 69% fixed + name(31% auto) */
.bp-table .bpt-cat       { width: 6.5%;  text-align: center; }
.bp-table .bpt-sub       { width: 7%;    text-align: center; }
.bp-table .bpt-img       { width: 8%;    text-align: center; padding: 6px 4px; }
.bp-table .bpt-name      { width: auto; }
.bp-table .bpt-vendor    { width: 7.5%;  text-align: center; }
.bp-table .bpt-price     { width: 8.5%;  text-align: right;  padding-right: 12px; }
.bp-table .bpt-rate      { width: 4.5%;  text-align: center; }
.bp-table .bpt-fprice    { width: 9.5%;  text-align: right;  padding-right: 12px; font-weight: 700; }
.bp-table .bpt-weight    { width: 5%;    text-align: right;  padding-right: 8px; }
.bp-table .bpt-moq       { width: 5%;    text-align: right;  padding-right: 8px; }
.bp-table .bpt-date      { width: 8%;    text-align: center; }

/* BP cell base */
.bp-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.4;
}
.bp-table td.col-checkbox { text-align: center; }

/* Category badge cell */
.bp-table td.bp-td-cat {
    text-align: center;
    overflow: visible;
}

/* Subcategory cell */
.bp-table td.bp-td-sub {
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* Image cell */
.bp-table td.bp-td-img {
    text-align: center;
    padding: 8px 6px;
    width: 106px;
}

/* Name column — natural wrap for long names */
.bp-table td.bp-td-name {
    white-space: normal;
    word-break: keep-all;
    overflow: visible;
    line-height: 1.4;
    font-size: 13px;
    padding: 8px 10px;
}

/* Vendor column */
.bp-table td.bp-td-vendor {
    text-align: center;
    font-size: 12.5px;
}

/* Price column */
.bp-table td.bp-td-price {
    text-align: right;
    padding-right: 12px;
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
}

/* Final price highlight */
.bp-table td.bp-td-fprice {
    text-align: right;
    padding-right: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

/* Numeric columns (weight, moq) */
.bp-table td.bp-td-num {
    text-align: right;
    padding-right: 8px;
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
}

/* Rate column */
.bp-table td.bp-td-rate {
    text-align: center;
    font-size: 12.5px;
}

/* Date column */
.bp-table td.bp-td-date {
    text-align: center;
    font-size: 11.5px;
    color: #888;
    letter-spacing: -0.3px;
}

/* Product image thumbnail in list */
.bp-table .bpt-thumb {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    vertical-align: middle;
}
.bp-table .bpt-thumb-empty {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
    background: #f9fafb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 26px;
}

/* Checkbox in table */
.data-table .row-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--nv-green);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-tertiary);
}

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

.empty-state p {
    margin-bottom: 12px;
    font-size: 13px;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: var(--nv-green);
    color: white;
    border-color: var(--nv-green);
}

.btn-primary:hover { background: var(--nv-green-dark); border-color: var(--nv-green-dark); }

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover { background: var(--bg-main); }

.btn-success { background: #198754; color: white; border-color: #198754; }
.btn-success:hover { background: #157347; border-color: #157347; }
.btn-outline { background: transparent; }
.btn-outline:hover { background: rgba(25, 135, 84, 0.08); }

.btn-danger {
    background: transparent;
    color: var(--nv-red);
    border: none;
    padding: 4px 6px;
}

.btn-danger:hover { background: #fff5f5; }

.btn-sm { padding: 4px 8px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }

.btn-icon {
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
}

.btn-icon:hover { color: var(--text-primary); background: var(--bg-main); border-radius: var(--radius-sm); }

.action-buttons {
    display: flex;
    gap: 2px;
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-snack { background: #fff3e0; color: #e65100; }
.badge-accessory { background: #e8f2ff; color: #0066cc; }
.badge-packaging { background: #f3e5f5; color: #7b1fa2; }
.badge-draft { background: #f2f4f6; color: #8b95a1; }
.badge-active { background: var(--nv-green-light); color: var(--nv-green-dark); }
.badge-inactive { background: #ffe8e8; color: var(--nv-red); }
.badge-ready { background: #e3f2fd; color: #1565c0; }
.badge-marketing { background: #f3e5f5; color: #6a1b9a; }
.badge-marketing-pending { background: #fff3e0; color: #e65100; border: 1px dashed #e65100; }
.badge-platform { background: #e8eaf6; color: #283593; }
.badge-operation { background: #e8f5e9; color: #2e7d32; }
.badge-suspended { background: #fff8e1; color: #f57f17; }
.badge-discontinued { background: #fce4ec; color: #c62828; }

/* ============ MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px;
    overflow-y: auto;
}

.modal-overlay.show { display: flex; }
.modal-overlay.active { display: flex; }

/* Calc Register Modal — 풀와이드 레이아웃 */
.calc-register-modal {
    max-width: 85vw !important;
    width: 85vw !important;
    min-width: 900px;
}
.cr-modal-body {
    max-height: 82vh;
    overflow-y: auto;
    padding: 28px 40px;
}

/* 2단 그리드 — 좌 입력(1fr) + 우 결과(1.6fr) 넉넉한 비율 */
.cr-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 40px;
}
.cr-col {
    min-width: 0;
}

/* 섹션 타이틀 */
.cr-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e8eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 입력 필드 그룹 */
.cr-field-group {
    margin-bottom: 14px;
}
.cr-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}
.cr-input-full {
    width: 100%;
    box-sizing: border-box;
}

/* 구성품 테이블 */
.cr-comp-table-wrap {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e5e8eb;
    border-radius: 8px;
}
.cr-comp-table-wrap::-webkit-scrollbar { width: 5px; }
.cr-comp-table-wrap::-webkit-scrollbar-track { background: #f4f6f8; }
.cr-comp-table-wrap::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.cr-comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cr-comp-table thead th {
    position: sticky;
    top: 0;
    background: #f4f6f8;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-align: left;
    border-bottom: 1px solid #e5e8eb;
    white-space: nowrap;
}
.cr-comp-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f2f5;
}
.cr-comp-table tbody tr:last-child td { border-bottom: none; }
.cr-comp-table tbody tr:hover { background: #fafbfc; }

/* 단가계산 결과 카드 */
.cr-calc-result {
    background: #f8fafb;
    border: 1px solid #e5e8eb;
    border-radius: 8px;
    padding: 18px 22px;
}
.cr-calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 40px;
}
.cr-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}
.cr-calc-label {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}
.cr-calc-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: right;
    white-space: nowrap;
}
.cr-calc-highlight {
    background: #f0f7f1;
    border-radius: 6px;
    padding: 6px 12px !important;
    grid-column: 1 / -1;
}
.cr-calc-highlight .cr-calc-label { font-weight: 700; color: #333; font-size: 13px; }
.cr-calc-highlight .cr-calc-value { color: var(--nv-green); font-size: 15px; }

.cr-calc-total {
    grid-column: 1 / -1;
    background: #e8f5e9;
    border-radius: 6px;
    padding: 8px 14px !important;
}
.cr-calc-total .cr-calc-label { font-weight: 800; color: #2e7d32; font-size: 14px; }
.cr-calc-total .cr-calc-value { font-weight: 800; color: #2e7d32; font-size: 16px; }

.cr-calc-divider {
    height: 1px;
    background: #e0e3e7;
    margin: 8px 0;
}

/* 이익 박스 */
.cr-calc-profit-box {
    background: linear-gradient(135deg, #1b2838 0%, #2c3e50 100%);
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 6px;
}
.cr-calc-profit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.cr-calc-profit-label {
    font-size: 14px;
    color: #adb5bd;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cr-calc-profit-value {
    font-size: 22px;
    font-weight: 800;
    color: #66bb6a;
}
.cr-calc-rates {
    font-size: 12px;
    color: #78909c;
    margin-top: 6px;
    text-align: right;
}

/* 하단 푸터 */
.cr-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    border-top: 1px solid #e5e8eb;
    background: #fafbfc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.cr-footer-hint {
    font-size: 11px;
    color: #999;
}
.cr-footer-btns {
    display: flex;
    gap: 8px;
}

/* 반응형 — 1100px 이하 1단 */
@media (max-width: 1100px) {
    .calc-register-modal { max-width: 98vw !important; width: 98vw !important; min-width: auto; }
    .cr-grid { grid-template-columns: 1fr; gap: 20px; }
    .cr-modal-body { padding: 18px 20px; }
    .cr-modal-footer { padding: 14px 20px; }
}
.cr-readonly-val {
    font-size: 13px;
    color: #333;
    display: inline-block;
}

/* 상품구분 토글 (일반/시즌) */
.cr-product-type-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #d0d5db;
    border-radius: 8px;
    overflow: hidden;
}
.cr-type-btn {
    flex: 1;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #777;
    background: #fafbfc;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.cr-type-btn + .cr-type-btn { border-left: 1px solid #d0d5db; }
.cr-type-btn:hover { background: #f0f2f5; color: #333; }
.cr-type-btn.active[data-type="NORMAL"] {
    background: var(--nv-green);
    color: #fff;
}
.cr-type-btn.active[data-type="SEASON"] {
    background: var(--nv-blue);
    color: #fff;
}

/* 이미지 업로드 탭 & 드롭존 */
.cr-image-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
    border-bottom: 2px solid #e5e8eb;
}
.cr-img-tab {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.cr-img-tab:hover { color: #555; background: #eee; }
.cr-img-tab.active {
    color: #fff;
    background: var(--nv-green);
    border-color: var(--nv-green);
    border-bottom-color: transparent;
}
.cr-file-drop {
    border: 2px dashed #d0d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfc;
}
.cr-file-drop:hover,
.cr-file-drop.dragover {
    border-color: var(--nv-green);
    background: #f0faf2;
}
.cr-upload-progress {
    height: 4px;
    background: #e5e8eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.cr-upload-progress-bar {
    height: 100%;
    background: var(--nv-green);
    transition: width 0.3s;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.2s ease;
}

.modal-lg { max-width: 680px; }
.modal-xl { max-width: 960px; }
.modal-large { max-width: 860px; }

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-header-actions .modal-close {
    margin-left: 4px;
}

/* Vendor grade/status badges */
.vendor-grade-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 36px;
    text-align: center;
    white-space: nowrap;
}
.vendor-grade-badge.grade-A { background: #dcfce7; color: #15803d; }
.vendor-grade-badge.grade-B { background: #dbeafe; color: #1d4ed8; }
.vendor-grade-badge.grade-C { background: #fef3c7; color: #b45309; }
.vendor-grade-badge.grade-D { background: #fee2e2; color: #dc2626; }

.vendor-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 58px;
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
}
.vendor-status-badge.status-active { background: #dcfce7; color: #15803d; }
.vendor-status-badge.status-new { background: #dbeafe; color: #1d4ed8; }
.vendor-status-badge.status-stopped { background: #fee2e2; color: #dc2626; }
.vendor-status-badge.status-expired { background: #f3f4f6; color: #6b7280; }

/* Vendor field readonly styling */
.vendor-field[readonly],
.vendor-field[disabled] {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: var(--text-primary);
    cursor: default;
}

.vendor-field.editable {
    background: white !important;
    border-color: var(--nv-green) !important;
    cursor: text !important;
}

select.vendor-field.editable {
    cursor: pointer !important;
}

/* Vendor table column widths - 10 data columns, balanced layout */
.vendor-table { table-layout: fixed; min-width: 920px; }
.vendor-table .col-checkbox { width: 36px; text-align: center; }
.vendor-table .col-checkbox input[type="checkbox"] { cursor: pointer; }

/* Column width distribution (total ~920px) */
.vendor-table .vt-grade    { width: 50px; text-align: center; }
.vendor-table .vt-status   { width: 76px; text-align: center; }
.vendor-table .vt-name     { width: 110px; }
.vendor-table .vt-biznum   { width: 116px; }
.vendor-table .vt-ceo      { width: 70px; }
.vendor-table .vt-contact  { width: 70px; }
.vendor-table .vt-phone    { width: 116px; }
.vendor-table .vt-payment  { width: 76px; text-align: center; }
.vendor-table .vt-trade    { width: 70px; text-align: center; }
.vendor-table .vt-date     { width: 86px; text-align: center; }

/* Cell text handling */
.vendor-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vendor-table td.col-checkbox { text-align: center; }
.vendor-table td.tc { text-align: center; }
.vendor-table td.fs11 { font-size: 11px; }

/* ====== Seller Table ====== */
.seller-table { table-layout: fixed; min-width: 920px; }
.seller-table .col-checkbox { width: 36px; text-align: center; }
.seller-table .col-checkbox input[type="checkbox"] { cursor: pointer; }

/* Seller column width distribution (~920px) */
.seller-table .st-type       { width: 66px; text-align: center; }
.seller-table .st-status     { width: 76px; text-align: center; }
.seller-table .st-shopname   { width: 140px; }
.seller-table .st-bizname    { width: 130px; }
.seller-table .st-member     { width: 90px; }
.seller-table .st-contact    { width: 70px; }
.seller-table .st-phone      { width: 116px; }
.seller-table .st-grade      { width: 50px; text-align: center; }
.seller-table .st-date       { width: 86px; text-align: center; }

/* Seller cell text handling */
.seller-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.seller-table td.col-checkbox { text-align: center; }
.seller-table td.tc { text-align: center; }
.seller-table td.fs11 { font-size: 11px; }

/* Seller field readonly styling (reuse vendor patterns) */
.seller-field[readonly],
.seller-field[disabled] {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: var(--text-primary);
    cursor: default;
}

.seller-field.editable {
    background: white !important;
    border-color: var(--nv-green) !important;
    cursor: text !important;
}

select.seller-field.editable {
    cursor: pointer !important;
}

/* Four-column form row */
.form-row.four-col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Toolbar filter select */
.toolbar-select {
    width: auto !important;
    min-width: 100px;
    font-size: 12px !important;
    padding: 5px 10px !important;
    height: 32px;
}

/* Sortable column headers */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.data-table th.sortable:hover {
    background: #e2e6ea;
}
.data-table th.sortable i {
    font-size: 9px;
    margin-left: 3px;
    opacity: 0.4;
    transition: opacity 0.15s;
}
.data-table th.sortable.sort-asc i,
.data-table th.sortable.sort-desc i {
    opacity: 1;
    color: var(--nv-green);
}
.data-table th.sortable.sort-asc i::before { content: "\f0de"; }
.data-table th.sortable.sort-desc i::before { content: "\f0dd"; }

/* Pagination */
.pagination-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    font-size: 12px;
    flex-wrap: wrap;
}
.pagination-bar:empty { display: none; }
.pagination-info {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 500;
}
.pagination-buttons {
    display: flex;
    gap: 4px;
}
.pagination-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.12s;
}
.pagination-btn:hover:not(:disabled):not(.active) {
    background: var(--bg-main);
    border-color: #bbb;
}
.pagination-btn.active {
    background: var(--nv-green);
    color: white;
    border-color: var(--nv-green);
    font-weight: 700;
}
.pagination-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
/* Legacy support */
.pagination-bar .page-info {
    color: var(--text-tertiary);
    margin-right: 10px;
    font-size: 11px;
}
.pagination-bar button {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.12s;
}
.pagination-bar button:hover:not(:disabled):not(.active) {
    background: var(--bg-main);
    border-color: #bbb;
}
.pagination-bar button.active {
    background: var(--nv-green);
    color: white;
    border-color: var(--nv-green);
    font-weight: 700;
}
.pagination-bar button:disabled {
    opacity: 0.4;
    cursor: default;
}
.pagination-bar .page-dots {
    padding: 0 4px;
    color: var(--text-tertiary);
}

/* Business License Upload Layout */
.biz-info-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.biz-license-area {
    flex: 0 0 200px;
    min-width: 200px;
}

.biz-fields-area {
    flex: 1;
    min-width: 0;
}

.biz-license-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.biz-license-preview {
    width: 200px;
    height: 260px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s;
}

.biz-license-preview:hover {
    border-color: var(--nv-green);
}

.biz-license-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    cursor: pointer;
}

.biz-license-preview img:hover {
    opacity: 0.9;
}

.biz-license-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    text-align: center;
}

.biz-license-placeholder i {
    font-size: 36px;
    color: #d1d5db;
}

.biz-license-placeholder span {
    font-size: 12px;
    line-height: 1.4;
}

.biz-license-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.biz-license-btn {
    font-size: 10px !important;
    padding: 3px 8px !important;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.biz-license-btn i {
    font-size: 10px;
}

/* Fullscreen image viewer overlay */
.biz-license-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.biz-license-fullscreen img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .biz-info-layout {
        flex-direction: column;
    }
    .biz-license-area {
        flex: none;
        width: 100%;
        min-width: auto;
    }
    .biz-license-preview {
        width: 100%;
        height: 200px;
    }
    .biz-license-actions {
        max-width: 100%;
    }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 15px;
    font-weight: 700;
}

.modal-close {
    width: 28px; height: 28px;
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover { background: var(--bg-main); color: var(--text-primary); }

.modal-body {
    padding: 20px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
}

/* ====== SP Edit Modal Footer (Large Buttons) ====== */
.sp-edit-footer {
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f8fafb;
}
.sp-edit-cancel-btn {
    padding: 8px 18px;
    font-size: 13px;
    color: #666;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    cursor: pointer;
}
.sp-edit-cancel-btn:hover { background: #f5f5f5; }
.sp-edit-footer-actions {
    display: flex;
    gap: 10px;
}
.sp-edit-save-btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--nv-green);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(3,199,90,0.3);
    transition: all 0.2s;
}
.sp-edit-save-btn:hover { background: #02b050; box-shadow: 0 4px 12px rgba(3,199,90,0.4); transform: translateY(-1px); }
.sp-edit-ready-btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: #1976d2;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(25,118,210,0.3);
    transition: all 0.2s;
}
.sp-edit-ready-btn:hover { background: #1565c0; box-shadow: 0 4px 12px rgba(25,118,210,0.4); transform: translateY(-1px); }
.sp-edit-approve-btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: #e65100;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(230,81,0,0.3);
    transition: all 0.2s;
}
.sp-edit-approve-btn:hover { background: #d84315; box-shadow: 0 4px 12px rgba(230,81,0,0.4); transform: translateY(-1px); }

/* ============ MODAL TABS ============ */
.modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.modal-tab {
    padding: 8px 14px;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
    transition: all 0.15s;
}

.modal-tab.active {
    color: var(--nv-green);
    border-bottom-color: var(--nv-green);
    font-weight: 700;
}

.modal-tab:hover { color: var(--text-secondary); }

.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 14px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-label.required::after { content: ' *'; color: var(--nv-red); }

.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 12px;
    font-family: inherit;
    transition: border-color 0.15s;
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--nv-green);
    box-shadow: 0 0 0 2px rgba(3,199,90,0.1);
}

.form-control:read-only { background: #f8f9fa; color: var(--text-tertiary); }

textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row.three-col { grid-template-columns: 1fr 1fr 1fr; }

/* ============ FORM CARD ============ */
.page-form-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.form-card-body {
    padding: 20px;
}

.form-card-footer {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: #fafbfc;
}

/* Form section tabs (registration page) - legacy kept for reference */
.form-section-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    background: #fafbfc;
}

.form-sec-tab {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
    transition: all 0.15s;
}

.form-sec-tab.active {
    color: var(--nv-green);
    border-bottom-color: var(--nv-green);
    font-weight: 700;
    background: var(--bg-white);
}

.form-sec-tab:hover { color: var(--text-secondary); }

.form-sec-content {
    display: none;
    padding: 20px;
}

.form-sec-content.active { display: block; }

/* ---- Continuous form section headers (single-page layout) ---- */
.form-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--nv-green);
    background: linear-gradient(135deg, #f0faf4, #f7fdf9);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid #e0e8e3;
    letter-spacing: -0.2px;
}

.form-section-header i {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.page-form-card > .form-section-header:first-child {
    border-top: none;
    border-radius: 8px 8px 0 0;
}

.form-section-body {
    padding: 20px;
}

.form-section-body + .form-section-header {
    margin-top: 0;
}

/* ---- Image Upload Area ---- */
.image-upload-area {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fafbfc;
}

.image-upload-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #f5f6f7;
}

.img-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s;
}

.img-tab.active {
    color: var(--nv-green);
    background: #fff;
    font-weight: 700;
    border-bottom: 2px solid var(--nv-green);
}

.img-tab:hover:not(.active) { color: var(--text-secondary); }

.img-input-area {
    display: none;
    padding: 12px;
}

.img-input-area.active { display: block; }

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px dashed #d0d7de;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-tertiary);
    text-align: center;
}

.file-upload-label:hover {
    border-color: var(--nv-green);
    color: var(--nv-green);
    background: #f0faf4;
}

.file-upload-label i { font-size: 28px; margin-bottom: 8px; }
.file-upload-label span { font-size: 13px; font-weight: 500; }
.file-upload-label small { font-size: 11px; margin-top: 4px; color: var(--text-tertiary); }

.img-preview {
    display: none;
    padding: 12px;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

.img-preview img {
    max-width: 120px;
    max-height: 80px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    object-fit: contain;
}

.img-preview-clear {
    border: none;
    background: #ff4d4f;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- Subcategory Inline Row ---- */
.subcategory-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.subcategory-row .form-control { flex: 1; }

.subcategory-inline-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 12px;
}

.btn-outline-green {
    border: 1px solid var(--nv-green);
    color: var(--nv-green);
    background: #fff;
}
.btn-outline-green:hover { background: #f0faf4; }

.btn-outline-red {
    border: 1px solid #ff4d4f;
    color: #ff4d4f;
    background: #fff;
}
.btn-outline-red:hover { background: #fff1f0; }

/* ---- Category Manager Page ---- */
.category-manager-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 0 20px 0;
}

.cat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.cat-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.cat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafbfc;
}

.cat-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cat-icon {
    font-size: 28px;
    line-height: 1;
}

.cat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cat-code {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    background: #eef0f3;
    padding: 1px 6px;
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
}

.cat-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.cat-product-count {
    font-size: 12px;
    color: var(--text-tertiary);
    background: #eef0f3;
    padding: 3px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cat-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-sort-badge {
    font-size: 11px;
    color: var(--text-tertiary);
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
}

.cat-sub-list {
    padding: 14px 20px;
}

.cat-sub-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-sub-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.sub-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #f0faf4;
    border: 1px solid #c8e6d8;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: #1a7f45;
}

.sub-tag-count {
    font-size: 10px;
    background: #d4edda;
    color: #155724;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

.sub-tag-del {
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}

.sub-tag-del:hover:not(:disabled) { color: #ff4d4f; }
.sub-tag-del:disabled { cursor: not-allowed; opacity: 0.3; }

.sub-tag-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: #fff;
    border: 1px dashed var(--nv-green);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--nv-green);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.sub-tag-add:hover {
    background: #f0faf4;
}

/* ---- Category Tree Section ---- */
.cat-tree-section {
    padding: 14px 20px 16px;
}

.cat-tree-section .cat-sub-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cat-tree-section .sub-tag-add {
    margin-left: auto;
    font-size: 11px;
    padding: 3px 10px;
}

.cat-depth-badge {
    font-size: 11px;
    color: #6c63ff;
    background: #eeecff;
    padding: 3px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cat-tree-container {
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fdfdfe;
    overflow: hidden;
}

.tree-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
}

.tree-empty i { margin-right: 6px; }

/* Tree node */
.tree-node {
    border-bottom: 1px solid #f3f3f3;
}

.tree-node:last-child { border-bottom: none; }

.tree-node-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 6px;
    transition: background 0.1s;
}

.tree-node-row:hover {
    background: #f5f8ff;
}

.tree-indent {
    flex-shrink: 0;
}

.tree-toggle {
    width: 20px;
    height: 20px;
    border: none;
    background: #eef0f3;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, background 0.15s;
    font-size: 10px;
    color: #666;
}

.tree-toggle:hover { background: #dde0e5; }

.tree-toggle.open { transform: rotate(90deg); }

.tree-leaf-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ccc;
}

.tree-node-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin: 0 2px;
}

.tree-node-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
    border-radius: 4px;
    padding: 2px 4px;
    transition: background 0.15s;
}
.tree-node-name:not(.editing):hover {
    background: #eef2ff;
    cursor: pointer;
}

.tree-node-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.tree-node-count {
    font-size: 11.5px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 28px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tree-node-count i {
    font-size: 10px;
    opacity: 0.7;
}

.tree-btn {
    height: 26px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    gap: 3px;
    padding: 0 8px;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}

.tree-node-row:hover .tree-btn { opacity: 1; }

.tree-btn-rename {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #bbdefb;
}
.tree-btn-rename:hover { background: #bbdefb; }

/* ====== Inline Rename Editing ====== */
.tree-node-name.editing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    background: transparent;
    padding: 0;
}
.tree-inline-input {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    border: 2px solid #1976d2;
    border-radius: 5px;
    padding: 4px 10px;
    background: #fff;
    outline: none;
    min-width: 120px;
    flex: 1;
    height: 30px;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tree-inline-input:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.18);
}
.tree-inline-btns {
    display: inline-flex;
    gap: 3px;
    flex-shrink: 0;
}
.tree-inline-confirm,
.tree-inline-cancel {
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.15s, border-color 0.15s;
}
.tree-inline-confirm {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}
.tree-inline-confirm:hover {
    background: #c8e6c9;
}
.tree-inline-cancel {
    background: #ffebee;
    color: #e53935;
    border-color: #ffcdd2;
}
.tree-inline-cancel:hover {
    background: #ffcdd2;
}
.tree-inline-saving {
    font-size: 12px;
    color: #888;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
}

.tree-btn-add {
    background: #e8f5e9;
    color: var(--nv-green);
    border-color: #c8e6c9;
}
.tree-btn-add:hover { background: #c8e6c9; }

.tree-btn-del {
    background: #ffebee;
    color: #e53935;
    border-color: #ffcdd2;
}
.tree-btn-del:hover:not(:disabled) { background: #ffcdd2; }
.tree-btn-del:disabled { color: #ccc; background: #f5f5f5; border-color: #eee; cursor: not-allowed; opacity: 0.4; }

/* Tree children collapse/expand */
.tree-children {
    display: none;
    border-top: 1px solid #f0f0f0;
}

.tree-children.open { display: block; }

/* Depth visual indicators */
.tree-node.depth-0 > .tree-node-row { background: #fafbfc; }
.tree-node.depth-1 > .tree-node-row { background: #fdfdfe; }
.tree-node.depth-0 > .tree-node-row .tree-node-name { font-weight: 600; }

/* Form hint text */
.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Image tab switcher JS helper */


/* Coming soon placeholder */
.coming-soon {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.coming-soon i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.2;
}

.coming-soon h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.coming-soon p {
    font-size: 13px;
    margin-bottom: 14px;
}

/* ============ PRICE CALCULATOR ============ */
.price-calculator {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
}

.price-calculator h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--nv-green);
}

.calc-preview { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-color); }

.calc-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    border: 1px solid var(--border-light);
}

.calc-preview-item.highlight {
    background: var(--nv-green-light);
    border-color: var(--nv-green);
}

.preview-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.preview-formula { font-size: 10px; color: var(--text-tertiary); }
.preview-value { font-size: 14px; font-weight: 800; color: var(--nv-green); }

/* ============ SALE PRODUCT CARDS ============ */
.sp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.sp-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.15s;
    cursor: pointer;
}

.sp-card:hover { box-shadow: var(--shadow-md); border-color: var(--nv-green); }

.sp-card-header {
    padding: 14px 16px 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.sp-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sp-card-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.sp-card-body { padding: 0 16px 14px; }

.sp-card-compositions {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 10px;
}

.sp-comp-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    background: var(--bg-main);
    border-radius: 10px;
    font-size: 10px;
    color: var(--text-tertiary);
}

.sp-card-costs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.sp-cost-item {
    padding: 8px;
    background: var(--bg-main);
    border-radius: var(--radius);
    text-align: center;
}

.sp-cost-label { font-size: 10px; color: var(--text-tertiary); display: block; }
.sp-cost-value { font-size: 13px; font-weight: 800; color: var(--text-primary); }
.sp-cost-value.profit { color: var(--nv-green); }
.sp-cost-value.loss { color: var(--nv-red); }

.sp-card-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sp-card-date { font-size: 10px; color: var(--text-tertiary); }

/* ============ SALE PRODUCT FORM LAYOUT ============ */
.sp-form-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }

.sp-cost-params {
    margin-top: 16px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.sp-cost-params h4, .sp-composition-section h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============ COMPOSITION AREA (Left-Right Split) ============ */
.comp-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 480px;
    max-height: 480px;
    overflow: hidden;
}

.comp-split-left {
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.comp-split-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.comp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 1;
}

.comp-panel-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.comp-panel-title i { color: var(--nv-green); font-size: 13px; }

.comp-panel-count {
    background: var(--nv-green);
    color: white;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.comp-search-area {
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    flex-shrink: 0;
}

.comp-search-row {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
}

.comp-filter { width: 100px; flex-shrink: 0; padding: 5px 6px; font-size: 11px; }
.comp-search { flex: 1; }
.comp-search input { width: 100%; padding: 5px 6px 5px 28px; font-size: 11px; }

/* Scrollbar styling for composition lists */
.comp-product-list::-webkit-scrollbar,
.comp-selected-body::-webkit-scrollbar { width: 6px; }
.comp-product-list::-webkit-scrollbar-track,
.comp-selected-body::-webkit-scrollbar-track { background: #f8f9fa; }
.comp-product-list::-webkit-scrollbar-thumb,
.comp-selected-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.comp-product-list::-webkit-scrollbar-thumb:hover,
.comp-selected-body::-webkit-scrollbar-thumb:hover { background: #aaa; }

.comp-product-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.comp-product-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.15s;
    gap: 8px;
}

.comp-product-item:hover { background: var(--nv-green-light); }
.comp-product-item:last-child { border-bottom: none; }
.comp-product-item.just-added {
    animation: compItemFlash 0.5s ease;
}

@keyframes compItemFlash {
    0% { background: var(--nv-green-light); }
    100% { background: transparent; }
}

.comp-item-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.comp-item-name { font-size: 12px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-item-meta { font-size: 10px; color: var(--text-tertiary); }
.comp-item-price { font-size: 12px; font-weight: 700; color: var(--nv-green); white-space: nowrap; flex-shrink: 0; }

.comp-item-add {
    background: var(--nv-green);
    color: white;
    border: none;
    width: 28px; height: 28px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.comp-item-add:hover { background: var(--nv-green-dark); transform: scale(1.1); }
.comp-item-add:active { transform: scale(0.95); }

/* Right panel - Selected compositions */
.comp-selected-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.comp-selected-list {
    min-height: 100%;
}

.comp-selected-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 11px;
    transition: all 0.15s;
}

.comp-selected-item:last-child { border-bottom: none; }
.comp-selected-item:hover { background: #fff5f5; }
.comp-selected-item.just-added {
    animation: compSelectedFlash 0.6s ease;
}

@keyframes compSelectedFlash {
    0% { background: #e8f5e9; }
    100% { background: transparent; }
}

.comp-sel-badge { flex-shrink: 0; }
.comp-sel-name { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.comp-sel-qty { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }

.comp-sel-qty input {
    width: 48px;
    padding: 3px 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    text-align: center;
    font-family: inherit;
    transition: border-color 0.15s;
}

.comp-sel-qty input:focus { border-color: var(--nv-green); outline: none; }

.comp-sel-subtotal { font-size: 11px; font-weight: 700; color: var(--nv-green); min-width: 65px; text-align: right; flex-shrink: 0; }

.comp-sel-remove {
    background: none;
    border: none;
    color: var(--text-disabled);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.comp-sel-remove:hover { color: white; background: var(--nv-red); }

.comp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-disabled);
    text-align: center;
    height: 100%;
    min-height: 200px;
}

.comp-empty-state i { font-size: 36px; margin-bottom: 10px; opacity: 0.4; }
.comp-empty-state p { font-size: 12px; margin: 2px 0; }
.comp-empty-state .hint { font-size: 10px; color: var(--text-tertiary); margin-top: 6px; }

/* Summary Footer */
.comp-summary-footer {
    flex-shrink: 0;
    border-top: 2px solid var(--border-color);
    background: #f8f9fa;
}

.comp-summary {
    padding: 10px 14px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.summary-item.total {
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
    padding-top: 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Responsive: stack on narrow screens */
@media (max-width: 768px) {
    .comp-split-layout {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }
    .comp-split-left {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        max-height: 360px;
    }
    .comp-split-right {
        max-height: 360px;
    }
}

/* ============ SALE PRODUCT PAGE FLUID LAYOUT ============ */
.sp-page-content {
    max-width: 100%;
    width: 100%;
}

/* ============ SP CATEGORY MANAGEMENT ============ */
/* ====== SP Category Table Styles ====== */

.sp-cat-steps-flow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sp-cat-step-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 3px;
    background: #f4f6f8;
    border: 1px solid #e5e8eb;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.sp-cat-step-chip-num {
    background: var(--nv-green);
    color: white;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.sp-cat-step-chip-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 6px;
    margin-left: 2px;
}

.sp-cat-step-arrow {
    font-size: 9px;
    color: #bbb;
}

.text-muted-desc {
    font-size: 11.5px;
    color: var(--text-tertiary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.row-action-btn {
    background: none;
    border: 1px solid #e5e8eb;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    transition: all 0.15s;
}
.row-action-btn:hover {
    background: var(--bg-secondary);
    color: var(--nv-green);
    border-color: var(--nv-green);
}
.row-action-btn.del:hover {
    color: var(--nv-red);
    border-color: var(--nv-red);
}

.row-inactive { opacity: 0.5; }

.table-footer-bar {
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Toolbar Divider */
.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Excel Buttons */
.btn-excel-down {
    background: #217346 !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
}
.btn-excel-down:hover {
    background: #1a5c37 !important;
}
.btn-excel-up {
    background: #2b6cb0 !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
}
.btn-excel-up:hover {
    background: #1e5591 !important;
}

/* Excel Upload Preview */
.bp-excel-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.bp-excel-summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
}
.bp-excel-summary-item strong {
    font-size: 15px;
    color: var(--text-primary);
}
.bp-excel-summary-item.success {
    border-color: #c6f6d5;
    background: #f0fff4;
}
.bp-excel-summary-item.success strong { color: #22543d; }
.bp-excel-summary-item.success i { color: #38a169; }
.bp-excel-summary-item.error {
    border-color: #fed7d7;
    background: #fff5f5;
}
.bp-excel-summary-item.error strong { color: #9b2c2c; }
.bp-excel-summary-item.error i { color: #e53e3e; }
.bp-excel-summary-item.info {
    border-color: #bee3f8;
    background: #ebf8ff;
}
.bp-excel-summary-item.info i { color: #3182ce; }

/* XL Modal */
.modal-xl {
    max-width: 1200px !important;
    width: 95vw !important;
}
.spn-step-section { margin-bottom: 14px; }

.spn-step-section .seller-reg-table-wrap { border-color: var(--border-color); }

.spn-step-comp-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow: hidden;
}

.spn-step-left {
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.spn-step-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Summary bar at the bottom */
.spn-total-summary {
    margin-top: 14px;
}

.spn-total-summary .comp-summary {
    background: #f0fdf4;
    border: 2px solid var(--nv-green);
    border-radius: 8px;
    padding: 12px 16px;
}

/* ============ PRICE CALCULATION PAGE ============ */
.calc-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }

.calc-select-section, .calc-params-section, .calc-result-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.calc-select-section h3, .calc-params-section h3, .calc-result-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-composition { margin-top: 14px; }
.calc-composition h4 { font-size: 13px; font-weight: 700; margin-bottom: 6px; }

.calc-comp-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

.calc-comp-item:last-child { border-bottom: none; }

.calc-param-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.param-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-tertiary); margin-bottom: 3px; }
.param-group .form-control { font-size: 13px; font-weight: 700; }

.highlight-param .form-control {
    background: var(--nv-green-light);
    border-color: var(--nv-green);
    color: var(--nv-green);
    font-weight: 800;
}

.calc-steps { display: grid; gap: 6px; margin-bottom: 20px; }

.calc-step {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.step-label { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.step-formula { font-size: 10px; color: var(--text-tertiary); }
.step-value { font-size: 15px; font-weight: 800; text-align: right; color: var(--text-primary); }
.step-value.negative { color: var(--nv-red); }
.step-value.profit { color: var(--nv-green); }

.calc-step.result-highlight {
    background: var(--nv-green-light);
    border-color: var(--nv-green);
}

.calc-chart-section h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; }

.chart-container { position: relative; }

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    top: 60px;
    right: 16px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast {
    background: var(--sidebar-bg);
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 12px;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 6px;
    animation: toastIn 0.25s ease;
}

.toast.success { background: var(--nv-green); }
.toast.error { background: var(--nv-red); }
.toast.warning { background: var(--nv-orange); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============ DETAIL MODAL ============ */
.detail-section { margin-bottom: 16px; }

.detail-section h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.detail-item { display: flex; flex-direction: column; }
.detail-item-label { font-size: 10px; color: var(--text-tertiary); }
.detail-item-value { font-size: 13px; font-weight: 700; }

/* ============ Dashboard Charts ============ */
.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.chart-card h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Dashboard Recent */
.dashboard-recent {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.recent-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.recent-card h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.recent-card h3 i { color: var(--text-tertiary); font-size: 12px; }
.recent-list { max-height: 220px; overflow-y: auto; }

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.recent-item:last-child { border-bottom: none; }
.recent-item-name { font-size: 12px; font-weight: 500; }
.recent-item-info { font-size: 11px; color: var(--text-tertiary); }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #ccc; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
    .calc-param-grid { grid-template-columns: repeat(2, 1fr); }
    .sp-form-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 12px; }
    .stats-row { flex-wrap: wrap; }
    .stat-cell { min-width: 50%; }
    .dashboard-grid-2, .dashboard-grid-3, .dashboard-charts, .dashboard-recent { grid-template-columns: 1fr; }
    .form-row, .form-row.three-col, .form-row.four-col { grid-template-columns: 1fr; }
    .calc-param-grid { grid-template-columns: 1fr; }
    .calc-step { grid-template-columns: 1fr; gap: 3px; }
    .modal { margin: 8px; }
    .sp-card-grid { grid-template-columns: 1fr; }
    .header-nav { display: none; }
}

/* ============ UTILITIES ============ */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-tertiary); }
.text-danger { color: var(--nv-red); }
.text-success { color: var(--nv-green); }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.d-none { display: none; }

/* ============ UNIFIED TABLE FORM (매입처/판매처 공통) ============ */
/* Naver SmartStore Seller Center Style - Compact Table Layout v3.0 */
/* 매입처 등록/수정 + 판매처 등록/수정 동일한 UI 포맷 */

.seller-reg-card {
    background: var(--bg-white);
    border: 1px solid #e1e5e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.seller-reg-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e5e8eb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    background: #fff;
}

.seller-reg-table-wrap + .seller-reg-table-wrap {
    margin-top: 20px;
}

.seller-reg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.seller-reg-table colgroup col {
    min-width: 100px;
}

/* ---- Section Header Row ---- */
.srt-header {
    background: #fafbfc;
    color: #191f28;
    padding: 16px 22px;
    font-size: 15px;
    font-weight: 800;
    text-align: left;
    border-bottom: none;
    border-top: 2.5px solid var(--nv-green);
    letter-spacing: -0.3px;
    position: relative;
    margin-top: 12px;
}

.srt-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--nv-green);
    border-radius: 0 2px 2px 0;
}

.srt-header i {
    margin-right: 10px;
    font-size: 15px;
    color: var(--nv-green);
}

.srt-header small {
    font-size: 11px;
    font-weight: 400;
    color: #8b95a1;
    margin-left: 8px;
}

/* Section header color variants */
.srt-header.srt-orange { border-top-color: var(--nv-orange); }
.srt-header.srt-orange::before { background: var(--nv-orange); }
.srt-header.srt-orange i { color: var(--nv-orange); }

.srt-header.srt-blue { border-top-color: var(--nv-blue); }
.srt-header.srt-blue::before { background: var(--nv-blue); }
.srt-header.srt-blue i { color: var(--nv-blue); }

.srt-header.srt-purple { border-top-color: var(--nv-purple); }
.srt-header.srt-purple::before { background: var(--nv-purple); }
.srt-header.srt-purple i { color: var(--nv-purple); }

.srt-header.srt-red { border-top-color: var(--nv-red); }
.srt-header.srt-red::before { background: var(--nv-red); }
.srt-header.srt-red i { color: var(--nv-red); }

.srt-header.srt-teal { border-top-color: #009688; }
.srt-header.srt-teal::before { background: #009688; }
.srt-header.srt-teal i { color: #009688; }

/* ---- Label Cells (TH) ---- */
.srt-label {
    background: #f5f7f9;
    color: #333d4b;
    font-weight: 600;
    font-size: 13px;
    padding: 14px 18px;
    border: 1px solid #e8ebed;
    white-space: nowrap;
    vertical-align: middle;
    text-align: left;
    letter-spacing: -0.2px;
    line-height: 1.5;
    min-width: 130px;
}

.srt-label small {
    display: block;
    color: #8b95a1;
    font-weight: 400;
    font-size: 11px;
    margin-top: 4px;
    letter-spacing: 0;
    line-height: 1.4;
}

.srt-label.required::after {
    content: ' *';
    color: var(--nv-red);
    font-size: 14px;
    vertical-align: baseline;
    font-weight: 700;
    margin-left: 2px;
}

/* ---- Input Cells (TD) ---- */
.srt-input {
    padding: 12px 16px;
    border: 1px solid #e8ebed;
    vertical-align: middle;
    background: #fff;
}

/* ---- Form Controls ---- */
.srt-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d6db;
    border-radius: 6px;
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    color: #333d4b;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    line-height: 1.5;
}

.srt-control:focus {
    outline: none;
    border-color: var(--nv-green);
    box-shadow: 0 0 0 4px rgba(3, 199, 90, 0.10);
    background: #fff;
}

.srt-control:read-only:not(select) {
    background: #f5f6f7;
    color: #555;
    cursor: default;
}

.srt-control:disabled {
    background: #f5f6f7;
    color: #555;
    cursor: default;
    opacity: 0.85;
}

.srt-control.editable {
    background: #fff;
    border-color: var(--nv-green);
    box-shadow: inset 0 0 0 1px rgba(3, 199, 90, 0.08);
}

.srt-control::placeholder {
    color: #b0b8c1;
    font-weight: 400;
    font-size: 13px;
}

select.srt-control {
    appearance: auto;
    cursor: pointer;
    padding-right: 28px;
    background-color: #fff;
}

textarea.srt-control {
    resize: vertical;
    min-height: 56px;
    line-height: 1.6;
}

/* ---- Link Group ---- */
.srt-link-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.srt-link-group .srt-control {
    flex: 1;
}

.srt-link-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border-radius: 4px;
}

/* ---- License Upload (Compact) ---- */
.srt-license-group {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.srt-file-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
    line-height: 1.3;
    border-radius: 3px;
}

.srt-license-mini {
    margin-top: 5px;
    max-width: 100%;
    min-height: 24px;
}

.srt-license-mini img {
    max-height: 60px;
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #e3e7eb;
    cursor: pointer;
    object-fit: contain;
}

.srt-license-placeholder {
    color: #bbb;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.srt-license-placeholder i {
    font-size: 13px;
}

/* ---- Footer Buttons ---- */
/* ====== SP Image Upload Area (Registration Form) ====== */
.sp-image-upload-area {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.sp-image-preview {
    width: 80px;
    height: 80px;
    border: 2px dashed #dde0e4;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    flex-shrink: 0;
    overflow: hidden;
    color: #bbb;
    font-size: 10px;
    gap: 4px;
    transition: border-color 0.2s;
}
.sp-image-preview i { font-size: 22px; }
.sp-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
.sp-image-preview:has(img) {
    border-style: solid;
    border-color: var(--nv-green);
}

.sp-image-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ====== SP Thumbnail in Table Rows ====== */
.sp-td-thumb {
    text-align: center;
    vertical-align: middle;
    padding: 8px 6px !important;
    width: 106px;
}

.sp-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    vertical-align: middle;
    cursor: pointer;
}

.sp-thumb-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
    color: #d1d5db;
    font-size: 26px;
}

/* ====== SP Edit Wide Modal ====== */
.sp-edit-wide-modal {
    max-width: 85vw !important;
    width: 85vw !important;
    min-width: 900px;
}

/* ====== SP Edit: Modal override for sc-top-layout ====== */
.spe-top-layout {
    max-height: 440px;
    min-height: 300px;
}
.sc-recalc-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
    font-size: 11px;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.sc-recalc-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.spe-section-header small {
    font-weight: 400;
    font-size: 11px;
    opacity: 0.8;
    margin-left: 8px;
}

/* Top: Search + Selected compositions side by side */
.spe-composition-layout {
    display: grid;
    grid-template-columns: 33% 40% 27%;
    grid-template-rows: 440px;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    margin-bottom: 0;
}
.spe-search-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: #fff;
    overflow: hidden;
}
.spe-selected-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}
.spe-search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f4f6f8;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #e3e7eb;
    flex-shrink: 0;
}
.spe-cat-tabs {
    display: flex;
    gap: 0;
    padding: 8px 10px;
    border-bottom: 1px solid #e3e7eb;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.spe-cat-tab {
    padding: 4px 10px;
    border: 1px solid #dde0e4;
    background: #fff;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 4px;
    margin-right: 4px;
    margin-bottom: 2px;
    color: #666;
}
.spe-cat-tab:hover { background: #f0f0f0; }
.spe-cat-tab.active {
    background: var(--nv-green);
    color: #fff;
    border-color: var(--nv-green);
}
.spe-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid #e3e7eb;
    flex-shrink: 0;
}
.spe-search-input-wrap i { color: #aaa; font-size: 12px; }
.spe-search-input-wrap .form-control {
    flex: 1;
    font-size: 12px;
    padding: 5px 8px;
    border: 1px solid #dde0e4;
    border-radius: 4px;
}
.spe-search-footer {
    padding: 6px 12px;
    font-size: 10px;
    color: #999;
    border-top: 1px solid #f0f2f5;
    text-align: center;
    flex-shrink: 0;
    background: #fafafa;
}

/* 원가산출 패널 (3번째 컬럼) */
.spe-cost-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid var(--border-color);
    overflow: hidden;
}
.spe-cost-panel-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, #1565c0, #1976d2);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.spe-cost-panel-header i {
    margin-right: 6px;
    font-size: 12px;
}
.spe-cost-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.spe-cost-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
}
.spe-cost-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.spe-cost-info {
    flex: 1;
    min-width: 0;
}
.spe-cost-cat {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    display: block;
}
.spe-cost-count {
    font-size: 10px;
    color: #999;
}
.spe-cost-amount {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}
.spe-cost-divider {
    height: 1px;
    background: #e8eaed;
    margin: 6px 0;
}
.spe-cost-subtotal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px;
    background: #f8f9ff;
    border-radius: 6px;
    margin: 2px 0;
}
.spe-cost-subtotal-label {
    font-size: 12px;
    font-weight: 700;
    color: #1565c0;
}
.spe-cost-subtotal-label i {
    margin-right: 4px;
}
.spe-cost-subtotal-val {
    font-size: 14px;
    font-weight: 800;
    color: #1565c0;
}
.spe-cost-work-row .spe-cost-info {
    flex: 0 0 auto;
}
.spe-cost-input-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}
.spe-cost-input {
    width: 68px;
    padding: 3px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: right;
    font-weight: 600;
}
.spe-cost-input:focus {
    outline: none;
    border-color: var(--nv-green);
    box-shadow: 0 0 0 2px rgba(3,199,90,0.12);
}
.spe-cost-unit {
    font-size: 11px;
    color: #777;
    font-weight: 600;
}
.spe-cost-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: 8px;
    margin-top: 6px;
}
.spe-cost-total span {
    font-size: 12px;
    font-weight: 700;
    color: #2e7d32;
}
.spe-cost-total strong {
    font-size: 15px;
    font-weight: 800;
    color: #1b5e20;
}
.spe-cost-total i {
    margin-right: 4px;
}

/* Bottom: 단가 계산 (2컬럼 - 공급가 + 정산) */
.spe-calc-flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: stretch;
    border: 1px solid #e0e3e8;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #fff;
}
.spe-calc-flow-2col {
    grid-template-columns: 1fr 1fr;
}
.spe-flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    color: #b0b8c4;
    font-size: 14px;
    background: #f9fafb;
    border-left: 1px solid #eef0f3;
    border-right: 1px solid #eef0f3;
    flex-shrink: 0;
}
.spe-flow-step {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.spe-calc-flow-2col .spe-flow-step:first-child {
    border-right: 1px solid #e0e3e8;
}
.spe-flow-step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f0f4f8, #e8ecf2);
    border-bottom: 2px solid #dde2ea;
}
.spe-flow-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--nv-green);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}
.spe-flow-step-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #3a4356;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.spe-flow-step-title i { font-size: 12.5px; color: #5a6c82; }

/* Step 3: 정산 & 수익분석 - 다크 테마 */
.spe-flow-step-result { background: linear-gradient(135deg, #232a36, #2e3647); }
.spe-flow-step-header-result { background: linear-gradient(135deg, #343d50, #4a5570); border-bottom-color: rgba(255,255,255,0.1); }
.spe-flow-step-num-result { background: #64b5f6; }
.spe-flow-step-header-result .spe-flow-step-title { color: #fff; }
.spe-flow-step-header-result .spe-flow-step-title i { color: #64b5f6; }

/* Flow Step Body */
.spe-flow-step-body {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.spe-flow-step-body-result {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Flow Rows */
.spe-flow-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
}
.spe-flow-label {
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    white-space: nowrap;
}
.spe-flow-label i { font-size: 11.5px; }
.spe-flow-label small { font-size: 11px; color: #999; margin-left: 3px; }
.spe-flow-val {
    font-weight: 700;
    color: #333;
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-size: 13px;
}
.spe-flow-val-accent { color: var(--nv-green); }

/* Subtotal row */
.spe-flow-sub {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #dde0e4;
}
.spe-flow-sub .spe-flow-label { font-weight: 700; color: #444; font-size: 12.5px; }
.spe-flow-sub .spe-flow-val { color: #1565c0; font-size: 13.5px; }

/* Separator */
.spe-flow-sep { height: 1px; background: #e8eaed; margin: 8px 0; }

/* Input Row */
.spe-flow-input-row { padding: 4px 0; }
.spe-flow-input-wrap { display: flex; align-items: center; gap: 4px; }
.spe-flow-input {
    width: 78px;
    padding: 6px 8px;
    border: 1.5px solid #d1d6db;
    border-radius: 6px;
    font-size: 13px;
    text-align: right;
    font-weight: 600;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.spe-flow-input:focus { outline: none; border-color: var(--nv-green); box-shadow: 0 0 0 3px rgba(3,199,90,0.12); }
.spe-flow-unit { font-size: 12px; color: #777; white-space: nowrap; min-width: 14px; font-weight: 600; }

/* Highlight Card (총 매입원가) */
.spe-flow-highlight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #e8f5e9, #f0faf4);
    border: 1.5px solid #a5d6a7;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: auto;
}
.spe-flow-highlight span {
    font-size: 12.5px;
    font-weight: 700;
    color: #2e7d32;
    display: flex;
    align-items: center;
    gap: 5px;
}
.spe-flow-highlight span i { font-size: 12px; }
.spe-flow-highlight strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--nv-green);
    font-variant-numeric: tabular-nums;
}

/* Step 3 Result Area */
.spe-result-settlement {
    background: linear-gradient(135deg, rgba(100,181,246,0.12), rgba(66,165,245,0.06));
    border: 1.5px solid rgba(100,181,246,0.35);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.spe-result-settlement-label {
    font-size: 13px;
    font-weight: 700;
    color: #90caf9;
    display: flex;
    align-items: center;
    gap: 6px;
}
.spe-result-settlement-label i { font-size: 13px; }
.spe-result-settlement-value {
    font-size: 19px;
    font-weight: 800;
    color: #64b5f6;
    font-variant-numeric: tabular-nums;
}
.spe-result-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    margin: 14px 0;
}
.spe-result-profit-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.spe-result-formula {
    font-size: 10.5px;
    color: rgba(255,255,255,0.45);
    text-align: center;
    margin-bottom: 10px;
}
.spe-result-profit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.spe-result-profit-item {
    text-align: center;
    padding: 10px 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
}
.spe-result-profit-label {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.spe-result-profit-label i { font-size: 12px; }
.spe-result-profit-value {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.spe-recalc-btn {
    width: 100%;
    margin-top: 10px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.spe-recalc-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* Keep existing shared styles */
.spe-comp-table-wrap {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.spe-comp-table-wrap::-webkit-scrollbar { width: 6px; }
.spe-comp-table-wrap::-webkit-scrollbar-track { background: #f5f5f5; }
.spe-comp-table-wrap::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.spe-comp-table-wrap::-webkit-scrollbar-thumb:hover { background: #aaa; }
.spe-comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.spe-comp-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f4f6f8;
}
.spe-comp-table th {
    padding: 9px 10px;
    font-weight: 600;
    font-size: 12px;
    color: #5a6374;
    border-bottom: 1px solid #e3e7eb;
    text-align: center;
    white-space: nowrap;
}
.spe-comp-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}
.spe-comp-table tbody tr:hover {
    background: #f0faf4;
}
.spe-comp-cat-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.spe-comp-cat-badge.cat-snack { background: #fff3e0; color: #e65100; }
.spe-comp-cat-badge.cat-accessory { background: #fce4ec; color: #c62828; }
.spe-comp-cat-badge.cat-packaging { background: #e3f2fd; color: #1565c0; }
.spe-comp-qty-input {
    width: 48px;
    padding: 3px 4px;
    border: 1px solid #dde0e4;
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
}
.spe-comp-qty-input:focus {
    border-color: var(--nv-green);
    outline: none;
}
.spe-comp-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-size: 13px;
    padding: 3px 6px;
    border-radius: 3px;
    transition: all 0.15s;
}
.spe-comp-remove-btn:hover {
    background: #fee;
    color: var(--nv-red);
}
.spe-comp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #aaa;
    gap: 8px;
}
.spe-comp-empty i { font-size: 28px; }
.spe-comp-empty p { font-size: 12px; margin: 0; }
.spe-comp-add-bar {
    padding: 8px 10px;
    border-top: 1px solid #f0f2f5;
    flex-shrink: 0;
}
/* Add composition area */
.spe-add-comp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #e8f5e9;
    font-size: 12px;
    font-weight: 600;
    color: #2e7d32;
    border-top: 1px solid #c8e6c9;
}
.spe-add-comp-search {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid #e3e7eb;
}
.spe-add-comp-search .form-control { font-size: 11px; padding: 4px 6px; }
.spe-add-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.spe-add-list::-webkit-scrollbar { width: 6px; }
.spe-add-list::-webkit-scrollbar-track { background: #f5f5f5; }
.spe-add-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.spe-add-list::-webkit-scrollbar-thumb:hover { background: #aaa; }
.spe-add-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    font-size: 11px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.15s;
}
.spe-add-item:hover { background: #e8f5e9; }
.spe-add-item .spe-add-name { flex: 1; }
.spe-add-item .spe-add-price { color: var(--nv-green); font-weight: 600; white-space: nowrap; }
.spe-add-item .spe-add-btn {
    background: var(--nv-green);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.spe-add-item .spe-add-btn:hover { background: #388e3c; }

/* Calc right panel */
.spe-calc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 0;
}
.spe-calc-section {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
}
.spe-calc-section:last-child { border-bottom: none; margin-bottom: 0; }
.spe-calc-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #5a6374;
    margin-bottom: 10px;
    padding-bottom: 5px;
}
.spe-calc-section-title i { color: var(--nv-green); margin-right: 5px; }
.spe-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
}
.spe-calc-label {
    color: #555;
}
.spe-calc-value {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.spe-calc-subtotal {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #dde0e4;
}
.spe-calc-subtotal .spe-calc-label { font-weight: 600; color: #444; }
.spe-calc-subtotal .spe-calc-value { color: var(--nv-blue); }
.spe-calc-highlight {
    background: #e8f5e9;
    border-radius: 6px;
    padding: 10px 12px !important;
    border-bottom: none !important;
}
.spe-calc-total .spe-calc-label {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}
.spe-calc-total .spe-calc-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--nv-green);
}
.spe-calc-profit-section {
    background: #f0f4ff;
    border-radius: 6px;
    padding: 10px 12px !important;
    border-bottom: none !important;
}
/* 수식 텍스트 스타일 */
.spe-calc-formula {
    font-size: 10px;
    color: #888;
    font-style: italic;
    padding: 2px 0 1px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}
.spe-calc-formula-profit {
    font-size: 11px;
    color: #e74c3c;
    font-weight: 600;
    font-style: normal;
    padding: 0 0 3px;
    letter-spacing: -0.2px;
}
/* 센터이익 차감 항목 빨간색 표시 */
.spe-val-deduct {
    color: #e74c3c !important;
    font-weight: 600 !important;
}
.spe-calc-action {
    padding: 8px 12px;
    border-top: 1px solid #e3e7eb;
    flex-shrink: 0;
}

/* 인라인 입력 (단가계산 내 직접 입력) */
.spe-calc-input-row {
    align-items: center;
}
.spe-inline-input {
    display: flex;
    align-items: center;
    gap: 4px;
}
.spe-calc-inline {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #d0d5db;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
}
.spe-calc-inline:focus {
    border-color: var(--nv-green);
    outline: none;
    box-shadow: 0 0 0 2px rgba(3,199,90,0.15);
}
.spe-inline-unit {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    min-width: 16px;
}

@media (max-width: 1100px) {
    .sp-edit-wide-modal { max-width: 98vw !important; width: 98vw !important; min-width: auto; }
}
@media (max-width: 768px) {
    .spe-composition-layout {
        grid-template-columns: 1fr;
    }
    .spe-search-panel { border-right: none; border-bottom: 1px solid var(--border-color); max-height: 300px; }
    .spe-price-calc-layout {
        grid-template-columns: 1fr;
    }
    .spe-calc-body { padding: 12px 14px; }
}

.seller-reg-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px 0 0;
    margin-top: 24px;
    border-top: 1px solid #e3e7eb;
}

/* ====== Sticky Bottom Action Bar ====== */
.sp-sticky-action-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #fff;
    border-top: 2px solid #e3e7eb;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.sp-action-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-action-bar-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.sp-action-bar-hint i {
    color: var(--nv-green);
    font-size: 13px;
}

.sp-action-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.sp-action-preview {
    background: #f4f6f8;
    color: #495057;
    border-color: #dde0e4;
}
.sp-action-preview:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.sp-action-draft {
    background: #f4f6f8;
    color: #495057;
    border-color: #dde0e4;
}
.sp-action-draft:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.sp-action-save {
    background: var(--nv-green);
    color: #fff;
    border-color: var(--nv-green);
    padding: 9px 24px;
}
.sp-action-save:hover {
    background: var(--nv-green-dark);
    border-color: var(--nv-green-dark);
    box-shadow: 0 2px 8px rgba(3, 199, 90, 0.3);
}

.sp-action-cancel {
    background: #fff;
    color: #868e96;
    border-color: #dde0e4;
}
.sp-action-cancel:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #ced4da;
}

/* Ensure page content has bottom padding so bar doesn't cover content */
#page-sp-new .page-content {
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    .sp-sticky-action-bar {
        padding: 10px 12px;
        flex-direction: column;
        gap: 8px;
    }
    .sp-action-bar-left {
        display: none;
    }
    .sp-action-bar-right {
        width: 100%;
        justify-content: center;
    }
    .sp-action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ---- Calculation Result Cells ---- */
.srt-calc-result {
    font-size: 13.5px;
    font-weight: 700;
    color: #333d4b;
    padding: 9px 12px;
    background: #f8f9fa;
    border: 1px solid #e8ebed;
    border-radius: 6px;
    min-height: 36px;
    line-height: 1.5;
}

.srt-calc-highlight {
    background: linear-gradient(135deg, #e9f8ef 0%, #d4f5e0 100%);
    color: var(--nv-green-dark);
    font-size: 15px;
    font-weight: 800;
    border: 2px solid var(--nv-green);
    border-radius: 6px;
    padding: 10px 14px;
}

/* ---- Helper / Guide Text (Naver SmartStore style) ---- */
.srt-help {
    font-size: 12px;
    color: #6b7684;
    margin-top: 8px;
    line-height: 1.7;
    font-weight: 400;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.srt-help::before {
    content: '\f05a';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--nv-green);
    font-size: 11px;
    flex-shrink: 0;
    margin-top: 2px;
}

.srt-help a {
    color: var(--nv-green);
    text-decoration: underline;
}

.srt-help-warn {
    font-size: 12px;
    color: #e65100;
    margin-top: 8px;
    line-height: 1.7;
    padding: 8px 12px;
    background: #fff8e1;
    border-radius: 6px;
    border: 1px solid #ffe0b2;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.srt-help-warn::before {
    content: '\f071';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 11px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ---- Input with unit suffix ---- */
.srt-input-unit {
    display: flex;
    align-items: center;
    gap: 6px;
}

.srt-input-unit .srt-control {
    flex: 1;
}

.srt-input-unit .srt-unit {
    font-size: 12.5px;
    color: #6b7684;
    white-space: nowrap;
    font-weight: 500;
}

/* ---- Toggle Button Group (Naver style) ---- */
.srt-toggle-group {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d1d6db;
    width: fit-content;
}

.srt-toggle-btn {
    padding: 8px 18px;
    font-size: 12.5px;
    font-weight: 600;
    border: none;
    background: #fff;
    color: #6b7684;
    cursor: pointer;
    transition: all 0.15s;
    border-right: 1px solid #d1d6db;
}

.srt-toggle-btn:last-child {
    border-right: none;
}

.srt-toggle-btn.active {
    background: var(--nv-green);
    color: #fff;
}

.srt-toggle-btn:hover:not(.active) {
    background: #f0f2f4;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .seller-reg-table {
        table-layout: auto;
    }
    .seller-reg-table colgroup col {
        min-width: 80px;
    }
    .srt-label {
        font-size: 12px;
        padding: 10px 12px;
    }
    .srt-input {
        padding: 10px 12px;
    }
    .srt-control {
        font-size: 12.5px;
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {
    .seller-reg-table {
        font-size: 11px;
    }
    .seller-reg-table colgroup {
        display: none;
    }
    .srt-header {
        font-size: 13px;
        padding: 12px 14px;
    }
    .srt-header::before {
        width: 3px;
    }
}


/* ============================================
   Simple Price Calculator - v5 Redesign (Curtain + Flow)
   ============================================ */

/* ===== Card Common ===== */
.sc-card {
    background: #fff;
    border: 1px solid #e0e3e8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 12px;
}
.sc-card-header {
    background: linear-gradient(135deg, var(--nv-green), #02b050);
    color: #fff;
    padding: 11px 18px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sc-card-header i { font-size: 14px; }
.sc-card-header small { font-weight: 400; font-size: 12.5px; opacity: 0.85; margin-left: 4px; }

/* ===== Mode Toggle ===== */
.sc-mode-toggle {
    margin-left: 6px;
    margin-right: auto;
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.4);
}
.sc-mode-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.75);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sc-mode-btn:hover { background: rgba(255,255,255,0.25); color: #fff; }
.sc-mode-btn.active { background: #fff; color: var(--nv-green); }
.sc-mode-btn i { font-size: 10px; }

/* ===== Top 50:50 Layout ===== */
.sc-top-layout {
    display: grid;
    grid-template-columns: 33% 40% 27%;
    min-height: 280px;
    max-height: 520px;
    overflow: hidden;
}

/* ===== Left Browse Panel ===== */
.sc-browse-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8eaed;
    background: #fafbfc;
    min-height: 0;
    overflow: hidden;
}

/* ===== Cascade Category Filter (펼침식 상단→하단) ===== */
/* Search/Manual mode containers – fill parent browse-panel */
#sc-search-mode {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
#sc-manual-mode {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.sc-cascade-filter {
    flex-shrink: 0;
    border-bottom: 1px solid #e3e7eb;
}
.sc-cascade-level {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
}
.sc-cascade-level-main {
    background: linear-gradient(135deg, #f5f7f6, #eef3ea);
}
.sc-cascade-level-sub {
    background: #f2f5f3;
    border-top: 1px dashed #dde2e6;
    padding: 5px 12px;
}
.sc-cascade-label {
    font-size: 10px;
    font-weight: 700;
    color: #8a9bb0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 42px;
}
.sc-cascade-options {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.sc-cascade-opt {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1.5px solid #dde2e8;
    border-radius: 5px;
    background: #fff;
    color: #5a6374;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sc-cascade-opt i { font-size: 10px; }
.sc-cascade-opt:hover {
    border-color: var(--nv-green);
    color: var(--nv-green);
    background: #f0faf4;
}
.sc-cascade-opt.active {
    background: var(--nv-green);
    color: #fff;
    border-color: var(--nv-green);
}
.sc-cascade-opt.active i { color: #fff !important; }

/* Sub-category options (하위분류) */
.sc-cascade-level-sub .sc-cascade-opt {
    padding: 3px 9px;
    font-size: 10.5px;
    font-weight: 500;
    border-radius: 4px;
    border-color: #d4dce4;
}
.sc-cascade-level-sub .sc-cascade-opt.active {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #66bb6a;
    font-weight: 700;
}

/* Search Bar */
.sc-search-bar {
    padding: 7px 12px;
    border-bottom: 1px solid #f0f2f5;
    flex-shrink: 0;
}
.sc-search-input-wrap { position: relative; display: flex; align-items: center; }
.sc-search-input-wrap i { position: absolute; left: 10px; color: #aaa; font-size: 11px; pointer-events: none; }
.sc-search-input-wrap input {
    width: 100%;
    padding: 6px 10px 6px 28px;
    border: 1.5px solid #dde0e4;
    border-radius: 6px;
    font-size: 11.5px;
    transition: border-color 0.2s;
}
.sc-search-input-wrap input:focus { outline: none; border-color: var(--nv-green); box-shadow: 0 0 0 3px rgba(3,199,90,0.08); }

/* ===== Product List (max 10, with scrollbar) ===== */
.sc-add-list {
    flex: 1;
    overflow-y: auto;
    min-height: 60px;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #c0c6cf #f0f2f5;
}
.sc-add-list::-webkit-scrollbar { width: 6px; }
.sc-add-list::-webkit-scrollbar-track { background: #f0f2f5; }
.sc-add-list::-webkit-scrollbar-thumb { background: #c0c6cf; border-radius: 3px; }
.sc-add-list::-webkit-scrollbar-thumb:hover { background: #a0a8b4; }
.sc-add-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 11.5px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.15s;
}
.sc-add-item:hover { background: #e8f5e9; }
.sc-add-item .sc-add-name { flex: 1; font-weight: 500; color: #333; font-size: 11.5px; }
.sc-add-item .sc-add-price { color: var(--nv-green); font-weight: 700; white-space: nowrap; font-size: 11px; }
.sc-add-item .sc-add-btn {
    background: var(--nv-green); color: #fff; border: none; border-radius: 4px;
    padding: 3px 10px; font-size: 10px; font-weight: 600; cursor: pointer;
}
.sc-add-item .sc-add-btn:hover { background: var(--nv-green-dark); }
.sc-add-list-info {
    padding: 3px 12px; font-size: 10px; color: #999; text-align: center;
    border-top: 1px solid #f0f2f5; background: #fafbfc; flex-shrink: 0;
    margin-top: auto;
}

/* ===== Manual Input Mode ===== */
.sc-manual-form { padding: 14px; }
.sc-manual-title {
    font-size: 13px; font-weight: 700; color: var(--nv-green);
    margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
.sc-manual-title i { font-size: 14px; }
.sc-manual-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-end; }
.sc-manual-field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sc-manual-field-wide { flex: 2; }
.sc-manual-field-btn { flex: 0 0 auto; display: flex; align-items: flex-end; }
.sc-manual-field label { font-size: 11px; font-weight: 600; color: #555; }
.sc-manual-field input, .sc-manual-field select {
    padding: 7px 10px; border: 1.5px solid #dde0e4; border-radius: 6px; font-size: 12px;
}
.sc-manual-field input:focus, .sc-manual-field select:focus {
    outline: none; border-color: var(--nv-green); box-shadow: 0 0 0 3px rgba(3,199,90,0.1);
}
.sc-manual-add-btn { padding: 7px 18px !important; font-size: 12px !important; white-space: nowrap; }
.sc-manual-hint {
    margin-top: 8px; padding: 8px 10px; background: #f0f7ff; border: 1px solid #d6e5f7;
    border-radius: 6px; font-size: 11px; color: #5a7aa5; display: flex; align-items: center; gap: 6px;
}
.sc-manual-hint i { color: #4a90d9; font-size: 12px; flex-shrink: 0; }
.sc-filter-select {
    padding: 6px 28px 6px 10px;
    font-size: 11.5px;
    border: 1.5px solid #c8e6c9;
    border-radius: 6px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    color: #333;
    font-weight: 500;
    transition: border-color 0.2s;
    min-width: 100px;
}
.sc-filter-select:focus { outline: none; border-color: var(--nv-green); box-shadow: 0 0 0 3px rgba(3,199,90,0.1); }

/* ===== Right Selected Panel ===== */
.sc-selected-panel { display: flex; flex-direction: column; background: #fff; min-height: 0; overflow: hidden; }
.sc-panel-header {
    padding: 8px 14px; border-bottom: 1px solid #e8eaed; background: #fafbfc;
    flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
}
.sc-panel-header h3 {
    font-size: 12px; font-weight: 700; color: #333d4b; margin: 0;
    display: flex; align-items: center; gap: 7px;
}
.sc-panel-header h3 i { color: var(--nv-green); font-size: 12px; }
.sc-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; background: var(--nv-green);
    color: #fff; border-radius: 9px; font-size: 10px; font-weight: 700;
}

/* Comp Table */
.sc-comp-table-wrap {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #c0c6cf #f0f2f5;
}
.sc-comp-table-wrap::-webkit-scrollbar { width: 6px; }
.sc-comp-table-wrap::-webkit-scrollbar-track { background: #f0f2f5; }
.sc-comp-table-wrap::-webkit-scrollbar-thumb { background: #c0c6cf; border-radius: 3px; }
.sc-comp-table-wrap::-webkit-scrollbar-thumb:hover { background: #a0a8b4; }
.sc-comp-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.sc-comp-table thead { position: sticky; top: 0; z-index: 1; background: #f4f6f8; }
.sc-comp-table th {
    padding: 6px 4px; font-weight: 600; font-size: 10px; color: #5a6374;
    border-bottom: 2px solid #e3e7eb; text-align: center; white-space: nowrap;
}
.sc-comp-table td { padding: 5px 4px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; text-align: center; font-size: 11px; }
.sc-comp-table tbody tr:hover { background: #f0faf4; }
.sc-comp-cat-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.sc-comp-cat-badge.cat-snack { background: #fff3e0; color: #e65100; }
.sc-comp-cat-badge.cat-accessory { background: #fce4ec; color: #c62828; }
.sc-comp-cat-badge.cat-packaging { background: #e3f2fd; color: #1565c0; }
.sc-comp-qty-input { width: 42px; padding: 3px 2px; border: 1.5px solid #dde0e4; border-radius: 5px; font-size: 11px; text-align: center; font-weight: 600; }
.sc-comp-qty-input:focus { border-color: var(--nv-green); outline: none; }
.sc-comp-remove-btn { background: none; border: none; cursor: pointer; color: #ccc; font-size: 12px; padding: 2px 5px; border-radius: 4px; }
.sc-comp-remove-btn:hover { background: #fde8e8; color: var(--nv-red); }
.sc-comp-subtotal { font-weight: 700; color: var(--nv-green); }
.sc-comp-name { text-align: left !important; font-weight: 500; color: #333; }
.sc-comp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 16px; color: #b0b5bd; gap: 6px; }
.sc-comp-empty i { font-size: 24px; color: #dde0e4; }
.sc-comp-empty p { font-size: 11px; margin: 0; text-align: center; line-height: 1.5; }

/* ===== Bottom Calc: 4-Step Flow Layout (inside sc-card) ===== */
.sc-calc-header-bar { background: linear-gradient(135deg, #1a73e8, #4a90e8); }
.sc-calc-header-bar small { opacity: 0.75; }
.sc-calc-flow-inner {
    display: grid;
    grid-template-columns: 3fr auto 3fr auto 4fr;
    gap: 0;
    align-items: stretch;
}

/* Flow Arrow */
.sc-flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    color: #b0b8c4;
    font-size: 14px;
    background: #f9fafb;
    border-left: 1px solid #eef0f3;
    border-right: 1px solid #eef0f3;
    flex-shrink: 0;
}

/* Flow Step */
.sc-flow-step {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.sc-flow-step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f0f4f8, #e8ecf2);
    border-bottom: 2px solid #dde2ea;
}
.sc-flow-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--nv-green);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}
.sc-flow-step-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #3a4356;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.sc-flow-step-title i { font-size: 12.5px; color: #5a6c82; }

/* Step 3: 정산 & 수익분석 - 다크 테마 */
.sc-flow-step-result { background: linear-gradient(135deg, #232a36, #2e3647); }
.sc-flow-step-header-result { background: linear-gradient(135deg, #343d50, #4a5570); border-bottom-color: rgba(255,255,255,0.1); }
.sc-flow-step-num-result { background: #64b5f6; }
.sc-flow-step-header-result .sc-flow-step-title { color: #fff; }
.sc-flow-step-header-result .sc-flow-step-title i { color: #64b5f6; }

/* Flow Step Body */
.sc-flow-step-body {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.sc-flow-step-body-result {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Flow Rows */
.sc-flow-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
}
.sc-flow-label {
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    white-space: nowrap;
}
.sc-flow-label i { font-size: 11.5px; }
.sc-flow-label small { font-size: 11px; color: #999; margin-left: 3px; }
.sc-flow-val {
    font-weight: 700;
    color: #333;
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-size: 13px;
}
.sc-flow-val-accent { color: var(--nv-green); }

/* Subtotal row */
.sc-flow-sub {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #dde0e4;
}
.sc-flow-sub .sc-flow-label { font-weight: 700; color: #444; font-size: 12.5px; }
.sc-flow-sub .sc-flow-val { color: #1565c0; font-size: 13.5px; }

/* ====== Right Cost Panel (3rd Column) ====== */
.sc-cost-panel {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-left: 1px solid #e8eaed;
    min-height: 0;
    overflow: hidden;
}
.sc-cost-panel-header {
    padding: 8px 14px;
    border-bottom: 1px solid #e8eaed;
    background: linear-gradient(135deg, #e3f0ff, #eef3fb);
    flex-shrink: 0;
}
.sc-cost-panel-header h3 {
    font-size: 12px;
    font-weight: 700;
    color: #1565c0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}
.sc-cost-panel-header h3 i { font-size: 12px; color: #1976d2; }
.sc-cost-panel-body {
    padding: 14px 14px 16px;
    flex: 1;
    overflow-y: auto;
}
.sc-cost-category {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}
.sc-cost-category:last-of-type { border-bottom: none; }
.sc-cost-cat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sc-cost-cat-icon i { font-size: 13px; }
.sc-cost-cat-info {
    flex: 1;
    min-width: 0;
}
.sc-cost-cat-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}
.sc-cost-cat-count {
    display: block;
    font-size: 10.5px;
    color: #999;
    font-weight: 400;
}
.sc-cost-cat-val {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}
.sc-cost-divider {
    height: 1px;
    background: #e0e5ec;
    margin: 8px 0;
}
.sc-cost-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 0;
}
.sc-cost-subtotal-label {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}
.sc-cost-subtotal-val {
    font-size: 15px;
    font-weight: 800;
    color: #1565c0;
}

/* Separator */
.sc-flow-sep { height: 1px; background: #e8eaed; margin: 8px 0; }

/* Input Row */
.sc-flow-input-row { padding: 4px 0; }
.sc-flow-input-wrap { display: flex; align-items: center; gap: 4px; }
.sc-flow-input {
    width: 78px;
    padding: 6px 8px;
    border: 1.5px solid #d1d6db;
    border-radius: 6px;
    font-size: 13px;
    text-align: right;
    font-weight: 600;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sc-flow-input:focus { outline: none; border-color: var(--nv-green); box-shadow: 0 0 0 3px rgba(3,199,90,0.12); }
.sc-flow-unit { font-size: 12px; color: #777; white-space: nowrap; min-width: 14px; font-weight: 600; }

/* Highlight Cards (총 매입원가) */
.sc-flow-highlight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #e8f5e9, #f0faf4);
    border: 1.5px solid #a5d6a7;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: auto;
}
.sc-flow-highlight span {
    font-size: 12.5px;
    font-weight: 700;
    color: #2e7d32;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sc-flow-highlight span i { font-size: 12px; }
.sc-flow-highlight strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--nv-green);
    font-variant-numeric: tabular-nums;
}

/* ===== Step 3: 정산 & 수익 분석 내부 스타일 ===== */

/* 상단: 센터정산금 */
.sc-result-settlement {
    background: linear-gradient(135deg, rgba(100,181,246,0.12), rgba(66,165,245,0.06));
    border: 1.5px solid rgba(100,181,246,0.35);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sc-result-settlement-label {
    font-size: 13px;
    font-weight: 700;
    color: #90caf9;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sc-result-settlement-label i { font-size: 13px; }
.sc-result-settlement-value {
    font-size: 19px;
    font-weight: 800;
    color: #64b5f6;
    font-variant-numeric: tabular-nums;
}

/* 구분선 */
.sc-result-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    margin: 14px 0;
}

/* 수익 분석 영역 */
.sc-result-profit-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.sc-result-formula {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    font-style: italic;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sc-result-profit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.sc-result-profit-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sc-result-profit-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}
.sc-result-profit-label i { font-size: 12px; }
.sc-result-profit-value {
    font-size: 28px;
    font-weight: 800;
    color: #66bb6a;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

/* Action Bar (inside card) */
.sc-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e3e7eb;
    background: #fafbfc;
}
.sc-action-bar .btn { padding: 10px 24px; font-size: 13px; font-weight: 600; border-radius: 6px; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .sc-calc-flow-inner { grid-template-columns: 1fr; }
    .sc-flow-arrow { display: none !important; }
    .sc-flow-step { border-bottom: 1px solid #eef0f3; }
    .sc-flow-step:last-child { border-bottom: none; }
    .sc-result-profit-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
    .sc-top-layout { grid-template-columns: 1fr; max-height: none; }
    .sc-browse-panel { border-right: none; border-bottom: 1px solid #e8eaed; max-height: 320px; }
    .sc-selected-panel { max-height: 320px; border-right: none; border-bottom: 1px solid #e8eaed; }
    .sc-cost-panel { border-left: none; border-top: 1px solid #e8eaed; max-height: 200px; }
    .sc-calc-flow-inner { grid-template-columns: 1fr; }
    .sc-flow-arrow { display: none !important; }
    .sc-flow-step { border-bottom: 1px solid #eef0f3; }
    .sc-flow-step:last-child { border-bottom: none; }
    .sc-cascade-options { flex-wrap: wrap; }
    .sc-mode-toggle { margin-left: 0; margin-top: 4px; }
    .sc-result-profit-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================================
   SmartStore-style Cascading Category Picker v3 (CSP)
   항상 열린 인라인 패널, 탭 기반 (검색 + 선택)
   ============================================================= */
.csp-wrap {
    width: 100%;
    border: 1px solid #d5d8dc;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

/* ---- Tab bar ---- */
.csp-tabs {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #e5e8eb;
    background: #f8f9fa;
}
.csp-tab {
    position: relative;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    background: #fff;
    border: 1px solid #d5d8dc;
    border-bottom: none;
    border-left: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.csp-tab:first-child { border-left: none; }
.csp-tab:hover { background: #f0f0f0; }
.csp-tab-active {
    background: var(--nv-green) !important;
    color: #fff !important;
    border-color: var(--nv-green) !important;
    font-weight: 600;
}
.csp-tab-arrow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--nv-green);
    z-index: 1;
}

/* ---- Select tab: columns ---- */
.csp-cols-area {
    overflow-x: auto;
}
.csp-cols {
    display: flex;
    min-height: 200px;
    max-height: 260px;
}
.csp-col {
    min-width: 190px;
    flex: 1;
    border-right: 1px solid #eceef1;
    display: flex;
    flex-direction: column;
}
.csp-col:last-child { border-right: none; }
.csp-col-head {
    font-size: 11.5px;
    font-weight: 700;
    color: #888;
    padding: 10px 14px 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #eceef1;
    flex-shrink: 0;
    letter-spacing: 0.2px;
}
.csp-col-body {
    flex: 1;
    overflow-y: auto;
}
.csp-col-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13.5px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.08s, color 0.08s;
}
.csp-col-item:last-child { border-bottom: none; }
.csp-col-item:hover { background: #f0f4ff; }
.csp-col-item.active {
    background: #e8f5e9;
    color: var(--nv-green);
    font-weight: 700;
}
.csp-col-arrow {
    font-size: 10px;
    color: #ccc;
    flex-shrink: 0;
}
.csp-col-item.active .csp-col-arrow { color: var(--nv-green); }

/* ---- Search tab ---- */
.csp-search-area {
    min-height: 200px;
    max-height: 260px;
    display: flex;
    flex-direction: column;
}
.csp-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #eceef1;
    background: #fafbfc;
}
.csp-search-icon-bar {
    color: #adb5bd;
    font-size: 14px;
    flex-shrink: 0;
}
.csp-search-input {
    flex: 1;
    border: 1px solid #d5d8dc;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.csp-search-input:focus { border-color: var(--nv-green); box-shadow: 0 0 0 2px rgba(3,199,90,0.1); }
.csp-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}
.csp-search-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    color: #adb5bd;
    font-size: 13px;
}
.csp-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.08s;
}
.csp-search-item:hover { background: #f0f4ff; }
.csp-search-item.selected {
    background: #e8f5e9;
    color: var(--nv-green);
    font-weight: 600;
}
.csp-search-icon { font-size: 16px; flex-shrink: 0; }
.csp-search-path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csp-search-count {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ---- Selected path bar ---- */
.csp-pathbar {
    padding: 10px 14px;
    background: #f0faf0;
    border-top: 1px solid #e0efe0;
    font-size: 12.5px;
}
.csp-pathbar-label {
    color: var(--nv-green);
    font-weight: 700;
    margin-right: 6px;
}
.csp-pathbar-val {
    color: #333;
    font-weight: 600;
}

/* ---- Scrollbar ---- */
.csp-col-body::-webkit-scrollbar,
.csp-search-results::-webkit-scrollbar { width: 5px; }
.csp-col-body::-webkit-scrollbar-track,
.csp-search-results::-webkit-scrollbar-track { background: transparent; }
.csp-col-body::-webkit-scrollbar-thumb,
.csp-search-results::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.csp-col-body::-webkit-scrollbar-thumb:hover,
.csp-search-results::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ============================================================
   SmartStore-style Sale Category Picker (SPC)
   ============================================================ */
.spc-wrap {
    border: 1px solid #e5e8eb;
    border-radius: 8px;
    overflow: hidden;
}
.spc-select-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    padding: 14px;
    max-height: 320px;
    overflow-y: auto;
    background: #fafbfc;
}
.spc-cat-item {
    background: #fff;
    border: 2px solid #e5e8eb;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.spc-cat-item:hover {
    border-color: var(--nv-green);
    background: #f0faf0;
    box-shadow: 0 2px 8px rgba(3, 199, 90, 0.1);
}
.spc-cat-item.active {
    border-color: var(--nv-green);
    background: #e8f5e9;
    box-shadow: 0 2px 8px rgba(3, 199, 90, 0.15);
}
.spc-cat-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.spc-cat-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}
.spc-cat-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    flex: 1;
}
.spc-cat-count {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 1px 7px;
    border-radius: 10px;
}
.spc-cat-item.active .spc-cat-count {
    background: var(--nv-green);
    color: #fff;
}
.spc-cat-desc {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    padding-left: 32px;
}
.spc-search-results {
    max-height: 280px;
}
/* SPC scrollbar */
.spc-select-area::-webkit-scrollbar { width: 5px; }
.spc-select-area::-webkit-scrollbar-track { background: transparent; }
.spc-select-area::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.spc-select-area::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ============================================================
   Emoji Icon Picker - Enhanced v2
   ============================================================ */
.icon-picker-wrap {
    position: relative;
    display: inline-block;
}
.icon-picker-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1.5px solid #e0e3e8;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: all 0.15s;
    min-width: 180px;
}
.icon-picker-display:hover {
    border-color: var(--nv-green);
    background: #f8fdf8;
}
.icon-picker-preview {
    font-size: 28px;
    line-height: 1;
    min-width: 34px;
    text-align: center;
}
.icon-picker-label {
    font-size: 12px;
    color: #888;
    flex: 1;
}
.icon-picker-arrow {
    font-size: 10px;
    color: #aaa;
    transition: transform 0.2s;
}
.icon-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    background: #fff;
    border: 1.5px solid #e0e3e8;
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
    width: 440px;
    animation: iconPickerSlide 0.18s ease-out;
    overflow: hidden;
}
@keyframes iconPickerSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Search bar */
.ip-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #eef0f3;
    background: #fafbfc;
    position: relative;
}
.ip-search-icon {
    color: #bbb;
    font-size: 13px;
    position: absolute;
    left: 22px;
    pointer-events: none;
}
.ip-search-input {
    flex: 1;
    border: 1.5px solid #e0e3e8;
    border-radius: 8px;
    padding: 7px 12px 7px 32px;
    font-size: 12px;
    outline: none;
    background: #fff;
    transition: border-color 0.15s;
}
.ip-search-input:focus {
    border-color: var(--nv-green);
    box-shadow: 0 0 0 3px rgba(3,199,90,0.08);
}
.ip-search-input::placeholder {
    color: #bbb;
}
.ip-search-clear {
    position: absolute;
    right: 18px;
    border: none;
    background: none;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.1s;
}
.ip-search-clear:hover {
    background: #f0f0f0;
    color: #666;
}
.ip-search-result-label {
    padding: 8px 12px 4px;
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ip-no-result {
    padding: 30px 20px;
    text-align: center;
    color: #aaa;
}
.ip-no-result p {
    margin: 8px 0 4px;
    font-size: 13px;
    color: #888;
}
.ip-no-result small {
    font-size: 11px;
    color: #bbb;
}

/* Tabs */
.icon-picker-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px 6px;
    border-bottom: 1px solid #eef0f3;
}
.icon-tab {
    border: none;
    background: #f0f2f5;
    color: #555;
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
}
.icon-tab:hover {
    background: #e0e3e8;
}
.icon-tab.active {
    background: var(--nv-green);
    color: #fff;
    font-weight: 600;
}

/* Grid */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    padding: 10px;
    max-height: 240px;
    overflow-y: auto;
}
.icon-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.1s;
    padding: 0;
}
.icon-cell:hover {
    background: #f0f7ff;
    border-color: #a0c4ff;
    transform: scale(1.2);
}
.icon-cell.selected {
    background: #e8f5e9;
    border-color: var(--nv-green);
    box-shadow: 0 0 0 2px rgba(3, 199, 90, 0.25);
    transform: scale(1.1);
}
.icon-picker-grid::-webkit-scrollbar { width: 5px; }
.icon-picker-grid::-webkit-scrollbar-track { background: transparent; }
.icon-picker-grid::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.icon-picker-grid::-webkit-scrollbar-thumb:hover { background: #bbb; }
