@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
    --blue-900: #0c2961;
    --blue-800: #0e3a82;
    --blue-700: #1551b4;
    --sky-200: #d9ecff;
    --sky-100: #e9f5ff;
    --sky-50: #f5fbff;
    --text-900: #0c1b2e;
    --text-700: #2c4059;
    --text-500: #5d6f86;
    --border: #d9e4f0;
    --shadow: 0 10px 35px rgba(15, 67, 138, 0.08);
    --radius: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: radial-gradient(circle at 15% 20%, rgba(65, 137, 255, 0.08), transparent 35%),
                radial-gradient(circle at 85% 10%, rgba(13, 74, 173, 0.12), transparent 40%),
                var(--sky-50);
    color: var(--text-900);
    font-family: 'Manrope', 'Noto Sans KR', 'Segoe UI', -apple-system, sans-serif;
}

a { color: inherit; text-decoration: none; }

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, var(--blue-800), var(--blue-900));
    color: #eef3fb;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--sky-200), #ffffff);
    display: grid;
    place-items: center;
    color: var(--blue-900);
    font-weight: 800;
    font-size: 20px;
    box-shadow: var(--shadow);
}

.brand-name {
    font-weight: 700;
    font-size: 18px;
}

.brand-tagline {
    font-size: 12px;
    opacity: 0.7;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-group {
    display: flex;
    flex-direction: column;
}

.sub-nav {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 2px 4px 6px 28px;
    padding: 5px 5px 5px 10px;
    border-left: 2px solid rgba(180, 211, 255, 0.42);
    border-radius: 0 9px 9px 0;
    background: rgba(5, 33, 84, 0.2);
}

.nav-group:hover .sub-nav,
.nav-group:focus-within .sub-nav {
    display: flex;
}

.nav-group > .nav-item::after {
    margin-left: auto;
    color: currentColor;
    content: "›";
    font-size: 18px;
    line-height: 1;
    opacity: 0.68;
    transform: rotate(90deg);
    transition: transform 0.18s ease;
}

.nav-group:hover > .nav-item::after,
.nav-group:focus-within > .nav-item::after {
    transform: rotate(-90deg);
}

.sub-item {
    position: relative;
    padding: 8px 10px 8px 17px;
    border-radius: 8px;
    color: #dceaff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    transition: color 0.18s ease, background 0.18s ease;
}

.sub-item::before {
    position: absolute;
    top: 50%;
    left: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(190, 216, 255, 0.7);
    content: "";
    transform: translateY(-50%);
}

.sub-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sub-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: inset 3px 0 0 #b9d8ff;
}

.sub-item.active::before {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(185, 216, 255, 0.18);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #d8e7ff;
}

.nav-icon {
    display: inline-flex;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    color: var(--nav-icon-color, currentColor);
    background: var(--nav-icon-bg, transparent);
    border-radius: 9px;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.nav-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-icon-dashboard { --nav-icon-color: #56d7ff; --nav-icon-bg: rgba(86, 215, 255, 0.13); }
.nav-icon-orders { --nav-icon-color: #ffd166; --nav-icon-bg: rgba(255, 209, 102, 0.14); }
.nav-icon-products { --nav-icon-color: #b9a2ff; --nav-icon-bg: rgba(185, 162, 255, 0.14); }
.nav-icon-inbound { --nav-icon-color: #ff937d; --nav-icon-bg: rgba(255, 147, 125, 0.14); }
.nav-icon-inventory { --nav-icon-color: #55dfa2; --nav-icon-bg: rgba(85, 223, 162, 0.14); }
.nav-icon-claims { --nav-icon-color: #ff86ad; --nav-icon-bg: rgba(255, 134, 173, 0.14); }
.nav-icon-analytics { --nav-icon-color: #64e2d4; --nav-icon-bg: rgba(100, 226, 212, 0.14); }
.nav-icon-barcodes { --nav-icon-color: #f8dc6b; --nav-icon-bg: rgba(248, 220, 107, 0.14); }
.nav-icon-settings { --nav-icon-color: #c7a6ff; --nav-icon-bg: rgba(199, 166, 255, 0.14); }

.nav-item:hover .nav-icon {
    transform: translateY(-1px);
}

.nav-item.active .nav-icon {
    background: var(--nav-icon-bg, #eef5ff);
    box-shadow: 0 3px 9px rgba(17, 55, 112, 0.12);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: #ffffff;
    color: var(--blue-800);
    box-shadow: var(--shadow);
}

.main-panel {
    display: grid;
    grid-template-rows: 72px 1fr;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.82);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.favorite {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.favorite-toggle[aria-expanded="true"] {
    border-color: var(--blue-700);
    background: var(--sky-100);
}

.favorite-links {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.favorite-link {
    display: inline-flex;
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid var(--sky-200);
    border-radius: 999px;
    align-items: center;
    background: #fff;
    color: var(--blue-800);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.favorite-link:hover,
.favorite-link.active {
    border-color: var(--blue-700);
    background: var(--sky-100);
}

.favorite-panel {
    position: absolute;
    z-index: 50;
    top: calc(100% + 12px);
    left: 0;
    width: 290px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(12, 41, 97, 0.2);
}

.favorite-panel-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}

.favorite-panel-head strong {
    color: var(--text-900);
    font-size: 14px;
}

.favorite-panel-head span {
    color: var(--text-500);
    font-size: 11px;
}

.favorite-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.favorite-option {
    display: flex;
    min-width: 0;
    padding: 7px 8px;
    border-radius: 8px;
    align-items: center;
    gap: 6px;
    color: var(--text-700);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.favorite-option:hover {
    background: var(--sky-50);
}

.favorite-option input {
    flex: 0 0 auto;
}

.favorite-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hint {
    color: var(--text-500);
    font-size: 13px;
}

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

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 14px;
    background: var(--sky-100);
    border: 1px solid var(--sky-200);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-700), var(--blue-900));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.user-name {
    font-weight: 700;
}

.user-role {
    font-size: 12px;
    color: var(--text-500);
}

.content {
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.page-header-inline {
    align-items: flex-start;
}

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

.eyebrow {
    color: var(--blue-700);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0;
    font-size: 12px;
}

h1 {
    margin: 4px 0 6px;
    font-size: 28px;
}

.subtitle {
    margin: 0;
    color: var(--text-500);
}

.actions {
    display: flex;
    gap: 10px;
}

.pill {
    border: none;
    outline: none;
    background: var(--sky-100);
    color: var(--blue-800);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid var(--sky-200);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.pill.primary {
    background: linear-gradient(135deg, var(--blue-700), var(--blue-900));
    color: #fff;
    border: none;
}

.pill.outline {
    background: transparent;
}

.pill.danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff7f7;
}

.pill:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pill.ghost {
    background: rgba(255, 255, 255, 0.5);
}

.pill.full {
    width: 100%;
    justify-content: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.metric-label {
    color: var(--text-500);
    font-size: 13px;
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--blue-900);
}

.metric-value.accent {
    color: var(--blue-700);
}

.metric-foot {
    color: var(--text-500);
    font-size: 12px;
}

.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.board-card .card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.board-card h3 {
    margin: 2px 0 0;
}

.link {
    color: var(--blue-700);
    font-weight: 700;
    font-size: 14px;
}

.list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--sky-50);
}

.list-title {
    font-weight: 700;
}

.list-sub {
    color: var(--text-500);
    font-size: 12px;
}

.list-date {
    color: var(--text-500);
    font-size: 13px;
}

.chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--sky-200);
    color: var(--blue-900);
    font-weight: 700;
    font-size: 12px;
    text-align: center;
}

.flash {
    margin-bottom: 14px;
}

.flash-message {
    padding: 12px 14px;
    background: #fff9e6;
    border: 1px solid #ffe3a4;
    border-radius: 12px;
    color: #9a6b00;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 20% 30%, rgba(65, 137, 255, 0.1), transparent 45%),
                radial-gradient(circle at 80% 20%, rgba(21, 81, 180, 0.12), transparent 50%),
                linear-gradient(145deg, #f7fbff, #e7f1ff);
}

.login-panel {
    width: min(420px, 90vw);
    padding: 28px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(12, 41, 97, 0.15);
    border: 1px solid var(--border);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-title {
    margin: 18px 0 6px;
    font-size: 26px;
}

.login-subtitle {
    margin: 0 0 14px;
    color: var(--text-500);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: var(--text-700);
}

.login-form input {
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--sky-50);
    font-size: 15px;
}

.login-form input:focus {
    outline: 2px solid var(--sky-200);
    border-color: var(--blue-700);
}

.login-hint {
    margin-top: 8px;
    color: var(--text-500);
    font-size: 13px;
}

/* Table + modal for base registration */
.table-card {
    margin-top: 6px;
}

.table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.table-title {
    font-weight: 800;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--sky-100);
    border: 1px solid var(--border);
    color: var(--text-700);
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}

.inventory-view-count-form {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inventory-create-modal-panel {
    width: min(1280px, calc(100vw - 48px));
}

.inventory-create-form-grid {
    grid-template-columns: minmax(220px, 1.15fr) minmax(220px, 1.15fr) minmax(160px, 0.9fr) minmax(160px, 0.9fr);
}

#inventoryCreateModal .inventory-create-span-2 {
    grid-column: span 2;
}

#inventoryCreateModal .inventory-edit-span-2,
#inventoryCreateModal .retail-photo-field {
    grid-column: span 4;
}

#inventoryCreateModal .paste-image-box {
    min-height: 92px;
    max-height: 140px;
}

#inventoryCreateModal .paste-image-box img {
    max-height: 88px;
}

.inventory-view-count-form select {
    min-width: 120px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-700);
    font: inherit;
}

.inventory-thumb-size-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-700);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.inventory-thumb-size-toggle input {
    width: 16px;
    height: 16px;
}

.account-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: -2px 0 10px;
}

.account-filter-chip {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-700);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.account-filter-chip:hover,
.account-filter-chip.active {
    border-color: var(--blue-700);
    background: var(--sky-100);
    color: var(--blue-800);
}

.account-filter-chip.domeggook {
    border-color: #b8df9d;
    background: #eef9e8;
    color: #32621f;
}

.account-filter-chip.domeggook:hover,
.account-filter-chip.domeggook.active {
    border-color: #7fbd55;
    background: #dff3d2;
    color: #245116;
}

.full-period-toggle {
    display: inline-flex;
    flex-direction: row !important;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-700);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.full-period-toggle input {
    margin: 0;
}

.table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.orders-table-wrap {
    overflow-x: auto;
}
.orders-table {
    overflow: visible;
}
.orders-table.hide-optional-columns .can-hide {
    display: none;
}
.orders-table .table-row {
    /* 기본: 숨김 상태(차수는 표시, 나머지 선택 열 숨김) 기준 19열 */
    grid-template-columns: 0.3fr 1fr 0.9fr 0.6fr 0.5fr 0.8fr 1.15fr 1fr 0.8fr 0.8fr 2.5fr 1fr 0.5fr 1fr 1.15fr 1.1fr 1.1fr 0.8fr 0.65fr;
    align-items: center;
    font-size: 13px;
    padding: 10px;
}
.orders-table .table-row.shipped {
    background: #e7f4ff;
}
.orders-table .table-row.claim-row {
    background: #fff1e1;
    border-color: #f2c897;
}
.orders-table .table-row.claim-row.shipped {
    background: #ffe8d2;
    border-color: #eab67e;
}
.orders-table .table-row.kakao-exported {
    background: #f5efe3;
}
.orders-table .table-row.head {
    font-weight: 700;
    font-size: 13px;
}
.orders-table .sortable {
    cursor: pointer;
    user-select: none;
}
.orders-table .sortable::after {
    content: ' ↕';
    font-size: 11px;
    color: var(--text-500);
}

.order-match-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
}

.order-match-location {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--text-700);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-stock-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    color: var(--text-600);
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
}

.order-stock-cell strong {
    color: var(--text-900);
    font-size: 13px;
    font-weight: 800;
}

.order-stock-link {
    color: var(--text-900);
    font-size: 13px;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: rgba(16, 73, 148, 0.35);
    text-underline-offset: 2px;
    cursor: pointer;
}

.order-stock-link:hover,
.order-stock-link:focus-visible {
    color: var(--primary);
    text-decoration-color: currentColor;
}

.order-stock-cell strong.negative-stock,
.order-stock-link.negative-stock {
    color: #dc2626;
}

.order-fulfillment-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-top: 2px;
    padding: 3px 6px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
}

.order-fulfillment-badge.retail {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.order-fulfillment-badge.review {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.order-fulfillment-badge.shortage {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.order-stock-empty {
    align-self: center;
    color: var(--text-400);
}

.order-mall-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 52px;
    min-width: 0;
    text-align: center;
}

.order-mall-logo {
    display: block;
    width: auto;
    max-width: 80px;
    height: 23px;
    object-fit: contain;
    border-radius: 3px;
}

.order-mall-name {
    font-size: 13px;
    font-weight: 800;
}

.order-mall-account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    max-width: 88px;
    min-height: 20px;
    padding: 2px 7px;
    overflow: hidden;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #f8fbff;
    color: var(--blue-900);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.orders-table .table-row.head > :nth-child(2) {
    justify-self: center;
    text-align: center;
}

.order-mall-sort-name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.order-product-name-cell {
    position: relative;
    min-width: 0;
}

.order-product-name-copy {
    display: block;
    width: 100%;
    max-height: none;
    padding: 3px 5px;
    overflow: visible;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    text-overflow: clip;
    overflow-wrap: anywhere;
    white-space: normal;
    cursor: copy;
    -webkit-box-orient: initial;
    -webkit-line-clamp: unset;
}

.order-product-name-copy:hover,
.order-product-name-copy:focus-visible {
    background: #eff6ff;
    color: var(--blue-900);
    outline: 1px solid #bfdbfe;
}

.order-product-copy-feedback {
    position: absolute;
    right: 4px;
    bottom: -18px;
    z-index: 2;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--blue-900);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity .15s ease, transform .15s ease;
}

.order-product-name-cell.copied .order-product-copy-feedback {
    opacity: 1;
    transform: translateY(0);
}

.order-no-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.25;
}

.order-no-cell span + span {
    color: var(--text-500);
    font-size: 12px;
}

