/* server_monitor 화면 CSS — 퍼블리싱 시안 newchart(server_list v0.7 · server_detail · issues · criteria v0.1)의 <style> 4개를 한 파일로 합친 것.
   페이지별로 겹치던 규칙(.topbar .page-title .seg .status .app 등)은 목록 페이지 값을 기본으로 두고, 하위 페이지는 .sub / .pagination 으로 구분한다. */
:root {
  --bg: #020817;
  --surface: #071631;
  --line: rgba(56, 189, 248, .22);
  --line-soft: rgba(56, 189, 248, .1);
  --line-strong: rgba(125, 211, 252, .5);
  --text: #e6f1ff;
  --text-2: #8aa4c4;
  --text-3: #6f87a8;
  --cyan: #38bdf8;
  --cyan-soft: #7dd3fc;
  /* 상태 색상 (어두운 배경 기준 상호 구분 검증됨) */
  --ok: #22c55e;
  --warn: #f5b400;
  --down: #ef4444;
  --nodata: #f9a8d4;
  --noreport: #a78bfa;
  --inactive: #737d90;
  --radius: 12px;
  --mono: ui-monospace, "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(1200px 520px at 50% 0, rgba(30, 64, 175, .2), transparent 70%), var(--bg);
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, select, input { font: inherit; }
:focus-visible { outline: 2px solid var(--cyan-soft); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: .93em; }
.muted { color: var(--text-3); }
/* 항목 이름: 점선 밑줄 + 마우스를 올리면 설명 */
.term { border-bottom: 1px dotted var(--text-3); cursor: help; }

/* 상태 키워드 → 색상 (--c) */
.st-all { --c: var(--cyan); }
.st-ok { --c: var(--ok); }
.st-warn { --c: var(--warn); }
.st-down { --c: var(--down); }
.st-nodata { --c: var(--nodata); }
.st-noreport { --c: var(--noreport); }
.st-inactive { --c: var(--inactive); }
.st-note { --c: var(--text-3); }   /* 알림 단계 '기록' (알림 없음, 회색) — 2026-11-03 3단계 */

/* ---------- 공통: 패널 (위쪽 테두리에 빛) ---------- */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(14, 36, 74, .72), rgba(5, 14, 32, .88));
  box-shadow: inset 0 1px 0 rgba(125, 211, 252, .08), 0 0 24px rgba(14, 165, 233, .06);
}
.panel::before {
  content: "";
  position: absolute; top: -1px; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, .7), transparent);
  pointer-events: none;
}
.pad { padding: 16px 18px 18px; }

/* ---------- 레이아웃 ---------- */
.app { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 24px; min-height: 100vh; }
.app.sub { max-width: 1880px; margin: 0 auto; padding-bottom: 32px; min-height: 0; }

