/* ========== 디자인 토큰 ========== */
:root {
  --bg: #eef0f4;
  --orb-1: #c7d2fe;
  --orb-2: #fde2c8;
  --orb-3: #bae6fd;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --blur: blur(22px) saturate(170%);
  --surface: rgba(255, 255, 255, 0.6);
  --surface-2: rgba(255, 255, 255, 0.4);
  --border: rgba(15, 23, 42, 0.07);
  --border-strong: rgba(15, 23, 42, 0.12);
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #8b93a1;
  --primary: #2f5bd3;
  --primary-hover: #2549b0;
  --primary-soft: rgba(47, 91, 211, 0.1);
  --ink: #111827;
  --on-ink: #ffffff;
  --pos: #15803d;
  --pos-soft: rgba(22, 163, 74, 0.1);
  --neg: #dc2626;
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  color-scheme: light;
}

html.dark-mode {
  --bg: #0a0d14;
  --orb-1: #1e2a5a;
  --orb-2: #3a2a1c;
  --orb-3: #0f3a4a;
  --glass: rgba(24, 29, 42, 0.5);
  --glass-strong: rgba(24, 29, 42, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #eceff5;
  --text-2: #a9b1c0;
  --text-3: #6b7485;
  --primary: #6e95ff;
  --primary-hover: #8eadff;
  --primary-soft: rgba(110, 149, 255, 0.14);
  --ink: #eceff5;
  --on-ink: #0a0d14;
  --pos: #4ade80;
  --pos-soft: rgba(74, 222, 128, 0.1);
  --neg: #f87171;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* ========== 기본 ========== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
a { color: inherit; text-decoration: none; }
body::before, body::after, .app::before {
  content: ""; position: fixed; z-index: -1; border-radius: 50%;
  filter: blur(90px); opacity: 0.7; pointer-events: none;
}
body::before { width: 520px; height: 520px; top: -140px; left: 120px; background: var(--orb-1); }
body::after { width: 460px; height: 460px; bottom: -160px; right: -80px; background: var(--orb-2); }
.app::before { width: 380px; height: 380px; top: 40%; left: 45%; background: var(--orb-3); opacity: 0.5; }
.muted { color: var(--text-3); }
.pos { color: var(--pos) !important; }
.neg { color: var(--neg) !important; }

.icon {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ========== 레이아웃 ========== */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ========== 사이드바 ========== */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--glass); color: var(--text-2);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column; padding: 20px 14px;
  z-index: 50; overflow-y: auto;
  transition: transform 0.25s ease;
}
.sidebar-brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 4px 8px 22px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--ink);
  color: var(--on-ink); font-weight: 800; font-size: 18px;
  display: grid; place-items: center;
}
.brand-name { color: var(--text); font-weight: 800; font-size: 16px; letter-spacing: 0.08em; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; margin-bottom: 2px;
  background: none; border: 0; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--glass-strong); color: var(--text); font-weight: 600; box-shadow: var(--glass-highlight), 0 2px 8px rgba(15,23,42,0.06); border: 1px solid var(--glass-border); }
.nav-item.active .icon { color: var(--primary); }

.sidebar-backdrop { display: none; }