.dashboard-summary-grid {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.dashboard-metric {
    position: relative;
    min-width: 0;
    border-top: 3px solid #8bb8f0;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 34px rgba(12, 41, 97, 0.13);
}

.dashboard-metric.warning { border-top-color: #efb84b; }
.dashboard-metric.danger { border-top-color: #ea7a72; }
.dashboard-metric.soldout { border-top-color: #9c83dc; }
.dashboard-metric.info { border-top-color: #62baa0; }

.metric-top {
    display: flex;
    min-height: 24px;
    margin-bottom: 7px;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    color: var(--text-500);
    font-size: 10px;
    font-weight: 700;
}

.metric-icon {
    display: inline-flex;
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--sky-100);
    color: var(--blue-800);
}

.dashboard-board-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
    gap: 16px;
}

.dashboard-wide-card {
    grid-column: 1 / -1;
}

.dashboard-live-badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: #e8f8ef;
    color: #168052;
    font-size: 11px;
    font-weight: 800;
}

.dashboard-action-list,
.dashboard-mall-list,
.dashboard-order-list,
.dashboard-availability-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-action-list > a {
    display: flex;
    min-height: 52px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--sky-50);
}

.dashboard-action-list > a:hover,
.dashboard-order-list > a:hover,
.dashboard-availability-list > a:hover {
    border-color: var(--sky-300);
    background: var(--sky-100);
}

.dashboard-action-list span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.dashboard-action-list small,
.dashboard-order-list small,
.dashboard-availability-list small {
    color: var(--text-500);
    font-size: 11px;
}

.dashboard-action-list b {
    color: var(--blue-800);
    white-space: nowrap;
}

.dashboard-mall-list > a {
    display: grid;
    grid-template-columns: 125px 1fr 190px;
    min-height: 34px;
    align-items: center;
    gap: 10px;
}

.dashboard-mall-filter {
    display: flex;
    margin: -3px 0 12px;
    align-items: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.dashboard-mall-filter label {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-mall-filter label > span {
    color: var(--text-500);
    font-size: 10px;
    font-weight: 800;
}

.dashboard-mall-filter > span {
    padding-bottom: 9px;
    color: var(--text-500);
    font-weight: 800;
}

.dashboard-mall-filter input,
.dashboard-mall-filter select {
    width: 132px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--sky-50);
    color: var(--text-900);
    font: inherit;
    font-size: 12px;
}

.dashboard-mall-filter .pill {
    min-height: 34px;
    padding: 0 11px;
    font-size: 11px;
}

.dashboard-mall-name,
.dashboard-order-mall {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

.dashboard-mall-logo {
    width: auto;
    max-width: 82px;
    height: 20px;
    object-fit: contain;
}

.dashboard-mall-text {
    color: var(--text-700);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-mall-bar {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--sky-100);
}

.dashboard-mall-bar i {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue-700), #73a9e8);
}

.dashboard-mall-list strong {
    color: var(--blue-900);
    font-size: 12px;
    text-align: right;
}

.dashboard-mall-result {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: flex-end;
    gap: 9px;
    white-space: nowrap;
}

.dashboard-mall-result small {
    color: var(--text-500);
    font-size: 13px;
    font-weight: 800;
    white-space: normal;
    text-align: right;
    line-height: 1.4;
}

.dashboard-mall-result strong {
    font-size: 15px;
    font-weight: 900;
}

.dashboard-mall-total {
    display: flex;
    min-height: 42px;
    margin-top: 9px;
    padding: 8px 4px 0;
    border-top: 1px solid var(--border);
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.dashboard-mall-total-title {
    margin-right: auto;
    color: var(--text-500);
    font-size: 14px;
    font-weight: 900;
}

.dashboard-mall-total > span:not(.dashboard-mall-total-title) {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.dashboard-mall-total small {
    color: var(--text-500);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-mall-total strong,
.dashboard-mall-total b {
    color: var(--blue-900);
    font-size: 15px;
    font-weight: 900;
}

.dashboard-order-list > a {
    display: grid;
    grid-template-columns: 145px minmax(260px, 1fr) 65px 90px 82px;
    min-height: 54px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    align-items: center;
    gap: 10px;
}

.dashboard-order-mall {
    flex-wrap: wrap;
}

.dashboard-order-mall small {
    display: block;
    width: 100%;
}

.dashboard-order-product {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.dashboard-order-product strong,
.dashboard-order-product small,
.dashboard-availability-product {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-order-qty,
.dashboard-order-receiver {
    font-size: 12px;
    text-align: center;
}

.dashboard-order-status,
.dashboard-availability-status {
    display: inline-flex;
    padding: 5px 7px;
    border-radius: 999px;
    justify-content: center;
    background: #fff4d9;
    color: #9a6813;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-order-status.done {
    background: #e8f8ef;
    color: #168052;
}

.dashboard-availability-list > a {
    display: grid;
    grid-template-columns: 105px minmax(220px, 0.8fr) minmax(260px, 1.2fr) 60px;
    min-height: 54px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    align-items: center;
    gap: 10px;
}

.dashboard-availability-list > a > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.dashboard-availability-status.soldout_completed {
    background: #f0eaff;
    color: #6745ad;
}

.dashboard-availability-status.restock_ready,
.dashboard-availability-status.resume_pending {
    background: #e8f8ef;
    color: #168052;
}

.dashboard-availability-list b {
    color: var(--blue-900);
    text-align: right;
    white-space: nowrap;
}

.dashboard-empty {
    display: grid;
    min-height: 100px;
    place-items: center;
    color: var(--text-500);
    font-size: 13px;
}

@media (max-width: 1250px) {
    .dashboard-summary-grid {
        grid-template-columns: repeat(3, minmax(170px, 1fr));
    }
}

@media (max-width: 880px) {
    .dashboard-summary-grid,
    .dashboard-board-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-wide-card {
        grid-column: auto;
    }
    .dashboard-order-list > a {
        grid-template-columns: 115px minmax(180px, 1fr) 55px;
    }
    .dashboard-order-receiver {
        display: none;
    }
    .dashboard-availability-list > a {
        grid-template-columns: 95px 1fr 50px;
    }
    .dashboard-availability-product {
        display: none;
    }
}

/* Data analytics */
.analytics-header {
    align-items: flex-end;
}

.analytics-filter {
    display: flex;
    margin-bottom: 16px;
    padding: 14px 16px;
    align-items: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.analytics-filter label {
    display: flex;
    min-width: 145px;
    flex-direction: column;
    gap: 5px;
}

.analytics-filter label > span {
    color: var(--text-500);
    font-size: 11px;
    font-weight: 800;
}

.analytics-filter input,
.analytics-filter select {
    height: 40px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--sky-50);
    color: var(--text-900);
    font: inherit;
}

.analytics-filter-separator {
    padding-bottom: 10px;
    color: var(--text-500);
    font-weight: 800;
}

.analytics-mall-filter {
    min-width: 170px !important;
}

.analytics-best-filter .analytics-search {
    min-width: 230px;
    flex: 1;
}

.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.analytics-kpi {
    display: flex;
    min-height: 128px;
    flex-direction: column;
    justify-content: space-between;
    border-top: 3px solid #90b8e8;
}

.analytics-kpi.primary { border-top-color: var(--blue-700); }
.analytics-kpi.settlement { border-top-color: #49af85; }
.analytics-kpi > span { color: var(--text-500); font-size: 12px; font-weight: 700; }
.analytics-kpi > strong { color: var(--blue-900); font-size: clamp(19px, 1.55vw, 27px); }
.analytics-kpi > div { display: flex; align-items: center; gap: 6px; }
.analytics-kpi small { color: var(--text-500); font-size: 10px; }

.analytics-change {
    display: inline-flex;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.analytics-change.up { color: #14784c; background: #e8f8ef; }
.analytics-change.down { color: #c44949; background: #fff0f0; }
.analytics-change.neutral { color: #60758b; background: var(--sky-100); }

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(330px, 0.75fr) minmax(600px, 1.65fr);
    gap: 16px;
    margin-bottom: 16px;
}

.analytics-mall-card { order: 1; }
.analytics-chart-card { order: 2; }

.analytics-mall-card .analytics-card-note strong {
    display: inline-block;
    margin-top: 3px;
    color: var(--blue-900);
    font-size: 11px;
    white-space: nowrap;
}

.analytics-chart-card,
.analytics-mall-card,
.analytics-ranking-card,
.analytics-products-card {
    min-width: 0;
}

.analytics-chart-card {
    position: relative;
}

.analytics-chart-card.is-loading {
    opacity: 0.55;
    pointer-events: none;
    cursor: progress;
}

.analytics-chart-card .card-head,
.analytics-mall-card .card-head,
.analytics-ranking-card .card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.analytics-chart-card h3,
.analytics-mall-card h3,
.analytics-ranking-card h3 { margin: 2px 0 0; }
.analytics-card-note { color: var(--text-500); font-size: 11px; text-align: right; }

.analytics-trend-tools {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-direction: column;
}

.analytics-trend-filter {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    gap: 2px;
    background: var(--sky-100);
}

.analytics-trend-filter a {
    display: inline-flex;
    min-width: 43px;
    height: 29px;
    padding: 0 9px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    color: var(--text-500);
    font-size: 11px;
    font-weight: 800;
}

.analytics-trend-filter a:hover {
    color: var(--blue-800);
    background: rgba(255, 255, 255, 0.75);
}

.analytics-trend-filter a.active {
    color: #fff;
    background: var(--blue-800);
    box-shadow: 0 3px 8px rgba(11, 78, 162, 0.2);
}

.analytics-bars {
    display: grid;
    grid-template-columns: repeat(var(--bar-count), minmax(28px, 1fr));
    min-width: calc(var(--bar-count) * 30px);
    height: 245px;
    gap: 5px;
    align-items: end;
    overflow: visible;
}

.analytics-bars-yearly {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    min-width: 520px;
    gap: 18px;
}

.analytics-bars-monthly,
.analytics-bars-weekly {
    grid-template-columns: repeat(12, minmax(52px, 1fr));
    min-width: 720px;
    gap: 9px;
}

.analytics-bars-daily {
    grid-template-columns: repeat(30, minmax(29px, 1fr));
    min-width: 900px;
}

.analytics-chart-card {
    overflow-x: auto;
}

.analytics-bar-item {
    display: grid;
    height: 205px;
    grid-template-rows: 20px 1fr 18px;
    gap: 3px;
    align-items: end;
    text-align: center;
}

.analytics-bar-value {
    overflow: hidden;
    color: var(--blue-900);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-bar-track {
    display: flex;
    width: 100%;
    height: 160px;
    align-items: flex-end;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(to top, var(--sky-50), transparent);
}

.analytics-bar-track i {
    display: block;
    width: 100%;
    min-height: 3px;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, #74a8e8, var(--blue-800));
    transition: filter 0.15s ease, transform 0.15s ease;
}

.analytics-bar-item:hover .analytics-bar-track i { filter: saturate(1.4); transform: scaleX(1.06); }
.analytics-bar-label { color: var(--text-500); font-size: 10px; font-weight: 700; white-space: nowrap; }

.analytics-mall-list {
    display: flex;
    max-height: 255px;
    flex-direction: column;
    gap: 7px;
    overflow-y: auto;
}

.analytics-mall-list > a {
    display: grid;
    grid-template-columns: 105px minmax(70px, 1fr) 105px;
    min-height: 38px;
    align-items: center;
    gap: 9px;
}

.analytics-mall-logo { display: flex; align-items: center; }
.analytics-logo { width: auto; max-width: 92px; height: 22px; object-fit: contain; }
.analytics-logo-text { font-size: 12px; font-weight: 800; }
.analytics-mall-progress { height: 7px; overflow: hidden; border-radius: 999px; background: var(--sky-100); }
.analytics-mall-progress i { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: #4f8bd5; }
.analytics-mall-list > a > span:last-child { display: flex; flex-direction: column; text-align: right; }
.analytics-mall-list strong { color: var(--blue-900); font-size: 11px; }
.analytics-mall-list small { color: var(--text-500); font-size: 9px; }

.analytics-ranking-card {
    position: relative;
    margin-bottom: 20px;
    transition: opacity 0.16s ease;
}

.analytics-ranking-card.is-loading {
    opacity: 0.5;
    pointer-events: none;
    cursor: progress;
}

.analytics-ranking-card.is-loading::after {
    position: absolute;
    z-index: 5;
    top: 18px;
    right: 18px;
    padding: 6px 10px;
    border-radius: 999px;
    content: "불러오는 중...";
    background: var(--blue-800);
    box-shadow: var(--shadow);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}
.analytics-ranking-head {
    align-items: center !important;
}

.analytics-month-filter {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex: 1;
}

.analytics-month-filter > strong {
    color: var(--blue-900);
    font-size: 12px;
    white-space: nowrap;
}

.analytics-month-filter > span {
    display: flex;
    min-width: 0;
    padding: 3px;
    border-radius: 999px;
    gap: 2px;
    overflow-x: auto;
    background: var(--sky-100);
}

.analytics-month-filter a {
    display: inline-flex;
    min-width: 37px;
    height: 27px;
    padding: 0 7px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    color: var(--text-500);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.analytics-month-filter a:hover {
    color: var(--blue-800);
    background: rgba(255, 255, 255, 0.7);
}

.analytics-month-filter a.active {
    color: #fff;
    background: var(--blue-800);
    box-shadow: 0 3px 8px rgba(11, 78, 162, 0.2);
}

.analytics-top-mall-filter {
    display: flex;
    min-width: 190px;
    height: 36px;
    padding: 3px 5px 3px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    align-items: center;
    gap: 6px;
    background: #fff;
}

.analytics-top-mall-filter select {
    min-width: 0;
    height: 28px;
    padding: 0 24px 0 5px;
    border: 0;
    outline: 0;
    flex: 1;
    background: transparent;
    color: var(--text-800);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
}

.analytics-top-filter-logo {
    width: auto;
    max-width: 66px;
    height: 18px;
    object-fit: contain;
}

.analytics-top-filter-logo-text {
    color: var(--blue-800);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.analytics-top-products { display: grid; grid-template-columns: repeat(5, minmax(175px, 1fr)); gap: 12px; }
.analytics-top-products > a {
    display: flex;
    position: relative;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    gap: 8px;
    flex-direction: column;
    background: var(--sky-50);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.analytics-top-products > a:hover {
    border-color: var(--sky-300);
    background: #fff;
    box-shadow: 0 10px 24px rgba(12, 41, 97, 0.11);
    transform: translateY(-2px);
}
.analytics-top-products > a > b {
    display: flex;
    position: absolute;
    z-index: 2;
    top: 15px;
    left: 15px;
    width: 72px;
    height: 82px;
    padding: 10px 8px 7px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 13px;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-direction: column;
    background: linear-gradient(145deg, #ff315c 0%, #ed1645 48%, #cf0835 100%);
    box-shadow: 0 7px 16px rgba(203, 4, 48, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    color: #fff;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
}
.analytics-top-products > a > b > span {
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}
.analytics-top-products > a > b > strong {
    color: #fff;
    font-size: 38px;
    font-weight: 900;
    line-height: .95;
    text-shadow: 0 2px 2px rgba(116, 0, 28, 0.25);
}
.analytics-top-products img,
.analytics-top-products .analytics-image-empty {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / .82;
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}
.analytics-top-products > a > span:last-child {
    display: flex;
    padding-top: 2px;
    flex-direction: column;
}
.analytics-product-name { min-width: 0; }
.analytics-product-name strong {
    display: -webkit-box;
    min-height: 42px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.5;
}
.analytics-product-name small {
    display: -webkit-box;
    width: 100%;
    min-height: 34px;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-all;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.5;
    white-space: normal;
}
.analytics-top-products strong { color: var(--text-900); font-size: 15px; }
.analytics-top-products > a > span:last-child strong {
    color: #df163e;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.2;
}
.analytics-top-products small { color: var(--text-500); font-size: 11.5px; }
.analytics-top-products > a > span:last-child small {
    margin-top: 3px;
    color: var(--blue-900);
    font-size: 12.5px;
    font-weight: 800;
}

.analytics-image-empty {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--sky-100);
    color: var(--text-500);
    font-size: 8px;
    text-align: center;
}

.analytics-empty { display: grid; min-height: 110px; place-items: center; color: var(--text-500); font-size: 13px; }
.analytics-compact-summary { display: flex; margin: 0 0 12px; gap: 8px; flex-wrap: wrap; }
.analytics-compact-summary > span { padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text-500); font-size: 11px; }
.analytics-compact-summary strong { color: var(--blue-800); }

.analytics-products-card { padding: 0; overflow-x: auto; }
.analytics-products-head,
.analytics-product-row {
    display: grid;
    grid-template-columns: 86px minmax(320px, 1.5fr) minmax(130px, .6fr) 90px 85px 115px 150px 130px;
    min-width: 1130px;
    align-items: center;
    gap: 10px;
}
.analytics-products-head {
    min-height: 58px;
    padding: 0 16px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--sky-100);
    color: var(--text-700);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}
.analytics-products-head > span:nth-child(2) { text-align: left; }
.analytics-product-row {
    position: relative;
    min-height: 86px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    text-align: center;
    transition: background 0.15s ease;
}
.analytics-product-row:hover { background: var(--sky-50); }
.analytics-rank {
    display: flex;
    width: 64px;
    height: 64px;
    padding: 7px 6px 5px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 11px;
    align-items: center;
    justify-content: center;
    justify-self: center;
    gap: 0;
    flex-direction: column;
    background: linear-gradient(145deg, #ff315c 0%, #ed1645 48%, #cf0835 100%);
    box-shadow: 0 6px 14px rgba(203, 4, 48, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    color: #fff;
    font-weight: 900;
    white-space: nowrap;
}
.analytics-rank > span { font-size: 13px; line-height: 1; }
.analytics-rank > b { font-size: 27px; line-height: .95; }
.analytics-rank.top { color: #fff; }
.analytics-product-cell { display: flex; min-width: 0; align-items: center; gap: 10px; text-align: left; }
.analytics-product-cell img,
.analytics-product-cell .analytics-image-empty { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; }
.analytics-product-cell > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.analytics-product-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.analytics-product-cell small { overflow: hidden; color: var(--text-500); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-channel-stack { display: flex; position: relative; z-index: 2; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.analytics-row-logo { width: auto; max-width: 55px; height: 17px; object-fit: contain; }
.analytics-row-logo-text { font-size: 9px; font-weight: 800; }
.analytics-channel-stack small { width: 100%; color: var(--text-500); font-size: 9px; }
.analytics-sales-cell { display: flex; flex-direction: column; gap: 6px; color: var(--blue-900); }
.analytics-sales-cell > span { display: block; height: 5px; overflow: hidden; border-radius: 99px; background: var(--sky-100); }
.analytics-sales-cell i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-800), #75aae8); }
.analytics-row-link { position: absolute; z-index: 1; inset: 0; }

@media (max-width: 1250px) {
    .analytics-kpi-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
    .analytics-grid { grid-template-columns: 1fr; }
    .analytics-top-products { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
}

@media (max-width: 760px) {
    .analytics-kpi-grid { grid-template-columns: 1fr 1fr; }
    .analytics-kpi { min-height: 112px; }
    .analytics-top-products { grid-template-columns: 1fr; }
    .analytics-filter-separator { display: none; }
    .analytics-filter label { flex: 1 1 140px; }
    .analytics-ranking-head { align-items: flex-start !important; flex-wrap: wrap; }
    .analytics-month-filter { order: 3; width: 100%; flex-basis: 100%; justify-content: flex-start; }
    .analytics-top-mall-filter { order: 4; min-width: 180px; }
}

.member-permission-notice {
    display: flex;
    margin-bottom: 14px;
    padding: 12px 15px;
    border: 1px solid #f0d391;
    border-radius: 12px;
    align-items: center;
    gap: 12px;
    background: #fff9e9;
    color: #72531d;
    font-size: 13px;
}

.member-permission-notice strong {
    flex: 0 0 auto;
}

.member-role-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.member-role-summary .card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 4px 12px;
}

.readonly-notice,
.permission-guide {
    display: flex;
    margin-bottom: 14px;
    padding: 12px 15px;
    border: 1px solid #f0d391;
    border-radius: 12px;
    align-items: center;
    gap: 12px;
    background: #fff9e9;
    color: #72531d;
    font-size: 13px;
}

.readonly-notice strong,
.permission-guide > strong { flex: 0 0 auto; }
.permission-guide b { color: #4d3918; }
.read-only-page form[method="post"] :is(input, select, textarea, button) {
    pointer-events: none;
    opacity: .58;
}

.permission-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(520px, 1fr));
    gap: 16px;
    align-items: start;
}

.permission-role-card { padding: 0; overflow: hidden; }
.permission-role-head {
    display: flex;
    min-height: 82px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(135deg, #fff, var(--sky-50));
}
.permission-role-head > div { display: flex; align-items: center; gap: 10px; }
.permission-role-head h2 { margin: 0; color: var(--blue-900); font-size: 18px; }
.permission-role-head > small { max-width: 180px; color: var(--text-500); font-size: 10px; text-align: right; }

.permission-row {
    display: grid;
    grid-template-columns: minmax(185px, 1fr) 108px minmax(145px, .85fr);
    min-height: 70px;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    align-items: center;
    gap: 10px;
}
.permission-row:first-child { border-top: 0; }
.permission-row.head {
    min-height: 42px;
    background: var(--sky-100);
    color: var(--text-600);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}
.permission-row.head span:first-child { text-align: left; }
.permission-resource { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.permission-resource strong { color: var(--text-900); font-size: 13px; }
.permission-resource small { color: var(--text-500); font-size: 10px; }
.permission-access select {
    width: 100%;
    height: 36px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--blue-900);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
}
.permission-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.permission-actions label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-700);
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}
.permission-actions label.disabled { opacity: .38; cursor: not-allowed; }
.permission-actions input { width: 15px; height: 15px; accent-color: var(--blue-700); }
.permission-no-action { color: var(--text-400); font-size: 10px; }

.permission-save-bar {
    display: flex;
    position: sticky;
    z-index: 8;
    bottom: 12px;
    margin: 16px 0 20px;
    padding: 12px 15px;
    border: 1px solid var(--sky-300);
    border-radius: 13px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
}
.permission-save-bar span { color: var(--text-500); font-size: 12px; }

.permission-audit-card { margin-bottom: 20px; }
.permission-audit-list { display: flex; flex-direction: column; gap: 5px; }
.permission-audit-list > div {
    display: grid;
    grid-template-columns: 110px 1fr 145px;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 8px;
    align-items: center;
    background: var(--sky-50);
    font-size: 11px;
}
.permission-audit-list time { color: var(--text-500); text-align: right; }

.permission-denied-card {
    display: flex;
    max-width: 680px;
    min-height: 390px;
    margin: 55px auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}
.permission-denied-icon {
    display: grid;
    width: 68px;
    height: 68px;
    margin-bottom: 14px;
    border-radius: 50%;
    place-items: center;
    background: #fff0f1;
    color: #d82945;
    font-size: 34px;
    font-weight: 900;
}
.permission-denied-card h1 { margin: 5px 0 10px; color: var(--blue-900); }
.permission-denied-card > p:not(.eyebrow) { color: var(--text-500); line-height: 1.7; }

@media (max-width: 1280px) {
    .permission-role-grid { grid-template-columns: 1fr; }
}

.member-role-summary strong {
    color: var(--blue-900);
    font-size: 24px;
    text-align: right;
}

.member-role-summary small {
    grid-column: 1 / -1;
    color: var(--text-500);
}

.member-role-badge,
.member-status {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.member-role-badge.admin {
    background: #e7efff;
    color: #164e9e;
}

.member-role-badge.manager {
    background: #e7f8f1;
    color: #187654;
}

.member-role-badge.staff {
    background: #f1edff;
    color: #6548a8;
}

.member-status.active {
    background: #e7f8f1;
    color: #187654;
}

.member-status.inactive {
    background: #f1f3f6;
    color: var(--text-500);
}

.member-list-card {
    overflow: hidden;
}

.member-table {
    min-width: 850px;
    overflow-x: auto;
}

.member-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr 100px 90px 150px 110px 150px;
    min-height: 58px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 10px;
    color: var(--text-700);
    font-size: 13px;
}

.member-row.head {
    min-height: 44px;
    border-radius: 10px;
    background: var(--sky-100);
    color: var(--blue-900);
    font-weight: 800;
}

.member-row:last-child {
    border-bottom: 0;
}

.member-username {
    color: var(--blue-900);
    font-weight: 800;
}

.member-row-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.member-row-actions form {
    margin: 0;
}

.member-edit-modal {
    width: min(620px, calc(100vw - 36px));
}

.member-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.member-form-grid label {
    display: grid;
    gap: 5px;
}

.member-form-grid label > span {
    color: var(--text-700);
    font-size: 12px;
    font-weight: 700;
}

.member-form-grid input,
.member-form-grid select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-900);
}

.member-form-grid input[readonly] {
    background: var(--sky-50);
    color: var(--text-500);
}

.member-form-grid .member-active-field {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 7px;
}

.member-form-grid .member-active-field input {
    width: auto;
    min-height: auto;
}

.member-password-help {
    margin: 7px 0 0;
    color: var(--text-500);
    font-size: 11px;
}

@media (max-width: 720px) {
    .member-role-summary,
    .member-form-grid {
        grid-template-columns: 1fr;
    }
    .member-form-grid .member-active-field {
        grid-column: auto;
    }
}

.smartstore-order-no-cell {
    width: 82px;
    max-width: 100%;
    justify-self: start;
}

.smartstore-order-no-cell span {
    display: block;
    width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
}

.order-thumb {
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #f6fbff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.claim-create-table .table-row,
.claims-table .table-row {
    align-items: center;
    font-size: 13px;
    padding: 10px;
}

.claim-create-table .table-row {
    grid-template-columns: 1.4fr 1.1fr 0.9fr 2.1fr 0.6fr 0.9fr;
}

.claim-create-table .table-row.head,
.claims-table .table-row.head {
    font-weight: 700;
    font-size: 13px;
}

.claim-create-table input[type="number"] {
    width: 100%;
}

.claims-table .table-row {
    grid-template-columns: 0.45fr 0.6fr 0.8fr 1.2fr 1fr 0.9fr 2fr 0.8fr 0.55fr 0.55fr 0.65fr 0.8fr 0.9fr 0.8fr 0.8fr 0.6fr;
}

.muted {
    color: var(--text-500);
    font-size: 12px;
}

.inventory-table {
    overflow-x: auto;
}
.inventory-table .table-row {
    grid-template-columns: 34px 52px 84px 1fr 1.8fr 0.75fr 0.8fr 0.9fr 0.75fr 0.85fr 0.85fr 0.95fr 1.35fr;
    align-items: center;
    font-size: 13px;
}

.inventory-table .table-row > div {
    min-width: 0;
}

.inventory-table .table-row > div:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-table .table-row > div:first-child input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.inventory-table .table-row > div:nth-child(2) {
    text-align: center;
}

.inventory-no-button {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--text-900);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.inventory-no-button:hover,
.inventory-no-button:focus-visible {
    color: var(--blue-800);
    text-decoration: underline;
    outline: none;
}

.inventory-thumb {
    width: 63px;
    height: 63px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--sky-50);
    overflow: hidden;
}

.unified-inventory-table .inventory-thumb {
    width: 128px;
    height: 128px;
}

.unified-inventory-table .inventory-main-row {
    min-height: 152px;
}

.inventory-table.unified-inventory-table .table-row.head,
.inventory-table.unified-inventory-table .inventory-main-row {
    grid-template-columns: 34px 52px 148px 1fr 1.8fr 0.75fr 0.8fr 0.9fr 0.75fr 0.85fr 0.85fr 0.95fr 1.35fr;
}

.unified-inventory-table.large-thumbnails .inventory-thumb {
    width: 150px;
    height: 150px;
}

.unified-inventory-table.large-thumbnails .inventory-main-row {
    min-height: 174px;
}

.unified-inventory-table.large-thumbnails .table-row.head,
.unified-inventory-table.large-thumbnails .inventory-main-row {
    grid-template-columns: 34px 52px 174px 1fr 1.8fr 0.75fr 0.8fr 0.9fr 0.75fr 0.85fr 0.85fr 0.95fr 1.35fr;
}

.inventory-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.inventory-table .inventory-main-row {
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.inventory-table .inventory-main-row:hover,
.inventory-table .inventory-main-row.expanded {
    background: var(--sky-50);
    border-color: var(--sky-200);
}

.inventory-table .inventory-main-row.has-match {
    border-left: 4px solid var(--blue-700);
}

.inventory-table .table-row.head {
    grid-template-columns: 34px 52px 84px 1fr 1.8fr 0.75fr 0.8fr 0.9fr 0.75fr 0.85fr 0.85fr 0.95fr 1.35fr;
}

.inventory-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 22px 8px 4px;
}

.inventory-page-numbers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.inventory-page-number,
.inventory-page-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--sky-200);
    border-radius: 10px;
    background: #fff;
    color: var(--blue-800);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.inventory-page-number:hover,
.inventory-page-nav:hover {
    border-color: var(--blue-700);
    background: var(--sky-50);
}

.inventory-page-number.active {
    border-color: var(--blue-800);
    background: var(--blue-800);
    color: #fff;
    pointer-events: none;
}

.match-count-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--sky-100);
    color: var(--blue-800);
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.inventory-item-cell {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.inventory-item-name-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.inventory-item-name-line .match-count-badge {
    margin-left: 4px;
}

.inventory-unmatched-mall-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.inventory-unmatched-mall-badge.is-complete {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.inventory-match-logo-strip {
    display: inline-flex;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px 2px;
    margin-left: 2px;
}

.inventory-match-logo-strip > span {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 0 1px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.72);
}

.inventory-match-mini-logo {
    display: block;
    width: auto;
    max-width: 54px;
    height: 16.5px;
    object-fit: contain;
    border-radius: 3px;
}

.inventory-match-mini-name {
    color: var(--text-700);
    font-size: 9px;
    font-weight: 800;
}

.inventory-availability-row-btn {
    padding: 5px 9px;
    white-space: nowrap;
}

.inventory-availability-row-actions {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.inventory-soldout-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: #ffe0df;
    color: #bd2828;
    font-size: 11px;
    font-weight: 800;
}

#inventorySoldoutReleaseModal .inventory-soldout-release-panel {
    width: min(1080px, calc(100vw - 40px));
}

.inventory-soldout-release-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: min(62vh, 620px);
    margin-top: 10px;
    overflow: auto;
}

.inventory-soldout-release-item {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 84px minmax(440px, auto);
    gap: 10px;
    align-items: center;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--sky-50);
}

.inventory-soldout-release-mall,
.inventory-soldout-release-stock {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.inventory-soldout-release-action {
    display: flex;
    min-width: 0;
    flex-flow: row wrap;
    gap: 5px 7px;
    align-items: flex-end;
}

.inventory-soldout-release-action > .pill {
    min-height: 32px;
    white-space: nowrap;
}

.inventory-soldout-release-action > small {
    flex: 0 0 100%;
    line-height: 1.15;
}

.inventory-soldout-release-mall span,
.inventory-soldout-release-stock span,
.inventory-soldout-release-stock small,
.inventory-soldout-release-action small {
    color: var(--text-500);
    font-size: 12px;
}

.inventory-soldout-release-mall strong,
.inventory-soldout-release-mall code {
    overflow-wrap: anywhere;
}

.inventory-soldout-release-mall code {
    color: #1b55a5;
}

.inventory-soldout-release-mall em {
    color: var(--text-700);
    font-size: 12px;
    font-style: normal;
}

.inventory-soldout-release-stock strong {
    color: var(--navy);
    font-size: 18px;
}

.inventory-force-release-fields {
    display: grid;
    grid-template-columns: 88px minmax(140px, 180px) auto;
    gap: 6px;
    align-items: end;
}

.inventory-force-release-fields label {
    display: grid;
    gap: 3px;
}

.inventory-force-release-fields label span {
    color: var(--text-600);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.inventory-force-release-fields input {
    box-sizing: border-box;
    width: 100%;
    height: 32px;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text-900);
}

.inventory-force-release-fields .pill {
    min-height: 32px;
    white-space: nowrap;
}

.inventory-soldout-release-item.batch-running {
    border-color: #78a9ed;
    box-shadow: 0 0 0 2px rgb(28 92 174 / 8%);
}

.inventory-soldout-release-item.batch-completed {
    border-color: #9bd6b2;
    background: #f2fbf5;
}

.inventory-soldout-release-item.batch-failed {
    border-color: #efaaaa;
    background: #fff7f7;
}

.inventory-soldout-release-item.batch-failed .inventory-soldout-release-action > small {
    color: #bd2828;
}

@media (max-width: 760px) {
    .inventory-soldout-release-item {
        grid-template-columns: 1fr;
    }

    .inventory-force-release-fields {
        grid-template-columns: 84px minmax(130px, 1fr) auto;
    }
}

.match-mode-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.inventory-edit-span-2 {
    grid-column: span 2;
}

#inventoryEditSelectedBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#inventoryEditModal.anchor-mode {
    align-items: flex-start;
    justify-content: center;
}

#inventoryEditModal.anchor-mode .modal {
    position: fixed;
    top: var(--inventory-edit-top, 20px);
    left: var(--inventory-edit-left, 320px);
    width: var(--inventory-edit-width, min(1040px, calc(100vw - 520px)));
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    transform: none;
}

#inventoryEditModal .modal {
    width: min(1040px, calc(100vw - 520px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

#inventoryEditModal .inventory-edit-modal-panel {
    min-width: min(920px, calc(100vw - 540px));
}

#inventoryEditModal .form-grid {
    grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr);
}

#inventoryEditModal .inventory-edit-span-2,
#inventoryEditModal .retail-photo-field {
    grid-column: span 4;
}

#inventoryEditModal .inventory-edit-inbound-row {
    grid-column: span 4;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 150px 150px;
    gap: 12px;
    align-items: stretch;
}

#inventoryEditModal .inventory-edit-memo-field {
    min-width: 0;
}

#inventoryEditModal .inventory-edit-memo-field textarea {
    min-height: 122px;
    resize: vertical;
}

.inventory-edit-inbound-photo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inventory-edit-inbound-photo > span {
    color: var(--text-700);
    font-weight: 700;
}

.inventory-inbound-photo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 122px;
    padding: 8px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--sky-50);
    color: var(--text-500);
    font: inherit;
}

.inventory-inbound-photo-box.has-image {
    cursor: zoom-in;
}

.inventory-inbound-photo-box img {
    display: none;
    width: 100%;
    height: 104px;
    object-fit: contain;
    border-radius: 8px;
}

.inventory-inbound-photo-box.has-image span {
    display: none;
}

.inventory-inbound-photo-box.has-image img {
    display: block;
}

.inventory-inbound-photo-box:disabled {
    cursor: default;
    opacity: 1;
}

@media (max-width: 1100px) {
    #inventoryEditModal .inventory-edit-inbound-row {
        grid-template-columns: minmax(240px, 1fr) 130px 130px;
    }
}

.inventory-image-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.inventory-image-slot {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inventory-slot-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.inventory-slot-actions .pill {
    width: 100%;
}

.inventory-image-slot > strong {
    color: var(--text-700);
    font-size: 12px;
}

#inventoryEditModal .paste-image-box {
    min-height: 92px;
    max-height: 140px;
}

#inventoryEditModal .paste-image-box img {
    max-height: 88px;
}

#inventoryEditModal .paste-image-box.has-image img {
    cursor: zoom-in;
}

