/* =============================================
   O2C 모니터링 대시보드 v2 - CSS
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base: #0a0d18;
  --bg-surface: #10152a;
  --bg-card: #141929;
  --bg-card2: #1a2035;
  --bg-hover: #1f2640;
  --bg-glass: rgba(20, 25, 41, 0.80);

  --border: rgba(99, 117, 200, 0.15);
  --border-active: rgba(99, 117, 200, 0.4);

  --accent: #6c63ff;
  --accent2: #48cae4;
  --accent3: #f9a825;
  --accent4: #ef6c00;
  --accent-green: #26a69a;
  --accent-red: #ef5350;

  --text-primary: #e8ecff;
  --text-secondary: #8892b0;
  --text-muted: #4a5568;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --glow: 0 0 20px rgba(108, 99, 255, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Pretendard', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 배경 그리드 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 117, 200, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 117, 200, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.app-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ──── 헤더 ──── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--glow);
  flex-shrink: 0;
}

.header-brand h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.header-brand span {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: -2px;
}

.header-center {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-nav {
  display: flex;
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
}

.tab-btn {
  padding: 6px 18px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(108, 99, 255, 0.4);
}

.tab-btn:not(.active):hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(38, 166, 154, 0.12);
  border: 1px solid rgba(38, 166, 154, 0.3);
  border-radius: 20px;
  font-size: 11px;
  color: var(--accent-green);
  font-weight: 700;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1)
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8)
  }
}

.last-update {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--mono);
  white-space: nowrap;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
}

/* ──── 메인 & 탭 패널 ──── */
.main-content {
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.tab-panel.active {
  display: flex;
}

/* ──── 섹션 타이틀 ──── */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ──── KPI 3종 카드 ──── */
.kpi-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.kpi3-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi3-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.kpi3-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi3-card:hover::before {
  opacity: 1;
}

.kpi3-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kpi3-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.kpi3-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi3-badge.up {
  color: var(--accent-green);
  background: rgba(38, 166, 154, 0.12);
}

.kpi3-badge.down {
  color: var(--accent-red);
  background: rgba(239, 83, 80, 0.12);
}

.kpi3-badge.warn {
  color: var(--accent3);
  background: rgba(249, 168, 37, 0.12);
}

.kpi3-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.kpi3-main {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi3-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 2px;
}

.kpi3-sub {
  color: var(--text-secondary);
  font-size: 12px;
}

.kpi3-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.kpi3-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
}

.kpi3-detail-label {
  color: var(--text-secondary);
}

.kpi3-detail-val {
  font-family: var(--mono);
  font-weight: 600;
}

.kpi3-status-row {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
  line-height: 1.5;
}

/* 출하율 게이지 */
.gauge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.gauge-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-base);
  border-radius: 3px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1.2s ease-out;
}

.gauge-pct {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  flex-shrink: 0;
}

/* ──── O2C 플로우 ──── */
.flow-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow-x: auto;
}

.o2c-flow {
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-width: 900px;
}

/* 노드 */
.flow-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.flow-node {
  width: 140px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  background: var(--bg-card2);
  transition: var(--transition);
  cursor: default;
  position: relative;
}

.flow-node:hover {
  border-color: var(--node-color, var(--accent));
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.2);
}

.flow-node.status-warning {
  border-color: rgba(249, 168, 37, 0.5);
}

.flow-node.status-error {
  border-color: rgba(239, 83, 80, 0.5);
  animation: pulseError 2s infinite;
}

@keyframes pulseError {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 83, 80, 0);
  }

  50% {
    box-shadow: 0 0 12px 4px rgba(239, 83, 80, 0.3);
  }
}

.node-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.node-name {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
  color: var(--node-color, var(--accent));
}

