/**
 * ZipCode Hub — Modern Admin Dashboard Stylesheet
 * High-end SaaS / Cloud Management Design System
 */

/* ── 어드민 테마 변수 ── */
:root,
[data-theme="light"] {
  --adm-bg: #f8fafc;
  --adm-surface: #ffffff;
  --adm-surface-elevated: #ffffff;
  --adm-surface-subtle: #f1f5f9;
  --adm-surface-hover: #e2e8f0;
  --adm-border: rgba(15, 23, 42, 0.08);
  --adm-border-strong: rgba(15, 23, 42, 0.16);
  --adm-text: #0f172a;
  --adm-text-secondary: #475569;
  --adm-text-tertiary: #94a3b8;
  --adm-primary: #2563eb;
  --adm-primary-hover: #1d4ed8;
  --adm-primary-subtle: rgba(37, 99, 235, 0.08);
  --adm-primary-border: rgba(37, 99, 235, 0.2);
  --adm-success: #10b981;
  --adm-success-subtle: rgba(16, 185, 129, 0.1);
  --adm-warning: #f59e0b;
  --adm-warning-subtle: rgba(245, 158, 11, 0.1);
  --adm-danger: #ef4444;
  --adm-danger-subtle: rgba(239, 68, 68, 0.1);
  --adm-terminal-bg: #0f172a;
  --adm-terminal-text: #e2e8f0;
  --adm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --adm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --adm-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --adm-shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --adm-glass-bg: rgba(255, 255, 255, 0.85);
  --adm-glass-border: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] {
  --adm-bg: #090d16;
  --adm-surface: #111827;
  --adm-surface-elevated: #1f2937;
  --adm-surface-subtle: #1e293b;
  --adm-surface-hover: #334155;
  --adm-border: rgba(255, 255, 255, 0.08);
  --adm-border-strong: rgba(255, 255, 255, 0.16);
  --adm-text: #f8fafc;
  --adm-text-secondary: #94a3b8;
  --adm-text-tertiary: #64748b;
  --adm-primary: #3b82f6;
  --adm-primary-hover: #60a5fa;
  --adm-primary-subtle: rgba(59, 130, 246, 0.16);
  --adm-primary-border: rgba(59, 130, 246, 0.3);
  --adm-success: #34d399;
  --adm-success-subtle: rgba(52, 211, 153, 0.15);
  --adm-warning: #fbbf24;
  --adm-warning-subtle: rgba(251, 191, 36, 0.15);
  --adm-danger: #f87171;
  --adm-danger-subtle: rgba(248, 113, 113, 0.15);
  --adm-terminal-bg: #030712;
  --adm-terminal-text: #f3f4f6;
  --adm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --adm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  --adm-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
  --adm-shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  --adm-glass-bg: rgba(17, 24, 39, 0.85);
  --adm-glass-border: rgba(255, 255, 255, 0.08);
}

/* ── 어드민 기본 레이아웃 ── */
body.admin-body {
  background: var(--adm-bg);
  color: var(--adm-text);
  min-height: 100vh;
  padding: 0;
  margin: 0;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

/* ── 프리미엄 상단 헤더 / 내비바 ── */
.adm-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--adm-glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--adm-border);
  transition: all 0.2s ease;
}

.adm-header__inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* 브랜드 로고 & 배지 */
.adm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--adm-text);
  flex-shrink: 0;
}

.adm-brand:hover {
  text-decoration: none;
}

.adm-brand__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.adm-brand__meta {
  display: flex;
  flex-direction: column;
}

.adm-brand__name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.adm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.adm-badge--prod {
  background: var(--adm-success-subtle);
  color: var(--adm-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.adm-badge--live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--adm-success);
  box-shadow: 0 0 8px var(--adm-success);
  animation: adm-pulse 2s infinite ease-in-out;
}

@keyframes adm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.adm-brand__sub {
  font-size: 0.72rem;
  color: var(--adm-text-tertiary);
}