.inventory-image-viewer-backdrop {
    z-index: 2600;
    background: rgba(3, 12, 31, 0.88);
    backdrop-filter: blur(3px);
}

.inventory-image-viewer-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(94vw, 1400px);
    height: min(88vh, 1000px);
}

.inventory-image-viewer-panel img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
}

.inventory-image-viewer-close {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 1;
    background: #fff;
}

.inventory-crop-modal-panel {
    width: min(980px, calc(100vw - 48px));
}

.inventory-crop-layout {
    display: grid;
    gap: 14px;
    margin-top: 10px;
}

.inventory-crop-viewport {
    width: min(820px, calc(100vw - 120px));
    max-width: 100%;
    max-height: min(72vh, 760px);
    margin: 0 auto;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f7fbff;
    padding: 12px;
}

.inventory-crop-stage {
    position: relative;
    margin: 0 auto;
    overflow: visible;
    border-radius: 16px;
    touch-action: none;
    line-height: 0;
    cursor: crosshair;
}

#inventoryCropImage {
    position: relative;
    max-width: none;
    max-height: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
    display: block;
    border-radius: 12px;
}

.inventory-crop-selection {
    position: absolute;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 9999px rgba(12, 41, 97, 0.32);
    border-radius: 14px;
    cursor: move;
    touch-action: none;
}

.inventory-crop-selection::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(21, 81, 180, 0.9);
    border-radius: 12px;
    pointer-events: none;
}

.inventory-crop-controls {
    display: grid;
    gap: 8px;
}

.inventory-crop-button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-crop-controls label {
    display: grid;
    gap: 6px;
    color: var(--text-700);
    font-size: 13px;
    font-weight: 700;
}

.inventory-crop-controls input[type="range"] {
    width: 100%;
}

.inventory-match-detail {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 0.22s ease, opacity 0.18s ease, transform 0.18s ease;
}

.inventory-match-detail.open {
    max-height: 680px;
    opacity: 1;
    transform: translateY(0);
}

.inventory-extra-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
    padding: 0 12px 12px;
}

.inventory-extra-info > div {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
}

.inventory-extra-info strong {
    display: block;
    margin-bottom: 4px;
    color: var(--blue-800);
    font-size: 12px;
}

.inventory-extra-info p {
    margin: 0;
    color: var(--text-700);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.inventory-match-detail-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
    padding: 0 12px 12px 12px;
}

.inventory-match-card,
.inventory-match-empty {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
}

.inventory-match-card {
    display: grid;
    grid-template-columns: 56px 1fr;
    column-gap: 10px;
    align-items: start;
}

.inventory-match-card.wholesale-match-card {
    border-color: #b9df9f;
    background: #f1faeb;
}

