/* ── 언어 선택기 (공통) ── */
.lang-selector-wrap{position:relative;display:inline-flex;align-items:center;}
.lang-toggle-btn{display:flex;align-items:center;gap:.35rem;background:transparent;border:1px solid var(--border-bright);border-radius:999px;padding:.38rem .75rem;font-size:.82rem;font-weight:600;color:var(--muted);cursor:pointer;white-space:nowrap;font-family:inherit;transition:background .18s,border-color .18s,color .18s;}
.lang-toggle-btn:hover{color:var(--text);border-color:var(--accent);}
.lang-toggle-btn .chevron{transition:transform .2s;opacity:.6;}
.lang-selector-wrap.open .lang-toggle-btn .chevron{transform:rotate(180deg);}
.lang-dropdown{position:absolute;top:calc(100% + 6px);right:0;background:var(--surface);border:1px solid var(--border-bright);border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.25);overflow:hidden;min-width:140px;opacity:0;pointer-events:none;transform:translateY(-6px);transition:opacity .18s,transform .18s;z-index:300;}
.lang-selector-wrap.open .lang-dropdown{opacity:1;pointer-events:auto;transform:translateY(0);}
.lang-option{display:flex;align-items:center;gap:.5rem;padding:.6rem 1rem;font-size:.85rem;font-weight:500;color:var(--muted);cursor:pointer;transition:background .15s;white-space:nowrap;}
.lang-option:hover{background:rgba(91,110,245,.1);color:var(--text);}
.lang-option.active{font-weight:700;color:var(--accent);background:rgba(91,110,245,.08);}


/* PAGE */
.page-wrap { max-width:1200px; margin:0 auto; padding:2.5rem max(1.5rem,2vw) 5rem; }
.page-header { display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:1rem; margin-bottom:2rem; }
.page-title-wrap {}
.page-title { font-family:'Pretendard',sans-serif; font-size:clamp(1.5rem,3vw,2rem);
  font-weight:800; letter-spacing:-0.02em; color:var(--white); }
.page-sub { font-size:0.875rem; color:var(--muted); margin-top:0.3rem; }

.btn-write { display:inline-flex; align-items:center; gap:0.4rem; padding:0.55rem 1.3rem;
  border-radius:10px; border:none; background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:#fff; font-size:0.875rem; font-weight:700; cursor:pointer;
  font-family:'Noto Sans KR',sans-serif; text-decoration:none; transition:opacity 0.15s; }
.btn-write:hover { opacity:0.85; }

/* ══════════════════════════════════════════════
   모바일 햄버거 메뉴 (공통)
   nav에 .nav-hamburger 버튼 + #navMobileMenu 필요
   ══════════════════════════════════════════════ */

/* 햄버거 버튼 */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  cursor: pointer;
  z-index: 200;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: all 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 모바일 전체 메뉴 오버레이 */
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: rgba(9,9,15,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 1rem max(1.5rem,4vw) 1.5rem;
  flex-direction: column;
  gap: 0.25rem;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.nav-mobile-menu.open { display: flex; }

/* 메뉴 항목 */
.nav-mobile-menu .m-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}
.nav-mobile-menu .m-link:last-child { border-bottom: none; }
.nav-mobile-menu .m-link:hover,
.nav-mobile-menu .m-link.active { color: var(--text); }
.nav-mobile-menu .m-link.m-accent { color: var(--accent); }
.nav-mobile-menu .m-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.75rem 0.5rem 0.25rem;
  opacity: 0.6;
}
.nav-mobile-menu .m-lang-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.5rem;
}
.nav-mobile-menu .m-lang-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.nav-mobile-menu .m-lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 768px 이하: nav-right 숨기고 햄버거 표시 */
@media (max-width: 768px) {
  .nav-right { display: none; }
  .nav-hamburger { display: flex; }
}

