/* ═══════════════════════════════════════════════════════════
   ANI 2048 Admin Dashboard — Style
   Dark Glassmorphism Theme
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ─ 색상 팔레트 ─ */
  --bg-primary:    #0a0e17;
  --bg-secondary:  #111827;
  --bg-card:       rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input:      rgba(15, 23, 42, 0.8);
  --bg-sidebar:    rgba(15, 23, 42, 0.6);

  --border-color:  rgba(99, 102, 241, 0.2);
  --border-focus:  rgba(99, 102, 241, 0.6);

  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-heading:   #f1f5f9;

  --accent:         #6366f1;
  --accent-light:   #818cf8;
  --accent-glow:    rgba(99, 102, 241, 0.25);

  --success:  #10b981;
  --danger:   #ef4444;
  --warning:  #f59e0b;
  --info:     #3b82f6;

  /* ─ 기본 ─ */
  --radius-sm:  6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --glass-blur: 16px;

  --sidebar-width: 200px;
  --header-height: 60px;
}

/* ═══ 리셋 ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 배경 그라디언트 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(16,185,129,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   로그인 화면
   ═══════════════════════════════════════════════════════════ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 400px;
  width: 90%;
  animation: fadeInUp 0.6s ease;
}

.login-logo { font-size: 56px; margin-bottom: 12px; }
.login-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.btn-google-login {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-google-login:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

.login-error { color: var(--danger); margin-top: 16px; font-size: 13px; min-height: 18px; }

/* ═══════════════════════════════════════════════════════════
   헤더
   ═══════════════════════════════════════════════════════════ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-logo { font-size: 28px; }
.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-heading);
}
.header-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  vertical-align: middle;
}

.header-right { display: flex; align-items: center; gap: 16px; }
.header-email { font-size: 13px; color: var(--text-secondary); }
.btn-logout {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   레이아웃
   ═══════════════════════════════════════════════════════════ */
.dashboard { position: relative; z-index: 1; }

.main-layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ═══ 사이드바 ═══ */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-sidebar);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-color);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}
.nav-btn.active {
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.15);
  font-weight: 600;
}
.nav-icon { font-size: 18px; width: 24px; text-align: center; }

/* ═══ 콘텐츠 ═══ */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  max-width: 960px;
}

.panel { display: none; }
.panel.active { display: block; animation: fadeIn 0.3s ease; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
}

/* ═══════════════════════════════════════════════════════════
   검색바
   ═══════════════════════════════════════════════════════════ */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.search-select {
  padding: 10px 12px;
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.search-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--border-focus); }

.search-results {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 20px;
}
.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-item .sr-nick { font-weight: 500; }
.search-result-item .sr-uid { font-size: 12px; color: var(--text-muted); font-family: monospace; }

/* ═══════════════════════════════════════════════════════════
   카드
   ═══════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.3s;
}
.card:hover { border-color: rgba(99, 102, 241, 0.35); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}
.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
}
.card-actions { display: flex; gap: 8px; }
.card-body { padding: 16px 18px; }

.user-uid-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.uid-label { font-size: 12px; color: var(--text-muted); }
.uid-value {
  font-size: 13px;
  font-family: 'Courier New', monospace;
  color: var(--accent-light);
  user-select: all;
}

/* ═══════════════════════════════════════════════════════════
   필드
   ═══════════════════════════════════════════════════════════ */
.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.field-row label {
  min-width: 120px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.field-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s;
  max-width: 260px;
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field-input.changed {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.06);
}
.field-readonly {
  font-size: 14px;
  color: var(--text-primary);
  padding: 8px 0;
}

.field-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.field-group .field-input { max-width: 140px; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
}

/* ═══════════════════════════════════════════════════════════
   버튼
   ═══════════════════════════════════════════════════════════ */
.btn-primary {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--text-muted); }

.btn-save {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--success);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  animation: fadeIn 0.2s ease;
}
.btn-save:hover { background: #0d9668; }

.btn-danger {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
}

.btn-small {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-small:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   도감
   ═══════════════════════════════════════════════════════════ */
.collection-habitat {
  margin-bottom: 16px;
}
.collection-habitat h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 8px;
  text-transform: capitalize;
}
.collection-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.collection-cell {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  transition: all 0.2s;
}
.collection-cell.found {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success);
  color: var(--success);
}

/* ═══════════════════════════════════════════════════════════
   우편함
   ═══════════════════════════════════════════════════════════ */