.inventory-match-card .inventory-match-product-image {
    grid-row: span 4;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--sky-50);
}

.inventory-match-card .inventory-match-card-mall {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.inventory-match-card .inventory-match-card-logo {
    display: block;
    width: auto;
    max-width: 66px;
    height: 17px;
    object-fit: contain;
    border: 0;
    border-radius: 4px;
    background: transparent;
}

.inventory-match-card .inventory-match-card-mall-name {
    color: var(--blue-800);
    font-size: 12px;
    font-weight: 800;
}

.inventory-match-card .inventory-match-card-mall small {
    display: inline-flex;
    padding: 2px 6px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #f8fbff;
    color: #154d91;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.inventory-match-card .thumb-placeholder {
    grid-row: span 4;
    display: flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--sky-50);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.inventory-match-card span:not(.thumb-placeholder) {
    display: block;
    color: var(--blue-800);
    font-size: 12px;
    font-weight: 700;
}

.inventory-match-card span.inventory-match-card-mall {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 5px;
    white-space: nowrap;
}

.inventory-match-card strong {
    display: block;
    margin-top: 4px;
    color: var(--text-900);
    font-size: 13px;
}

.inventory-match-card .product-code-status {
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff3cd;
    color: #9a5b00;
    font-size: 11px;
    font-weight: 800;
    vertical-align: middle;
}

.inventory-match-card p {
    margin: 5px 0 0;
    color: var(--text-700);
    font-size: 13px;
    line-height: 1.35;
}

.inventory-match-card em {
    display: block;
    margin-top: 4px;
    color: var(--text-500);
    font-size: 12px;
    font-style: normal;
}

.inventory-match-empty {
    margin: 0 12px 12px;
    color: var(--text-500);
    font-size: 13px;
}

.inventory-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.modal.soldout-modal {
    max-width: 420px;
    width: calc(100% - 32px);
}
.inventory-table .table-row.head {
    font-weight: 700;
    font-size: 13px;
}

.inventory-sortable,
.inbound-sortable {
    cursor: pointer;
    user-select: none;
}

.inventory-sortable::after,
.inbound-sortable::after {
    content: "↕";
    margin-left: 4px;
    color: var(--text-500);
    font-size: 11px;
}

.inventory-sortable.active,
.inbound-sortable.active {
    color: var(--blue-800);
}

.inventory-sortable.active[data-direction="asc"]::after,
.inbound-sortable.active[data-direction="asc"]::after {
    content: "↑";
}

.inventory-sortable.active[data-direction="desc"]::after,
.inbound-sortable.active[data-direction="desc"]::after {
    content: "↓";
}

.inbound-table {
    overflow-x: auto;
}
.inbound-table .table-row {
    grid-template-columns: 0.4fr 0.5fr 1fr 1fr 1.4fr 2.2fr 0.6fr 0.6fr 0.6fr 0.6fr 0.8fr 0.55fr 0.8fr 0.9fr 0.8fr 0.9fr 1.3fr 0.7fr;
    align-items: center;
    font-size: 13px;
}
.inbound-table .table-row.head {
    font-weight: 700;
    font-size: 13px;
}

.inbound-thumb {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--sky-50);
    overflow: hidden;
}

.inbound-thumb-pair {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inbound-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.retail-inbound-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 12px;
    margin-bottom: 12px;
}

.retail-create-modal {
    width: min(1180px, 96vw);
    max-height: 90vh;
    overflow-y: auto;
}

.retail-recent-modal {
    width: min(1120px, 94vw);
    max-height: 86vh;
    overflow-y: auto;
}

.retail-modal-subhead {
    margin-top: 16px;
}

.retail-wholesale-search-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin-top: 12px;
}

.retail-wholesale-search-row label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: var(--text-700);
}

.retail-wholesale-search-row input {
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--sky-50);
    font-size: 15px;
}

.retail-stock-table .table-row {
    grid-template-columns: 0.6fr 1.1fr 1.8fr 1fr 0.7fr;
    align-items: center;
    font-size: 13px;
}

.retail-wholesale-table .table-row {
    grid-template-columns: 0.35fr 0.55fr 1.1fr 2.1fr 1fr 0.65fr 0.75fr;
    align-items: center;
    font-size: 13px;
}

.retail-recent-wholesale-table .table-row {
    grid-template-columns: 0.35fr 0.55fr 0.75fr 1.25fr 2.3fr 0.55fr 0.7fr 0.75fr;
    align-items: center;
    font-size: 13px;
}

.retail-candidate-row {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-900);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.retail-candidate-row:hover {
    background: var(--sky-50);
    border-color: var(--sky-200);
}

.retail-recent-row {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-900);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.retail-recent-row:hover {
    background: var(--sky-50);
    border-color: var(--sky-200);
}

.retail-movement-table .table-row {
    grid-template-columns: 0.45fr 0.6fr 0.9fr 0.9fr 1.4fr 2.2fr 0.7fr 0.7fr 1.2fr 1.8fr 1.5fr 0.7fr;
    align-items: center;
    font-size: 13px;
}

.retail-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.retail-inventory-table .table-row {
    grid-template-columns: 0.4fr 0.55fr 1.4fr 2.2fr 1.1fr 0.8fr 0.9fr;
    align-items: center;
    font-size: 13px;
}

.retail-inventory-table .retail-inventory-main-row {
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.retail-inventory-table .retail-inventory-main-row:hover,
.retail-inventory-table .retail-inventory-main-row.expanded {
    background: var(--sky-50);
    border-color: var(--sky-200);
}

.retail-inventory-table .table-row.has-match {
    border-left: 4px solid var(--blue-700);
}

.retail-photo-field {
    grid-column: span 2;
}

#inboundModal .modal {
    width: min(1180px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.inbound-photo-grid {
    grid-column: 2 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.form-grid .inbound-photo-grid .retail-photo-field {
    grid-column: auto;
}

.inbound-photo-grid .paste-image-box {
    min-height: 150px;
}

.inbound-photo-grid .paste-image-box img {
    max-height: 130px;
}

.inbound-selected-stock-images {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f7fbff;
    padding: 14px;
}

.inbound-selected-stock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-900);
}

.inbound-selected-stock-head span {
    color: var(--text-500);
    font-size: 13px;
    overflow-wrap: anywhere;
    text-align: right;
}

.inbound-selected-stock-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.inbound-selected-stock-card {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 8px;
}

.inbound-selected-stock-card figcaption {
    margin-bottom: 6px;
    color: var(--text-700);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.inbound-selected-stock-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    display: block;
    border-radius: 10px;
    background: var(--sky-50);
}

.retail-required-field > span {
    color: var(--blue-900);
}

.retail-required-field input,
.retail-required-field select {
    background: #fff8d8;
    border-color: #f0b429;
    box-shadow: inset 4px 0 0 #f0b429;
    font-weight: 700;
}

.retail-required-field input:focus,
.retail-required-field select:focus {
    border-color: var(--blue-700);
    box-shadow: inset 4px 0 0 #f0b429, 0 0 0 3px rgba(21, 81, 180, 0.12);
    outline: none;
}

.paste-image-box {
    min-height: 120px;
    border: 1px dashed var(--sky-200);
    border-radius: 14px;
    background: var(--sky-50);
    display: grid;
    place-items: center;
    padding: 10px;
    cursor: copy;
    outline: none;
}

.paste-image-box:focus {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(21, 81, 180, 0.12);
}

.paste-image-box img {
    display: none;
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 10px;
}

.paste-image-box.has-image .paste-image-empty {
    display: none;
}

.paste-image-box.has-image img {
    display: block;
}

.paste-image-empty {
    color: var(--text-500);
    font-size: 13px;
    text-align: center;
}

.retail-thumb {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--sky-50);
    overflow: hidden;
}

.retail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.orders-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 6px;
}

.table-row {
    display: grid;
    grid-template-columns: 1.2fr 1.6fr 1fr 0.8fr 0.8fr 1.2fr 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.table-row.head {
    background: var(--sky-100);
    font-weight: 800;
}

.base-account-table .table-row {
    grid-template-columns: 1.12fr 1.33fr .8fr .8fr .65fr 1fr .9fr 1fr;
}

.base-account-mall-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.base-account-mall-identity > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.base-account-mall-logo-wrap {
    display: grid;
    width: 56px;
    height: 30px;
    flex: 0 0 56px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.base-account-mall-logo {
    display: block;
    width: 50px;
    height: 24px;
    object-fit: contain;
}

.base-account-mall-logo-fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background: linear-gradient(135deg, var(--sky-100), #fff);
    color: var(--blue-800);
    font-size: 13px;
    font-weight: 900;
}

.base-account-table .admin-link-cell {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.base-account-table .admin-link-cell > a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.base-account-table .admin-link-cell > .pill {
    flex: 0 0 auto;
}

.cafe24-pg-modal {
    width: min(980px, 95vw);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.mall-api-modal { width: min(760px, 95vw); }
.mall-api-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.mall-api-input .pill { min-width: 64px; padding: 10px 12px; }

.pg-password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.pg-password-field .pill {
    min-width: 64px;
    padding: 10px 12px;
}

.form-grid .pg-comment-field {
    grid-column: 1 / -1;
}

.pg-comment-field textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.5;
}

.pg-attachment-section {
    margin-top: 16px;
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--sky-50);
}

.pg-attachment-section:focus {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(30, 92, 180, 0.12);
    outline: none;
}

.pg-attachment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.pg-attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.pg-paste-guide {
    display: flex;
    min-height: 74px;
    margin-bottom: 14px;
    border: 2px dashed var(--sky-200);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: var(--text-500);
    cursor: text;
}

.pg-paste-guide strong {
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--sky-100);
    color: var(--blue-800);
}

.pg-pending-wrap {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.pg-pending-wrap > strong,
.pg-saved-title {
    display: block;
    margin-bottom: 9px;
    color: var(--text-700);
    font-size: 13px;
}

.pg-pending-preview {
    height: 120px;
    background: #f8fafc;
}

.pg-pending-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pg-pending-item {
    border-color: var(--sky-200);
    box-shadow: 0 0 0 2px rgba(30, 92, 180, 0.05);
}

.pg-pending-remove {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b91c1c;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.pg-attachment-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.pg-attachment-item > a {
    display: block;
    height: 120px;
    background: #f8fafc;
}

.pg-attachment-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pg-attachment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
}

.pg-attachment-meta > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-attachment-meta label {
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    color: #b91c1c;
    cursor: pointer;
}

.pg-attachment-meta input {
    width: auto;
    margin: 0;
}

.pg-form-status {
    min-height: 20px;
    margin: 12px 0 0;
}

@media (max-width: 720px) {
    .pg-attachment-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.smartstore-registration-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.smartstore-registration-toolbar form:first-child {
    min-width: 300px;
    margin-right: auto;
}

.smartstore-registration-toolbar label {
    display: grid;
    gap: 6px;
}

.smartstore-registration-toolbar select,
.smartstore-draft-row input,
.smartstore-draft-row select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text-700);
    font: inherit;
}

.smartstore-registration-summary {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.smartstore-draft-list {
    display: grid;
    gap: 10px;
}

.smartstore-draft-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.smartstore-draft-row {
    display: grid;
    grid-template-columns: 100px minmax(320px, 1.3fr) minmax(330px, 1fr) 110px;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
}

.smartstore-draft-row.selected {
    border-color: #79aef7;
    background: #f7fbff;
    box-shadow: 0 0 0 2px rgba(40, 104, 196, 0.08);
}

.smartstore-draft-image {
    display: grid;
    gap: 5px;
    color: var(--text-500);
    text-align: center;
}

.smartstore-draft-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--blue-800);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.smartstore-draft-row .smartstore-draft-check input {
    width: 18px;
    height: 18px;
    padding: 0;
    accent-color: var(--blue-700);
}

.smartstore-draft-image img {
    width: 84px;
    height: 84px;
    margin: auto;
    border-radius: 10px;
    object-fit: cover;
}

.smartstore-draft-fields,
.smartstore-draft-category,
.smartstore-draft-state {
    display: grid;
    gap: 7px;
}

.smartstore-draft-fields label,
.smartstore-draft-category label {
    display: grid;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
}

.smartstore-draft-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-500);
    font-size: 12px;
}

@media (max-width: 1100px) {
    .smartstore-draft-row { grid-template-columns: 90px 1fr; }
    .smartstore-draft-category, .smartstore-draft-state { grid-column: 2; }
    .smartstore-registration-summary { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

.strong {
    font-weight: 700;
}

.mono {
    font-family: 'Noto Sans KR', monospace;
    color: var(--blue-800);
}

.actions-col {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.empty {
    padding: 16px;
    text-align: center;
    color: var(--text-500);
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--sky-50);
}

.pill.tiny {
    padding: 6px 10px;
    font-size: 13px;
}

.pill.info {
    background: var(--sky-100);
    color: var(--blue-800);
    border: 1px solid var(--sky-200);
}

.match-modal {
    width: min(760px, 96vw);
}

.match-toolbar {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.match-toolbar input {
    flex: 1;
    min-width: 220px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--sky-50);
    font-size: 14px;
}

.match-order-context {
    display: grid;
    grid-template-columns: 88px 1.6fr 1fr 0.7fr;
    gap: 8px;
    margin-top: 10px;
}

.catalog-match-context {
    grid-template-columns: 112px 1.6fr 1fr;
}

.match-order-context > div {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--sky-50);
    padding: 10px 12px;
    min-width: 0;
}

.match-order-context span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-500);
    font-size: 12px;
    font-weight: 700;
}

.match-order-context strong {
    display: block;
    color: var(--text-900);
    font-size: 14px;
    line-height: 1.45;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.match-order-context input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-900);
}

.match-order-thumb {
    min-height: 88px;
}

#matchOrderThumbBox {
    width: 62px;
    height: 62px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#catalogMatchThumbBox {
    width: 82px;
    height: 82px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#matchOrderThumbBox img,
#catalogMatchThumbBox img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.thumb-placeholder {
    padding: 0 6px;
    color: var(--text-500);
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
}

#matchOrderThumbBox img,
#catalogMatchThumbBox img,
.order-thumb img,
.inventory-thumb img,
.inventory-match-product-image,
.inbound-thumb img,
.retail-thumb img,
.mall-product-thumb,
.item-select-thumb img,
#mallProductMatchTable .match-candidate-thumb img {
    cursor: zoom-in;
}

.image-hover-preview {
    position: fixed;
    z-index: 10000;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(12, 41, 97, 0.28);
    pointer-events: none;
    display: none;
    padding: 10px;
    overflow: hidden;
    width: auto;
    height: auto;
    max-width: min(calc(100vw - 24px), 700px);
}

.image-hover-preview.show {
    display: block;
}

.image-hover-preview-grid {
    display: grid;
    grid-template-columns: repeat(var(--preview-columns, 1), minmax(0, 150px));
    gap: 6px;
    width: auto;
    height: auto;
    align-items: start;
}

.image-hover-preview figure {
    min-width: 0;
    margin: 0;
    display: grid;
    grid-template-rows: 18px 150px;
    gap: 4px;
    overflow: hidden;
}

.image-hover-preview figcaption {
    color: var(--text-700);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.image-hover-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

/* 재고관리 썸네일은 상품의 세부 모양을 확인하기 쉽도록 더 크게 표시한다. */
.image-hover-preview.inventory-hover-preview {
    max-width: calc(100vw - 24px);
}

.image-hover-preview.inventory-hover-preview .image-hover-preview-grid {
    grid-template-columns: repeat(
        var(--preview-columns, 1),
        minmax(0, var(--inventory-preview-size, 225px))
    );
}

.image-hover-preview.inventory-hover-preview figure {
    grid-template-rows: 18px var(--inventory-preview-size, 225px);
}

.image-hover-preview.order-list-preview .image-hover-preview-grid {
    grid-template-columns: 260px;
}

.image-hover-preview.order-list-preview figure {
    grid-template-rows: 18px 260px;
}

.image-hover-preview.order-list-preview img {
    width: 260px;
    height: 260px;
}

.image-hover-preview.match-modal-preview .image-hover-preview-grid {
    grid-template-columns: 390px;
}

.image-hover-preview.match-modal-preview figure {
    grid-template-rows: 18px 390px;
}

.image-hover-preview.match-modal-preview img {
    width: 390px;
    height: 390px;
}

.match-table {
    margin-top: 10px;
    max-height: 420px;
    overflow-y: auto;
}

.match-table .table-row {
    grid-template-columns: 0.55fr 2.25fr 1.2fr 0.8fr 0.85fr 0.85fr;
    align-items: center;
}

#matchTable .table-row > div:nth-child(6),
#matchTable .table-row > div:nth-child(7) {
    padding: 10px 8px;
    border-radius: 9px;
    text-align: center;
}

#matchTable.stock-focus-wholesale .table-row > div:nth-child(6),
#matchTable.stock-focus-retail .table-row > div:nth-child(7) {
    background: var(--sky-100);
    color: var(--blue-800);
    box-shadow: inset 0 0 0 1px var(--sky-200);
}

#matchTable.stock-focus-wholesale .table-row.head > div:nth-child(6),
#matchTable.stock-focus-retail .table-row.head > div:nth-child(7) {
    background: var(--blue-800);
    color: #fff;
    box-shadow: none;
}

.match-stock-value {
    font-variant-numeric: tabular-nums;
}

.match-price-value {
    color: var(--blue-800);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.match-candidate-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.match-use-thumbnail {
    white-space: nowrap;
}

.match-candidate-thumb {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--sky-50);
    overflow: hidden;
}