/* 탭 세그먼트 컨트롤 */
.adm-nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--adm-surface-subtle);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--adm-border);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.adm-nav-tabs::-webkit-scrollbar {
  display: none;
}

.adm-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 0.80rem;
  font-weight: 500;
  color: var(--adm-text-secondary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: all 0.15s ease;
}

.adm-nav-tab:hover {
  color: var(--adm-text);
  background: var(--adm-surface-hover);
}

.adm-nav-tab.is-active {
  color: var(--adm-primary);
  background: var(--adm-surface);
  font-weight: 600;
  box-shadow: var(--adm-shadow-sm);
}

.adm-nav-tab svg {
  width: 15px;
  height: 15px;
  opacity: 0.75;
  flex-shrink: 0;
}

.adm-nav-tab.is-active svg {
  opacity: 1;
}

.adm-nav-tab.is-locked,
.adm-nav-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: auto;
}

.adm-nav-sync-lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 999px;
  letter-spacing: -0.2px;
  margin-left: 6px;
  animation: admPulseLock 2s infinite ease-in-out;
  user-select: none;
}

[data-theme='dark'] .adm-nav-sync-lock {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

@keyframes admPulseLock {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.55; }
}

.adm-sync-lock-pulse {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 6px #ef4444;
  display: inline-block;
}

/* 우측 퀵 컨트롤 및 프로필 */
.adm-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.adm-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--adm-surface-subtle);
  border: 1px solid var(--adm-border);
  color: var(--adm-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.adm-action-btn:hover {
  color: var(--adm-text);
  background: var(--adm-surface-hover);
  border-color: var(--adm-border-strong);
}

.adm-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  background: var(--adm-surface-subtle);
  border: 1px solid var(--adm-border);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--adm-text);
}

.adm-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
}

.adm-user-role {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--adm-primary-subtle);
  color: var(--adm-primary);
  font-weight: 600;
  text-transform: uppercase;
}

.adm-btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--adm-danger);
  background: var(--adm-danger-subtle);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.adm-btn-logout:hover {
  background: var(--adm-danger);
  color: #ffffff;
  text-decoration: none;
}

/* ── KPI / 대시보드 통계 카드 그리드 ── */
.adm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.adm-kpi-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--adm-shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.adm-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--adm-shadow);
  border-color: var(--adm-border-strong);
}

.adm-kpi-meta {
  display: flex;
  flex-direction: column;
}

.adm-kpi-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--adm-text-secondary);
  margin-bottom: 4px;
}

.adm-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--adm-text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.adm-kpi-sub {
  font-size: 0.75rem;
  color: var(--adm-text-tertiary);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.adm-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.adm-kpi-icon--blue {
  background: var(--adm-primary-subtle);
  color: var(--adm-primary);
}

.adm-kpi-icon--green {
  background: var(--adm-success-subtle);
  color: var(--adm-success);
}

.adm-kpi-icon--amber {
  background: var(--adm-warning-subtle);
  color: var(--adm-warning);
}

.adm-kpi-icon--purple {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

/* ── 메인 카드 패널 ── */
.adm-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 16px;
  box-shadow: var(--adm-shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  transition: border-color 0.2s ease;
}

.adm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.adm-card-title-group h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--adm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.adm-card-title-group p {
  font-size: 0.85rem;
  color: var(--adm-text-secondary);
  margin: 4px 0 0;
}

/* 툴바 & 액션 바 */
.adm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--adm-surface-subtle);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
}

.adm-search-wrap {
  position: relative;
  flex: 1 1 260px;
  display: flex;
  align-items: center;
}

.adm-search-icon {
  position: absolute;
  left: 12px;
  color: var(--adm-text-tertiary);
  pointer-events: none;
}

.adm-search-input {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 38px;
  font-size: 0.88rem;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  color: var(--adm-text);
  transition: all 0.15s ease;
}

.adm-search-input:focus {
  outline: none;
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px var(--adm-primary-subtle);
}

.adm-search-clear {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--adm-text-tertiary);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  line-height: 1;
}