.node-fullname {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.node-role {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.node-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.node-stat {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.node-stat-label {
  color: var(--text-muted);
}

.node-stat-val {
  font-family: var(--mono);
  font-weight: 600;
}

.node-error-count {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.node-error-count.zero {
  background: rgba(38, 166, 154, 0.12);
  color: var(--accent-green);
}

.node-error-count.nonzero {
  background: rgba(239, 83, 80, 0.12);
  color: var(--accent-red);
}

/* 화살표 (인터페이스) */
.flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
  margin-top: 36px;
  /* 노드 아이콘 높이 맞춤 */
}

.if-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  margin-bottom: 4px;
  transition: var(--transition);
}

.if-badge.status-normal {
  border-color: rgba(38, 166, 154, 0.4);
  color: var(--accent-green);
}

.if-badge.status-warning {
  border-color: rgba(249, 168, 37, 0.4);
  color: var(--accent3);
}

.if-badge.status-error {
  border-color: rgba(239, 83, 80, 0.4);
  color: var(--accent-red);
  animation: pulseError 2s infinite;
}

.if-arrow-line {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
}

.if-arrow-body {
  height: 2px;
  width: 50px;
  background: var(--border-active);
  border-radius: 1px;
}

.if-arrow-head {
  font-size: 14px;
  color: var(--border-active);
}

.if-counts {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

.if-counts .err {
  color: var(--accent-red);
  font-weight: 700;
}

/* ──── 인터페이스 테이블 ──── */
.if-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.if-table thead {
  background: var(--bg-card2);
  position: sticky;
  top: 0;
  z-index: 2;
}

.if-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.if-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.if-table tbody tr:last-child {
  border-bottom: none;
}

.if-table tbody tr:hover {
  background: var(--bg-hover);
}

.if-table tbody td {
  padding: 10px 14px;
  font-size: 12px;
}

.td-mono {
  font-family: var(--mono);
  font-size: 11px;
}

.td-err {
  font-family: var(--mono);
  font-weight: 700;
}

.td-err.zero {
  color: var(--accent-green);
}

.td-err.nonzero {
  color: var(--accent-red);
}

.td-lasterr {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--mono);
  max-width: 260px;
}

.td-lasterr.none {
  color: var(--text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}

.status-badge.normal {
  background: rgba(38, 166, 154, 0.12);
  color: var(--accent-green);
}

.status-badge.warning {
  background: rgba(249, 168, 37, 0.12);
  color: var(--accent3);
}

.status-badge.error {
  background: rgba(239, 83, 80, 0.12);
  color: var(--accent-red);
}

/* ──── 알림 가로 배치 ──── */
.alerts-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.alert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  animation: fadeInUp 0.4s ease-out;
  transition: var(--transition);
}

.alert-card:hover {
  border-color: var(--border-active);
  background: var(--bg-hover);
}

.alert-card.error {
  border-left: 3px solid var(--accent-red);
}

.alert-card.warning {
  border-left: 3px solid var(--accent3);
}

.alert-card.info {
  border-left: 3px solid var(--accent2);
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.alert-card.error .alert-title {
  color: var(--accent-red);
}

.alert-card.warning .alert-title {
  color: var(--accent3);
}

.alert-card.info .alert-title {
  color: var(--accent2);
}

.alert-msg {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.alert-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--mono);
}

/* ──── SO 추적 탭 ──── */
.so-search-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.so-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.so-search-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.so-search-input {
  flex: 1;
  min-width: 220px;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.so-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.so-search-btn {
  padding: 9px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.so-search-btn:hover {
  background: #7b73ff;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

.so-hint-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hint-label {
  font-size: 11px;
  color: var(--text-muted);
}

.hint-chip {
  padding: 4px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--mono);
  transition: var(--transition);
}

.hint-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108, 99, 255, 0.08);
}

/* SO 결과 영역 */
.so-result {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: fadeInUp 0.4s ease-out;
}

.so-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.so-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.so-number {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--mono);
  color: var(--accent2);
}

.so-overall-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.so-overall-badge.delivered {
  background: rgba(38, 166, 154, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(38, 166, 154, 0.3);
}

.so-overall-badge.in_transit {
  background: rgba(41, 182, 246, 0.15);
  color: #29b6f6;
  border: 1px solid rgba(41, 182, 246, 0.3);
}

.so-overall-badge.error {
  background: rgba(239, 83, 80, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 83, 80, 0.3);
}

.so-overall-badge.invoiced {
  background: rgba(171, 71, 188, 0.15);
  color: #ab47bc;
  border: 1px solid rgba(171, 71, 188, 0.3);
}

.so-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.so-meta-item {}

.so-meta-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.so-meta-val {
  font-size: 13px;
  font-weight: 600;
}

/* 타임라인 */
.timeline-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 20px;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 44px;
  width: 2px;
  height: calc(100% - 12px);
  background: var(--border);
}

.tl-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding-top: 10px;
}

.tl-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid var(--border);
  background: var(--bg-card2);
  z-index: 1;
  flex-shrink: 0;
}

.tl-dot.done {
  border-color: var(--accent-green);
  background: rgba(38, 166, 154, 0.1);
}

.tl-dot.warning {
  border-color: var(--accent3);
  background: rgba(249, 168, 37, 0.1);
  animation: pulseDot2 2s infinite;
}

.tl-dot.error {
  border-color: var(--accent-red);
  background: rgba(239, 83, 80, 0.1);
  animation: pulseError 2s infinite;
}

.tl-dot.pending {
  border-color: var(--text-muted);
  background: var(--bg-surface);
}

.tl-dot.blocked {
  border-color: var(--text-muted);
  background: var(--bg-surface);
  opacity: 0.5;
}

@keyframes pulseDot2 {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(249, 168, 37, 0)
  }

  50% {
    box-shadow: 0 0 8px 3px rgba(249, 168, 37, 0.3)
  }
}

.tl-body {
  flex: 1;
  padding: 8px 0 24px;
}

.tl-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.tl-node-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.tl-event {
  font-size: 14px;
  font-weight: 700;
}

.tl-ts {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-secondary);
}

.tl-ts.null {
  color: var(--text-muted);
  font-style: italic;
}

.tl-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 4px;
}

.tl-if-info {
  margin-top: 6px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tl-if-id {
  color: var(--accent2);
}

.tl-if-lat {
  color: var(--accent3);
}

.if-log-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* SO 빈 상태 */
.so-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
}

.so-empty-icon {
  font-size: 56px;
  opacity: 0.25;
}

.so-empty-text {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.8;
}

/* ──── 로딩 ──── */
#loadingOverlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 24px;
  transition: opacity 0.5s ease-out;
}

.loader-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 0 40px rgba(108, 99, 255, 0.5);
  animation: logoFloat 2s ease-in-out infinite;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-8px)
  }
}

.loader-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.loader-bar {
  width: 200px;
  height: 3px;
  background: var(--bg-surface);
  border-radius: 2px;
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  animation: loadAnim 1.5s forwards;
}

@keyframes loadAnim {
  from {
    width: 0
  }

  to {
    width: 100%
  }
}

/* ──── 유틸 ──── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card2);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* 스크롤바 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 3px;
}

/* 반응형 */
@media (max-width: 1000px) {
  .kpi-grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .so-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kpi-grid-3 {
    grid-template-columns: 1fr;
  }

  .header {
    padding: 0 14px;
  }

  .main-content {
    padding: 14px;
  }
}