/* ── White 테마 오버라이드 ── */
[data-theme="white"] .nav-hamburger { border-color: rgba(0,0,0,0.12); }
[data-theme="white"] .nav-hamburger span { background: #555555; }
[data-theme="white"] .nav-mobile-menu {
  background: rgba(255,255,255,0.98);
  border-bottom-color: rgba(0,0,0,0.08);
}
[data-theme="white"] .nav-mobile-menu .m-link { color: #555555; border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="white"] .nav-mobile-menu .m-link:hover { color: #111111; }
[data-theme="white"] .nav-mobile-menu .m-section-title { color: #888888; }
[data-theme="white"] .nav-mobile-menu .m-lang-btn { border-color: rgba(0,0,0,0.12); color: #555555; }
[data-theme="white"] .nav-mobile-menu .m-lang-btn.active { background: #0070f3; border-color: #0070f3; color: #fff; }

  /* ══════════════════════════════════════════════
     WHITE THEME 오버라이드 — admin.html 전용
     ══════════════════════════════════════════════ */

  /* ── Nav ── */
  [data-theme="white"] nav {
    background: rgba(255,255,255,0.92);
    border-bottom-color: rgba(0,0,0,0.08);
  }
  [data-theme="white"] .nav-logo { color: #111111; }
  [data-theme="white"] .nav-dropdown-trigger {
    background: rgba(0,112,243,0.08);
    color: #0070f3;
    border-color: rgba(0,112,243,0.25);
  }
  [data-theme="white"] .nav-dropdown-trigger:hover { background: rgba(0,112,243,0.14); }
  [data-theme="white"] .nav-dropdown-menu {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  }
  [data-theme="white"] .nav-dropdown-menu a { color: #555555; border-bottom-color: rgba(0,0,0,0.06); }
  [data-theme="white"] .nav-dropdown-menu a:hover { background: rgba(0,112,243,0.06); color: #111111; }
  [data-theme="white"] .nav-dropdown-menu a.menu-accent { color: #0070f3; }

  /* ── page-title gradient text ── */
  [data-theme="white"] .page-title {
    background: linear-gradient(135deg, #111111, #0070f3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  /* ── stat-card ── */
  [data-theme="white"] .stat-card { background: #ffffff; border-color: rgba(0,0,0,0.08); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
  [data-theme="white"] .stat-card-value { color: #111111; }

  /* ── table ── */
  [data-theme="white"] .log-table thead tr { border-bottom-color: rgba(0,0,0,0.1); }
  [data-theme="white"] .log-table th { color: #888888; }
  [data-theme="white"] .log-table td { border-bottom-color: rgba(0,0,0,0.06); color: #333333; }
  [data-theme="white"] .log-table tbody tr:hover { background: rgba(0,112,243,0.04); }
  [data-theme="white"] .cell-date { color: #888888; }
  [data-theme="white"] .cell-ip   { color: #888888; }

  /* ── badge ── */
  [data-theme="white"] .badge-success { background: rgba(52,211,153,0.12); color: #059669; border-color: rgba(52,211,153,0.3); }
  [data-theme="white"] .badge-fail    { background: rgba(248,113,113,0.1);  color: #dc2626; border-color: rgba(248,113,113,0.3); }
  [data-theme="white"] .badge-short   { background: rgba(0,112,243,0.08);   color: #0070f3; border-color: rgba(0,112,243,0.2); }
  [data-theme="white"] .badge-short:hover { background: rgba(0,112,243,0.14); }
  [data-theme="white"] .badge-shorterr { background: rgba(248,113,113,0.08); color: #dc2626; border-color: rgba(248,113,113,0.25); }

  /* ── row action buttons ── */
  [data-theme="white"] .btn-row-qr     { color: #0ea5e9; border-color: rgba(14,165,233,0.3); }
  [data-theme="white"] .btn-row-qr:hover { background: rgba(14,165,233,0.1); }
  [data-theme="white"] .btn-row-delete:hover { background: rgba(220,38,38,0.08); }
  [data-theme="white"] .btn-stats:hover { background: rgba(0,112,243,0.08); }
  [data-theme="white"] .btn-row-url-action { color: #888888; }
  [data-theme="white"] .btn-row-url-action:hover { color: #0070f3; }

  /* ── QR popup ── */
  [data-theme="white"] .qr-popup-overlay { background: rgba(0,0,0,0.35); }
  [data-theme="white"] .qr-popup {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 32px 80px rgba(0,0,0,0.15);
  }
  [data-theme="white"] .qr-popup-title { color: #111111; }
  [data-theme="white"] .qr-popup-close { color: #888888; }
  [data-theme="white"] .qr-popup-close:hover { color: #111111; }
  [data-theme="white"] .qr-download-btn {
    background: linear-gradient(135deg, #0070f3, #7928ca);
    color: #fff;
  }
  [data-theme="white"] .modal-qr-btn-dl { background: #0070f3; color: #fff; }
  [data-theme="white"] .modal-qr-btn-copy { color: #0070f3; border-color: rgba(0,112,243,0.3); }
  [data-theme="white"] .modal-qr-btn-copy:hover { background: rgba(0,112,243,0.08); }

  /* ── 통계 modal ── */
  [data-theme="white"] .stats-overlay { background: rgba(0,0,0,0.35); }
  [data-theme="white"] .stats-modal {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 32px 80px rgba(0,0,0,0.15);
  }
  [data-theme="white"] .stats-title   { color: #111111; }
  [data-theme="white"] .stats-close   { color: #888888; }
  [data-theme="white"] .stats-close:hover { color: #111111; }
  [data-theme="white"] .stats-section-title { color: #111111; }
  [data-theme="white"] .stats-tab { color: #888888; border-color: rgba(0,0,0,0.1); }
  [data-theme="white"] .stats-tab.active { background: #0070f3; border-color: #0070f3; color: #fff; }
  [data-theme="white"] .stats-tab:hover { background: rgba(0,112,243,0.08); color: #0070f3; }
  [data-theme="white"] .bar-track { background: rgba(0,0,0,0.06); }
  [data-theme="white"] .bar-fill  { background: linear-gradient(90deg, #0070f3, #7928ca); }
  [data-theme="white"] .bar-label { color: #666666; }
  [data-theme="white"] .bar-count { color: #111111; }
  [data-theme="white"] .kpi-card  { background: #f5f5f5; border-color: rgba(0,0,0,0.08); }
  [data-theme="white"] .kpi-value { color: #111111; }
  [data-theme="white"] .kpi-label { color: #888888; }
  [data-theme="white"] .stats-empty { color: #888888; }
  [data-theme="white"] .stats-error { color: #dc2626; }
  [data-theme="white"] .ratio-legend-dot-total   { background: #0070f3; }
  [data-theme="white"] .ratio-legend-dot-unique  { background: #7928ca; }
  [data-theme="white"] .ratio-legend-dot-mobile  { background: #0ea5e9; }
  [data-theme="white"] .ratio-legend-dot-desktop { background: #34d399; }

  /* ── 상세 modal ── */
  [data-theme="white"] .modal-overlay { background: rgba(0,0,0,0.35); }
  [data-theme="white"] .modal {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 32px 80px rgba(0,0,0,0.15);
  }
  [data-theme="white"] .modal-title    { color: #111111; }
  [data-theme="white"] .modal-close    { color: #888888; }
  [data-theme="white"] .modal-close:hover { color: #111111; }
  [data-theme="white"] .detail-label   { color: #888888; }
  [data-theme="white"] .detail-value   { color: #111111; }
  [data-theme="white"] .detail-url     { color: #0070f3; }
  [data-theme="white"] .detail-content { background: #f5f5f5; border-color: rgba(0,0,0,0.08); color: #333333; }
  [data-theme="white"] .btn-modal-edit   { background: rgba(0,112,243,0.1); color: #0070f3; border-color: rgba(0,112,243,0.3); }
  [data-theme="white"] .btn-modal-edit:hover { background: rgba(0,112,243,0.18); }
  [data-theme="white"] .btn-modal-save   { background: #0070f3; color: #fff; }
  [data-theme="white"] .btn-modal-cancel { color: #888888; border-color: rgba(0,0,0,0.12); }
  [data-theme="white"] .btn-modal-cancel:hover { background: rgba(0,0,0,0.04); }
  [data-theme="white"] .btn-modal-delete { color: #dc2626; border-color: rgba(220,38,38,0.3); }
  [data-theme="white"] .btn-modal-delete:hover { background: rgba(220,38,38,0.08); }
  [data-theme="white"] .form-input-edit {
    background: #f5f5f5;
    border-color: rgba(0,0,0,0.12);
    color: #111111;
  }
  [data-theme="white"] .form-input-edit:focus { border-color: rgba(0,112,243,0.45); }

  /* ── 삭제 확인 modal ── */
  [data-theme="white"] .delete-modal-title { color: #111111; }
  [data-theme="white"] .delete-modal-name  { color: #0070f3; }

  /* ── 탈퇴 modal ── */
  [data-theme="white"] #withdrawOverlay { background: rgba(0,0,0,0.35); }
  [data-theme="white"] #withdrawOverlay > div { background: #ffffff !important; border-color: rgba(0,0,0,0.1) !important; }
  [data-theme="white"] #withdrawPassword {
    background: #f5f5f5 !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #111111 !important;
  }

  /* ── toolbar / pagination ── */
  [data-theme="white"] .table-toolbar { border-color: rgba(0,0,0,0.08); }
  [data-theme="white"] .table-toolbar-title { color: #111111; }
  [data-theme="white"] .size-select {
    background: #ffffff;
    border-color: rgba(0,0,0,0.12);
    color: #555555;
  }
  [data-theme="white"] .page-btn { border-color: rgba(0,0,0,0.12); color: #555555; }
  [data-theme="white"] .page-btn:hover { background: rgba(0,112,243,0.08); border-color: rgba(0,112,243,0.3); color: #0070f3; }
  [data-theme="white"] .page-btn.active { background: linear-gradient(135deg,#0070f3,#7928ca); border-color: transparent; color: #fff; }

  /* ── empty-row ── */
  [data-theme="white"] .empty-row { color: #888888; }
  