.adm-search-clear:hover {
  color: var(--adm-text);
}

/* 공통 버튼 디자인 */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  font-size: 0.86rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.adm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.adm-btn--primary {
  background: var(--adm-primary);
  color: #ffffff;
  border-color: var(--adm-primary);
}

.adm-btn--primary:hover:not(:disabled) {
  background: var(--adm-primary-hover);
  border-color: var(--adm-primary-hover);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.adm-btn--secondary {
  background: var(--adm-surface);
  color: var(--adm-text);
  border-color: var(--adm-border);
}

.adm-btn--secondary:hover:not(:disabled) {
  background: var(--adm-surface-hover);
  border-color: var(--adm-border-strong);
}

.adm-btn--ghost {
  background: transparent;
  color: var(--adm-text-secondary);
}

.adm-btn--ghost:hover:not(:disabled) {
  background: var(--adm-surface-subtle);
  color: var(--adm-text);
}

.adm-btn--danger {
  background: var(--adm-danger-subtle);
  color: var(--adm-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.adm-btn--danger:hover:not(:disabled) {
  background: var(--adm-danger);
  color: #ffffff;
}

.adm-btn--sm {
  height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
  border-radius: 6px;
}

.adm-btn.is-active {
  background: var(--adm-primary-subtle);
  color: var(--adm-primary);
  border-color: var(--adm-primary-border);
  font-weight: 600;
}

/* 필터 칩 토글 */
.adm-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--adm-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.adm-chip-toggle input[type="checkbox"] {
  accent-color: var(--adm-primary);
  cursor: pointer;
}

.adm-chip-toggle:hover {
  background: var(--adm-surface-hover);
  color: var(--adm-text);
}

.adm-select {
  height: 40px;
  padding: 0 32px 0 12px;
  font-size: 0.86rem;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  color: var(--adm-text);
  cursor: pointer;
}

.adm-select:focus {
  outline: none;
  border-color: var(--adm-primary);
}

/* ── 데이터 테이블 ── */
.adm-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: var(--adm-surface);
}

.adm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  text-align: left;
}

.adm-table th {
  background: var(--adm-surface-subtle);
  color: var(--adm-text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--adm-border);
  white-space: nowrap;
}

.adm-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--adm-border);
  color: var(--adm-text);
  vertical-align: middle;
}

.adm-table tr:last-child td {
  border-bottom: none;
}

.adm-table tr:hover td {
  background: var(--adm-surface-subtle);
}

/* 클릭 복사 칩 */
.adm-copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--adm-surface-subtle);
  border: 1px solid var(--adm-border);
  border-radius: 6px;
  color: var(--adm-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.adm-copy-chip:hover {
  background: var(--adm-primary-subtle);
  border-color: var(--adm-primary-border);
}

.adm-addr-text {
  font-weight: 500;
  color: var(--adm-text);
  cursor: pointer;
  border-bottom: 1px dashed var(--adm-border-strong);
  padding-bottom: 1px;
}

.adm-addr-text:hover {
  color: var(--adm-primary);
  border-color: var(--adm-primary);
}

/* 행 액션 버튼들 */
.adm-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── 페이지네이션 ── */
.adm-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--adm-border);
}

.adm-pager__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.adm-pager__btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--adm-text-secondary);
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.adm-pager__btn:hover:not(:disabled) {
  color: var(--adm-text);
  background: var(--adm-surface-hover);
  border-color: var(--adm-border-strong);
}

.adm-pager__btn.is-active {
  background: var(--adm-primary);
  color: #ffffff;
  border-color: var(--adm-primary);
  font-weight: 600;
}

.adm-pager__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.adm-pager__info {
  font-size: 0.82rem;
  color: var(--adm-text-secondary);
}

.adm-pager__info strong {
  color: var(--adm-text);
}

/* ── 터미널 콘솔 로그 윈도우 ── */
.adm-terminal {
  background: var(--adm-terminal-bg);
  color: var(--adm-terminal-text);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: var(--adm-shadow-lg);
  margin: 16px 0;
  display: flex;
  flex-direction: column;
}

