/* ========================================================
   픽투셀 통합 검색 — 개선된 디자인
   - 픽투셀 그린 + 부드러운 그림자/여백
   - 다크모드 자동 (시스템 설정 기반)
   ======================================================== */

:root {
  --primary: #1DBA76;
  --primary-dark: #168f59;
  --primary-darker: #0f6f44;
  --primary-light: rgba(29,186,118,0.10);
  --primary-mid: rgba(29,186,118,0.25);
  --accent-purple: #6b7af0;
  --bg: #f7f9f8;
  --bg-card: #ffffff;
  --bg-soft: #ecf2ee;
  --bg-hover: rgba(29,186,118,0.08);
  --border: #e3e8e5;
  --border-soft: rgba(0,0,0,0.04);
  --text: #1a2620;
  --text-soft: #364039;
  --text-muted: #5e6862;
  --card-bg: var(--bg-card);
  --sidebar-bg: var(--bg-card);
  --muted: var(--text-muted);
  --danger: #e15048;
  --danger-light: rgba(225,80,72,0.10);
  --warn: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(20,40,30,0.04), 0 1px 3px rgba(20,40,30,0.06);
  --shadow-md: 0 2px 4px rgba(20,40,30,0.06), 0 4px 12px rgba(20,40,30,0.08);
  --shadow-lg: 0 4px 8px rgba(20,40,30,0.08), 0 12px 28px rgba(20,40,30,0.12);
  --shadow-glow: 0 0 0 4px var(--primary-light);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

:root[data-theme="dark"] {
  --bg: #0c1310;
  --bg-card: #161e1a;
  --bg-soft: #1d2723;
  --bg-hover: rgba(29,186,118,0.14);
  --border: #2a3530;
  --border-soft: rgba(255,255,255,0.04);
  --text: #e6ece8;
  --text-soft: #b8c2bc;
  --text-muted: #7e8a82;
  --primary-light: rgba(29,186,118,0.18);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.5), 0 12px 28px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
               "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-dark); }

/* ===== 버튼 시스템 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-decoration: none;
  user-select: none;
  letter-spacing: -0.01em;
}
.btn:disabled, .btn[disabled] {
  opacity: 0.4; cursor: not-allowed; pointer-events: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-danger:hover:not(:disabled) {
  background: #c93e36;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-warn, .btn-success {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-warn:hover:not(:disabled) {
  background: rgba(245,158,11,0.08);
  border-color: var(--warn);
  color: var(--warn);
}
.btn-success { background: var(--primary); color: white; border: none; }
.btn-success:hover:not(:disabled) { background: var(--primary-dark); }

.btn.armed {
  background: linear-gradient(180deg, var(--danger) 0%, #b83a37 100%) !important;
  color: white !important;
  border-color: transparent !important;
  animation: pulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(225,80,72,0.6);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(225,80,72,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(225,80,72,0); }
  100% { box-shadow: 0 0 0 0 rgba(225,80,72,0); }
}

/* ===== 입력 필드 ===== */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], textarea, select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
::placeholder { color: var(--text-muted); }

/* ===== 로그인 화면 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(29,186,118,0.10), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(107,122,240,0.06), transparent 40%),
    var(--bg);
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.login-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary), var(--primary-darker));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-sub {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 13px;
}
.info-box {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.tab {
  flex: 1;
  background: transparent; border: none; cursor: pointer;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--bg-card);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  margin: 14px 0 6px;
}
.tab-panel input { padding: 11px 12px; }
.tab-panel button {
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  font-size: 14px;
}
.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 1.2em;
  font-weight: 500;
}
.success-msg {
  color: var(--primary-dark);
  font-size: 13px;
  margin-top: 12px;
  font-weight: 500;
}

/* ===== 앱 레이아웃 ===== */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* ===== 사이드바 ===== */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}
.brand {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary), var(--primary-darker));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.user-card {
  background: linear-gradient(135deg, var(--primary-light), rgba(29,186,118,0.04));
  border: 1px solid var(--primary-light);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
}
.user-email {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 3px;
  font-weight: 400;
}

.nav-row {
  display: flex; gap: 6px;
  margin-bottom: 18px;
}
.nav-row .btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12.5px;
}

/* ===== 새 공통 사이드 네비게이션 ===== */
.nav-menu { display: flex; flex-direction: column; gap: 3px; margin: 4px 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  text-decoration: none; color: var(--text);
  background: transparent; border: none; width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--bg-hover); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.nav-item-icon { font-size: 19px; width: 26px; text-align: center; flex-shrink: 0; }
.nav-item-text { flex: 1; }
.nav-admin-sep { border-top: 1px solid var(--border); margin: 6px 0; }
.nav-admin .nav-item { font-size: 12px; padding: 6px 10px; color: var(--text-muted); }
.nav-admin .nav-item:hover { background: rgba(100,100,100,0.08); color: var(--text); }

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 16px 0 10px;
  padding-left: 4px;
}