/* ---------- 상단 바 ---------- */
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 4px 0; }
.topbar.sub { align-items: flex-end; padding: 0; }
.title-wrap { display: flex; align-items: center; gap: 14px; }
.topbar.sub .title-wrap { margin-top: 10px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 0 18px rgba(56, 189, 248, .45);
  color: #fff;
}
.brand-logo .ic { width: 22px; height: 22px; }
.brand-name { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.topbar.sub .page-title { font-size: 24px; letter-spacing: -.01em; color: #fff; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.back:hover { color: var(--cyan-soft); }
.back .ic { width: 16px; height: 16px; }
.title-icon, .topbar .srv-icon {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  color: #e0f2fe;
  background: radial-gradient(circle at 35% 30%, rgba(125, 211, 252, .35), rgba(14, 58, 120, .9));
  box-shadow: 0 0 0 1px rgba(125, 211, 252, .45), 0 0 16px rgba(56, 189, 248, .35);
}
.title-icon .ic, .topbar .srv-icon .ic { width: 22px; height: 22px; }
.title-icon.alert {
  color: #fecaca;
  background: radial-gradient(circle at 35% 30%, rgba(248, 113, 113, .4), rgba(90, 20, 30, .9));
  box-shadow: 0 0 0 1px rgba(248, 113, 113, .5), 0 0 16px rgba(239, 68, 68, .35);
}
.topbar .srv-icon.off { color: #94a3b8; background: rgba(30, 41, 59, .9); box-shadow: 0 0 0 1px rgba(100, 116, 139, .6); }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-meta { margin-top: 3px; font-size: 13px; color: var(--text-2); }
.title-meta .sep { margin: 0 6px; color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-actions .btn .ic { width: 16px; height: 16px; }

.live {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: 10px;
  font-size: 13px; color: var(--text-2);
  background: rgba(2, 10, 28, .6);
  border: 1px solid var(--line);
}
.live b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: ping 1.8s infinite; }
.live-sep { color: var(--text-3); }
/* 부분 갱신 실패 → 점·시각이 빨갛게 */
.live.err .live-dot { background: var(--down); animation: none; }
.live.err b { color: var(--down); }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* ---------- 폼 요소 / 버튼 ---------- */
.input {
  height: 38px; padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(2, 10, 28, .6);
  color: var(--text);
  font: inherit; font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: rgba(125, 211, 252, .6); box-shadow: 0 0 0 3px rgba(56, 189, 248, .18); }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238aa4c4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
.select option { background: #061226; color: var(--text); }
.search { position: relative; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.search .input { padding-left: 34px; width: 260px; }

.btn {
  height: 38px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(56, 189, 248, .04);
  color: var(--text);
  font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: rgba(56, 189, 248, .1); border-color: var(--line-strong); }
.btn .ic { width: 16px; height: 16px; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.icon-btn { position: relative; width: 38px; padding: 0; justify-content: center; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; background: transparent; border-color: transparent; color: var(--text-3); }
.icon-btn.sm:hover { background: rgba(56, 189, 248, .08); color: var(--text); }
.btn-primary {
  border-color: rgba(125, 211, 252, .6);
  background: linear-gradient(180deg, #0ea5e9, #2563eb);
  color: #fff;
  box-shadow: 0 0 16px rgba(56, 189, 248, .35);
}
.btn-primary:hover { border-color: #bae6fd; background: linear-gradient(180deg, #38bdf8, #3b82f6); }
/* 상단 버튼: 열린 문제 (붉은 톤 + 건수 뱃지) */
.btn-issue { border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .1); color: #fecaca; }
.btn-issue:hover { border-color: #f87171; background: rgba(239, 68, 68, .2); }
.btn-issue b {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 99px;
  background: var(--down); color: #fff;
  font-size: 11px; font-weight: 800;
}
.btn-issue.none { border-color: var(--line); background: rgba(56, 189, 248, .04); color: var(--text); }
.btn-issue.none b { background: rgba(125, 211, 252, .15); color: var(--text-2); }
.view-toggle .ic { width: 15px; height: 15px; }

/* ---------- KPI 카드 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; overflow: hidden; }
.kpi-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.kpi .term { border-bottom-color: currentColor; }
.kpi-icon {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 22%, transparent);
}
.kpi-icon .ic { width: 16px; height: 16px; }
.kpi-value { margin-top: 10px; font-size: 26px; font-weight: 700; line-height: 1.15; color: #fff; text-shadow: 0 0 18px rgba(56, 189, 248, .35); }
.kpi-value small { margin-left: 3px; font-size: 13px; font-weight: 500; color: var(--text-2); text-shadow: none; }
.kpi-sub { margin-top: 4px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub b { font-weight: 600; color: var(--c); }
.kpi.st-all .kpi-sub b { color: var(--text); }
.kpi.st-inactive .kpi-value { color: var(--text-2); text-shadow: none; }
.kpi.st-down { border-color: rgba(239, 68, 68, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 28px rgba(239, 68, 68, .14); }
.kpi.st-down::before { background: linear-gradient(90deg, transparent, rgba(252, 165, 165, .8), transparent); }
/* 추이선 (현재 장식용 더미) */
.spark { position: absolute; right: 14px; top: 50px; width: 40%; height: 32px; overflow: visible; }
.spark-line { fill: none; stroke: var(--cyan); stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px rgba(56, 189, 248, .8)); }
.spark-area { fill: rgba(56, 189, 248, .12); }

/* ---------- AI 코어 무대: 양옆 운영 서버 + 가운데 코어. 위쪽 88px 은 제목 자리 ---------- */
.ai-stage {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  min-height: 600px;
  padding: 88px 20px 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 50% 60% at 50% 55%, rgba(29, 78, 216, .3), transparent 70%),
    linear-gradient(rgba(56, 189, 248, .035) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(56, 189, 248, .035) 1px, transparent 1px) 0 0 / 40px 40px,
    #020a1c;
}
.ai-beams { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.ai-layer {
  position: absolute;
  top: 22px; left: 50%;
  padding: 10px 32px;
  border: 1px solid rgba(56, 189, 248, .45);
  border-radius: 6px;
  background: rgba(2, 10, 28, .85);
  box-shadow: 0 0 24px rgba(56, 189, 248, .18), inset 0 0 16px rgba(56, 189, 248, .08);
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
}
.ai-layer::before, .ai-layer::after { content: ""; position: absolute; top: 50%; width: 72px; height: 1px; }
.ai-layer::before { right: 100%; background: linear-gradient(90deg, transparent, rgba(56, 189, 248, .6)); }
.ai-layer::after { left: 100%; background: linear-gradient(90deg, rgba(56, 189, 248, .6), transparent); }
/* letter-spacing 이 글자 뒤에도 붙어 한쪽으로 쏠리므로 같은 값만큼 왼쪽 여백을 줘서 가운데 맞춤 */
.ai-layer-name { padding-left: .28em; font-size: 17px; font-weight: 700; letter-spacing: .28em; color: #fff; text-shadow: 0 0 12px rgba(125, 211, 252, .8), 0 0 28px rgba(56, 189, 248, .5); }
.ai-layer-desc { margin-top: 3px; padding-left: .42em; font-size: 11px; font-weight: 600; letter-spacing: .42em; color: var(--cyan-soft); }
.ai-nodes { display: flex; flex-direction: column; justify-content: space-evenly; gap: 10px; width: 292px; }

/* 서버 카드 (운영 / 비운영 공용). --nc: 카드 색 */
.ai-node {
  --nc: var(--cyan);
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--nc) 40%, transparent);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(10, 30, 64, .94), rgba(5, 16, 38, .94));
  box-shadow: 0 0 16px color-mix(in srgb, var(--nc) 14%, transparent), inset 0 0 12px color-mix(in srgb, var(--nc) 6%, transparent);
  transition: border-color .2s, box-shadow .2s;
}
.ai-node:hover { border-color: color-mix(in srgb, var(--nc) 75%, #fff); box-shadow: 0 0 22px color-mix(in srgb, var(--nc) 35%, transparent), inset 0 0 12px color-mix(in srgb, var(--nc) 10%, transparent); }
.ai-node[data-status="warn"] { --nc: var(--warn); }
.ai-node[data-status="nodata"] { --nc: var(--nodata); }
.ai-node[data-status="noreport"] { --nc: var(--noreport); }
.ai-node[data-status="down"] {
  --nc: var(--down);
  border-color: rgba(239, 68, 68, .6);
  background: linear-gradient(90deg, rgba(60, 14, 24, .94), rgba(22, 8, 20, .94));
  box-shadow: 0 0 24px rgba(239, 68, 68, .3), inset 0 0 12px rgba(239, 68, 68, .1);
}
/* 5초마다 데이터를 보낼 때 연결점이 깜빡임 */
.ai-nodes .ai-node.is-send::after { animation: ai-dot-send 1s ease-out; }
/* 빛줄기가 출발하는 점 - 코어 쪽 옆면 */
.ai-nodes .ai-node::after {
  content: "";
  position: absolute; top: 50%;
  width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--nc) 70%, #fff);
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--nc) 80%, transparent);
}
.ai-nodes-left .ai-node::after { right: -4px; }
.ai-nodes-right .ai-node::after { left: -4px; }
.ai-node-icon {
  display: inline-grid; flex: none; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--nc) 35%, transparent), rgba(10, 34, 74, .92));
  color: #e0f2fe;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--nc) 50%, transparent), 0 0 12px color-mix(in srgb, var(--nc) 45%, transparent);
}
.ai-node-icon .ic { width: 15px; height: 15px; }
.ai-node-body { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; line-height: 1.35; }
.ai-node-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ai-node-name { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: 13px; font-weight: 600; color: #fff; text-overflow: ellipsis; white-space: nowrap; }
/* 요약: 이상 내용이 있으면 이상 내용(카드 상태 색), 없으면 IP */
.ai-node-sum { overflow: hidden; margin-top: 3px; font-size: 11px; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.ai-node-sum.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ai-node-sum.is-issue { font-weight: 600; color: color-mix(in srgb, var(--nc) 75%, #fff); }
/* 사용률: CPU · 메모리 · 디스크 최대 (값이 70% 이상 노랑, 90% 이상 빨강) */
.ai-res { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin-top: 3px; font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.ai-res-item + .ai-res-item::before { content: "·"; margin-right: 6px; color: var(--text-3); }
.ai-res-item b { margin-left: 2px; font-size: 11.5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ai-res-item.is-warn b { color: var(--warn); }
.ai-res-item.is-crit b { color: #f87171; }
.ai-res-item.is-empty b { color: var(--text-3); font-weight: 500; }
.ai-live { display: inline-flex; flex: none; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--c); }
.ai-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; animation: ai-blink 1.6s ease-in-out infinite; }
.ai-live.st-down::before { animation-duration: .8s; }
.ai-node.is-off { border-style: dashed; border-color: rgba(100, 116, 139, .55); background: rgba(15, 23, 42, .6); box-shadow: none; }
.ai-node.is-off:hover { border-color: #94a3b8; box-shadow: none; }
.ai-node.is-off .ai-node-icon { background: rgba(30, 41, 59, .9); color: #94a3b8; box-shadow: 0 0 0 1px rgba(100, 116, 139, .6); }
.ai-node.is-off .ai-node-name { color: #cbd5e1; }
.ai-off-tag { flex: none; padding: 2px 8px; border-radius: 999px; background: rgba(100, 116, 139, .22); font-size: 11px; font-weight: 600; color: #cbd5e1; white-space: nowrap; }

/* AI 코어 - 세로 위치는 무대 본문(제목 자리, 범례 자리 제외) 가운데 */
.ai-core {
  --core: clamp(220px, 21vw, 340px);
  position: absolute;
  top: calc(50% + 18px - var(--core) / 2);
  left: calc(50% - var(--core) / 2);
  display: grid; place-items: center;
  width: var(--core); height: var(--core);
  border-radius: 50%;
}
.ai-core::before {
  content: "";
  position: absolute; inset: -45%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(56, 189, 248, .26), rgba(37, 99, 235, .1) 55%, transparent);
  pointer-events: none;
}
.ai-core-ring { position: absolute; border-radius: 50%; }
/* 구체 뒤 어두운 원: 가운데까지 들어오는 연결선이 구체 뒤로 가려져 구체가 선 위에 놓인 느낌 */
.ai-core-occluder { inset: 0; background: radial-gradient(closest-side, rgba(3, 10, 28, .92) 72%, rgba(3, 10, 28, 0) 82%); }
/* 코어 이미지 (입자 구체 core.jpg) — 3D 를 못 그릴 때 보이는 대체 이미지. 검은 배경은 화면 합성(screen)으로 지움 */
.ai-core-orb {
  inset: 4%;
  border-radius: 0;
  background: url(core.jpg) center / contain no-repeat;
  mix-blend-mode: screen;
  animation: ai-orb 6s ease-in-out infinite;
  transition: opacity 1s ease;
}
@keyframes ai-orb { 50% { transform: scale(1.04); filter: brightness(1.2); } }
/* 3D 구체 (three.js). 검은 배경을 screen 합성으로 지움. 바깥 입자가 잘리지 않게 코어보다 크게 */
.ai-core-3d { inset: -20%; width: 140%; height: 140%; border-radius: 0; mix-blend-mode: screen; opacity: 0; transition: opacity 1s ease; pointer-events: none; }
.ai-core.is-3d .ai-core-3d { opacity: 1; }
.ai-core.is-3d .ai-core-orb { opacity: 0; animation: none; }
/* 빛줄기 범례 */
.ai-legend { position: absolute; bottom: 16px; left: 50%; display: flex; gap: 18px; font-size: 11px; color: var(--text-2); white-space: nowrap; transform: translateX(-50%); }
.ai-legend li { display: flex; align-items: center; gap: 6px; }
.ai-legend li::before { content: ""; width: 22px; border-top: 2px solid; }
.ai-legend .flow::before { border-color: var(--cyan-soft); box-shadow: 0 0 6px var(--cyan); }
.ai-legend .cut::before { border-top-style: dashed; border-color: var(--down); }
.ai-legend .note { color: var(--text-3); }
.ai-legend .note::before { display: none; }

/* ---------- 비운영 서버 ---------- */
.ai-offline { padding: 12px 18px 18px; }
.ai-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; margin-bottom: 8px; }
.ai-section-title { font-size: 14px; font-weight: 700; color: #fff; }
.ai-section-title span { margin-left: 4px; color: var(--warn); }
.ai-section-desc { font-size: 12px; color: var(--text-2); }
.ai-offline-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 10px; }

/* ---------- 서버 상세(카드 보기): 섹션 헤더 / 필터 ---------- */
.section-title { font-size: 16px; font-weight: 700; color: #fff; }
.section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 12px; }
.section-head .desc { margin-left: 4px; font-size: 12px; color: var(--text-2); }
.section-head-sub { margin-top: 28px; }
.total { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; color: var(--c, var(--cyan)); background: color-mix(in srgb, var(--c, var(--cyan)) 16%, transparent); }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .right { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(2, 10, 28, .6); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  border: 0; border-radius: 8px;
  background: none; color: var(--text-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); background: rgba(56, 189, 248, .06); }
.seg button.active { color: #fff; background: rgba(56, 189, 248, .16); box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .4); }
.seg .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.seg em { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: rgba(125, 211, 252, .08); color: var(--text-2); font-variant-numeric: tabular-nums; }
.seg button.active em { background: rgba(255, 255, 255, .14); color: #fff; }
/* 보기 방식: 코어 보기(무대 + 비운영 목록) / 카드 보기(서버 상세 카드만) */
body[data-view="core"] .srv-detail { display: none; }
body[data-view="cards"] .ai-stage, body[data-view="cards"] .ai-offline { display: none; }

/* ---------- 상태 배지 ---------- */
.status {
  --c: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 24px; padding: 0 9px;
  border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.status.st-ok { --c: var(--ok); }
.status.st-warn { --c: var(--warn); }
.status.st-down { --c: var(--down); }
.status.st-nodata { --c: var(--nodata); }
.status.st-noreport { --c: var(--noreport); }
.status.st-inactive { --c: #94a3b8; }
.status.st-note { --c: var(--text-3); }
.status.st-down::before { animation: ai-blink .8s infinite; }
.srv-card-head .status, .srv-modal-head .status { height: 26px; padding: 0 10px; }

/* ---------- 서버 카드 ---------- */
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr)); gap: 12px; }
.srv-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 16px; transition: border-color .15s; }
.srv-card:hover { border-color: var(--line-strong); }
/* 끌어서 순서 바꾸기: 카드는 grab, 안의 링크는 그대로 pointer. 끌리는 카드는 흐리게 */
.srv-card[draggable="true"] { cursor: grab; }
.srv-card[draggable="true"] a { cursor: pointer; }
.srv-card.is-dragging { opacity: .35; border-style: dashed; }
.srv-card[data-status="warn"] { border-color: rgba(245, 180, 0, .35); }
.srv-card[data-status="nodata"] { border-color: rgba(249, 168, 212, .35); }
.srv-card[data-status="noreport"] { border-color: rgba(167, 139, 250, .4); }
/* 비운영: 점선 테두리 + 회색 톤 */
.srv-card[data-status="inactive"] { border-style: dashed; border-color: rgba(100, 116, 139, .55); }
.srv-card[data-status="inactive"]::before { display: none; }
.srv-card[data-status="inactive"] .srv-icon { color: #94a3b8; background: rgba(30, 41, 59, .9); box-shadow: 0 0 0 1px rgba(100, 116, 139, .6); }
.srv-card[data-status="down"] { border-color: rgba(239, 68, 68, .55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 28px rgba(239, 68, 68, .16); }
.srv-card[data-status="down"]::before { background: linear-gradient(90deg, transparent, rgba(252, 165, 165, .8), transparent); }
/* 카드 머리: 서버 + 상태 */
.srv-card-head { display: flex; align-items: center; gap: 10px; }
.srv { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.srv-icon {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  color: #e0f2fe;
  background: radial-gradient(circle at 35% 30%, rgba(125, 211, 252, .35), rgba(14, 58, 120, .9));
  box-shadow: 0 0 0 1px rgba(125, 211, 252, .45), 0 0 12px rgba(56, 189, 248, .35);
}
.srv-icon .ic { width: 16px; height: 16px; }
.srv-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv:hover .srv-title { color: var(--cyan-soft); }
/* 서버 정보: 계열 / OS / IP / 호스트명 / 마지막 수신 / 가동 */
.srv-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 12px 14px; border-radius: 10px; background: rgba(2, 10, 28, .45); border: 1px solid var(--line-soft); }
.srv-info div { min-width: 0; }
.srv-info dt { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.srv-info dd { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.srv-info dd.mono { font-family: var(--mono); font-size: 12.5px; }
.srv-info dd.txt { color: var(--c); font-weight: 600; }
.srv-info dd.none { color: var(--text-3); }
/* 리소스 도넛 차트 (CPU / 메모리 / 디스크 최대) */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric {
  --mc: var(--cyan);
  --glow: color-mix(in srgb, var(--mc) 50%, transparent);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px 12px;
  border-radius: 10px;
  background: rgba(2, 10, 28, .5);
  border: 1px solid var(--line-soft);
}
.metric.is-warn { --mc: var(--warn); }
.metric.is-crit { --mc: var(--down); }
.donut { position: relative; width: 84px; aspect-ratio: 1; color: var(--mc); }
.donut svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut circle { fill: none; stroke-width: 4; }
.donut .track { stroke: rgba(125, 211, 252, .1); }
.donut .bar { stroke: currentColor; stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .8s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 3px var(--glow)); }
.donut-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text); }
.donut-val b { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.donut-val small { font-size: 11px; font-weight: 500; color: var(--text-3); margin-left: 1px; }
.metric.is-empty .donut-val { font-size: 16px; color: var(--text-3); }
.metric-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.metric-label .mnt { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.lv-tag { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; color: var(--mc); background: color-mix(in srgb, var(--mc) 16%, transparent); }
/* 이상 내용 */
.issue { --c: var(--text-3); display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.issue.st-warn { --c: var(--warn); }
.issue.st-down { --c: var(--down); }
.issue.st-nodata { --c: var(--nodata); }
.issue.st-noreport { --c: var(--noreport); }
.issue-label { flex: none; font-size: 11px; font-weight: 700; color: var(--c); }
.issue p { line-height: 1.45; color: var(--text); }
.issue.is-none { background: rgba(2, 10, 28, .3); border-color: var(--line-soft); }
.issue.is-none p { color: var(--text-3); }
.list-empty { padding: 48px 16px; text-align: center; color: var(--text-3); }

/* ---------- 모달: 서버 상세(무대 카드를 누르면) · 과거 보고(상세 페이지 표 행을 누르면, .wide) ---------- */
.srv-modal {
  position: fixed;
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(14, 36, 74, .97), rgba(5, 14, 32, .98));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .08), 0 24px 64px rgba(0, 0, 0, .6), 0 0 40px rgba(14, 165, 233, .15);
}
.srv-modal.wide { width: min(1100px, calc(100vw - 32px)); }
.srv-modal[data-status="warn"] { border-color: rgba(245, 180, 0, .55); }
.srv-modal[data-status="down"] { border-color: rgba(239, 68, 68, .65); box-shadow: 0 24px 64px rgba(0, 0, 0, .6), 0 0 40px rgba(239, 68, 68, .2); }
.srv-modal[data-status="nodata"] { border-color: rgba(249, 168, 212, .55); }
.srv-modal[data-status="noreport"] { border-color: rgba(167, 139, 250, .6); }
.srv-modal[data-status="inactive"] { border-style: dashed; border-color: rgba(148, 163, 184, .6); }
.srv-modal[data-status="inactive"] .srv-icon { color: #94a3b8; background: rgba(30, 41, 59, .9); box-shadow: 0 0 0 1px rgba(100, 116, 139, .6); }
.srv-modal[open] { animation: modal-in .2s ease-out; }
.srv-modal::backdrop { background: rgba(2, 8, 23, .72); backdrop-filter: blur(4px); }
.srv-modal-inner { display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 48px); padding: 18px 20px 20px; overflow-y: auto; }
.srv-modal-head { display: flex; align-items: center; gap: 10px; }
.srv-modal-title { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: 18px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.srv-modal-body { display: flex; flex-direction: column; gap: 14px; }
.srv-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.srv-modal-foot .ic { width: 16px; height: 16px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes ai-blink { 50% { opacity: .3; } }
@keyframes ai-dot-send {
  0% { transform: scale(2.2); box-shadow: 0 0 0 0 color-mix(in srgb, var(--nc) 70%, transparent), 0 0 16px 6px color-mix(in srgb, var(--nc) 90%, transparent); }
  100% { transform: scale(1); box-shadow: 0 0 0 12px transparent, 0 0 8px 2px color-mix(in srgb, var(--nc) 80%, transparent); }
}

/* ---------- 하위 페이지 공통: 섹션 제목 ---------- */
.sec-head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-title { font-size: 15px; font-weight: 700; color: #fff; }
.sec-title em { margin-left: 4px; font-style: normal; color: var(--cyan-soft); }
.sec-title.is-open em { color: #fca5a5; }
.sec-desc { font-size: 12px; color: var(--text-2); }
.sec-desc .sep { margin: 0 6px; color: var(--text-3); }

/* ---------- 사용률 막대 / 숫자 (70 이상 노랑, 90 이상 빨강) ---------- */
.meter { --c: var(--cyan); height: 6px; overflow: hidden; border-radius: 99px; background: rgba(125, 211, 252, .1); }
.meter i { display: block; width: calc(var(--v, 0) * 1%); height: 100%; border-radius: inherit; background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
.meter.is-warn { --c: var(--warn); }
.meter.is-crit { --c: var(--down); }
.is-warn-text { color: var(--warn) !important; }
.is-crit-text { color: #f87171 !important; }

/* ---------- 서버 상세 1) 요약 ---------- */
.summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px 16px; }
.tile-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.tile-value { font-size: 26px; font-weight: 700; line-height: 1.15; color: #fff; white-space: nowrap; }
.tile-value small { margin-left: 2px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.tile-sub { overflow: hidden; font-size: 12px; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.tile .meter { margin-top: 2px; }
.tile.verdict .status { align-self: flex-start; height: 32px; padding: 0 14px; font-size: 15px; }
.tile.verdict .tile-sub { white-space: normal; color: var(--text); line-height: 1.45; }
.verdict-row { display: flex; align-items: center; gap: 10px; }
.rule-link { font-size: 13px; font-weight: 600; color: var(--cyan-soft); text-decoration: underline; text-underline-offset: 3px; }
.rule-link:hover { color: #fff; }
.load { display: flex; gap: 16px; }
.load div { display: flex; flex-direction: column; }
.load b { font-size: 24px; font-weight: 700; line-height: 1.15; color: #fff; font-variant-numeric: tabular-nums; }
.load span { font-size: 11px; color: var(--text-3); }

/* ---------- 서버 상세 2) 리소스 추이: 지표별 작은 그래프 4개 ---------- */
.trend { position: relative; }
.charts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.chart-card { padding: 14px 16px 10px; border-radius: 10px; background: rgba(2, 10, 28, .45); border: 1px solid var(--line-soft); }
.chart-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.chart-head b { font-size: 16px; font-weight: 700; color: #fff; }
.chart-head span { font-size: 16px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chart { position: relative; height: 150px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: rgba(125, 211, 252, .1); }
.chart .tick { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .area { fill: rgba(57, 135, 229, .16); }
.chart .line { fill: none; stroke: #3987e5; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chart .event { fill: #fb923c; stroke: var(--surface); stroke-width: 1.5; }
.chart .hover-dot { fill: #3987e5; stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: rgba(226, 240, 255, .35); stroke-width: 1; }
.chart .hit { cursor: crosshair; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 170px; padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(4, 12, 30, .96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  font-size: 12px;
}
.chart-tip p { margin-bottom: 6px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.chart-tip li { display: flex; align-items: center; gap: 7px; color: var(--text-2); line-height: 1.7; }
.chart-tip li b { margin-left: auto; padding-left: 14px; color: #fff; font-variant-numeric: tabular-nums; }
.chart-tip .tip-event { display: flex; align-items: center; gap: 7px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); color: #fdba74; }
.chart-tip .tip-event::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fb923c; }

/* ---------- 표 공통 ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-3); text-align: left; white-space: nowrap; }
.tbl th small { margin-left: 4px; font-size: 11px; font-weight: 500; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); color: var(--text); white-space: nowrap; }
.tbl tbody tr:hover td { background: rgba(56, 189, 248, .04); }
.tbl tbody tr:target td { background: rgba(56, 189, 248, .14); }
.tbl tbody tr:target td:first-child { box-shadow: inset 3px 0 0 var(--cyan); }
.tbl .num { text-align: right; }
.tbl td.wrap { white-space: normal; min-width: 240px; }
.tbl .pct { font-weight: 600; }
.tbl tr.group th { padding: 16px 12px 7px; border-bottom: 1px solid var(--line-soft); font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--cyan-soft); }
.tbl tr.group th em { margin-left: 6px; font-style: normal; color: var(--text-3); }
.tbl tbody:first-of-type tr.group th { padding-top: 6px; }
.tbl tr.row { cursor: pointer; }
.tbl tr.row:hover td { background: rgba(56, 189, 248, .08); }
.tbl .srv-link { font-weight: 700; color: #fff; }
.tbl .srv-link:hover { color: var(--cyan-soft); text-decoration: underline; text-underline-offset: 3px; }
.tbl td.empty { padding: 22px 12px; text-align: center; color: var(--text-3); white-space: normal; }
.tbl .badge-none { display: inline-block; padding: 2px 8px; border-radius: 6px; background: rgba(245, 180, 0, .12); border: 1px solid rgba(245, 180, 0, .4); font-size: 11px; font-weight: 700; color: #fde68a; }
.tbl .badge-off { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: rgba(100, 116, 139, .22); font-size: 11px; font-weight: 600; color: #cbd5e1; vertical-align: 1px; }

/* 서버 상세 3) 디스크: 마운트별 카드 */
.disk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.disk-item { padding: 12px 14px 14px; border-radius: 10px; background: rgba(2, 10, 28, .45); border: 1px solid var(--line-soft); }
.disk-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.disk-mount { font-family: var(--mono); font-size: 14px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disk-label { margin-left: auto; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.disk-top b { font-size: 18px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.disk-item .meter { height: 8px; }
/* 서버 상세 4) 프로세스 */
.proc-name { font-family: var(--mono); font-size: 12.5px; color: #fff; }
.tbl td.role { white-space: normal; min-width: 200px; max-width: 480px; color: var(--text-2); font-size: 12.5px; }
/* AI 발견: 행을 누르면 모달(evModal)에 설명(문장마다 줄바꿈)과 처리 폼 */
.srv-modal.mid { width: min(760px, calc(100vw - 32px)); }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.ev-desc { font-size: 13.5px; line-height: 1.65; white-space: normal; overflow-wrap: anywhere; }
.ev-sec + .ev-sec { margin-top: 10px; }
.ev-sec b { display: block; margin-bottom: 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--cyan-soft); }
.event-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.event-form input[type="text"] { flex: 1 1 220px; min-width: 0; }
.event-form small { flex-basis: 100%; }

/* ---------- 열린 문제: 열림 · 해소 기준 ---------- */
.rules { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding: 12px 18px; }
.rules-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--cyan-soft); white-space: nowrap; }
.rules-title .ic { width: 16px; height: 16px; }
.rules-list { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.rules-list li { padding: 5px 10px; border-radius: 8px; background: rgba(2, 10, 28, .5); border: 1px solid var(--line-soft); font-size: 12.5px; color: var(--text); }
.rules-list li b { margin-right: 6px; font-weight: 700; color: var(--cyan-soft); }
.rules-list li.notice { border-color: rgba(245, 180, 0, .45); background: rgba(245, 180, 0, .08); color: #fde68a; }
.rules-list li.notice b { color: var(--warn); }
.kind { display: inline-block; padding: 2px 8px; border-radius: 6px; background: rgba(125, 211, 252, .08); border: 1px solid var(--line-soft); font-size: 12px; color: var(--text-2); }
.time { color: var(--text-2); }
/* 알림: 아직 발송 전 (아웃박스) */
.outbox { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #fde68a; }
.outbox::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.sent { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #86efac; }
.sent::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
/* 알림 아웃박스: 사건 (열림 / 단계 상승 / 해소 / 요약) */
.event { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.event.ev-open { color: #fca5a5; background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .35); }
.event.ev-escalate { color: #fdba74; background: rgba(251, 146, 60, .12); border: 1px solid rgba(251, 146, 60, .4); }
.event.ev-resolve { color: #86efac; background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .35); }
.event.ev-remind { color: var(--text-2); background: rgba(125, 211, 252, .08); border: 1px solid var(--line-soft); }
.tbl .msg-title { font-weight: 600; color: #fff; }
.tbl .err { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .35); font-size: 11px; color: #fca5a5; white-space: normal; }
/* 확인 */
.ack-btn { height: 28px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(125, 211, 252, .5); background: rgba(56, 189, 248, .12); color: #e0f2fe; font-size: 12px; font-weight: 700; cursor: pointer; }
.ack-btn:hover { background: rgba(56, 189, 248, .25); }
.ack-btn:disabled { opacity: .5; cursor: wait; }
.acked { display: inline-flex; flex-direction: column; font-size: 12px; font-weight: 600; color: #86efac; line-height: 1.3; }
.acked small { font-size: 11px; font-weight: 500; color: var(--text-3); }

/* ---------- 기준표 적재 ---------- */
.upload-desc { margin-bottom: 14px; font-size: 13px; line-height: 1.6; color: var(--text); }
.upload-desc b { color: var(--cyan-soft); }
.upload-form { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.file-drop {
  position: relative;
  flex: 1 1 420px;
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 8px 8px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(2, 10, 28, .5);
  color: var(--text-2);
  transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.is-over { border-color: var(--cyan); background: rgba(56, 189, 248, .08); }
.file-drop.has-file { border-style: solid; color: var(--text); }
/* 실제 파일 입력은 칸 전체를 덮는 투명 입력 → 눌러도, 끌어다 놓아도 동작 */
.file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop .ic { width: 22px; height: 22px; color: var(--cyan-soft); }
.file-name { flex: 1; min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-drop.has-file .file-name { font-family: var(--mono); font-weight: 600; color: #fff; }
.file-drop .btn { pointer-events: none; height: 38px; }
.upload-form > .btn-primary { min-width: 120px; height: 56px; font-size: 15px; }
.upload-result { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.upload-result.is-ok { border: 1px solid rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .08); color: #bbf7d0; }
.upload-result.is-error { border: 1px solid rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .1); color: #fecaca; }
.token { display: flex; align-items: center; gap: 8px; }
.token code { padding: 4px 8px; border-radius: 6px; background: rgba(2, 10, 28, .6); border: 1px solid var(--line-soft); font-family: var(--mono); font-size: 12px; color: #c7e9ff; user-select: all; }
.copy-btn { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: rgba(56, 189, 248, .06); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.copy-btn:hover { border-color: var(--line-strong); color: #fff; }
.copy-btn.is-done { border-color: rgba(34, 197, 94, .5); color: #86efac; }

/* ---------- 페이지네이션 (페이지당 10 / 20 / 50개 보기) ---------- */
.pagination { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--text-2); }
.page-size { display: flex; align-items: center; gap: 8px; }
.pagination .seg { padding: 3px; border-radius: 10px; flex-wrap: nowrap; }
.pagination .seg button { height: 26px; padding: 0 10px; border-radius: 7px; font-size: 12px; font-weight: 600; gap: 0; }
.pagination .seg button:hover { color: #fff; }
.pagination .seg button.active { background: rgba(56, 189, 248, .18); }
.page-info { font-variant-numeric: tabular-nums; }
.pager { display: flex; gap: 4px; margin-left: auto; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(2, 10, 28, .6); color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.pager button:hover:not(:disabled) { border-color: var(--line-strong); color: #fff; }
.pager button[aria-current="page"] { border-color: rgba(125, 211, 252, .6); background: linear-gradient(180deg, #0ea5e9, #2563eb); color: #fff; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager .gap { display: grid; place-items: center; min-width: 20px; color: var(--text-3); }

/* ---------- 로그인 ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 28px 26px 26px; }
.login .title-wrap { margin-bottom: 10px; }
.login .input { width: 100%; }
.login .btn-primary { height: 42px; margin-top: 4px; }
.form-err { padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .1); color: #fecaca; font-size: 13px; }

/* ---------- 반응형 ---------- */
@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) { .ai-nodes { width: 250px; } }
@media (max-width: 1100px) { .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 좁은 화면: 코어를 위에 두고 서버를 아래로 쌓음 (빛줄기는 카드 위쪽에서 출발) */
@media (max-width: 760px) {
  .app { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-actions, .filters .right { margin-left: 0; width: 100%; }
  .search, .search .input { width: 100%; }
  .filters .right .select { flex: 1; }
  .donut { width: 72px; }
  .ai-stage { flex-direction: column; justify-content: flex-start; gap: 10px; padding: 112px 16px 20px; }
  .ai-layer { width: calc(100% - 32px); padding: 10px 16px; white-space: normal; }
  .ai-layer::before, .ai-layer::after { display: none; }
  .ai-core { --core: 200px; position: relative; top: auto; left: auto; order: -1; margin: 36px auto 56px; }
  .ai-nodes { width: auto; }
  .ai-nodes .ai-node::after { display: none; }
  .ai-legend { position: static; order: 1; flex-wrap: wrap; justify-content: center; margin-top: 6px; white-space: normal; transform: none; }
}
@media (max-width: 640px) {
  .app.sub { padding: 14px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .upload-form > .btn-primary { width: 100%; }
  .pager { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live-dot, .ai-core-orb, .ai-live::before, .status::before, .ai-nodes .ai-node.is-send::after, .srv-modal[open] { animation: none; }
}