.adm-terminal-bar {
  background: rgba(0, 0, 0, 0.4);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.adm-terminal-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.adm-terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.adm-terminal-dot--red { background: #ef4444; }
.adm-terminal-dot--yellow { background: #f59e0b; }
.adm-terminal-dot--green { background: #10b981; }

.adm-terminal-title {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.adm-terminal-body {
  padding: 16px;
  max-height: 380px;
  min-height: 200px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.adm-terminal-line {
  display: flex;
  gap: 10px;
  word-break: break-all;
}

.adm-terminal-time {
  color: #64748b;
  user-select: none;
  flex-shrink: 0;
}

.adm-terminal-msg {
  color: #f1f5f9;
}

/* ── 프로그레스 바 ── */
.adm-progress {
  width: 100%;
  height: 8px;
  background: var(--adm-surface-subtle);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.adm-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
  background-size: 200% 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
  animation: adm-shimmer 2s infinite linear;
}

@keyframes adm-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 드롭존 (수동 업로드) ── */
.adm-dropzone {
  border: 2px dashed var(--adm-border-strong);
  border-radius: 14px;
  padding: 36px 20px;
  text-align: center;
  background: var(--adm-surface-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.adm-dropzone:hover,
.adm-dropzone.is-dragover {
  border-color: var(--adm-primary);
  background: var(--adm-primary-subtle);
}

.adm-dropzone__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--adm-primary);
}

.adm-dropzone__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--adm-text);
  margin-bottom: 4px;
}

.adm-dropzone__sub {
  font-size: 0.8rem;
  color: var(--adm-text-secondary);
}

/* ── 통계 클라우드 (시도별 분포) ── */
.adm-stat-cloud {
  background: var(--adm-surface-subtle);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adm-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--adm-text);
}

.adm-stat-pill strong {
  color: var(--adm-primary);
  font-family: var(--mono);
}

/* ── 2분할 레이아웃 그리드 (동기화 탭용) ── */
.adm-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.adm-box {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--adm-shadow-sm);
}

.adm-box-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--adm-text);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.adm-box-desc {
  font-size: 0.82rem;
  color: var(--adm-text-secondary);
  line-height: 1.5;
  margin: 0 0 16px;
}

/* ── API Playground 스타일 ── */
.adm-api-subtabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--adm-border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.adm-code-block {
  background: var(--adm-terminal-bg);
  color: #38bdf8;
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.adm-code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.adm-code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── 모달 다이얼로그 ── */
.adm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.adm-modal {
  width: 100%;
  max-width: 680px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border-strong);
  border-radius: 18px;
  box-shadow: var(--adm-shadow-modal);
  overflow: hidden;
  animation: adm-modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes adm-modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.adm-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.adm-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--adm-text);
  margin: 0;
}

.adm-modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--adm-text-tertiary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.adm-modal-close:hover {
  color: var(--adm-text);
  background: var(--adm-surface-subtle);
}

.adm-modal-body {
  padding: 24px;
  max-height: calc(85vh - 140px);
  overflow-y: auto;
}

.adm-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--adm-border);
  background: var(--adm-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.adm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.adm-form-grid--full {
  grid-column: 1 / -1;
}

.adm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adm-field__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--adm-text-secondary);
}

.adm-field__label strong {
  color: var(--adm-danger);
}

.adm-input {
  height: 40px;
  padding: 0 12px;
  font-size: 0.88rem;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  color: var(--adm-text);
  transition: all 0.15s ease;
}

.adm-input:focus {
  outline: none;
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px var(--adm-primary-subtle);
}

/* ── 플로팅 토스트 ── */
.adm-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.adm-toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 440px;
  padding: 12px 18px;
  background: var(--adm-surface-elevated);
  border: 1px solid var(--adm-border-strong);
  border-radius: 12px;
  box-shadow: var(--adm-shadow-lg);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--adm-text);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: adm-toast-slide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes adm-toast-slide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.adm-toast--success {
  border-left: 4px solid var(--adm-success);
}