.match-candidate-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.match-table .table-row.item {
    cursor: pointer;
}

.match-table .table-row.item:hover {
    background: var(--sky-50);
}

.match-table .table-row.item.selected {
    border-color: var(--sky-200);
    background: var(--sky-100);
}

/* 주문수집 > 재고 매칭 후보는 상품 사진을 충분히 확인할 수 있게 크게 표시한다. */
#matchModal .match-modal {
    width: min(1240px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 32px);
    overflow: hidden;
}

#matchModal .match-order-workspace {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
    align-items: stretch;
}

#matchModal .match-order-thumb {
    min-height: 246px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--sky-50);
}

#matchModal .match-order-thumb > span,
#matchModal .match-order-details span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-500);
    font-size: 12px;
    font-weight: 700;
}

#matchModal #matchOrderThumbBox {
    width: 220px;
    height: 220px;
    border-radius: 12px;
}

#matchModal .match-order-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#matchModal .match-order-details {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) minmax(180px, 1fr) minmax(140px, 0.7fr);
    gap: 8px;
}

#matchModal .match-order-details > div {
    min-width: 0;
    min-height: 94px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--sky-50);
}

#matchModal .match-order-details strong {
    display: block;
    color: var(--text-900);
    font-size: 14px;
    line-height: 1.45;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

#matchModal .match-order-details input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-900);
    font-size: 14px;
}

#matchModal .match-order-product-link {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

#matchModal .match-order-product-link:not(.disabled):hover strong {
    color: var(--blue-700);
    text-decoration: underline;
    text-underline-offset: 3px;
}

#matchModal .match-order-product-link.disabled {
    cursor: default;
}

#matchModal .match-order-side .match-toolbar {
    margin-top: 8px;
}

#matchModal .match-order-side .match-toolbar input {
    flex: 1 1 28%;
    min-width: 150px;
}

#matchModal .match-order-side .match-current {
    margin: 0;
}

#matchModal .match-status-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    margin: 4px 0 6px;
}

#matchModal .match-order-sale-price {
    display: block;
    flex: 0 0 105px;
    min-width: 0;
    min-height: 42px;
    padding: 6px 10px;
    border: 1px solid var(--sky-200);
    border-radius: 10px;
    background: var(--sky-50);
    white-space: nowrap;
}

#matchModal .match-order-sale-price span {
    color: var(--text-500);
    font-size: 11px;
    font-weight: 700;
}

#matchModal .match-order-sale-price strong {
    color: var(--blue-800);
    display: block;
    margin-top: 2px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

#matchModal .match-order-cost-price strong,
#matchModal .match-order-margin-price strong.negative {
    color: #d92323;
}

#matchModal .match-order-commission-price {
    flex-basis: 142px;
}

#matchModal .match-order-margin-price {
    flex-basis: 138px;
}

#matchModal .match-order-margin-price strong.positive {
    color: #087a4a;
}

#matchModal .match-status-row .match-mode-actions {
    margin-top: 0;
}

#matchModal .match-order-side .match-bulk-actions {
    margin: auto 0 0;
}

#matchTable {
    max-height: min(620px, calc(100vh - 390px));
}

#matchTable .table-row {
    grid-template-columns: 220px minmax(210px, 2.1fr) minmax(130px, 1.15fr) 82px 105px 105px 105px 110px;
}

#matchTable .table-row.item {
    min-height: 240px;
}

#matchTable .match-candidate-thumb {
    width: 220px;
    height: 220px;
    border-radius: 12px;
}

#matchTable .match-candidate-thumb img {
    object-fit: contain;
    background: #fff;
}

.match-current {
    margin: 6px 0 10px;
    font-size: 12px;
    color: var(--text-500);
}

.match-current.has-match {
    color: #d32f2f;
    font-weight: 700;
}

.match-bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 10px;
    padding: 10px 12px;
    border: 1px solid var(--sky-200);
    border-radius: 12px;
    background: var(--sky-50);
    color: var(--text-700);
    font-size: 13px;
    font-weight: 700;
}

.match-bulk-actions[hidden] {
    display: none;
}

.match-bulk-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.match-allocation-cell {
    text-align: center;
}

.match-allocation-input {
    width: 88px;
    padding: 10px 8px;
    border: 1px solid var(--sky-300);
    border-radius: 9px;
    background: #fff;
    color: var(--blue-900);
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.modal-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.match-modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.match-modal-title-row h3 {
    margin: 0;
}

.match-order-mall-source {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 4px 9px;
    border: 1px solid var(--sky-200);
    border-radius: 10px;
    background: var(--sky-50);
}

.match-order-mall-source[hidden] {
    display: none;
}

.match-order-mall-logo {
    max-width: 92px;
    height: 24px;
}

.match-order-mall-name {
    color: var(--blue-900);
    font-size: 13px;
    font-weight: 800;
}

.match-order-mall-account {
    max-width: 150px;
}

.compact-date-range {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-700);
    font-size: 12px;
    font-weight: 700;
}

.compact-date-range input {
    width: 132px;
    height: 38px;
    border: 1px solid var(--sky-200);
    border-radius: 10px;
    background: var(--sky-50);
    color: var(--text-900);
    padding: 0 9px;
}

.compact-filter {
    margin-bottom: 12px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 22, 55, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
}

.modal-backdrop.show {
    display: flex;
}

#inventoryCropModal {
    z-index: 2200;
}

#catalogMatchModal.anchor-mode {
    align-items: flex-start;
    justify-content: flex-start;
}

#catalogMatchModal.anchor-mode .match-modal {
    position: fixed;
    top: var(--catalog-match-top, 20px);
    left: 50%;
    transform: translateX(-50%);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

#brandMergeModal.show {
    z-index: 2200;
}

.modal {
    width: min(840px, 95vw);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(12, 41, 97, 0.2);
    padding: 20px 20px 16px;
    border: 1px solid var(--border);
    animation: pop 0.2s ease;
}

.claim-edit-modal {
    width: min(1100px, calc(100vw - 48px));
}

.claim-note-field {
    grid-column: span 2;
}

.claim-image-preview {
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: var(--sky-50);
}

.claim-image-preview img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.claims-manage-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

#inventoryCreateModal .modal {
    width: min(1280px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.form-grid label,
.form-grid .retail-photo-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: var(--text-700);
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--sky-50);
    font-size: 15px;
    font-family: inherit;
}
.form-grid input.prefill {
    color: var(--text-500);
}

.form-grid .checkbox-field {
    justify-content: flex-start;
}

.inline-check {
    min-height: 45px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--sky-50);
    display: flex;
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    font-weight: 700;
    color: var(--text-700);
}

.inline-check input {
    width: auto;
    padding: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.order-edit-group-save {
    display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; padding: 9px 12px;
    border: 1px solid #bcd5f2; border-radius: 12px; background: #eef7ff;
    color: var(--text-700); cursor: pointer;
}
.order-edit-group-save[hidden] { display: none; }
.order-edit-group-save input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: #1551b4; }
.order-edit-group-save span { display: flex; flex-direction: column; gap: 3px; }
.order-edit-group-save small { color: var(--text-500); font-weight: 500; }
.order-edit-modal-actions { align-items: center; justify-content: space-between; }
.order-edit-action-buttons { display: flex; flex: 0 0 auto; gap: 10px; }
@media (max-width: 760px) {
    .order-edit-modal-actions { align-items: stretch; flex-direction: column; }
    .order-edit-action-buttons { justify-content: flex-end; }
}

.brand-modal {
    width: min(720px, 96vw);
}

.brand-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.brand-toolbar input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--sky-50);
    font-size: 14px;
}

.brand-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--sky-100);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-700);
}

.brand-chip {
    padding: 6px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-900);
}

.brand-list {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    padding: 6px;
}

.brand-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    font-family: inherit;
    color: var(--text-900);
}

.brand-item-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.brand-item-actions {
    display: flex;
    justify-content: flex-end;
}

.brand-item:hover {
    background: var(--sky-50);
}

.brand-item.selected {
    border-color: var(--sky-200);
    background: var(--sky-100);
}

.item-select-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
}

.item-select-thumb {
    width: 56px;
    height: 56px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--sky-50);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-500);
    font-size: 11px;
    font-weight: 700;
}

.item-select-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.item-select-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-select-brand {
    color: var(--text-500);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.inventory-brand-picker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inventory-brand-picker input {
    flex: 1;
}

.inventory-brand-picker-modal {
    width: min(720px, 96vw);
}

.brand-modal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.brand-modal-toolbar input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--sky-50);
    font-size: 14px;
}

.brand-modal-list {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    padding: 6px;
}

.brand-modal-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-900);
}

.brand-modal-item:hover,
.brand-modal-item:focus-visible {
    border-color: var(--sky-200);
    background: var(--sky-50);
    outline: none;
}

.brand-modal-empty {
    padding: 18px 12px;
    color: var(--text-500);
    font-size: 14px;
    text-align: center;
}

/* Orders page filters & grid */
.filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filters.compact {
    padding: 15px;
    align-items: flex-start;
    width: 100%;
}

.filters.compact .filter-row {
    align-items: center;
    gap: 18px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
}

.filters.compact label span {
    font-size: 13px;
    color: var(--text-500);
}

.filters.compact select {
    min-width: 180px;
}

.filters.compact .filter-actions {
    margin-left: auto;
}

.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    flex-wrap: nowrap;
}

.filters-bar label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-bar label span {
    white-space: nowrap;
    font-weight: 700;
    color: var(--text-700);
}

.filters-bar select {
    min-width: 160px;
}

.pill-bar {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(240,248,255,0.9));
    padding: 16px 32px;
    border-radius: 26px;
    box-shadow: 0 12px 25px rgba(12, 41, 97, 0.12);
    border: 1px solid var(--border);
    align-self: flex-start;
    gap: 20px;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
}

.pill-bar .pill {
    padding: 10px 16px;
}

.pill-bar label span {
    font-weight: 800;
    color: var(--text-900);
}

.pill-bar select {
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: #f8fbff;
    font-weight: 600;
    color: var(--text-900);
}

.pill-bar select:focus {
    outline: 2px solid var(--sky-200);
    border-color: var(--blue-700);
}

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

.excel-upload {
    display: flex;
    align-items: center;
    gap: 6px;
}

.excel-upload .file-label {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.excel-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}

.filter-row label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: var(--text-700);
}

.inline-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-inputs input {
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--sky-50);
}

.tilde {
    color: var(--text-500);
}

.filter-row select,
.filter-row input {
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--sky-50);
}

.filter-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
    margin: 14px 0;
}

.upload-card .inline-select {
    display: flex;
    gap: 8px;
    align-items: center;
}

.upload-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.simple-upload {
    display: flex;
    align-items: center;
    gap: 8px;
}
.simple-upload select,
.simple-upload input[type="file"] {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
}
.simple-upload .pill {
    height: 32px;
    padding: 0 14px;
    border-radius: 16px;
}

/* Word rule modal tweaks */
.word-table .table-row {
    align-items: center;
    gap: 3px;
    border: none;
    padding: 4px 2px;
    display: grid;
    grid-template-columns: 60px 3fr 2fr 0.9fr 60px;
}
.word-table .table-row > div {
    padding: 2px 2px;
}
.word-table .col-word {
    min-width: 360px;
}
.word-table .col-note {
    min-width: 120px;
}
.word-table .col-action {
    width: 60px;
    text-align: center;
}
.word-table input {
    width: 100%;
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
}
.word-table .table-row.head {
    padding: 2px 2px;
}
.word-table .table-row.head > div {
    border: none;
    font-weight: 700;
}
.word-table-wrapper {
    max-height: 380px;
    overflow-y: auto;
    border: none;
    border-radius: 12px;
    padding: 4px;
    background: #fff;
    overflow-x: hidden;
}
.word-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 6px;
}
.word-toolbar .bulk-actions.inline {
    display: flex;
    gap: 8px;
}
.modal {
    width: min(920px, 96vw);
}
.bulk-box textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: 'Noto Sans KR', sans-serif;
    resize: vertical;
    font-size: 14px;
    min-height: 200px;
}

.list-row.two-col {
    grid-template-columns: 1fr;
}

.thumb-placeholder {
    width: 60px;
    height: 40px;
    border-radius: 10px;
    background: var(--sky-100);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--text-500);
    font-size: 12px;
}

.thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.catalog-thumb,
.catalog-thumb-placeholder {
    width: 58px;
    height: 58px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    cursor: zoom-in;
}

.catalog-thumb-placeholder {
    display: grid;
    place-items: center;
}

/* Product mapping table widths */
.table.product-map .table-row {
    grid-template-columns: 0.4fr 0.5fr 0.9fr 1fr 0.9fr 0.9fr 0.9fr 2.6fr 1.5fr 0.8fr 0.9fr 0.9fr 0.7fr;
}

/* Mall product operations */
.mall-product-header {
    margin-bottom: 16px;
}

.mall-product-selector {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 12px 16px;
    padding: 18px;
    margin-bottom: 12px;
}

.mall-product-selector-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-700);
}

.mall-product-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.mall-product-logo-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 46px;
    padding: 7px 11px;
}

.mall-product-logo-chip-image {
    display: block;
    width: auto;
    max-width: 96px;
    height: 25px;
    object-fit: contain;
    border-radius: 3px;
}

.mall-product-logo-chip-name {
    font-size: 13px;
    font-weight: 800;
}

.mall-account-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-700);
    background: #fff;
    text-decoration: none;
}

.mall-account-chip span {
    font-size: 11px;
    color: var(--text-500);
}

.mall-account-chip.active {
    border-color: var(--blue-700);
    background: var(--blue-800);
    color: #fff;
}

.mall-account-chip.active span {
    color: #dbeafe;
}

.mall-product-filters {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) 170px auto auto;
    align-items: end;
    gap: 10px;
    padding: 16px 18px;
    margin-bottom: 12px;
}

.mall-product-filters label {
    display: grid;
    gap: 6px;
}

.mall-product-filters label > span {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-700);
}

.mall-product-filters input,
.mall-product-filters select {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0 13px;
    background: var(--sky-50);
    color: var(--text-900);
}

.mall-product-summary {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, 0.7fr));
    gap: 10px;
    margin-bottom: 12px;
}

.mall-summary-card {
    display: grid;
    gap: 5px;
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.mall-summary-card span {
    font-size: 12px;
    color: var(--text-500);
}

.mall-summary-card strong {
    font-size: 17px;
    color: var(--text-900);
}

.mall-summary-card .mall-product-selected-account {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.mall-product-selected-logo {
    display: block;
    width: auto;
    max-width: 112px;
    height: 29px;
    object-fit: contain;
    border-radius: 4px;
}

.mall-product-selected-mall-name {
    font-size: 16px;
}

.mall-summary-card .mall-product-selected-admin {
    color: var(--text-700);
    font-size: 15px;
}

.mall-product-selected-admin::before {
    content: "·";
    margin-right: 7px;
    color: var(--text-500);
}

.mall-summary-card.matched {
    background: #effaf5;
}

.mall-summary-card.unmatched {
    background: #fff8e8;
}

.mall-summary-card.focus-stock {
    background: var(--sky-100);
}

.mall-product-table-card {
    padding: 16px;
}

.mall-product-table-head {
    align-items: flex-start;
    gap: 18px;
}

.mall-product-table-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.mall-product-page-size label {
    display: grid;
    gap: 5px;
}

.mall-product-page-size label > span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-500);
}

.mall-product-page-size select {
    min-width: 150px;
    height: 40px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--text-700);
    font-weight: 700;
}

.count-badge {
    display: inline-flex;
    margin-left: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--sky-100);
    color: var(--blue-800);
    font-size: 12px;
}

.mall-product-data-tools {
    position: relative;
    z-index: 3;
}

.mall-product-data-tools summary {
    list-style: none;
    cursor: pointer;
}

.mall-product-data-tools summary::-webkit-details-marker {
    display: none;
}

.mall-product-tool-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(23, 55, 98, 0.16);
}

.mall-product-tool-popover .excel-upload {
    display: flex;
    gap: 8px;
}

.mall-product-table-scroll {
    overflow-x: auto;
    padding-bottom: 6px;
}

.mall-product-operation-table {
    min-width: 2240px;
}

.mall-product-operation-row {
    display: grid;
    grid-template-columns: 34px 46px 88px 68px 135px 270px 104px 90px 300px 58px 98px 105px 125px 125px 145px 180px 90px;
    gap: 10px;
    align-items: center;
    min-height: 88px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text-900);
    font-size: 13px;
}

.mall-product-operation-row + .mall-product-operation-row {
    margin-top: 8px;
}

.mall-product-operation-row.head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 52px;
    background: var(--sky-100);
    font-weight: 800;
}

.mall-product-operation-row.is-unmatched {
    background: #fffcf5;
    border-color: #f5dca0;
}

.mall-product-operation-row.is-loss {
    background: #fff8f8;
}

.status-badge,
.group-badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.status-badge.success {
    background: #e2f5eb;
    color: #157347;
}

.status-badge.warning {
    background: #fff0c9;
    color: #986200;
}

button.status-badge {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

button.status-badge:hover {
    box-shadow: 0 0 0 2px rgba(21, 81, 180, 0.16);
}

#mallProductMatchModal .match-modal {
    width: min(1180px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 32px);
    overflow: hidden;
}

body.mall-product-match-open {
    overflow: hidden;
}

#mallProductMatchModal.viewport-anchor {
    width: 100vw;
    height: 100vh;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 12px;
    overflow: hidden;
}

#mallProductMatchModal.viewport-anchor .match-modal {
    position: fixed;
    top: 12px;
    left: 12px;
    width: min(1180px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    margin: 0;
}