.acc-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 3px;
  transition: background 0.12s;
}
.acc-card:hover { background: var(--bg-hover); }
.acc-info {
  font-size: 13px;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}
.acc-info b {
  display: inline-block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-weight: 600;
}
.acc-email {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 1px;
}
.owner-tag {
  display: inline-block;
  font-size: 9px;
  background: var(--text-muted);
  color: white;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.acc-actions { display: flex; gap: 0; }
.icon-btn {
  background: transparent;
  border: none;
  width: 24px; height: 24px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.icon-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--primary-dark);
}
.icon-btn.danger:hover:not(:disabled) {
  background: var(--danger-light);
  color: var(--danger);
}
.icon-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.add-account {
  margin-top: 12px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 4px;
}
.add-account summary {
  cursor: pointer;
  font-size: 12.5px;
  padding: 8px 10px;
  color: var(--text-soft);
  font-weight: 500;
  border-radius: var(--radius-sm);
  list-style: none;
}
.add-account summary::-webkit-details-marker { display: none; }
.add-account summary::before {
  content: "▶ ";
  font-size: 9px;
  margin-right: 4px;
  display: inline-block;
  transition: transform 0.15s;
}
.add-account[open] summary::before { transform: rotate(90deg); }
.add-account summary:hover { color: var(--text); }
.add-account form {
  display: flex; flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
}
.add-account input { font-size: 12px; padding: 7px 9px; }
.add-account button { padding: 8px; }
.hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 10px 8px;
  line-height: 1.5;
}
.hint code {
  background: var(--bg-card);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10.5px;
  border: 1px solid var(--border-soft);
}

.logout-btn {
  margin-top: auto;
  padding: 10px;
  font-size: 13px;
}

/* ===== 메인 영역 ===== */
.main {
  padding: 24px 28px 40px;
  overflow-x: auto;
  min-width: 0;
}

/* ===== 검색 영역 (카드들) ===== */
.search-zone {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 0.9fr;
  gap: 16px;
  margin-bottom: 20px;
}
.search-box, .delete-zone, .price-zone, .account-checks {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.search-box textarea {
  width: 100%; height: 88px;
  resize: vertical;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid transparent;
}
.search-box textarea:focus {
  background: var(--bg-card);
  border-color: var(--primary);
}
.search-actions {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.search-actions .btn-primary {
  padding: 5px 10px;
  font-size: 12px;
}
.search-hint {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.delete-zone {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(225,80,72,0.02) 100%);
  border-color: rgba(225,80,72,0.16);
}
.delete-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}
.delete-grid {
  display: flex !important;
  gap: 3px !important;
  flex-wrap: nowrap !important;
  grid-template-columns: unset !important;
}
.delete-grid .btn {
  flex: 1 !important;
  font-size: 11px !important;
  padding: 3px 4px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  min-width: 0 !important;
}

/* ── 가격 변경 zone ──────────────────────────────────────── */
.price-zone {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(16,185,129,0.03) 100%);
  border-color: rgba(16,185,129,0.2);
}
.price-zone-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}
.price-zone-body {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
}
.price-type-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.price-type-sel {
  flex: 1;
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  color: var(--text-main);
  font-size: 11px;
  min-width: 0;
}
.price-val-input {
  width: 70px;
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  color: var(--text-main);
  font-size: 11px;
}
.price-market-row {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-main);
}
.price-market-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.btn-price {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-price:hover { opacity: .88; }

/* ── 가격 변경 진행 모달 ─────────────────────────────────── */
.price-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.price-modal-box {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 24px 28px;
  min-width: 420px;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.price-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.done-badge {
  background: #10b981;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.price-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.pj-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  flex-wrap: wrap;
}
.pj-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-main);
  min-width: 120px;
  font-weight: 600;
}
.pj-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-soft);
  white-space: nowrap;
}
.verify-ok  { border-color: #10b981; color: #059669; }
.verify-fail { border-color: #ef4444; color: #dc2626; }

.account-checks {
  font-size: 13px;
}
.account-checks-label {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-soft);
}
.check-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  padding: 5px 0;
  font-size: 13px;
}
.check-label.small { font-size: 12px; }
.check-label input { accent-color: var(--primary); cursor: pointer; }

