/**
 * ==============================================================================
 * @file admin.css
 * @description UNNAMED 관리자 콘솔 전용 하이테크 미니멀리즘 스타일시트
 * - 테마: 딥 옵시디언 (#090a0f), 네온 바이올렛 (#a855f7), 에메랄드 (#10b981), 시안 (#06b6d4)
 * - 글래스모피즘, 정교한 테두리, 부드러운 전환 효과
 * ==============================================================================
 */

:root {
  --bg-primary: #090a0f;
  --bg-secondary: #0f121d;
  --bg-card: rgba(18, 22, 34, 0.75);
  --bg-card-hover: rgba(26, 31, 48, 0.85);
  --bg-input: #121624;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(168, 85, 247, 0.5);

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.25);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
  --backdrop-blur: blur(16px);
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body.admin-body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
  color: var(--text-main);
  font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: 80px;
}

/* ==============================================================================
   1. 헤더 & 네비게이션
   ============================================================================== */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-color);
}

.header-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  font-size: 1.3rem;
  color: var(--accent-purple);
  filter: drop-shadow(0 0 8px var(--accent-purple-glow));
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffffff 30%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.live-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: #34d399;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
}

.live-dot.pulse {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.refresh-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.control-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.btn-icon.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.btn-portal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.btn-portal-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

/* 탭 네비게이션 */
.admin-nav-bar {
  background: rgba(15, 18, 29, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.nav-tab.active {
  color: var(--accent-purple);
  border-bottom-color: var(--accent-purple);
  font-weight: 600;
}

/* ==============================================================================
   2. 본문 레이아웃 & 패널
   ============================================================================== */
.container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-fast);
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.panel.compact {
  padding: 18px;
}

.panel.full-width {
  width: 100%;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.panel-title-group h3, .panel-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.panel-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.panel-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* ==============================================================================
   3. 메트릭 카드 (KPI Cards)
   ============================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.metric-card.highlight-purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(18, 22, 34, 0.75));
  border-color: rgba(168, 85, 247, 0.3);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.metric-badge.live-pulse {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.metric-body {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -1px;
}

.metric-unit {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.metric-dual {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.metric-sublabel {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.metric-value-sm {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
}

.divider-v {
  width: 1px;
  height: 36px;
  background: var(--border-color);
}

.metric-footer {
  font-size: 0.78rem;
}

/* ==============================================================================
   4. 차트 및 그리드 시스템
   ============================================================================== */
.grid-2-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.grid-4-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-wrapper {
  position: relative;
  height: 280px;
  width: 100%;
}

.chart-wrapper-lg {
  position: relative;
  height: 340px;
  width: 100%;
}

.chart-wrapper-dual {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  height: 280px;
}

.chart-item {
  flex: 1;
  text-align: center;
}

.chart-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.donut-box {
  position: relative;
  height: 220px;
}

/* ==============================================================================
   5. 막대 게이지 목록 (Progress Bar List)
   ============================================================================== */
.bar-stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-stat-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.bar-stat-name {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.bar-stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-main);
}

.bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #a855f7, #c084fc);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill.color-cyan { background: linear-gradient(90deg, #06b6d4, #38bdf8); }
.bar-fill.color-emerald { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-fill.color-amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* ==============================================================================
   6. 테이블 시스템 (Data Tables)
   ============================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table, .simple-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th, .simple-table th {
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.data-table td, .simple-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr:hover, .simple-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:last-child td, .simple-table tbody tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-cyan { background: rgba(6, 182, 212, 0.15); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-muted { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

/* 실시간 피드 */
.live-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.live-feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  transition: var(--transition-fast);
}

.live-feed-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.feed-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-icon {
  font-size: 1rem;
}

.feed-path {
  font-weight: 600;
  color: var(--text-main);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-details {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.feed-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.feed-time {
  font-size: 0.72rem;
  color: var(--accent-purple);
  font-family: 'JetBrains Mono', monospace;
}

/* ==============================================================================
   7. 툴바 & 필터 시스템
   ============================================================================== */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-group {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
}

.btn-tab-period {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-tab-period.active {
  background: var(--accent-purple);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 12px var(--accent-purple-glow);
}

.data-mode-badge {
  font-size: 0.75rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.filter-panel {
  margin-bottom: 20px;
}

.log-filter-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-input, .admin-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 9px 12px;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
  width: 100%;
}

.admin-select.sm {
  padding: 4px 8px;
  font-size: 0.78rem;
}

.admin-input:focus, .admin-select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
}

.input-with-icon .admin-input {
  padding-left: 36px;
}

.filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

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

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 버튼 스타일 */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
  border: none;
}

.btn-primary.sm, .btn-secondary.sm, .btn-danger.sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-primary {
  background: var(--accent-purple);
  color: #ffffff;
  box-shadow: 0 0 16px var(--accent-purple-glow);
}

.btn-primary:hover {
  background: #9333ea;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: #f43f5e;
  color: #ffffff;
}

.btn-text-sm {
  background: transparent;
  border: none;
  color: var(--accent-purple);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-text-sm:hover {
  color: #c084fc;
}

/* ==============================================================================
   8. 페이지네이션 바
   ============================================================================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 4px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-page {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-page:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-page.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #ffffff;
  font-weight: 700;
}

.btn-page:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ==============================================================================
   9. 시스템 & 포털 관리 패널
   ============================================================================== */
.services-tab-header {
  margin-bottom: 24px;
}

.services-tab-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.info-table-wrap {
  width: 100%;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 180px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.info-table td {
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.info-table tr:last-child th, .info-table tr:last-child td {
  border-bottom: none;
}

.status-indicator {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.status-indicator.online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.info-banner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.2);
  margin-top: 24px;
}

.info-icon {
  font-size: 1.5rem;
}

.info-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.info-content p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.info-content code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #c084fc;
}

/* ==============================================================================
   10. 모달 & 토스트 알림
   ============================================================================== */
.admin-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.admin-modal-backdrop.show {
  display: flex;
}

.admin-modal {
  background: #111422;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title-group h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.btn-modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.2);
}

.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 16px;
  font-size: 0.85rem;
}

.detail-label {
  color: var(--text-muted);
  font-weight: 600;
}

.detail-value {
  color: var(--text-main);
  word-break: break-all;
}

.detail-code {
  background: #090a0f;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #94a3b8;
  max-height: 120px;
  overflow-y: auto;
}

/* 토스트 */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e2438;
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 0.85rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 유틸리티 컬러 */
.color-purple { color: #c084fc !important; }
.color-cyan { color: #38bdf8 !important; }
.color-emerald { color: #34d399 !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center !important; }

/* 커스텀 범례 */
.legend-custom {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-box {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.legend-box.color-p { background-color: #a855f7; }
.legend-box.color-u { background-color: #06b6d4; }

/* ==============================================================================
   11. 반응형 미디어 쿼리 (모바일 대응)
   ============================================================================== */
@media (max-width: 900px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .log-filter-grid {
    grid-template-columns: 1fr;
  }
  .grid-2-col {
    grid-template-columns: 1fr;
  }
  .grid-4-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .grid-4-col {
    grid-template-columns: 1fr;
  }
  .chart-wrapper-dual {
    flex-direction: column;
    height: auto;
  }
  .donut-box {
    width: 100%;
    height: 180px;
  }
}

/* ==============================================================================
   12. 관리자 인증(로그인 화면 & 헤더 상태) 스타일링
   ============================================================================== */
.admin-login-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #090a0f;
  background-image: 
    radial-gradient(circle at 15% 25%, rgba(168, 85, 247, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.admin-login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(18, 22, 34, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(168, 85, 247, 0.18);
  animation: loginCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

@keyframes loginCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.login-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 16px;
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.35);
}

.login-brand-titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.login-security-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 2px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-top: 6px;
}

.login-desc {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.login-notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 24px;
  font-size: 0.78rem;
  color: #d8b4fe;
  line-height: 1.45;
}

.login-notice-banner svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #c084fc;
}

#admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.login-input-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.01em;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon svg:not(.btn-pw-eye svg) {
  position: absolute;
  left: 14px;
  color: #64748b;
  pointer-events: none;
  z-index: 2;
}

.input-with-icon input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px 12px 42px;
  background: rgba(10, 12, 19, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-with-icon.password-wrap input {
  padding-right: 44px;
}

.input-with-icon input:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
  background: rgba(14, 18, 28, 0.95);
}

.btn-pw-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  z-index: 3;
}

.btn-pw-eye:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.login-error-box {
  padding: 11px 14px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  font-size: 0.8125rem;
  line-height: 1.45;
  text-align: left;
  animation: loginShake 0.3s ease;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.btn-login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  margin-top: 4px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.38);
}

.btn-login-submit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.5);
}

.btn-login-submit:active {
  transform: translateY(1px);
}

.btn-login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-footer-links {
  margin-top: 24px;
  text-align: center;
}

.link-back-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.link-back-portal:hover {
  color: #c084fc;
  text-decoration: underline;
}

/* 관리자 헤더의 인증 상태 배지 및 로그아웃 버튼 */
.admin-auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #e9d5ff;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn-change-pw {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  margin-left: 8px;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-change-pw:hover {
  background: rgba(168, 85, 247, 0.28);
  color: #f3e8ff;
  border-color: rgba(168, 85, 247, 0.55);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fda4af;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #ffe4e6;
  border-color: rgba(244, 63, 94, 0.45);
}