#mallProductMatchModal .match-order-workspace {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
}

#mallProductMatchModal .match-order-thumb {
    min-height: 246px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--sky-50);
}

#mallProductMatchModal .match-order-thumb > span,
#mallProductMatchModal .match-order-details span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-500);
    font-size: 12px;
    font-weight: 700;
}

#mallMatchOrderThumbBox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 220px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

#mallMatchOrderThumbBox img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#mallProductMatchModal .match-order-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#mallProductMatchModal .match-order-details {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) minmax(180px, 1fr) minmax(140px, 0.7fr);
    gap: 8px;
}

#mallProductMatchModal .match-order-details > div {
    min-width: 0;
    min-height: 94px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--sky-50);
}

#mallProductMatchModal .match-order-details strong {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

#mallProductMatchModal .match-order-details input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

#mallProductMatchModal .match-toolbar input {
    flex: 1 1 34%;
    min-width: 180px;
}

#mallProductMatchModal .mall-match-sale-price {
    flex: 0 0 118px;
    min-height: 42px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

#mallProductMatchModal .mall-match-sale-price span {
    display: block;
    color: var(--text-500);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

#mallProductMatchModal .mall-match-sale-price strong {
    display: block;
    margin-top: 2px;
    color: var(--blue-800);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

#mallProductMatchModal .mall-match-cost-price strong {
    color: #d92323;
}

#mallProductMatchModal .mall-match-margin-price {
    flex-basis: 132px;
}

#mallProductMatchModal .mall-match-margin-price strong.positive {
    color: #087a4a;
}

#mallProductMatchModal .mall-match-margin-price strong.negative {
    color: #d92323;
}

#mallProductMatchModal .match-bulk-actions {
    margin-top: auto;
}

#mallProductMatchTable {
    max-height: min(620px, calc(100vh - 390px));
}

#mallProductMatchTable .table-row {
    grid-template-columns: 220px minmax(210px, 2.1fr) minmax(130px, 1.15fr) 82px 105px 105px 105px 110px;
}

#mallProductMatchTable .table-row.item {
    min-height: 240px;
}

#mallProductMatchTable .match-candidate-thumb {
    width: 220px;
    height: 220px;
    border-radius: 12px;
}

#mallProductMatchTable .match-candidate-thumb img {
    object-fit: contain;
    background: #fff;
}

.group-badge {
    background: #e7efff;
    color: var(--blue-800);
}

/* 재고 품목을 기준으로 보는 쇼핑몰 등록현황 */
.inventory-listing-selector {
    display: grid;
    gap: 12px;
}

.inventory-listing-selector .mall-product-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.inventory-listing-mall-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 46px;
    padding: 7px 11px;
}

.inventory-listing-mall-chip-logo {
    display: block;
    width: auto;
    max-width: 96px;
    height: 25px;
    object-fit: contain;
    border-radius: 3px;
}

.inventory-listing-mall-chip-name {
    font-size: 13px;
    font-weight: 800;
}

.inventory-listing-filters {
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(340px, 1fr) 180px 150px auto;
    gap: 12px;
    align-items: end;
}

.inventory-listing-filters label {
    display: grid;
    gap: 6px;
}

.inventory-listing-summary {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(145px, .7fr));
    gap: 12px;
    margin: 12px 0;
}

.inventory-listing-summary .summary-card {
    min-height: 74px;
    padding: 15px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    color: var(--text-900);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
}

.inventory-listing-summary .summary-card span {
    color: var(--text-500);
    font-size: 12px;
}

.inventory-listing-summary .summary-card strong {
    font-size: 17px;
}

.inventory-listing-summary .inventory-listing-selected-account {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.inventory-listing-selected-logo {
    display: block;
    width: auto;
    max-width: 112px;
    height: 29px;
    object-fit: contain;
    border-radius: 4px;
}

.inventory-listing-selected-mall-name {
    font-size: 16px;
}

.inventory-listing-summary .inventory-listing-selected-admin {
    color: var(--text-700);
    font-size: 15px;
}

.inventory-listing-selected-admin::before {
    content: "·";
    margin-right: 7px;
    color: var(--text-500);
}

.inventory-listing-summary .summary-card.matched { background: #effbf5; }
.inventory-listing-summary .summary-card.unconfirmed { background: #fff9eb; }
.inventory-listing-summary .summary-card.pending { background: #eef6ff; }
.inventory-listing-summary .summary-card.excluded { background: #f3f5f8; }

.inventory-listing-card .table-head {
    align-items: center;
    gap: 16px;
}

.inventory-listing-card .table-head .muted {
    margin: 0;
    font-size: 12px;
    text-align: right;
}

.inventory-listing-table-options {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-left: auto;
}

.inventory-listing-table-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-800);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.inventory-listing-table-options input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue-700);
}

.inventory-listing-scroll {
    overflow-x: auto;
    padding-bottom: 4px;
}

.inventory-listing-table {
    min-width: 1880px;
}

.inventory-listing-row {
    display: grid;
    grid-template-columns: 55px 86px 145px 245px 72px 90px 120px 120px 190px 100px minmax(290px, 1fr) 220px;
    gap: 10px;
    align-items: center;
    min-height: 112px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-top: 8px;
    background: #fff;
}

.inventory-listing-table.has-sale-price {
    min-width: 2275px;
}

.inventory-listing-table.has-sale-price .inventory-listing-row {
    grid-template-columns: 55px 86px 145px 245px 72px 90px 115px 130px 145px 120px 120px 190px 100px minmax(290px, 1fr) 220px;
}

.inventory-listing-table.hide-inventory-details {
    min-width: 1380px;
}

.inventory-listing-table.hide-inventory-details .inventory-listing-row {
    grid-template-columns: 55px 86px 145px 245px 90px 100px minmax(340px, 1fr) 220px;
}

.inventory-listing-table.hide-inventory-details.has-sale-price {
    min-width: 1505px;
}

.inventory-listing-table.hide-inventory-details.has-sale-price .inventory-listing-row {
    grid-template-columns: 55px 86px 145px 245px 90px 115px 100px minmax(340px, 1fr) 220px;
}

.inventory-listing-table.hide-inventory-details .inventory-listing-optional {
    display: none;
}

.inventory-listing-sale-price {
    color: var(--blue-800);
    text-align: center;
}

.inventory-listing-finance {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
    text-align: center;
}

.inventory-listing-finance.positive { color: #138252; }
.inventory-listing-finance.negative { color: #d63c3c; }

.inventory-listing-row.head {
    min-height: 50px;
    margin-top: 0;
    border-radius: 12px;
    background: var(--sky-100);
    color: var(--text-800);
    font-weight: 700;
}

.inventory-listing-row.status-unconfirmed { border-color: #efd391; background: #fffdf7; }
.inventory-listing-row.status-pending { border-color: #bdd9fa; background: #f8fbff; }
.inventory-listing-row.status-excluded { opacity: .78; background: #f7f8fa; }

.inventory-listing-thumb {
    width: 72px;
    height: 72px;
}

.inventory-listing-thumb img { cursor: zoom-in; }

.inventory-listing-memo {
    max-height: 78px;
    overflow: hidden;
    color: var(--text-600);
    font-size: 12px;
    line-height: 1.45;
}

.listing-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.listing-status-badge.matched { color: #13724b; background: #dcf6e9; }
.listing-status-badge.unconfirmed { color: #946300; background: #fff0c8; }
.listing-status-badge.pending { color: var(--blue-800); background: #e3f0ff; }
.listing-status-badge.excluded { color: var(--text-600); background: #e8ebef; }

.inventory-listing-products {
    display: grid;
    gap: 7px;
    max-height: 92px;
    overflow-y: auto;
}

.inventory-listing-product {
    display: grid;
    grid-template-columns: minmax(90px, auto) 1fr;
    gap: 3px 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border);
    font-size: 12px;
}

.inventory-listing-product a,
.inventory-listing-product strong {
    color: var(--blue-800);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.inventory-listing-product em {
    grid-column: 2;
    color: var(--text-500);
    font-style: normal;
}

.inventory-listing-product small {
    grid-column: 2;
    color: var(--blue-700);
    font-size: 11px;
}

.inventory-listing-product .link-like-button {
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--blue-800);
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
}

.inventory-listing-product .link-like-button:hover {
    color: var(--blue-600);
}

.inventory-listing-product .link-like-button.danger {
    color: #bd2f3a;
}

.inventory-listing-product .link-like-button.danger:hover {
    color: #8f1823;
}

.inventory-listing-workflow {
    display: grid;
    gap: 7px;
}

.inventory-listing-workflow select,
.inventory-listing-workflow input {
    min-width: 0;
    width: 100%;
    height: 34px;
    padding: 5px 8px;
    font-size: 12px;
}

.inventory-listing-workflow button { justify-self: end; }

.inventory-listing-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.smartstore-direct-link-modal {
    width: min(980px, calc(100vw - 36px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.smartstore-direct-link-modal > .modal-head {
    flex: 0 0 auto;
}

.direct-link-modal-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: 4px;
}

.direct-link-inventory-context {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--sky-50);
}

.direct-link-inventory-context span {
    color: var(--text-500);
    font-size: 12px;
}

.direct-link-guide,
.direct-link-option-warning {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--text-600);
    background: #fff9e8;
    font-size: 12px;
    line-height: 1.5;
}

.direct-link-form-grid {
    margin-top: 14px;
    grid-template-columns: 1fr 1fr;
}

.direct-link-form-grid .full { grid-column: 1 / -1; }

.direct-link-group-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--sky-50);
}

.direct-link-group-toggle-row label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--blue-800);
    font-weight: 800;
    white-space: nowrap;
}

.direct-link-group-toggle-row input { width: 17px; height: 17px; accent-color: var(--blue-700); }
.direct-link-group-toggle-row span { color: var(--text-500); font-size: 12px; }

.direct-link-group-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.direct-link-group-search { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.direct-link-group-search input { min-width: 0; }

.direct-link-group-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.direct-link-group-summary span {
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--blue-800);
    background: var(--sky-100);
    font-size: 11px;
    font-weight: 700;
}

.direct-link-group-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    max-height: 230px;
    margin-top: 10px;
    overflow-y: auto;
}

.direct-link-group-result {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 9px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text-800);
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.direct-link-group-result.selected { border-color: var(--blue-700); background: var(--sky-100); box-shadow: inset 0 0 0 1px var(--blue-700); }
.direct-link-group-thumb { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 9px; overflow: hidden; background: var(--sky-50); }
.direct-link-group-thumb img { width: 100%; height: 100%; object-fit: cover; }
.direct-link-group-info { display: grid; gap: 2px; min-width: 0; }
.direct-link-group-info strong, .direct-link-group-info span, .direct-link-group-info em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.direct-link-group-info span { color: var(--text-600); font-size: 11px; }
.direct-link-group-info em { color: var(--text-500); font-size: 11px; font-style: normal; }

.smartstore-direct-link-modal .modal-actions {
    flex: 0 0 auto;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    background: #fff;
}

@media (max-width: 1100px) {
    .inventory-listing-filters { grid-template-columns: 1fr 1fr; }
    .inventory-listing-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .smartstore-direct-link-modal {
        width: calc(100vw - 12px);
        max-height: calc(100vh - 12px);
        max-height: calc(100dvh - 12px);
        padding: 14px 12px 10px;
    }
    .direct-link-modal-scroll { padding-right: 2px; }
    .smartstore-direct-link-modal .modal-actions {
        padding-bottom: max(2px, env(safe-area-inset-bottom));
    }
    .direct-link-inventory-context { grid-template-columns: 1fr; }
    .direct-link-form-grid { grid-template-columns: 1fr; }
    .direct-link-form-grid .full { grid-column: auto; }
    .direct-link-group-results { grid-template-columns: 1fr; }
}

.source-label {
    display: block;
    margin-top: 5px;
    color: var(--text-500);
}

.mall-product-thumb {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--sky-50);
    object-fit: cover;
}

.mall-product-thumb.placeholder {
    padding: 5px;
    color: var(--text-500);
    text-align: center;
    font-size: 10px;
}

.mall-product-name-cell,
.number-cell,
.stock-location-cell,
.history-cell,
.inventory-link-cell {
    display: grid;
    gap: 5px;
}

.mall-product-name-cell span,
.number-cell span,
.stock-location-cell span,
.history-cell span {
    color: var(--text-500);
    font-size: 12px;
}

.inventory-link-cell {
    max-height: 76px;
    overflow-y: auto;
    align-content: start;
}

.inventory-link-cell > span:not(.group-badge) {
    display: block;
    line-height: 1.35;
}

.stock-location-cell {
    padding: 9px;
    border-radius: 9px;
}

.stock-location-cell.stock-primary {
    background: #eaf4ff;
    outline: 1px solid #c8e1fb;
}

.number-cell.positive strong {
    color: #137148;
}

.number-cell.negative strong {
    color: #c63434;
}

.note-cell {
    max-height: 72px;
    overflow: hidden;
    line-height: 1.45;
}

.muted {
    color: var(--text-500);
}

@media (max-width: 1050px) {
    .mall-product-filters {
        grid-template-columns: 1fr 160px auto;
    }

    .mall-product-filters .pill.outline {
        display: none;
    }

    .mall-product-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mall-product-summary .mall-summary-card:first-child {
        grid-column: 1 / -1;
    }
}

.catalog-upload select {
    min-width: 210px;
}

.catalog-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 14px;
    margin-bottom: 18px;
}

.catalog-control-card {
    padding: 18px;
}

.catalog-control-title {
    font-weight: 800;
    color: var(--text-900);
    margin-bottom: 12px;
}

.catalog-control-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.catalog-control-row label:not(.file-label) {
    display: grid;
    gap: 6px;
    min-width: 170px;
}

.catalog-control-row label span {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-700);
}

.catalog-control-row select,
.catalog-control-row input[type="text"] {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--sky-50);
    padding: 0 12px;
    color: var(--text-700);
}

.catalog-search-field {
    flex: 1 1 260px;
}

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

.catalog-upload .hint {
    margin-top: 10px;
}

.catalog-account-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 14px;
}

.catalog-account-chips .account-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.catalog-account-chips .account-filter-chip span {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--sky-100);
    color: var(--blue-800);
    font-size: 11px;
    font-weight: 800;
}

.catalog-account-chips .account-filter-chip.active span {
    background: #fff;
}

.catalog-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.temu-paste-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(340px, 1.5fr) auto;
    gap: 12px;
    align-items: center;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff7ed, #f7fbff);
}

.coupang-paste-panel {
    grid-template-columns: minmax(220px, 0.9fr) minmax(420px, 2fr) auto;
}

.temu-paste-info {
    display: grid;
    gap: 4px;
}

.temu-paste-info strong {
    color: var(--text-900);
    font-weight: 900;
}

.temu-paste-info span {
    color: var(--text-500);
    font-size: 13px;
    line-height: 1.45;
}

.temu-paste-box {
    min-height: 48px;
    max-height: 120px;
    overflow: auto;
    border: 1px dashed #f59e0b;
    border-radius: 14px;
    background: #fff;
    padding: 12px 14px;
    color: var(--text-500);
    font-size: 13px;
    line-height: 1.5;
}

.temu-paste-box:focus {
    outline: 3px solid rgba(245, 158, 11, 0.22);
    border-color: #f59e0b;
}

.temu-paste-box.has-content {
    color: var(--text-700);
}

.table.catalog-products .table-row {
    grid-template-columns: 0.28fr 0.38fr 0.9fr 0.65fr 0.7fr 0.65fr 1fr 1.1fr 2.8fr 0.6fr 0.7fr 0.7fr 1fr;
}

.table.catalog-products .table-row > div {
    min-width: 0;
}

.catalog-mall-cell {
    display: grid;
    gap: 3px;
    line-height: 1.25;
}

.catalog-mall-cell strong {
    font-size: 13px;
    color: var(--text-900);
}

.catalog-mall-cell span {
    font-size: 12px;
    color: var(--text-500);
    word-break: break-all;
}

.table.catalog-products .strong {
    word-break: keep-all;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 41, 97, 0.25);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-box {
    background: #fff;
    padding: 18px 22px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid var(--sky-200);
    border-top-color: var(--blue-800);
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: var(--text-700);
    font-weight: 700;
}

.inventory-barcode-modal-panel {
    width: min(900px, calc(100vw - 48px));
}

.inventory-barcode-toolbar {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.inventory-barcode-toolbar input {
    flex: 1;
    min-width: 0;
}

.inventory-barcode-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding: 0 2px 8px;
    color: var(--text-700);
}

.inventory-barcode-results {
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--sky-200);
    border-radius: 14px;
    background: #fff;
}

.inventory-barcode-result-row {
    display: grid;
    grid-template-columns: 28px minmax(120px, .8fr) minmax(220px, 1.5fr) 150px;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--sky-100);
    cursor: pointer;
}

.inventory-barcode-result-row:last-child {
    border-bottom: 0;
}

.inventory-barcode-result-row:has(input:checked) {
    background: var(--sky-50);
}

.inventory-barcode-result-row strong,
.inventory-barcode-result-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.inventory-barcode-result-row code {
    color: var(--blue-800);
    font-size: 12px;
    white-space: nowrap;
}

.inventory-barcode-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.inventory-barcode-options label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-700);
    font-size: 13px;
    font-weight: 700;
}

.inventory-barcode-empty {
    padding: 32px 16px;
    color: var(--text-500);
    text-align: center;
}

.barcode-page-header {
    margin-bottom: 18px;
}