/* ===== 결과 영역 ===== */
.result-zone {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.result-toolbar {
  display: flex; align-items: center; flex-wrap: wrap;
  margin-bottom: 12px;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.price-filter {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.price-filter-label { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.price-filter input[type=number] {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  color: var(--text); border-radius: 6px; padding: 4px 8px; font-size: 13px;
  width: auto;
}
.btn-sm {
  padding: 3px 10px; font-size: 12px; border-radius: 5px;
  background: var(--bg-hover); color: var(--text-muted);
  border: 1px solid var(--border-soft); cursor: pointer;
}
.btn-sm:hover { background: var(--border-soft); }
.btn-sm:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination-bar {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.page-size-sel {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  color: var(--text); border-radius: 6px; padding: 3px 6px;
  font-size: 12px; width: auto; cursor: pointer;
}
#page-info { font-size: 12px; white-space: nowrap; min-width: 70px; text-align: center; }
.muted {
  color: var(--text-muted);
  font-size: 12.5px;
}
.empty-msg {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-msg::before {
  content: "🔍";
  display: block;
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* 결과 테이블 */
.result-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.result-table th {
  background: var(--bg-soft);
  text-align: left;
  padding: 10px 8px;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0; z-index: 1;
}
.result-table th:first-child { border-top-left-radius: var(--radius-sm); }
.result-table th:last-child { border-top-right-radius: var(--radius-sm); }
.result-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.result-table tbody tr { transition: background 0.12s; }
.result-table tbody tr:hover td { background: var(--bg-hover); }
.result-table tr.no-id { opacity: 0.6; font-style: italic; }
.col-check { width: 36px; }
.col-account { width: 78px; font-weight: 500; }
.col-img { width: 100px; }
.col-id {
  width: 140px;
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--text-muted);
}
.col-price {
  width: 90px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.col-link { width: 50px; text-align: center; }
.col-name { min-width: 220px; }
.product-img {
  width: 84px; height: 84px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  transition: transform 0.18s, box-shadow 0.18s;
  border: 1px solid var(--border-soft);
}
.product-img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}
.name-cell { line-height: 1.4; font-weight: 500; }
.hl {
  background: linear-gradient(180deg, transparent 60%, rgba(225,80,72,0.25) 60%);
  color: var(--danger);
  font-weight: 700;
  padding: 0 1px;
}
.id-cell { font-family: ui-monospace, monospace; }
.price { font-weight: 600; }
.link-btn {
  display: inline-block;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.12s;
}
.link-btn:hover {
  background: var(--bg-hover);
  transform: scale(1.1);
  text-decoration: none;
}
.link-btn.no-url {
  opacity: 0.4;
  cursor: default;
}
.link-btn.no-url:hover {
  background: none;
  transform: none;
}

/* 이미지 호버 미리보기 */
#img-preview {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  display: none;
  border-radius: var(--radius);
  padding: 6px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
#img-preview.show { display: block; }
#img-preview img {
  display: block;
  width: 320px; height: 320px;
  object-fit: cover;
  border-radius: 8px;
}

/* 이미지 풀스크린 모달 (클릭 시) */
.img-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 12, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  cursor: zoom-out;
  padding: 5vh 5vw;
  animation: fadeIn 0.18s ease;
}
.img-modal.show { display: flex; }
.img-modal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: default;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: zoomIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.img-modal-close {
  position: absolute;
  top: 22px; right: 24px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.img-modal-close:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* 토스트 */
.toast {
  position: fixed;
  top: 24px; right: 24px;
  background: rgba(20,30,25,0.95);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 10000;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 0.95; transform: translateY(0); }

/* 결과 상세 카드 */
.result-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 18px 22px;
  border-radius: var(--radius);
  margin-top: 18px;
  box-shadow: var(--shadow-sm);
}
.result-detail-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.result-detail-card ul {
  margin: 8px 0 8px 20px;
  font-size: 13px;
  line-height: 1.7;
}
.result-detail-card details { margin-top: 12px; }
.result-detail-card summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  padding: 4px 0;
}
.result-detail-card .btn { margin-top: 12px; }

/* ===== 관리자/도움말 ===== */
.admin-wrap, .help-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}
.admin-card, .help-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.admin-header, .help-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}
.admin-header h1, .help-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.admin-card h2, .help-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--primary-dark);
  letter-spacing: -0.01em;
}
.admin-card h2:first-of-type, .help-card h2:first-of-type {
  margin-top: 8px;
}
.user-list {
  margin-bottom: 24px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 4px;
}
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.user-row:last-child { border-bottom: none; }
.user-info { flex: 1; min-width: 0; }
.user-info b { font-weight: 600; }

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 14px 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.help-table th, .help-table td {
  text-align: left;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--border-soft);
}
.help-table tr:last-child td { border-bottom: none; }
.help-table th {
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.help-card ul, .help-card ol {
  margin: 8px 0 14px 22px;
  font-size: 13.5px;
  line-height: 1.7;
}
code {
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 90%;
  font-family: ui-monospace, monospace;
  border: 1px solid var(--border-soft);
}

/* 반응형 */
@media (max-width: 1100px) {
  .search-zone { grid-template-columns: 1fr 1fr; }
  .account-checks { grid-column: span 2; }
}
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
  }
  .search-zone { grid-template-columns: 1fr; }
  .account-checks { grid-column: auto; }
  .main { padding: 16px; }
}

/* 다크모드 토글 (우하단 floating) */
.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
}
.theme-toggle:hover {
  transform: translateY(-2px) rotate(15deg);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.theme-toggle:active {
  transform: translateY(0) rotate(0);
}

/* 스크롤바 (Webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