.adm-toast--error {
  border-left: 4px solid var(--adm-danger);
}

.adm-toast--info {
  border-left: 4px solid var(--adm-primary);
}

/* ── 빈 상태 (Empty State) ── */
.adm-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--adm-text-secondary);
}

.adm-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--adm-surface-subtle);
  color: var(--adm-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.adm-empty h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--adm-text);
  margin: 0 0 6px;
}

.adm-empty p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--adm-text-tertiary);
}

/* ── 도움말 모달 전용 스타일 ── */
.modal--help {
  max-width: 860px;
  width: 95%;
}

.help-layout {
  display: flex;
  min-height: 440px;
  max-height: 68vh;
  overflow: hidden;
}

.help-nav {
  width: 180px;
  flex-shrink: 0;
  background: var(--adm-surface-subtle);
  border-right: 1px solid var(--adm-border);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.help-nav__item {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--adm-text-secondary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-nav__item:hover {
  background: var(--adm-surface-hover);
  color: var(--adm-text);
}

.help-nav__item.is-active {
  background: var(--adm-primary);
  color: #ffffff;
  font-weight: 600;
}

.help-body {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  color: var(--adm-text);
  font-size: 0.88rem;
  line-height: 1.6;
}

.help-article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--adm-text);
}

.help-article h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 18px 0 8px;
  color: var(--adm-text);
}

.help-article p {
  margin: 0 0 10px;
  color: var(--adm-text-secondary);
}

.help-article ul,
.help-article ol {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--adm-text-secondary);
}

.help-article li {
  margin-bottom: 4px;
}

.help-callout {
  background: var(--adm-primary-subtle);
  border-left: 3px solid var(--adm-primary);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 0.82rem;
  color: var(--adm-text);
  margin: 14px 0;
}

.help-callout--warn {
  background: var(--adm-warning-subtle);
  border-left-color: var(--adm-warning);
}

.help-article kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-family: var(--mono);
  background: var(--adm-surface-subtle);
  border: 1px solid var(--adm-border-strong);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--adm-border-strong);
  color: var(--adm-text);
}

/* ── 고성능 CSS 툴팁 시스템 (Detailed Tooltips) ── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1100;
}

/* 툴팁 말풍선 본체 */
[data-tooltip]::before {
  content: attr(data-tooltip);
  background: var(--adm-terminal-bg);
  color: #f8fafc;
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  white-space: normal;
  width: max-content;
  max-width: 280px;
  text-align: left;
  letter-spacing: -0.01em;
}

/* 툴팁 화살표 */
[data-tooltip]::after {
  content: "";
  border: 5px solid transparent;
}

/* 상단 위치 (기본) */
[data-tooltip]:not([data-tooltip-pos])::before,
[data-tooltip][data-tooltip-pos="top"]::before {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  margin-bottom: 8px;
}

[data-tooltip]:not([data-tooltip-pos])::after,
[data-tooltip][data-tooltip-pos="top"]::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border-top-color: var(--adm-terminal-bg);
  margin-bottom: -2px;
}

/* 하단 위치 */
[data-tooltip][data-tooltip-pos="bottom"]::before {
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  margin-top: 8px;
}

[data-tooltip][data-tooltip-pos="bottom"]::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  border-bottom-color: var(--adm-terminal-bg);
  margin-top: -2px;
}

/* 호버 상태 활성화 */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
}

[data-tooltip]:not([data-tooltip-pos]):hover::before,
[data-tooltip][data-tooltip-pos="top"]:hover::before {
  transform: translateX(-50%) translateY(0);
}

[data-tooltip]:not([data-tooltip-pos]):hover::after,
[data-tooltip][data-tooltip-pos="top"]:hover::after {
  transform: translateX(-50%) translateY(0);
}

[data-tooltip][data-tooltip-pos="bottom"]:hover::before,
[data-tooltip][data-tooltip-pos="bottom"]:hover::after {
  transform: translateX(-50%) translateY(0);
}