.barcode-page-card {
    margin-bottom: 12px;
}

.barcode-page-search {
    display: grid;
    grid-template-columns: auto minmax(240px, 520px) auto auto;
    align-items: center;
    gap: 10px;
}

.barcode-page-search label {
    color: var(--text-700);
    font-weight: 800;
}

.barcode-list-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.barcode-list-summary h2 {
    margin: 0;
    font-size: 18px;
}

.barcode-list-table {
    overflow: hidden;
    border: 1px solid var(--sky-200);
    border-radius: 14px;
}

.barcode-list-row {
    display: grid;
    grid-template-columns: 54px 90px minmax(220px, 1.4fr) minmax(130px, .7fr) 170px 110px minmax(160px, .9fr);
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--sky-100);
}

.barcode-list-row:last-child {
    border-bottom: 0;
}

.barcode-list-head {
    min-height: 48px;
    background: var(--sky-100);
    color: var(--text-700);
    font-size: 13px;
    font-weight: 800;
}

.barcode-list-no {
    color: var(--text-500);
    font-weight: 700;
}

.barcode-list-item {
    font-weight: 800;
}

.barcode-code-text {
    color: var(--blue-800);
    font-size: 13px;
    font-weight: 700;
}

.barcode-list-empty {
    padding: 60px 16px;
    color: var(--text-500);
    text-align: center;
}

.barcode-link-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.barcode-link-status.linked {
    background: var(--sky-100);
    color: var(--blue-800);
}

.barcode-link-status.pending {
    background: #fff3d8;
    color: #956000;
}

.barcode-linked-inventory {
    color: var(--text-500);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.barcode-row-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.barcode-row-actions .pill {
    min-height: 34px;
    padding: 7px 12px;
    white-space: nowrap;
}

.barcode-print-modal-panel {
    width: min(620px, calc(100vw - 32px));
}

.barcode-print-product {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--sky-200);
    border-radius: 14px;
    background: var(--sky-50);
}

.barcode-print-product strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.barcode-print-product span {
    color: var(--text-500);
    font-size: 13px;
}

.barcode-print-product code {
    grid-column: 1 / -1;
    color: var(--blue-800);
    font-weight: 800;
}

.barcode-print-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.barcode-print-options label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-700);
    font-size: 13px;
    font-weight: 800;
}

.barcode-print-guide {
    margin: 12px 0 0;
    color: var(--text-500);
    font-size: 12px;
}

.barcode-create-modal-panel {
    width: min(760px, calc(100vw - 32px));
}

.barcode-link-modal-panel {
    width: min(860px, calc(100vw - 32px));
}

.barcode-create-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.barcode-create-fields label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-700);
    font-size: 13px;
    font-weight: 800;
}

.barcode-form-error {
    min-height: 20px;
    margin: 10px 0 0;
    color: #d33a2c;
    font-size: 13px;
    font-weight: 700;
}

.barcode-link-search {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.barcode-link-search input {
    flex: 1;
    min-width: 0;
}

.barcode-link-results {
    max-height: 390px;
    margin-top: 12px;
    overflow: auto;
    border: 1px solid var(--sky-200);
    border-radius: 14px;
}

.barcode-link-result-row {
    display: grid;
    grid-template-columns: 28px minmax(120px, .7fr) minmax(240px, 1.5fr) 170px;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--sky-100);
    cursor: pointer;
}

.barcode-link-result-row:last-child {
    border-bottom: 0;
}

.barcode-link-result-row:has(input:checked) {
    background: var(--sky-50);
}

.barcode-link-result-row.unavailable {
    color: var(--text-500);
    cursor: not-allowed;
    opacity: .72;
}

.barcode-link-result-row small {
    color: var(--text-500);
    text-align: right;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pop {
    from { transform: translateY(6px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@media (max-width: 900px) {
    .barcode-page-search {
        grid-template-columns: 1fr auto;
    }

    .barcode-page-search label {
        grid-column: 1 / -1;
    }

    .barcode-list-table {
        overflow-x: auto;
    }

    .barcode-list-row {
        min-width: 1100px;
    }

    .barcode-create-fields {
        grid-template-columns: 1fr;
    }

    .barcode-print-options {
        grid-template-columns: 1fr;
    }

    .barcode-link-result-row {
        grid-template-columns: 28px 1fr;
    }

    .barcode-link-result-row small {
        grid-column: 2;
        text-align: left;
    }

    .inventory-barcode-modal-panel {
        width: calc(100vw - 24px);
    }

    .inventory-barcode-result-row {
        grid-template-columns: 28px 1fr;
    }

    .inventory-barcode-result-row code {
        grid-column: 2;
    }

    .inventory-barcode-options {
        grid-template-columns: 1fr;
    }

    .inbound-photo-grid {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }

    .catalog-controls {
        grid-template-columns: 1fr;
    }

    .app-shell {
        grid-template-columns: 70px 1fr;
    }
    .sidebar .brand-text,
    .nav-item > span:not(.nav-icon) {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding-right: 8px;
        padding-left: 8px;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .topbar-right {
        align-self: flex-end;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .retail-inbound-grid {
        grid-template-columns: 1fr;
    }
}

.orders-sticky-head {
    position: fixed;
    top: 72px;
    z-index: 30;
    display: none;
    pointer-events: none;
}

.orders-sticky-head.show {
    display: block;
}

.orders-sticky-inner {
    pointer-events: auto;
}

/* 품절·재입고 관리 (1단계 작업 대기열) */
.availability-page-header {
    align-items: flex-end;
}

.availability-phase-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 18px;
    border: 1px solid #f1d595;
    border-radius: 16px;
    background: #fff9e9;
    color: #70551b;
}

/* 판매처별 상품명 생성 */
.product-name-page-header {
    align-items: flex-end;
}

.product-name-ai-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 18px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: linear-gradient(135deg, #eff6ff, #fff);
}

.product-name-ai-notice.fallback {
    border-color: #f1d595;
    background: linear-gradient(135deg, #fffbeb, #fff);
}

.product-name-ai-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: var(--blue-800);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.product-name-ai-notice.fallback .product-name-ai-icon {
    background: #b7791f;
}

.product-name-ai-notice p {
    margin: 3px 0 0;
    color: var(--text-500);
    font-size: 13px;
}

.product-name-account-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
}

.product-name-account-label {
    display: flex;
    align-items: center;
    gap: 18px;
}

.product-name-account-label > strong {
    flex: 0 0 58px;
}

.product-name-account-label .mall-product-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.product-name-account-label .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.product-name-account-label .pill small {
    color: var(--text-500);
    font-weight: 500;
}

.product-name-account-label .pill.active {
    background: var(--blue-800);
    border-color: var(--blue-800);
    color: #fff;
}

.product-name-account-label .pill.active small {
    color: #dbeafe;
}

.product-name-mall-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.product-name-mall-logo {
    width: 76px;
    max-height: 28px;
    object-fit: contain;
}

.product-name-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 220px 180px auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 14px;
}

.product-name-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-700);
    font-size: 13px;
    font-weight: 700;
}

.product-name-filters input,
.product-name-filters select,
.product-name-final {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-900);
    font: inherit;
}

.product-name-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 220px));
    gap: 12px;
    margin-bottom: 14px;
}

.product-name-summary .summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

.product-name-summary .summary-card span {
    color: var(--text-500);
    font-size: 13px;
}

.product-name-summary .summary-card strong {
    color: var(--blue-900);
    font-size: 20px;
}

.product-name-summary .summary-card.pending {
    background: #eef6ff;
}

.product-name-summary .summary-card.matched {
    background: #effbf5;
}

.product-name-card {
    padding: 18px;
}

.product-name-toolbar .actions {
    align-items: center;
    flex-wrap: wrap;
}

.product-name-select-all {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-700);
    font-size: 13px;
    font-weight: 700;
}

.product-name-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-name-row {
    display: grid;
    grid-template-columns: 56px 78px minmax(210px, .8fr) minmax(430px, 1.8fr) 130px;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--blue-700);
    border-radius: 14px;
    background: #fff;
}

.product-name-select-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.product-name-thumb {
    width: 72px;
    height: 72px;
}

.product-name-source {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.product-name-source > span,
.product-name-source > small,
.product-name-state > small {
    color: var(--text-500);
    font-size: 12px;
}

.product-name-source > strong {
    line-height: 1.4;
}

.product-name-source p {
    display: -webkit-box;
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--text-700);
    font-size: 12px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-name-registration {
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.product-name-registration.unregistered {
    background: #fff7ed;
    color: #c2410c;
}

.product-name-registration.registered {
    background: #ecfdf5;
    color: #047857;
}

.product-name-editor {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
}

.product-name-candidates {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.product-name-candidate {
    display: flex;
    min-width: 0;
    min-height: 58px;
    align-items: flex-start;
    gap: 7px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fbff;
    color: var(--text-700);
    cursor: pointer;
    text-align: left;
}

.product-name-candidate:hover,
.product-name-candidate.selected {
    border-color: var(--blue-700);
    background: var(--sky-100);
    color: var(--blue-900);
}

.product-name-candidate b {
    display: grid;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: var(--blue-800);
    font-size: 11px;
}

.product-name-candidate span {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.product-name-empty-candidates {
    grid-column: 1 / -1;
    padding: 15px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--text-500);
    font-size: 12px;
    text-align: center;
}

.product-name-final-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--text-700);
    font-size: 12px;
    font-weight: 700;
}

.product-name-final-label > span {
    display: flex;
    justify-content: space-between;
}

.product-name-length {
    color: var(--text-500);
    font-weight: 500;
}

.product-name-final:focus {
    outline: 2px solid rgba(21, 81, 180, .18);
    border-color: var(--blue-700);
}

.product-name-state {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
}

.product-name-state .product-name-status {
    align-self: flex-start;
}

@media (max-width: 1280px) {
    .product-name-row {
        grid-template-columns: 50px 72px minmax(180px, .8fr) minmax(360px, 1.5fr);
    }
    .product-name-state {
        grid-column: 3 / -1;
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 900px) {
    .product-name-filters {
        grid-template-columns: 1fr;
    }
    .product-name-summary {
        grid-template-columns: repeat(3, 1fr);
    }
    .product-name-row {
        grid-template-columns: 42px 72px 1fr;
    }
    .product-name-editor,
    .product-name-state {
        grid-column: 1 / -1;
    }
    .product-name-candidates {
        grid-template-columns: 1fr;
    }
}

.availability-phase-notice strong {
    flex: 0 0 auto;
}

.availability-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.availability-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    color: var(--text-700);
    text-decoration: none;
}

.availability-summary strong {
    font-size: 24px;
    color: var(--navy);
}

.availability-summary.active {
    border-color: #1a55b4;
    box-shadow: 0 0 0 2px rgba(26, 85, 180, 0.12);
}

.availability-summary.restock {
    background: #eefbf5;
}

.availability-summary.soldout {
    background: #fff8ea;
}

.availability-summary.completed {
    background: #fffdf5;
}

.availability-summary.resume {
    background: #eef5ff;
}

.availability-filter-card {
    margin-bottom: 14px;
}

.availability-filters {
    display: grid;
    grid-template-columns: 230px minmax(280px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.availability-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
}

.availability-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.availability-task {
    overflow: hidden;
    border: 1px solid var(--border);
    border-left: 5px solid #8ea9cc;
    border-radius: 16px;
    background: #fff;
}

.availability-task.status-restock_ready {
    border-left-color: #23a56d;
    background: #fbfffd;
}

.availability-task.status-soldout_pending,
.availability-task.status-soldout_completed {
    border-left-color: #d8a13b;
}

.availability-task-main {
    display: grid;
    grid-template-columns: 145px minmax(200px, 1fr) minmax(260px, 1.45fr) 140px 170px;
    gap: 14px;
    align-items: center;
    padding: 18px;
}

.availability-task-main > div {
    min-width: 0;
}

.availability-status-cell,
.availability-inventory-cell,
.availability-mall-cell,
.availability-stock-cell,
.availability-time-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.availability-status {
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf2f8;
    color: #4c6077;
    font-size: 13px;
    font-weight: 800;
}

.availability-status.soldout-pending,
.availability-status.soldout-completed {
    background: #fff0c9;
    color: #8a5d00;
}

.availability-status.restock-ready {
    background: #dff7ea;
    color: #13744a;
}

.availability-status.resume-pending,
.availability-status.resume-completed {
    background: #e4efff;
    color: #174e9e;
}

.availability-task-main span,
.availability-task-main small,
.availability-task-main em {
    color: var(--text-500);
    font-size: 12px;
    font-style: normal;
}

.availability-task-main strong,
.availability-task-main code {
    overflow-wrap: anywhere;
}

.availability-stock-cell strong {
    color: var(--navy);
    font-size: 20px;
}

.availability-mall-cell code {
    color: #1b55a5;
}

.availability-task-main .availability-mall-identity {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
}

.availability-mall-logo {
    display: block;
    width: auto;
    max-width: 112px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
}

.availability-task-main .availability-mall-name {
    color: var(--text-700);
    font-size: 13px;
    font-weight: 800;
}

.availability-task-main .availability-mall-account {
    color: var(--text-500);
    font-size: 12px;
}

.availability-mall-account::before {
    content: "·";
    margin-right: 6px;
    color: var(--text-500);
}

.availability-members {
    margin: 0 18px 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--sky-50);
}

.availability-members summary {
    cursor: pointer;
    color: var(--text-700);
    font-weight: 700;
}

.availability-members > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.availability-members span {
    padding: 6px 9px;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
}

.availability-task-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: rgba(240, 247, 255, 0.5);
}

.availability-note {
    min-width: 0;
    color: var(--text-500);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.availability-note {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.availability-automation-message {
    font-size: 12px;
}

.availability-automation-message.running {
    color: #174e9e;
}

.availability-automation-message.failed {
    color: #c33838;
}

.availability-automation-message.succeeded {
    color: #13744a;
}

.availability-task-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.availability-force-release {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.availability-force-release label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--text-500);
    font-size: 11px;
    font-weight: 700;
}

.availability-force-release input {
    width: 88px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-900);
    font-size: 13px;
}

.availability-force-release .availability-force-reason-field input {
    width: 230px;
}

.availability-automation-guide {
    margin-bottom: 16px;
    padding: 18px 20px 20px;
}

.availability-automation-guide-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.availability-automation-guide-head h2 {
    margin: 2px 0 0;
    font-size: 19px;
}

.availability-automation-guide-head > span {
    color: var(--text-500);
    font-size: 13px;
}

.availability-automation-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.availability-automation-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}

.availability-automation-table th,
.availability-automation-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.availability-automation-table th {
    background: var(--sky-50);
    color: var(--text-700);
    font-size: 12px;
    white-space: nowrap;
}

.availability-automation-table tbody tr:last-child td {
    border-bottom: 0;
}

.availability-automation-table td:nth-child(1),
.availability-automation-table td:nth-child(4) {
    font-weight: 800;
    white-space: nowrap;
}

.availability-automation-table th:nth-child(4),
.availability-automation-table td:nth-child(4),
.availability-automation-table .availability-right-divider {
    border-left: 3px solid var(--border);
}

.availability-automation-table .availability-mall-name {
    font-weight: 800;
    white-space: nowrap;
}

.availability-automation-group-head th {
    padding: 11px 12px;
    text-align: center;
    font-size: 14px;
}

.availability-automation-group-head .api-group {
    background: #e7f7ef;
    color: #08794e;
}

.availability-automation-group-head .browser-group {
    border-left: 3px solid var(--border);
    background: #eef4ff;
    color: #174f9f;
}

.availability-automation-table .availability-empty-cell {
    background: var(--sky-50);
    color: var(--text-500);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.availability-method {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.availability-method.api {
    background: #e7f7ef;
    color: #08794e;
}

.availability-method.browser {
    background: #eef4ff;
    color: #174f9f;
}

.availability-method.auth {
    background: #fff2d7;
    color: #9a5a00;
}

.availability-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 46px 20px;
    color: var(--text-500);
}

.availability-loading {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 35, 71, 0.45);
}

.availability-loading.show {
    display: flex;
}

.availability-loading > div {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-radius: 16px;
    background: #fff;
}

.availability-elapsed {
    color: var(--text-500);
    font-weight: 800;
    white-space: nowrap;
}

.availability-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #d6e6f8;
    border-top-color: #174f9f;
    border-radius: 50%;
    animation: availability-spin 0.8s linear infinite;
}

@keyframes availability-spin {
    to { transform: rotate(360deg); }
}

.kidkids-option-modal {
    width: min(980px, calc(100vw - 48px));
    max-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
}

.kidkids-option-search {
    width: 100%;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f5fbff;
    font-size: 15px;
}

.kidkids-option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(560px, 58vh);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbff;
}

.kidkids-option-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7e8fb;
    border-radius: 12px;
    background: #fff;
    color: var(--text-900);
    text-align: left;
    cursor: pointer;
}

.kidkids-option-row:hover,
.kidkids-option-row.active {
    border-color: #174f9f;
    background: #eaf5ff;
}

.kidkids-option-row span {
    color: #42617e;
    font-weight: 800;
}

.kidkids-option-row strong {
    font-size: 15px;
    line-height: 1.45;
}

.kidkids-option-empty {
    padding: 28px;
    text-align: center;
    color: var(--text-500);
}

