* { box-sizing: border-box; margin: 0; padding: 0; }
        body { font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif; background: #f5f6f8; min-height: 100vh; }

        /* ===== 스플래시 ===== */
        #splash {
            position: fixed; inset: 0; z-index: 9000;
            background: #fff;
            display: flex; flex-direction: column;
            align-items: center; justify-content: center; gap: 20px;
            transition: opacity 0.4s ease;
        }
        #splash.hide { opacity: 0; pointer-events: none; }
        .splash-logo {
            font-size: 36px; font-weight: 900; color: #111; letter-spacing: -1px;
        }
        .splash-logo span { color: #c9a84c; }
        .splash-bar-wrap {
            width: 160px; height: 3px; background: #f0f0f0; border-radius: 10px; overflow: hidden;
        }
        .splash-bar {
            height: 100%; width: 0%; background: #c9a84c; border-radius: 10px;
            animation: splash-fill 1.2s ease forwards;
        }
        @keyframes splash-fill {
            0%   { width: 0%; }
            60%  { width: 75%; }
            100% { width: 100%; }
        }
        .splash-text { font-size: 13px; color: #aaa; }

        /* ===== 상단 네비바 ===== */
        .topnav {
            position: sticky; top: 0; z-index: 200;
            background: #fff;
            border-bottom: 1px solid #e5e8eb;
            display: flex; align-items: center;
            padding: 0 20px;
            height: 56px;
            gap: 0;
        }
        .topnav-logo {
            font-size: 20px; font-weight: 900; color: #111;
            letter-spacing: -0.5px; margin-right: 24px; cursor: pointer;
            flex-shrink: 0; text-decoration: none;
        }
        .topnav-logo span { color: #c9a84c; }
        .topnav-tabs {
            display: flex; align-items: center; gap: 0;
            flex: 1; overflow-x: auto; scrollbar-width: none;
        }
        .topnav-tabs::-webkit-scrollbar { display: none; }
        .nav-tab {
            position: relative; padding: 0 16px; height: 56px;
            display: flex; align-items: center; cursor: pointer;
            font-size: 14px; font-weight: 500; color: #888;
            white-space: nowrap; transition: color 0.18s;
            border: none; background: none; text-decoration: none;
        }
        .nav-tab:hover { color: #111; }
        .nav-tab.active { color: #c9a84c; font-weight: 700; }
        .nav-tab.active::after {
            content: ''; position: absolute; bottom: 0; left: 0; right: 0;
            height: 3px; background: #c9a84c; border-radius: 3px 3px 0 0;
        }
        .topnav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
        .btn-add-product {
            background: #c9a84c; color: white; border: none;
            padding: 7px 16px; border-radius: 20px;
            font-size: 13px; font-weight: 700; cursor: pointer;
            transition: background 0.15s; white-space: nowrap;
        }
        .btn-add-product:hover { background: #b8973d; }

        /* ===== 메인 영역 ===== */
        .main-wrap { max-width: 1400px; margin: 0 auto; padding: 24px 16px; }

        /* ===== 검색/필터 바 ===== */
        .filter-bar {
            background: #fff; border-radius: 12px; border: 1px solid #e5e8eb;
            padding: 16px; margin-bottom: 20px;
            display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
        }
        .filter-bar select, .filter-bar input {
            border: 1px solid #e0e0e0; border-radius: 8px;
            padding: 8px 12px; font-size: 14px; font-family: inherit;
            background: #fafafa; color: #333; outline: none;
            transition: border-color 0.15s;
        }
        .filter-bar select:focus, .filter-bar input:focus { border-color: #c9a84c; background: #fff; }
        .filter-bar input[type="text"] { flex: 1; min-width: 180px; }
        .filter-bar select { min-width: 120px; }
        .btn-search {
            background: #c9a84c; color: white; border: none;
            padding: 8px 20px; border-radius: 8px;
            font-size: 14px; font-weight: 700; cursor: pointer;
            transition: background 0.15s; font-family: inherit;
        }
        .btn-search:hover { background: #b8973d; }
        .btn-reset {
            background: transparent; color: #888; border: 1px solid #e0e0e0;
            padding: 8px 16px; border-radius: 8px;
            font-size: 13px; cursor: pointer; transition: 0.15s; font-family: inherit;
        }
        .btn-reset:hover { background: #f5f5f5; color: #333; }

        /* ===== 뷰 컨트롤 바 ===== */
        .view-control-bar {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
        }
        .result-count { font-size: 14px; color: #666; }
        .result-count strong { color: #111; font-weight: 700; }
        .view-toggle { display: flex; gap: 4px; }
        .btn-view {
            background: transparent; border: 1px solid #e0e0e0;
            padding: 6px 12px; border-radius: 6px; cursor: pointer;
            font-size: 13px; color: #888; transition: 0.15s; font-family: inherit;
            display: flex; align-items: center; gap: 4px;
        }
        .btn-view.active { background: #c9a84c; color: white; border-color: #c9a84c; }
        .btn-view:hover:not(.active) { background: #f5f5f5; color: #333; }

        /* ===== 카드 뷰 ===== */
        .card-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 16px;
        }
        .product-card {
            background: #fff; border-radius: 12px; border: 1px solid #e5e8eb;
            overflow: hidden; transition: box-shadow 0.2s, transform 0.2s;
            cursor: pointer; display: flex; flex-direction: column;
        }
        .product-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }
        .card-img-wrap {
            width: 100%; aspect-ratio: 4/3; background: #fff;
            overflow: hidden; position: relative;
            border-bottom: 1px solid #f0f0f0;
        }
        .card-img-wrap img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
        .card-no-img {
            width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
            font-size: 40px; color: #ccc;
        }
        .card-img-count {
            position: absolute; bottom: 8px; right: 8px;
            background: rgba(0,0,0,0.6); color: white;
            font-size: 11px; padding: 2px 7px; border-radius: 10px;
        }
        .card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
        .card-company { font-size: 11px; color: #c9a84c; font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
        .card-model { font-size: 15px; font-weight: 700; color: #111; margin-bottom: 8px; line-height: 1.3; }
        .card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
        .tag {
            font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 600;
        }
        .tag-karat-24k { background: #FFF4D1; color: #B8860B; border: 1px solid #F0D080; }
        .tag-karat-18k { background: #FFED99; color: #E67E22; border: 1px solid #F5C940; }
        .tag-karat-14k { background: #F9F5F0; color: #6B5C48; border: 1px solid #DDD0BE; }
        .tag-weight { background: #EBF2FF; color: #2E5BFF; border: 1px solid #B8D0FF; }
        .tag-type { background: #F3E8FF; color: #7D3CFF; border: 1px solid #C8A8FF; }
        .card-price { font-size: 16px; font-weight: 900; color: #111; }
        .card-price span { font-size: 12px; font-weight: 400; color: #888; margin-left: 2px; }
        .card-memo { font-size: 12px; color: #888; margin-top: 6px; line-height: 1.5; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .card-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
        .btn-card-edit, .btn-card-delete {
            flex: 1; padding: 6px 0; border-radius: 6px; font-size: 12px; font-weight: 600;
            cursor: pointer; border: none; font-family: inherit; transition: 0.15s;
        }
        .btn-card-edit { background: #f5f6f8; color: #333; }
        .btn-card-edit:hover { background: #e8e9ec; }
        .btn-card-delete { background: #fff0f0; color: #e74c3c; }
        .btn-card-delete:hover { background: #ffd5d5; }

        /* ===== 테이블 뷰 ===== */
        .table-wrap { background: #fff; border-radius: 12px; border: 1px solid #e5e8eb; overflow: hidden; }
        .product-table { width: 100%; border-collapse: collapse; }
        .product-table th {
            background: #fafafa; padding: 12px 14px;
            font-size: 12px; font-weight: 700; color: #888;
            text-align: left; border-bottom: 1px solid #e5e8eb;
            white-space: nowrap;
        }
        .product-table td {
            padding: 12px 14px; font-size: 13px; color: #333;
            border-bottom: 1px solid #f0f0f0; vertical-align: middle;
        }
        .product-table tr:last-child td { border-bottom: none; }
        .product-table tr:hover td { background: #fdfaf3; }
        .table-thumb {
            width: 64px; height: 48px; object-fit: contain; border-radius: 6px;
            background: #fff; border: 1px solid #f0f0f0;
        }
        .table-no-thumb {
            width: 48px; height: 48px; border-radius: 6px;
            background: #f0f0f0; display: flex; align-items: center; justify-content: center;
            font-size: 18px; color: #ccc;
        }
        .table-actions { display: flex; gap: 6px; }
        .btn-tbl { padding: 5px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; border: none; font-family: inherit; font-weight: 600; transition: 0.15s; }
        .btn-tbl-edit { background: #f5f6f8; color: #333; }
        .btn-tbl-edit:hover { background: #e8e9ec; }
        .btn-tbl-delete { background: #fff0f0; color: #e74c3c; }
        .btn-tbl-delete:hover { background: #ffd5d5; }
        .table-memo { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #888; font-size: 12px; }

        /* ===== 빈 상태 ===== */
        .empty-state {
            text-align: center; padding: 80px 20px; color: #aaa;
        }
        .empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; }
        .empty-state p { font-size: 15px; }

        /* ===== 모달 공통 ===== */
        .modal-bg {
            display: none; position: fixed; inset: 0;
            background: rgba(0,0,0,0.5); z-index: 1000;
            align-items: center; justify-content: center; padding: 16px;
        }
        .modal-bg.open { display: flex; }
        .modal {
            background: #fff; border-radius: 16px;
            width: 100%; max-width: 560px;
            max-height: 90vh; overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0,0,0,0.2);
        }
        .modal-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 20px 24px 16px; border-bottom: 1px solid #f0f0f0;
            position: sticky; top: 0; background: #fff; z-index: 1;
        }
        .modal-title { font-size: 17px; font-weight: 900; color: #111; }
        .btn-modal-close {
            background: none; border: none; font-size: 22px; color: #aaa;
            cursor: pointer; line-height: 1; padding: 0 4px;
        }
        .btn-modal-close:hover { color: #333; }
        .modal-body { padding: 20px 24px; }
        .form-row { margin-bottom: 16px; }
        .form-row label { display: block; font-size: 13px; font-weight: 700; color: #555; margin-bottom: 6px; }
        .form-row label .req { color: #e74c3c; margin-left: 2px; }
        .form-control {
            width: 100%; border: 1px solid #e0e0e0; border-radius: 8px;
            padding: 10px 12px; font-size: 14px; font-family: inherit;
            background: #fafafa; outline: none; transition: border-color 0.15s;
        }
        .form-control:focus { border-color: #c9a84c; background: #fff; }
        textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }
        .form-row-inline { display: flex; gap: 10px; }
        .form-row-inline .form-row { flex: 1; margin-bottom: 0; }
        .modal-footer {
            display: flex; gap: 8px; justify-content: flex-end;
            padding: 16px 24px 20px; border-top: 1px solid #f0f0f0;
        }
        .btn-cancel {
            background: #f5f6f8; color: #555; border: none;
            padding: 10px 20px; border-radius: 8px;
            font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
            transition: 0.15s;
        }
        .btn-cancel:hover { background: #e8e9ec; }
        .btn-submit {
            background: #c9a84c; color: white; border: none;
            padding: 10px 24px; border-radius: 8px;
            font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
            transition: background 0.15s;
        }
        .btn-submit:hover { background: #b8973d; }
        .btn-submit:disabled { background: #ddd; cursor: not-allowed; }

        /* ===== 기본공임 숫자 입력 화살표 제거 ===== */
        #input-price { -moz-appearance: textfield; }
        #input-price::-webkit-outer-spin-button,
        #input-price::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

        /* ===== 기본공임 입력 래퍼 ===== */
        .price-input-wrap {
            display: flex; align-items: center;
            border: 1px solid #e0e0e0; border-radius: 8px;
            background: #fafafa; overflow: hidden;
            transition: border-color 0.15s;
        }
        .price-input-wrap:focus-within { border-color: #c9a84c; background: #fff; }
        .price-input-wrap input {
            flex: 1; border: none; background: transparent;
            padding: 10px 12px; font-size: 14px; font-family: inherit;
            outline: none;
            -moz-appearance: textfield;
        }
        .price-input-wrap input::-webkit-outer-spin-button,
        .price-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .price-unit {
            padding: 0 12px 0 4px; font-size: 14px; color: #888; font-weight: 600;
            flex-shrink: 0;
        }

        /* ===== 이미지 업로드 영역 ===== */
        .img-upload-area {
            border: 2px dashed #e0e0e0; border-radius: 10px;
            padding: 10px 16px; text-align: center; cursor: pointer;
            transition: border-color 0.15s; background: #fafafa;
            display: flex; align-items: center; gap: 10px;
        }
        .img-upload-area:hover { border-color: #c9a84c; background: #fdfaf3; }
        .img-upload-area input { display: none; }
        .img-upload-area p { font-size: 13px; color: #aaa; margin: 0; }
        .img-upload-area .upload-icon { font-size: 20px; flex-shrink: 0; }
        .img-preview-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
        .img-preview-item {
            position: relative; width: 80px; height: 80px;
            border-radius: 8px; overflow: hidden;
            background: #fff; border: 1px solid #e0e0e0;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
        }
        .img-preview-item img { pointer-events: none; }
        .img-preview-item img { width: 100%; height: 100%; object-fit: contain; }
        .img-preview-item .img-del {
            position: absolute; top: 2px; right: 2px;
            background: rgba(0,0,0,0.6); color: white;
            width: 18px; height: 18px; border-radius: 50%;
            font-size: 10px; display: flex; align-items: center; justify-content: center;
            cursor: pointer; line-height: 1; z-index: 10;
        }
        .img-uploading { font-size: 12px; color: #c9a84c; margin-top: 6px; }

        /* ===== 썸네일 지정 ===== */
        .img-preview-item.is-thumb { outline: 3px solid #4caf50; outline-offset: 1px; }
        .img-thumb-badge {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: #4caf50; color: white;
            font-size: 10px; font-weight: 700; text-align: center;
            padding: 2px 0; letter-spacing: 0.5px;
        }
        .img-preview-item:not(.is-thumb):hover .img-set-thumb {
            opacity: 1;
        }
        .img-set-thumb {
            position: absolute; inset: 0;
            background: rgba(0,0,0,0); color: transparent;
            font-size: 10px; font-weight: 700; text-align: center;
            cursor: pointer; transition: background 0.15s, color 0.15s;
            display: flex; align-items: flex-end; justify-content: center;
            padding-bottom: 2px;
        }
        .img-preview-item:not(.is-thumb):hover .img-set-thumb {
            background: rgba(0,0,0,0.35); color: white;
        }

        /* ===== 업체 관리 모달 ===== */
        .company-list { list-style: none; }
        .company-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 10px 12px; border-radius: 8px; font-size: 14px;
            border: 1px solid #f0f0f0; margin-bottom: 6px; background: #fafafa;
        }
        .company-add-row { display: flex; gap: 8px; margin-top: 12px; }
        .company-add-row input { flex: 1; }

        /* ===== 상세 모달 ===== */
        .detail-imgs {
            display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
            margin-bottom: 16px; scrollbar-width: thin;
        }
        .detail-imgs img {
            width: 120px; height: 120px; object-fit: contain;
            background: #fff; border-radius: 8px; flex-shrink: 0; cursor: pointer;
            border: 1px solid #f0f0f0;
        }

        /* ===== 스켈레톤 로딩 ===== */
        @keyframes skeleton-shine {
            0% { background-position: -400px 0; }
            100% { background-position: 400px 0; }
        }
        .skeleton {
            background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
            background-size: 800px 100%;
            animation: skeleton-shine 1.4s infinite linear;
            border-radius: 6px;
        }
        .skeleton-card {
            background: #fff; border-radius: 12px; border: 1px solid #e5e8eb;
            overflow: hidden;
        }
        .skeleton-card .sk-img { height: 200px; }
        .skeleton-card .sk-body { padding: 14px; }
        .skeleton-card .sk-line { height: 14px; margin-bottom: 10px; }
        .skeleton-card .sk-line.short { width: 50%; }
        .skeleton-card .sk-line.medium { width: 75%; }

        /* ===== 로딩 오버레이 (등록/수정 버튼용) ===== */
        .btn-submit.loading {
            position: relative; color: transparent; pointer-events: none;
        }
        .btn-submit.loading::after {
            content: ''; position: absolute;
            width: 16px; height: 16px;
            top: 50%; left: 50%;
            margin: -8px 0 0 -8px;
            border: 2px solid rgba(255,255,255,0.4);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.7s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .detail-field { margin-bottom: 12px; }
        .detail-field label { font-size: 11px; font-weight: 700; color: #aaa; display: block; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
        .detail-field p { font-size: 14px; color: #111; line-height: 1.6; white-space: pre-line; }
        .detail-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 12px; }

        /* ===== 크롭 모달 ===== */
        #modal-crop {
            display: none; position: fixed; inset: 0; z-index: 9800;
            background: rgba(0,0,0,0.85);
            align-items: center; justify-content: center;
            flex-direction: column; gap: 0; padding: 16px;
        }
        #modal-crop.open { display: flex; }
        .crop-header {
            width: 100%; max-width: 560px;
            background: #fff; border-radius: 14px 14px 0 0;
            padding: 14px 18px;
            display: flex; align-items: center; justify-content: space-between;
        }
        .crop-header-title { font-size: 15px; font-weight: 900; color: #111; display: flex; align-items: center; gap: 8px; }
        .crop-body {
            width: 100%; max-width: 560px;
            background: #1a1a1a;
            max-height: 60vh; overflow: hidden;
        }
        .crop-body img { display: block; max-width: 100%; max-height: 60vh; }
        .crop-footer {
            width: 100%; max-width: 560px;
            background: #fff; border-radius: 0 0 14px 14px;
            padding: 12px 18px;
            display: flex; align-items: center; justify-content: space-between;
        }
        .crop-hint { font-size: 12px; color: #888; }
        .crop-actions { display: flex; gap: 8px; }

        /* ===== 이미지 라이트박스 ===== */
        #img-lightbox {
            display: none; position: fixed; inset: 0; z-index: 9500;
            background: rgba(0,0,0,0.92);
            align-items: center; justify-content: center;
        }
        #img-lightbox.open { display: flex; }
        #img-lightbox-img {
            max-width: 90vw; max-height: 90vh;
            object-fit: contain; border-radius: 6px;
            touch-action: none;
            transform-origin: center center;
            user-select: none;
            cursor: default;
        }
        #img-lightbox-close {
            position: absolute; top: 16px; right: 20px;
            color: white; font-size: 32px; cursor: pointer;
            background: none; border: none; line-height: 1;
            opacity: 0.8;
        }
        #img-lightbox-close:hover { opacity: 1; }

        /* ===== 커스텀 확인 모달 ===== */
        #modal-confirm {
            display: none; position: fixed; inset: 0; z-index: 9700;
            background: rgba(0,0,0,0.4);
            align-items: center; justify-content: center; padding: 20px;
        }
        #modal-confirm.open { display: flex; }
        .confirm-box {
            background: #fff; border-radius: 20px; padding: 28px 24px 20px;
            max-width: 320px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
            text-align: center;
        }
        .confirm-box .confirm-icon { font-size: 36px; margin-bottom: 12px; }
        .confirm-box .confirm-title { font-size: 16px; font-weight: 900; color: #111; margin-bottom: 8px; }
        .confirm-box .confirm-desc { font-size: 13px; color: #888; line-height: 1.6; margin-bottom: 20px; }
        .confirm-btns { display: flex; gap: 8px; }
        .confirm-btns button { flex: 1; padding: 12px 0; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; border: none; font-family: inherit; transition: 0.15s; }
        .btn-confirm-cancel { background: #f5f6f8; color: #555; }
        .btn-confirm-cancel:hover { background: #e8e9ec; }
        .btn-confirm-ok { background: #e74c3c; color: white; }
        .btn-confirm-ok:hover { background: #c0392b; }

        /* ===== 토스트 ===== */
        .toast {
            position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
            background: #222; color: #fff; padding: 10px 20px;
            border-radius: 24px; font-size: 13px; font-weight: 600;
            z-index: 9999; opacity: 0; transition: opacity 0.3s;
            white-space: nowrap; pointer-events: none;
        }
        .toast.show { opacity: 1; }

        /* ===== 모바일 반응형 ===== */
        @media (max-width: 600px) {
            .topnav { padding: 0 12px; }
            .main-wrap { padding: 14px 10px; }
            .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
            .filter-bar { padding: 12px; gap: 8px; }
            .filter-bar input[type="text"] { min-width: 100px; }
            .detail-grid { grid-template-columns: 1fr 1fr; }
            .modal { max-width: 100%; border-radius: 12px; }

            /* 테이블 모바일 처리 */
            .table-wrap { overflow-x: hidden; }
            .product-table { min-width: unset; width: 100%; }
            .product-table td, .product-table th { padding: 8px 6px; font-size: 12px; }
            /* 썸네일 작게 */
            .table-thumb { width: 44px; height: 44px; }
            .table-no-thumb { width: 44px; height: 44px; font-size: 14px; }
        }