/* ========== 상단바 ========== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; min-height: 68px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
}
.topbar-title { flex: 1; min-width: 0; }
.breadcrumb { font-size: 12px; color: var(--text-3); }
.breadcrumb span { color: var(--text-2); }
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.topbar-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.menu-btn { display: none; }
.icon-sun { display: none; }
html.dark-mode .icon-sun { display: block; }
html.dark-mode .icon-moon { display: none; }

/* ========== KPI ========== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--glass-highlight), var(--shadow); min-width: 0; }
.kpi-label { font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 8px; }
.kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-accent { background: var(--ink); border-color: var(--ink); }
.kpi-accent .kpi-label { color: var(--on-ink); opacity: 0.65; }
.kpi-accent .kpi-value { color: var(--on-ink); }

/* ========== 패널 ========== */
.panel { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--glass-highlight), var(--shadow); min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-title { font-size: 15px; font-weight: 700; }
.panel-body { padding: 20px; }
.panel-footer { padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.panel-footer .form-group { margin-bottom: 10px; }

.calc-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.side-stack { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 88px; }
.toolbar { display: flex; gap: 8px; }

/* ========== 폼 ========== */
.form-section { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px dashed var(--border); }
.form-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.form-section-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; margin-bottom: 14px; }
.form-section-head small { font-weight: 500; color: var(--text-3); font-size: 12px; }
.step { width: 22px; height: 22px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field-grid .form-group { margin-bottom: 0; }
.form-group label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
input[type="number"], input[type="text"], input[type="password"], select {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input::placeholder { color: var(--text-3); }

.info-box { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--text-2); font-size: 13px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.info-box div { display: flex; flex-direction: column; }
.info-box span { font-size: 12px; }
.info-box strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.info-box .hl strong { color: var(--primary); }

.sales-group-box { margin-bottom: 10px; }
.sales-group-row { display: flex; align-items: flex-end; gap: 10px; }
.sales-group-row .form-group { flex: 1; margin-bottom: 0; }
.discount-check-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.discount-check-col label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.discount-check-col input { width: 18px; height: 18px; margin: 10px 0; accent-color: var(--primary); cursor: pointer; }
.btn-remove-group {
  width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-3); font-size: 18px; cursor: pointer;
}
.btn-remove-group:hover { color: var(--neg); border-color: var(--neg); }

.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; margin: 4px 0; font-size: 13.5px; font-weight: 500; }
.toggle-row > label:first-child { cursor: pointer; }
.toggle-wrapper { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.3s ease, opacity 0.3s ease; }
.toggle-wrapper.show { grid-template-rows: 1fr; opacity: 1; }
.toggle-inner { overflow: hidden; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; cursor: pointer; background: var(--border-strong); border-radius: 22px; transition: 0.2s; }
.slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ========== 버튼 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn .icon { width: 16px; height: 16px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; height: 44px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
html.dark-mode .btn-primary, html.dark-mode .btn-ebay { color: var(--on-ink); }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-dark:hover { opacity: 0.9; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.btn-outline:hover { background: var(--surface-2); color: var(--text); }
.btn-dashed { width: 100%; background: transparent; border: 1px dashed var(--border-strong); color: var(--text-2); font-weight: 500; }
.btn-dashed:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-link { background: none; border: 0; padding: 4px 8px; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.btn-link.edit { color: var(--primary); }
.btn-link.del { color: var(--neg); }
.btn-link:hover { background: var(--surface-2); }

/* ========== 결과 ========== */
.result-total { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius-sm); background: var(--pos-soft); margin-bottom: 18px; }
.result-total span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.result-total strong { font-size: 26px; font-weight: 800; color: var(--pos); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sub-title { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; margin: 4px 0 8px; }
.group-margins-list { font-size: 13px; margin-bottom: 14px; }
.group-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.group-row:last-child { border-bottom: 0; }
.group-row small { color: var(--neg); }
.group-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-list { margin: 0 0 14px; }
.result-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.result-list > div:last-child { border-bottom: 0; }
.result-list dt { color: var(--text-2); }
.result-list dt small { color: var(--text-3); }
.result-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-list .strong dt { color: var(--text); font-weight: 600; }

/* ========== 수익 분배 ========== */
.split-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.split-row { display: flex; align-items: center; gap: 8px; }
.split-row input[type="text"] { width: 88px; flex-shrink: 0; }
.split-row input[type="number"] { width: 70px; flex-shrink: 0; }
.split-row .pct { color: var(--text-3); }
.split-row .amt { flex: 1; text-align: right; font-weight: 700; color: var(--pos); font-variant-numeric: tabular-nums; white-space: nowrap; }
.split-summary { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }

/* ========== 테이블 ========== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); padding: 10px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .title-cell { font-weight: 600; white-space: normal; min-width: 160px; }
.data-table .title-cell small { display: block; font-weight: 500; color: var(--neg); font-size: 12px; }
.data-table .date-cell { color: var(--text-3); font-size: 12.5px; }
.data-table .empty { text-align: center; color: var(--text-3); padding: 40px 20px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--pos-soft); color: var(--pos); }
.badge.warn { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.badge.minus { background: rgba(220, 38, 38, 0.1); color: var(--neg); }

/* ========== 재고현황 ========== */
.inv-form-panel { margin-bottom: 20px; }
.inv-form { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.inv-form .form-group { margin-bottom: 0; }
.search-bar-sm { margin-bottom: 0; width: 260px; max-width: 100%; }
.search-bar-sm input { height: 32px; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.qty-stepper button { width: 30px; height: 32px; border: 0; background: transparent; color: var(--text-2); font-size: 16px; cursor: pointer; }
.qty-stepper button:hover { background: var(--primary-soft); color: var(--primary); }
.qty-stepper input { width: 56px; height: 32px; padding: 0 4px; border: 0; border-radius: 0; text-align: center; background: transparent; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper input:focus { box-shadow: none; }
.btn-login { height: 38px; }

/* ========== 로고 ========== */
.won-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ========== 플레이리스트 ========== */
.yt-add-bar { margin-bottom: 0; }
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.yt-item { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-border); box-shadow: var(--glass-highlight), var(--shadow); cursor: pointer; transition: transform 0.15s; }
.yt-item:hover { transform: translateY(-3px); }
.yt-item.playing { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }
.yt-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; background: rgba(0,0,0,0.35); transition: opacity 0.15s; }
.yt-play span { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.25); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.5); color: #fff; font-size: 18px; }
.yt-item:hover .yt-play, .yt-item.playing .yt-play { opacity: 1; }
.yt-info { padding: 12px 14px; padding-right: 44px; }
.yt-title { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-author { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.yt-delete { position: absolute; right: 8px; bottom: 10px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--text-3); font-size: 18px; cursor: pointer; }
.yt-delete:hover { color: var(--neg); background: var(--surface-2); }
.yt-empty { grid-column: 1 / -1; text-align: center; color: var(--text-3); padding: 48px 20px; }

.mini-player { position: fixed; right: 20px; bottom: 20px; width: 340px; max-width: calc(100vw - 32px); z-index: 60; display: none; overflow: hidden; border-radius: var(--radius); background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-border); box-shadow: var(--glass-highlight), 0 20px 50px rgba(0,0,0,0.2); }
.mini-player.show { display: block; animation: fadeIn 0.2s ease-out; }
.mini-player-frame { height: 200px; background: #000; }
.mini-player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.mini-player-body { padding: 10px 14px 12px; }
.mini-player-head { display: flex; align-items: center; gap: 8px; }
.mini-player-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-player .btn-modal-close { position: static; flex-shrink: 0; }
.mp-progress { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.mp-progress input { flex: 1; min-width: 0; }
.mini-player input[type="range"] { accent-color: var(--primary); height: 4px; cursor: pointer; }
.mp-controls { display: flex; align-items: center; justify-content: center; gap: 6px; }
.mp-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; }
.mp-btn:hover { background: var(--surface-2); color: var(--text); }
.mp-btn .icon { width: 17px; height: 17px; }
.mp-btn.active { color: var(--primary); background: var(--primary-soft); }
.mp-main { width: 42px; height: 42px; background: var(--ink); color: var(--on-ink); }
.mp-main:hover { background: var(--ink); color: var(--on-ink); opacity: 0.9; }
.mp-main .icon { fill: currentColor; stroke: none; }
.mp-main .icon-play { display: none; }
.mp-main.paused .icon-play { display: block; }
.mp-main.paused .icon-pause { display: none; }
.mp-volume { width: 70px; margin-left: 6px; }

/* ========== 로그인 모달 ========== */
.login-backdrop { background: rgba(10, 13, 20, 0.35); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); }
.login-modal { position: relative; width: 100%; max-width: 380px; padding: 36px 28px 28px; border-radius: 20px; background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-border); box-shadow: var(--glass-highlight), 0 30px 80px rgba(0,0,0,0.3); animation: loginIn 0.25s ease-out; }
@keyframes loginIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.login-mark { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; }
.login-mark .won-icon { width: 26px; height: 26px; }
.login-title { text-align: center; font-size: 18px; font-weight: 800; letter-spacing: 0.08em; }
.login-sub { text-align: center; margin: 4px 0 24px; color: var(--text-3); font-size: 13px; }
.login-modal input[type="text"], .login-modal input[type="password"] { height: 44px; }
.login-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin: 4px 0 12px; cursor: pointer; }
.login-remember input { accent-color: var(--primary); }
.login-msg { min-height: 18px; margin: 0 0 10px; font-size: 13px; color: var(--neg); }

/* ========== 카드 리스트 ========== */
.search-bar { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 20px; }
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-bar .icon { color: var(--text-3); }
.search-bar input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; padding: 0; }