.mailbox-list { max-height: 300px; overflow-y: auto; }
.mail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
  font-size: 13px;
}
.mail-item:last-child { border-bottom: none; }
.mail-info { display: flex; flex-direction: column; gap: 2px; }
.mail-title-text { font-weight: 500; color: var(--text-primary); }
.mail-meta { font-size: 11px; color: var(--text-muted); }
.mail-gems {
  font-weight: 600;
  color: var(--warning);
  white-space: nowrap;
}
.mail-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.mail-status.unread { background: rgba(59,130,246,0.15); color: var(--info); }
.mail-status.read { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.mail-status.claimed { background: rgba(16,185,129,0.15); color: var(--success); }

.mailbox-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════
   Details (구매이력 등)
   ═══════════════════════════════════════════════════════════ */
.details-section {
  margin-top: 12px;
}
.details-section summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-light);
  cursor: pointer;
  padding: 6px 0;
}
.details-content {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════
   모달
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  min-width: 380px;
  max-width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: fadeInUp 0.3s ease;
}
.modal-small { min-width: 320px; }
.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 20px;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-body .field-input { max-width: 100%; }
.modal-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════
   토스트
   ═══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--info); }
.toast.warning { background: var(--warning); color: #1a1a1a; }

/* ═══════════════════════════════════════════════════════════
   애니메이션
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  from { opacity: 1; } to { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   스크롤바
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.5); }

/* ═══════════════════════════════════════════════════════════
   최근 유저 패널
   ═══════════════════════════════════════════════════════════ */
.panel-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.recent-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
  cursor: default;
}
.recent-user-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.recent-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.recent-user-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.recent-user-nick {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
}
.recent-user-lv {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-light);
  background: var(--accent-glow);
  padding: 1px 7px;
  border-radius: 10px;
}
.recent-user-uid {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  user-select: all;
}
.recent-user-stats {
  display: flex;
  gap: 14px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.recent-user-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.recent-user-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
  white-space: nowrap;
}

.recent-loading, .recent-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.recent-loading {
  color: var(--accent-light);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════
   재화 로그
   ═══════════════════════════════════════════════════════════ */
.gem-log-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.gem-log-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}
.gem-log-stat.earn {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--success);
}
.gem-log-stat.spend {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
}
.gem-log-stat.total {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent-light);
}

.gem-log-container {
  max-height: 400px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
}
.gem-log-container.expanded {
  max-height: none;
}

.gem-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.gem-log-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.gem-log-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.gem-log-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  vertical-align: middle;
}
.gem-log-table tr:hover td {
  background: rgba(99, 102, 241, 0.04);
}
.gem-log-table tr:last-child td {
  border-bottom: none;
}

.gem-log-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.gem-log-type.earn {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.gem-log-type.spend {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.gem-log-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gem-log-amount.positive { color: var(--success); }
.gem-log-amount.negative { color: var(--danger); }

.gem-log-balance {
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.gem-log-reason {
  color: var(--text-primary);
  font-weight: 500;
}
.gem-log-detail {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 4px;
}
.gem-log-time {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.gem-log-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════
   스테이지 진행도
   ═══════════════════════════════════════════════════════════ */
.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 서식지 필터 탭 */
.stage-habitat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0 0 0;
}
.habitat-tab {
  padding: 4px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.habitat-tab:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.habitat-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.stage-visual {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}
.stage-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  transition: all 0.2s;
  min-width: 0;
  cursor: default;
}
.stage-node:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.stage-node.cleared {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}
.stage-node.current {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.stage-node.locked {
  opacity: 0.45;
}
.stage-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 10px;
}
.stage-node.cleared .stage-num {
  background: var(--success);
  color: #fff;
}
.stage-node.current .stage-num {
  background: var(--accent);
  color: #fff;
}
.stage-node.locked .stage-num {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.stage-cond {
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.stage-stars-group {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}
.stage-star {
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.15s, color 0.15s;
  line-height: 1;
  user-select: none;
}
.stage-star:hover {
  transform: scale(1.3);
}
.stage-star.filled {
  color: #f59e0b;
  text-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}
.stage-star.empty {
  color: var(--text-muted);
  opacity: 0.5;
}
.stage-star.empty:hover {
  color: #f59e0b;
  opacity: 0.8;
}
.stage-node.star-changed {
  border-color: #f59e0b !important;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.2);
}
.stage-total-stars {
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════
   계정 삭제 (Danger Zone)
   ═══════════════════════════════════════════════════════════ */
.card-danger {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.03);
}
.card-danger:hover {
  border-color: rgba(239, 68, 68, 0.45);
}
.card-danger .card-header {
  border-bottom-color: rgba(239, 68, 68, 0.15);
}
.card-danger .card-header h3 {
  color: var(--danger);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.danger-info {
  flex: 1;
}
.danger-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.danger-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.btn-danger-action {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-danger-action:hover {
  background: #dc2626;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* ═══ 반응형 ═══ */
@media (max-width: 768px) {
  .sidebar { width: 60px; padding: 16px 6px; }
  .nav-label { display: none; }
  .content { margin-left: 60px; }
  .field-grid { grid-template-columns: 1fr; }
  .search-bar { flex-wrap: wrap; }
  .recent-user-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .recent-user-right { flex-direction: row; align-items: center; }
  .stage-visual { flex-direction: column; }
  .stage-node { min-width: unset; }
  .danger-zone { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn-danger-action { text-align: center; }
}