/* ── 스피너 인디케이터 (버튼 및 테이블 인라인) ── */
.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: adm-spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.spinner-btn {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(37, 99, 235, 0.25);
  border-top-color: var(--adm-primary);
  border-radius: 50%;
  animation: adm-spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes adm-spin {
  to { transform: rotate(360deg); }
}

/* ── 지도 보기 버튼 & 팝업 칩 ── */
.adm-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface-subtle);
  color: var(--adm-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
  margin-left: 6px;
  text-decoration: none;
}

.adm-map-btn:hover {
  background: #fee500;
  color: #191919;
  border-color: #fada00;
  text-decoration: none;
}

.adm-map-btn--naver:hover {
  background: #03c75a;
  color: #ffffff;
  border-color: #02b350;
}

/* ── 감사 로그(Audit Log) 테이블 & 뱃지 ── */
.adm-action-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.adm-action-badge--CREATE {
  background: var(--adm-success-subtle);
  color: var(--adm-success);
}

.adm-action-badge--UPDATE {
  background: var(--adm-primary-subtle);
  color: var(--adm-primary);
}

.adm-action-badge--DELETE {
  background: var(--adm-danger-subtle);
  color: var(--adm-danger);
}

.adm-action-badge--TRUNCATE {
  background: #7f1d1d;
  color: #fecaca;
}

.adm-action-badge--SYNC,
.adm-action-badge--AUTO_SYNC {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

/* ── 우편번호 갱신 센터 신규 2열 마스터-디테일 레이아웃 ── */
.adm-sync-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1080px) {
  .adm-sync-layout {
    grid-template-columns: 1fr;
  }
}

.adm-sync-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.adm-sync-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* 좌측 서브 탭 세그먼트 컨트롤 */
.adm-sub-tabs {
  display: flex;
  background: var(--adm-surface-subtle);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--adm-border);
  gap: 4px;
}

.adm-sub-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--adm-text-secondary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.adm-sub-tab:hover {
  color: var(--adm-text);
  background: var(--adm-surface-hover);
}

.adm-sub-tab.is-active {
  color: var(--adm-primary);
  background: var(--adm-surface);
  box-shadow: var(--adm-shadow-sm);
  border: 1px solid var(--adm-border);
}

/* 우측 파일 리스트 카드 */
.adm-file-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  box-shadow: var(--adm-shadow-sm);
  overflow: hidden;
}

.adm-file-card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--adm-surface-subtle);
}

.adm-file-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--adm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.adm-file-table-wrap {
  max-height: 270px;
  overflow-y: auto;
}

.adm-file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.adm-file-table th {
  padding: 8px 14px;
  background: var(--adm-surface-subtle);
  color: var(--adm-text-tertiary);
  font-weight: 600;
  border-bottom: 1px solid var(--adm-border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.adm-file-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--adm-border);
  color: var(--adm-text);
}

.adm-file-table tr:last-child td {
  border-bottom: none;
}

.adm-file-table tr.is-processing {
  background: color-mix(in srgb, var(--adm-primary) 6%, transparent);
}

.adm-file-table tr.is-done {
  background: color-mix(in srgb, var(--adm-success) 4%, transparent);
}

.adm-file-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.adm-file-status--pending {
  background: var(--adm-surface-subtle);
  color: var(--adm-text-tertiary);
  border: 1px solid var(--adm-border);
}

.adm-file-status--processing {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.adm-file-status--done {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.adm-file-status--error {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── 모바일 반응형 ── */
@media (max-width: 900px) {
  .adm-header__inner {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .adm-nav-tabs {
    order: 3;
    width: 100%;
    margin-top: 8px;
  }
  .admin-container {
    padding: 16px 16px 48px;
  }
  .adm-form-grid {
    grid-template-columns: 1fr;
  }
  .adm-kpi-grid {
    grid-template-columns: 1fr;
  }
  .help-layout {
    flex-direction: column;
    max-height: 75vh;
  }
  .help-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--adm-border);
  }
}