.set-grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-items: start; }
.set-item { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.set-item:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.set-logo-wrapper { height: 60px; width: 100%; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.set-logo { max-width: 100%; max-height: 100%; object-fit: contain; }
.set-name { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.set-count { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.set-expanded-area, .result-header { grid-column: 1 / -1; }
.set-expanded-area { background: var(--surface-2); border: 1px solid var(--primary); border-radius: var(--radius); padding: 20px; margin: 4px 0 8px; animation: fadeIn 0.2s ease-out; }
.result-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.expanded-title { font-size: 15px; font-weight: 700; margin: 0; }
.btn-close-expanded { height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-close-expanded:hover { color: var(--text); background: var(--bg); }

.loading-box, .state-box { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--text-3); }
.state-box.error { color: var(--neg); }
.spinner { width: 28px; height: 28px; margin: 0 auto 12px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: rotate 0.8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

.pokemon-card-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pokemon-card-item { display: flex; flex-direction: column; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.pokemon-card-item:hover { border-color: var(--primary); transform: translateY(-2px); }
.pokemon-card-img-wrapper { aspect-ratio: 63 / 88; border-radius: 6px; overflow: hidden; background: var(--surface-2); margin-bottom: 8px; }
.pokemon-card-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pokemon-card-name { font-size: 13px; font-weight: 600; margin: 0 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pokemon-card-number { font-size: 12px; color: var(--text-3); }

/* ========== 모달 ========== */
.modal-backdrop { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 6, 23, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 1000; }
.card-detail-content { position: relative; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-border); box-shadow: var(--glass-highlight), var(--shadow); border-radius: 16px; padding: 28px 24px 24px; display: flex; flex-direction: column; align-items: center; animation: fadeIn 0.2s ease-out; }
.btn-modal-close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text-3); font-size: 22px; cursor: pointer; z-index: 2; }
.btn-modal-close:hover { background: var(--surface-2); color: var(--text); }
.card-3d-wrapper { width: 100%; max-width: 260px; aspect-ratio: 63 / 88; perspective: 1000px; margin-bottom: 20px; }
.card-detail-img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); transition: transform 0.1s ease-out; }
.card-detail-info { width: 100%; text-align: center; }
.card-detail-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.card-detail-info p { margin: 0 0 16px; font-size: 13px; }
.price-box { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.price-text { font-size: 16px; font-weight: 700; color: var(--pos); margin-bottom: 10px; }
.price-text small { font-size: 12px; font-weight: 500; color: var(--text-3); }
.price-text.none { color: var(--text-3); }
.btn-ebay { width: 100%; height: 40px; border: 0; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-weight: 600; cursor: pointer; }
.btn-ebay:hover { background: var(--primary-hover); }

/* ========== 반응형 ========== */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
  .side-stack { position: static; }
}
@media (max-width: 860px) {
  .main { margin-left: 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; background: var(--glass-strong); box-shadow: 0 0 40px rgba(0,0,0,0.25); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, 0.5); z-index: 45; }
  .menu-btn { display: grid; }
  .topbar { padding: 12px 16px; min-height: 60px; }
  .content { padding: 16px 16px 40px; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .inv-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-form .form-group:first-child, .inv-form .btn { grid-column: 1 / -1; }
  .search-bar-sm { width: 100%; }
  .breadcrumb { display: none; }
  .mini-player { right: 16px; bottom: 16px; }
  .yt-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 560px) {
  .kpi-grid { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 18px; }
  .panel-body { padding: 16px; }
  .panel-header, .panel-footer { padding: 14px 16px; }
  .info-box { grid-template-columns: minmax(0, 1fr); }
  .sales-group-row { gap: 8px; }
  .set-grid-container, .pokemon-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .set-expanded-area { padding: 14px; }
  .data-table th, .data-table td { padding: 10px 12px; }
}