.inventory-availability-request-panel {
    width: min(980px, calc(100vw - 48px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.availability-request-guide {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #f1d595;
    border-radius: 12px;
    background: #fff9e9;
    color: #70551b;
}

.availability-request-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--sky-50);
}

.availability-request-toolbar label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.availability-request-toolbar input {
    width: auto;
}

.availability-request-toolbar .availability-select-all {
    margin-left: 8px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
    color: var(--navy);
}

.availability-request-toolbar span {
    margin-left: auto;
    color: var(--navy);
    font-weight: 800;
}

.availability-candidate-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 390px;
    overflow-y: auto;
}

.availability-candidate {
    display: grid;
    grid-template-columns: 24px 82px minmax(150px, 0.65fr) minmax(260px, 1.35fr) auto;
    gap: 10px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.availability-candidate.filtered-out {
    display: none;
}

.availability-candidate.has-existing-task {
    background: #f4f7fa;
    cursor: default;
}

.availability-candidate.is-blocked {
    background: #fff8ea;
    cursor: default;
}

.availability-candidate input {
    width: auto;
}

.availability-candidate-type {
    padding: 5px 8px;
    border-radius: 999px;
    background: #e8f1ff;
    color: #1551a0;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}

.availability-candidate-type.wholesale {
    background: #e8f0ff;
}

.availability-candidate-type.retail {
    background: #e8f8ee;
    color: #197149;
}

.availability-candidate-mall,
.availability-candidate-product {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.availability-candidate-mall-identity {
    display: flex;
    min-height: 28px;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.availability-candidate-mall-logo {
    display: block;
    width: auto;
    max-width: 105px;
    height: 27px;
    object-fit: contain;
    border-radius: 5px;
}

.availability-candidate-mall-name {
    color: var(--text-800);
    font-size: 14px;
    font-weight: 800;
}

.availability-candidate-account {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 7px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #f8fbff;
    color: #154d91;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.availability-candidate-mall small,
.availability-candidate-product code,
.availability-candidate-product em {
    color: var(--text-500);
    font-size: 11px;
    font-style: normal;
    overflow-wrap: anywhere;
}

.availability-candidate-existing {
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff0c9;
    color: #8a5d00;
    font-size: 12px;
    font-weight: 800;
}

.availability-candidate-existing.blocked {
    max-width: 360px;
    border-radius: 10px;
    background: #fff2f0;
    color: #c02b20;
    white-space: normal;
}

.availability-candidate-empty {
    padding: 34px 16px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-500);
    text-align: center;
}

.availability-request-note {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    font-weight: 700;
}

.availability-request-success {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
    color: #0f2a44;
}

.availability-request-success[hidden] {
    display: none;
}

.availability-request-success strong {
    color: #0b4ea2;
}

.availability-request-success span {
    color: #58708a;
    font-size: 13px;
}

.availability-request-success div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.availability-request-success .availability-batch-progress {
    display: grid;
    gap: 6px;
    justify-content: stretch;
}

.availability-request-success .availability-batch-item {
    display: grid;
    grid-template-columns: minmax(140px, 0.7fr) minmax(220px, 1.3fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.72);
}

.availability-request-success .availability-batch-item strong {
    color: var(--text-800);
    font-size: 13px;
}

.availability-request-success .availability-batch-item.status-running {
    background: #fff8e6;
}

.availability-request-success .availability-batch-item.status-completed {
    background: #eaf8ef;
}

.availability-request-success .availability-batch-item.status-completed span {
    color: #167247;
    font-weight: 800;
}

.availability-request-success .availability-batch-item.status-failed,
.availability-request-success .availability-batch-item.status-manual {
    background: #fff0f0;
}

.availability-request-success .availability-batch-item.status-failed span,
.availability-request-success .availability-batch-item.status-manual span {
    color: #c62828;
    font-weight: 800;
}

#inventoryBatchCaptchaImage {
    display: block;
    max-width: 100%;
    max-height: 260px;
    margin: 16px auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    object-fit: contain;
}

@media (max-width: 1200px) {
    .availability-task-main {
        grid-template-columns: 130px 1fr 1.2fr 120px;
    }
    .availability-time-cell {
        grid-column: 2 / -1;
        flex-direction: row;
    }
}

@media (max-width: 800px) {
    .availability-summary-grid,
    .availability-filters {
        grid-template-columns: 1fr;
    }
    .availability-task-main {
        grid-template-columns: 1fr;
    }
    .availability-time-cell {
        grid-column: auto;
    }
    .availability-task-footer,
    .availability-phase-notice {
        align-items: flex-start;
        flex-direction: column;
    }
    .availability-force-release,
    .availability-task-actions {
        justify-content: flex-start;
    }
    .availability-force-release .availability-force-reason-field input {
        width: min(230px, 72vw);
    }
    .availability-candidate {
        grid-template-columns: 24px 78px 1fr;
    }
    .availability-candidate-product,
    .availability-candidate-existing {
        grid-column: 3;
    }
}

/* 모든 화면의 쇼핑몰 로고 모서리를 동일하게 부드럽게 처리 */
img[src*="/images/mall-logos/"] {
    border-radius: 7px;
    clip-path: inset(0 round 7px);
}

/* 위탁상품/발주관리 */
.consignment-page-header { align-items: flex-end; }
.consignment-page-header .page-actions { display: flex; align-items: center; gap: 8px; }
.consignment-safety-notice {
    display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 14px 18px;
    border: 1px solid #bdd9fb; border-radius: 16px; background: #eef7ff; color: var(--text-700);
}
.consignment-safety-notice p { margin: 3px 0 0; font-size: 13px; color: var(--text-500); }
.consignment-safety-icon {
    flex: 0 0 auto; padding: 8px 10px; border-radius: 10px; background: #1551b4; color: #fff;
    font-size: 12px; font-weight: 800;
}
.consignment-stock-sync-status {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px 16px;
    margin: 0 0 14px; padding: 12px 16px; border: 1px solid #c9dbef; border-radius: 14px;
    background: #fff; color: var(--text-700);
}
.consignment-stock-sync-status[hidden] { display: none; }
.consignment-stock-sync-status strong { color: #1551b4; }
.consignment-stock-sync-status span { font-size: 13px; }
.consignment-stock-sync-status small { color: var(--text-500); text-align: right; }
.consignment-stock-sync-memo { margin: 0 0 14px; padding: 14px 16px; }
.consignment-stock-sync-memo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.consignment-stock-sync-memo-head p { margin: 3px 0 0; color: var(--text-500); font-size: 12px; }
.consignment-schedule-badge { padding: 6px 10px; border-radius: 999px; background: #e9f2ff; color: #1551b4; font-size: 12px; font-weight: 700; }
.consignment-stock-sync-memo-list { display: grid; gap: 7px; }
.consignment-stock-sync-memo-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid #d9e6f7; border-left: 4px solid #8ca8cc; border-radius: 9px; background: #f8fbff; }
.consignment-stock-sync-memo-item.status-completed { border-left-color: #18a66a; }
.consignment-stock-sync-memo-item.status-partial,
.consignment-stock-sync-memo-item.status-failed { border-left-color: #dc5b50; }
.consignment-stock-sync-memo-item.status-collecting,
.consignment-stock-sync-memo-item.status-queued,
.consignment-stock-sync-memo-item.status-running { border-left-color: #2878d0; }
.consignment-stock-sync-memo-item > div { display: flex; align-items: center; min-width: 0; gap: 9px; }
.consignment-stock-sync-memo-item strong { flex: 0 0 auto; color: #1551b4; font-size: 12px; }
.consignment-stock-sync-memo-item time { flex: 0 0 auto; color: var(--text-500); font-size: 12px; }
.consignment-stock-sync-memo-item span { overflow: hidden; color: var(--text-700); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.consignment-stock-sync-memo-item small { color: var(--text-500); font-size: 12px; white-space: nowrap; }
.consignment-summary { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.consignment-summary .summary-card.active { outline: 2px solid #1551b4; outline-offset: -2px; }
.consignment-filters {
    display: flex; align-items: flex-end; gap: 12px; padding: 14px 18px; margin-bottom: 14px;
}
.consignment-filters > label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--text-700); }
.consignment-filters > label:first-child { flex: 1; }
.consignment-filters input, .consignment-filters select {
    min-width: 210px; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 11px; background: #f8fbff;
}
.consignment-card .table-head > div:first-child { display: flex; flex-direction: column; gap: 5px; }
.consignment-card .hint { display: flex; align-items: center; gap: 5px; }
.consignment-table-actions, .consignment-table-actions form { display: flex; align-items: center; gap: 8px; }
.consignment-table-actions select { height: 40px; min-width: 220px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.consignment-mall-logo { width: 43px; height: 20px; object-fit: contain; }
.consignment-table-scroll { overflow-x: auto; }
.consignment-table { min-width: 1280px; display: flex; flex-direction: column; gap: 8px; }
.consignment-row {
    display: grid; grid-template-columns: 84px minmax(200px, 1.2fr) minmax(180px, 1.05fr) 145px 120px minmax(330px, 1.8fr) 80px;
    gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #fafdff;
}
.consignment-row.head { min-height: 46px; padding-top: 8px; padding-bottom: 8px; background: #e8f4ff; font-weight: 800; text-align: center; }
.consignment-row.archived { opacity: .64; background: #f4f6f9; }
.consignment-image { position: relative; width: 72px; height: 72px; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; display: grid; place-items: center; }
.consignment-image .consignment-select { position: absolute; z-index: 2; top: 5px; left: 5px; width: 17px; height: 17px; accent-color: #1551b4; }
.consignment-image img { width: 100%; height: 100%; object-fit: contain; }
.consignment-image span { color: var(--text-400); font-size: 11px; }
.consignment-product-cell, .consignment-supplier-cell, .consignment-price-cell, .consignment-stock-cell, .consignment-channel-cell {
    min-width: 0; display: flex; flex-direction: column; gap: 4px;
}
.consignment-product-cell > small { color: #1551b4; font-weight: 800; }
.consignment-product-cell > span { font-size: 12px; color: var(--text-500); }
.consignment-product-cell > strong { line-height: 1.4; overflow-wrap: anywhere; }
.consignment-product-cell em, .consignment-price-cell em { color: #1265a8; font-size: 12px; font-style: normal; }
.consignment-product-cell p { margin: 2px 0 0; font-size: 11px; color: var(--text-500); }
.consignment-option-summary { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 5px; margin-top: 2px; font-size: 11px; }
.consignment-option-summary details { flex: 1 0 100%; }
.consignment-option-summary summary { width: fit-content; color: #1551b4; font-weight: 700; cursor: pointer; }
.consignment-option-summary details > span { display: block; margin-top: 3px; padding-left: 8px; color: var(--text-500); overflow-wrap: anywhere; }
.consignment-supplier-cell span, .consignment-price-cell span, .consignment-stock-cell small { font-size: 12px; color: var(--text-500); overflow-wrap: anywhere; }
.consignment-supplier-cell a { font-size: 12px; color: #1551b4; font-weight: 700; }
.consignment-stock { align-self: flex-start; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.consignment-stock.available { background: #e2f7ec; color: #087d48; }
.consignment-stock.check { background: #fff4d9; color: #a15f00; }
.consignment-stock.soldout { background: #ffe7e5; color: #b52b27; }
.consignment-channel-summary { font-size: 11px; color: var(--text-500); font-weight: 800; }
.consignment-channel-list { display: flex; flex-direction: column; gap: 7px; }
.consignment-channel-item { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 8px 76px 8px 9px; border: 1px solid #d5e5f6; border-radius: 10px; background: #fff; }
.consignment-channel-item > .listing-status-badge { position: absolute; top: 8px; right: 8px; }
.consignment-channel-item > strong { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.consignment-channel-item > small, .consignment-channel-account small { font-size: 11px; color: var(--text-500); }
.consignment-listing-sync { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 11px; font-weight: 800; color: var(--text-600); cursor: pointer; }
.consignment-listing-sync input { accent-color: var(--primary); }
.consignment-channel-account { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; }
.consignment-channel-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consignment-channel-empty { padding: 12px; border: 1px dashed #bfd2e7; border-radius: 10px; text-align: center; color: var(--text-400); font-size: 12px; }
.consignment-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.consignment-actions form, .consignment-actions button { width: 100%; }

#consignmentModal, #consignmentOptionModal {
    position: fixed; inset: 0; z-index: 2400; width: auto; max-width: none; padding: 24px;
    display: none; align-items: center; justify-content: center; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
#consignmentModal.show, #consignmentOptionModal.show { display: flex; }
#consignmentModal .modal-backdrop, #consignmentOptionModal .modal-backdrop { display: block; position: absolute; z-index: 0; }
.consignment-modal-panel {
    position: relative; z-index: 1; width: min(1050px, calc(100vw - 48px)); max-height: calc(100vh - 48px);
    overflow-y: auto; padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: #fff;
    box-shadow: 0 24px 80px rgba(6, 28, 70, .28);
}
.consignment-modal-panel .modal-head h2 { margin: 0; }
.consignment-modal-panel .icon-button { border: 0; background: transparent; font-size: 30px; color: var(--text-500); cursor: pointer; }
.consignment-option-modal-panel {
    position: relative; z-index: 1; width: min(1180px, calc(100vw - 48px)); max-height: calc(100vh - 48px);
    overflow-y: auto; padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: #fff;
    box-shadow: 0 24px 80px rgba(6, 28, 70, .28);
}
.consignment-option-modal-panel .modal-head h2 { margin: 0; max-width: 900px; overflow-wrap: anywhere; }
.consignment-option-modal-panel .icon-button { border: 0; background: transparent; font-size: 30px; color: var(--text-500); cursor: pointer; }
.consignment-option-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin: 14px 0 10px; }
.consignment-option-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.consignment-option-table { width: 100%; min-width: 1180px; border-collapse: collapse; }
.consignment-option-table th { padding: 10px 8px; background: #e8f4ff; color: var(--text-700); font-size: 12px; }
.consignment-option-table td { padding: 7px; border-top: 1px solid var(--border); }
.consignment-option-table td:first-child { min-width: 260px; }
.consignment-option-table input, .consignment-option-table select { width: 100%; min-width: 90px; height: 38px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.consignment-option-table .option-label { min-width: 250px; }
.consignment-option-table .option-channel-links { min-width: 250px; }
.option-channel-link { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.option-channel-link:last-child { margin-bottom: 0; }
.option-channel-link > span, .consignment-option-table .option-channel-links > small { font-size: 10px; color: var(--text-500); }
.option-channel-link .option-channel-sync { display: inline-flex; align-items: center; gap: 4px; color: var(--text-700); }
.option-channel-link .option-channel-sync input { width: 14px; height: 14px; margin: 0; }
.consignment-option-table-wrap > .empty { padding: 28px; }
.consignment-form-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.consignment-form-section h3 { margin: 0 0 10px; font-size: 15px; color: var(--text-900); }
.consignment-form-section.highlight { margin-left: -10px; margin-right: -10px; padding: 14px 10px 10px; border: 1px solid #bfdcff; border-radius: 14px; background: #f2f8ff; }
.consignment-channel-form-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.consignment-channel-form-head h3 { margin-bottom: 3px; }
.consignment-channel-form-head p { margin: 0; color: var(--text-500); font-size: 12px; }
.consignment-channel-form-list { display: flex; flex-direction: column; gap: 10px; }
.consignment-channel-form-row { padding: 12px; border: 1px solid #c8dbf0; border-radius: 12px; background: #fff; }
.consignment-channel-form-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: var(--text-700); font-size: 13px; }
.consignment-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.consignment-form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.consignment-form-grid label, .consignment-memo { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 800; color: var(--text-700); }
.consignment-form-grid label.wide { grid-column: 1 / -1; }
.consignment-form-grid input, .consignment-form-grid select, .consignment-memo textarea {
    width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font: inherit; font-weight: 500;
}
.consignment-memo { margin-top: 14px; }
body.modal-open { overflow: hidden; }

.consignment-match-picker { width: min(820px, calc(100vw - 40px)); max-width: 820px; max-height: calc(100vh - 60px); overflow: hidden; }
.consignment-match-picker .match-toolbar { margin: 12px 0; }
.consignment-match-picker .match-toolbar input { flex: 1; min-width: 240px; }
.consignment-match-results { display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.consignment-match-candidate { display: grid; grid-template-columns: 64px minmax(0, 1fr) 150px; gap: 12px; align-items: center; width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.consignment-match-candidate:hover { border-color: #1551b4; background: #f2f8ff; }
.consignment-match-thumb { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #f7faff; }
.consignment-match-thumb img { width: 100%; height: 100%; object-fit: contain; }
.consignment-match-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.consignment-match-info small { color: var(--text-500); }
.consignment-match-info strong { overflow-wrap: anywhere; }
.consignment-match-info em { color: #1265a8; font-size: 12px; font-style: normal; }
.consignment-match-price { display: flex; flex-direction: column; gap: 4px; text-align: right; font-size: 12px; font-weight: 800; }
.consignment-match-price small { color: var(--text-500); font-weight: 600; }

@media (max-width: 900px) {
    .consignment-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .consignment-stock-sync-memo-head,
    .consignment-stock-sync-memo-item { align-items: flex-start; flex-direction: column; }
    .consignment-stock-sync-memo-item { display: flex; }
    .consignment-stock-sync-memo-item > div { align-items: flex-start; flex-wrap: wrap; }
    .consignment-stock-sync-memo-item span { width: 100%; white-space: normal; }
    .consignment-stock-sync-memo-item small { white-space: normal; }
    .consignment-filters { align-items: stretch; flex-direction: column; }
    .consignment-filters input, .consignment-filters select { width: 100%; min-width: 0; }
    .consignment-table-actions, .consignment-table-actions form { align-items: stretch; flex-direction: column; }
    .consignment-form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
