/* PrimeWatch 관리페이지 (1.1)
   방향: 야간 관제 콘솔 — 짙은 남색 바탕, 얇은 선, 가벼운 굵기의 큰 숫자.
   포인트 #0055ff(조작·현재 위치·실시간)와 바이올렛(예정된 것: 점검·예약·모의 장애, 보조 계열).
   "신호선"(파랑→바이올렛 1px)은 지금 살아 있는 것·선택된 것에만 쓴다.
   상태는 색만으로 구분하지 않는다(모양: UP 원, DEGRADED 마름모, DOWN 사각, PAUSED 이중막대, MAINTENANCE 삼각, UNKNOWN 빈 원). */

:root {
  --canvas: #0b0e15;
  --surface: #11151f;
  --surface-2: #171c29;
  --surface-3: #1d2332;
  --field: #0d1119;
  --line: #222a3b;
  --line-strong: #323c53;
  --ink: #e8ebf3;
  --ink-2: #b5bdce;
  --muted: #8490a7;

  --point: #0055ff;
  --point-hover: #1f6bff;
  --accent: #6f9bff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 85, 255, 0.16);
  --violet: #8b5cf6;
  --violet-ink: #b49cff;
  --violet-soft: rgba(139, 92, 246, 0.16);
  --signal: linear-gradient(90deg, #0055ff 0%, #8b5cf6 55%, rgba(139, 92, 246, 0) 100%);
  --danger: #ff6b6b;

  --s-up: #3fd68f;
  --s-degraded: #f5b841;
  --s-down: #ff5c5c;
  --s-paused: #8f9ab0;
  --s-maint: #b49cff;
  --s-unknown: #78839b;

  --radius-xs: 4px;
  --radius-s: 8px;
  --radius-m: 12px;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--line-strong);
  --shadow-sheet: -16px 0 40px rgba(0, 0, 0, 0.5);
  --glow: 0 0 0 1px rgba(0, 85, 255, 0.55), 0 0 22px -6px rgba(0, 85, 255, 0.7);
  --track: -0.025em;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic',
    'Noto Sans KR', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, 'JetBrains Mono', Menlo, Consolas, monospace;
  --nav-w: 232px;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: var(--track);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
::selection { background: rgba(0, 85, 255, 0.45); color: #fff; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #9dbbff; text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 500; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
code, .mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
* { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }

/* ── 셸 ───────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav {
  background: linear-gradient(180deg, rgba(0, 85, 255, 0.07), rgba(0, 85, 255, 0) 220px), var(--canvas);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.035em; color: var(--ink); }
.brand-name b { color: var(--accent); font-weight: 700; }
.nav-list { list-style: none; margin: 0; padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 22px; }
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 450;
  transition: background-color 120ms ease, color 120ms ease;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a[aria-current='page'] {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(90deg, rgba(0, 85, 255, 0.28), rgba(0, 85, 255, 0.06) 70%, transparent);
  box-shadow: inset 2px 0 0 #3a78ff;
}
.nav-count { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.nav-user { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 22px 18px; display: grid; gap: 2px; }
.nav-user .who { font-weight: 600; }
.nav-user .role { font-size: 12px; color: var(--muted); }
.nav-user .actions { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; }
.nav .nav-user .actions a { display: inline; padding: 0; color: var(--accent); font-weight: 400; background: none; box-shadow: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; letter-spacing: inherit; }
.linkish:hover { text-decoration: underline; text-underline-offset: 3px; }

.main { min-width: 0; padding: 30px 36px 64px; }
.main:focus { outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 72ch; }
.banner {
  border: 1px solid color-mix(in srgb, var(--s-degraded) 45%, transparent);
  border-left: 3px solid var(--s-degraded);
  background: color-mix(in srgb, var(--s-degraded) 9%, var(--surface));
  padding: 12px 16px;
  border-radius: var(--radius-s);
  margin-bottom: 18px;
}

/* ── 버튼·입력 ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--radius-s);
  font: inherit;
  font-weight: 550;
  letter-spacing: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.btn:hover { background: var(--surface-3); border-color: #43506b; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--point);
  border-color: var(--point);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { background: var(--point-hover); border-color: var(--point-hover); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 20px -4px rgba(0, 85, 255, 0.8); }
.btn-danger { color: var(--danger); background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }

input[type='text'], input[type='password'], input[type='number'], input[type='email'], input[type='search'],
input[type='datetime-local'], select, textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input::placeholder, textarea::placeholder { color: #6b768c; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--surface-2); color: var(--ink); }
input[type='datetime-local']::-webkit-calendar-picker-indicator { filter: invert(0.75); }
textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #43506b; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--point); box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.28); }
input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--danger); }

/* ── 필터·표 ──────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input[type='search'] { width: 280px; }
.toolbar select { width: auto; min-width: 150px; }
.toolbar .spacer { flex: 1; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: 12.5px; font-weight: 500; color: var(--muted); background: transparent; white-space: nowrap; padding-top: 12px; padding-bottom: 10px; }
table.data th button { all: unset; cursor: pointer; letter-spacing: inherit; }
table.data th button:hover { color: var(--ink); }
table.data th button:focus-visible { outline: 2px solid var(--accent); }
table.data th[aria-sort] { color: var(--ink-2); }
table.data th[aria-sort] button::after { content: ' ↑'; color: var(--accent); }
table.data th[aria-sort='descending'] button::after { content: ' ↓'; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background-color 100ms ease; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: rgba(0, 85, 255, 0.06); }
table.data td.num { text-align: right; }
table.data .sub { display: block; font-size: 12px; color: var(--muted); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; font-weight: 600; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px 0; color: var(--muted); font-size: 13px; }
.pager .btns { display: flex; gap: 6px; }

/* ── 상태 표식 (이 화면의 중심 요소) ──────────────────── */
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.state::before { content: ''; width: 9px; height: 9px; flex: none; background: currentColor; }
.state-UP { color: var(--s-up); }
.state-UP::before { border-radius: 50%; box-shadow: 0 0 8px -1px currentColor; }
.state-DEGRADED { color: var(--s-degraded); }
.state-DEGRADED::before { transform: rotate(45deg) scale(0.85); }
.state-DOWN { color: var(--s-down); }
.state-DOWN::before { border-radius: 1px; box-shadow: 0 0 10px 0 currentColor; }
.state-PAUSED { color: var(--s-paused); }
.state-PAUSED::before { background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }
.state-MAINTENANCE { color: var(--s-maint); }
.state-MAINTENANCE::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 10px; height: 10px; }
.state-UNKNOWN { color: var(--s-unknown); }
.state-UNKNOWN::before { background: transparent; border: 2px solid currentColor; border-radius: 50%; }

.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 12px; color: var(--ink-2); }
.chip + .chip { margin-left: 4px; }
.tenant-status { font-size: 12.5px; font-weight: 600; }
.tenant-status.paused { color: var(--s-paused); }
.tenant-status.suspended { color: var(--s-down); }
.tenant-status.active { color: var(--s-up); }

/* ── 대시보드 ─────────────────────────────────────────── */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.board-cell {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, rgba(0, 85, 255, 0.1), rgba(0, 85, 255, 0) 60%), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 18px 20px 16px;
}
.board-cell::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--signal); opacity: 0.85; }
.board-cell h2 { font-size: 13.5px; font-weight: 500; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.board-cell h2 a { color: inherit; }
.board-cell h2 a:hover { color: var(--ink); }
.board-total { font-size: 40px; font-weight: 300; letter-spacing: -0.045em; line-height: 1.05; margin: 10px 0 14px; color: #fff; }
.state-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface-3); margin-bottom: 12px; }
.state-bar span { display: block; height: 100%; min-width: 3px; border-radius: 1px; }
.state-list { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel > header { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel > header h2 { font-size: 15px; font-weight: 600; }
.panel > .body { padding: 16px 20px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 11px 20px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin: 6px 0; }
.steps li.done { color: var(--muted); text-decoration: line-through; }

/* ── 측면 편집 시트 ───────────────────────────────────── */
dialog.sheet {
  margin: 0 0 0 auto;
  height: 100vh;
  max-height: 100vh;
  width: min(580px, 100vw);
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sheet);
}
dialog.sheet::backdrop, dialog.confirm::backdrop { background: rgba(3, 5, 10, 0.62); backdrop-filter: blur(2px); }
dialog.sheet[open] { animation: sheet-in 180ms cubic-bezier(0.2, 0.7, 0.2, 1); display: flex; flex-direction: column; }
@keyframes sheet-in { from { transform: translateX(28px); opacity: 0.5; } }
.sheet-head { position: relative; padding: 22px 26px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.sheet-head::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--signal); }
.sheet-head h2 { font-size: 18px; font-weight: 600; }
.sheet-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.sheet-body { padding: 20px 26px; overflow-y: auto; flex: 1; }
.sheet-foot { padding: 14px 26px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; background: var(--canvas); }
.sheet-foot .left { margin-right: auto; display: flex; gap: 8px; }

dialog.confirm {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  padding: 24px 26px 20px;
  width: min(440px, calc(100vw - 32px));
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
dialog.confirm p { margin: 10px 0 20px; color: var(--ink-2); }
dialog.confirm .row { display: flex; justify-content: flex-end; gap: 8px; }

/* ── 폼 ───────────────────────────────────────────────── */
.form { display: grid; gap: 16px; }
.form fieldset { border: 0; padding: 0; margin: 6px 0 0; display: grid; gap: 16px; }
.form legend { font-weight: 600; font-size: 13.5px; padding: 0 0 8px; color: var(--ink); border-bottom: 1px solid var(--line); width: 100%; margin-bottom: 4px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.field .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 12px; color: var(--muted); line-height: 1.5; }
.field .error { font-size: 12.5px; color: var(--danger); font-weight: 550; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 450; }
.check input { width: 16px; height: 16px; accent-color: var(--point); }
.form-error { border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); color: #ffb3b3; background: color-mix(in srgb, var(--danger) 12%, transparent); padding: 10px 14px; border-radius: var(--radius-s); }
.secret-box { border: 1px dashed var(--line-strong); padding: 14px 16px; border-radius: var(--radius-s); background: var(--field); }
.secret-box code { font-size: 16px; user-select: all; color: #fff; }

/* ── 알림 토스트 ──────────────────────────────────────── */
.toasts { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--surface-3); color: var(--ink); padding: 12px 18px; border-radius: var(--radius-s); max-width: 400px; box-shadow: var(--shadow-pop); border-left: 3px solid var(--point); }
.toast.error { background: #3a1820; color: #ffd6d6; border-left-color: var(--danger); }

/* ── 로그인 ───────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(380px, 480px); }
.login-side {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 18% 30%, rgba(0, 85, 255, 0.22), transparent 70%),
    radial-gradient(50% 50% at 85% 85%, rgba(139, 92, 246, 0.16), transparent 70%),
    var(--canvas);
  color: var(--ink-2);
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.login-side .brand { padding: 0; }
.login-side .brand-name { font-size: 20px; color: #fff; }
.login-side .brand-name b { color: var(--accent); }
.login-side small { color: var(--muted); font-size: 13px; }
.login-board { display: grid; gap: 28px; max-width: 560px; }
.login-board h2 { font-size: 34px; line-height: 1.2; font-weight: 300; letter-spacing: -0.045em; color: #fff; }
.login-field {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: rgba(13, 17, 25, 0.6);
  position: relative;
}
.login-field::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--signal); border-radius: var(--radius-m) var(--radius-m) 0 0; }
.login-field i { width: 9px; height: 9px; justify-self: center; background: currentColor; }
.login-field .f-UP { color: color-mix(in srgb, var(--s-up) 70%, var(--canvas)); border-radius: 50%; }
.login-field .f-DEGRADED { color: var(--s-degraded); transform: rotate(45deg) scale(0.85); }
.login-field .f-DOWN { color: var(--s-down); border-radius: 1px; box-shadow: 0 0 12px 1px currentColor; animation: login-pulse 2.4s ease-in-out infinite; }
.login-field .f-PAUSED { color: var(--s-paused); background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }
.login-field .f-MAINTENANCE { color: var(--s-maint); clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 10px; height: 10px; }
.login-field .f-UNKNOWN { color: var(--s-unknown); background: transparent; border: 2px solid currentColor; border-radius: 50%; }
@keyframes login-pulse { 50% { opacity: 0.35; box-shadow: 0 0 2px 0 currentColor; } }
.login-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.login-legend p { margin: 0 0 4px; color: var(--muted); flex-basis: 100%; font-size: 13px; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 36px; background: var(--surface); border-left: 1px solid var(--line); }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 18px; }
.login-card h1 { font-size: 24px; font-weight: 500; margin-bottom: 4px; }
.login-card .btn-primary { height: 42px; margin-top: 4px; font-size: 15px; }
.login-card input { height: 42px; }

@media (max-width: 1100px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .main { padding: 24px 24px 56px; }
  .login-field { grid-template-columns: repeat(12, 1fr); }
  .login-field i:nth-child(n + 97) { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; overflow: visible; }
  .brand { padding: 16px 16px 10px; }
  .nav-list { flex-direction: row; flex-wrap: wrap; padding: 4px 10px; }
  .nav a { padding: 6px 10px; font-size: 13.5px; }
  .nav-sep { display: none; }
  .nav-user { padding: 12px 16px; }
  .main { padding: 20px 16px 48px; }
  h1 { font-size: 22px; }
  .board { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .toolbar input[type='search'] { width: 100%; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .login-main { border-left: 0; padding: 32px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open] { animation: none; }
  .login-field .f-DOWN { animation: none; }
  * { transition: none !important; }
}
.login-note { margin: 0; font-size: 12.5px; }
.field .note { font-size: 12.5px; color: var(--ink-2); background: var(--accent-soft); border: 1px solid rgba(0, 85, 255, 0.28); border-radius: var(--radius-s); padding: 10px 14px; }
.panel.narrow { max-width: 540px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
dl.form dd { margin: 0; }

/* ── 상세 화면·차트 (S2) ─────────────────────────────── */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.detail-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .state { font-size: 14px; }
.detail-head .state::before { width: 12px; height: 12px; }
.detail-head p { margin: 6px 0 0; color: var(--muted); }
.detail-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin: 0 0 18px; }
.facts > div { background: var(--surface); padding: 16px 20px; min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 6px 0 0; font-size: 26px; font-weight: 300; letter-spacing: -0.04em; line-height: 1.15; color: #fff; overflow-wrap: anywhere; }
.facts dd small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: var(--track); line-height: 1.45; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--field); }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 6px; font: inherit; font-size: 13px; letter-spacing: inherit; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--point); color: #fff; font-weight: 600; }
.chart { margin: 0; }
.chart-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.chart-body { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 1.75; filter: drop-shadow(0 0 4px rgba(0, 85, 255, 0.55)); stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--accent); }
.chart-focus { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-cross { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; top: 0; width: 236px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 10px 12px; font-size: 12.5px; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5); pointer-events: none; display: grid; gap: 2px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12.5px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 140px auto 1fr; gap: 12px; align-items: baseline; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); font-size: 12.5px; }
.sev { font-weight: 650; font-size: 12.5px; }
.sev-critical { color: var(--s-down); }
.sev-warning { color: var(--s-degraded); }
.indent { padding-left: 18px; color: var(--muted); }
.stack { display: grid; gap: 18px; }
@media (max-width: 1100px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } .detail-head { flex-direction: column; } }
.crumb { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.table-wrap.flat { border: 0; border-radius: 0; }
.main > .panel + .split, .main > .split + .panel, .main > .panel + .panel, .main > .split + p { margin-top: 18px; }
.split { align-items: start; }
.panel > header .seg { margin-left: auto; }
.nav-count.alert { color: #22070a; background: var(--s-down); border-radius: 999px; padding: 0 7px; font-weight: 700; box-shadow: 0 0 12px -2px var(--s-down); }
.facts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field > .label { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: inherit; letter-spacing: inherit; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected='true'] { color: #fff; font-weight: 600; border-image: var(--signal) 1; border-bottom: 2px solid; }
.ok-text { color: var(--s-up); font-weight: 600; }
.bad-text { color: var(--s-down); font-weight: 600; }
.msg-preview { white-space: pre-wrap; font-size: 13px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; margin: 0; }
.plain-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.plain-list li .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }

/* ── S4: 가용률·대시보드·설정 ───────────────────────────── */
.board.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.board.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.facts.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .board.five, .board.six, .facts.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .board.five, .board.six, .facts.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack { display: grid; gap: 16px; align-content: start; }
.main > .panel + .split, .main > .panel + .panel { margin-top: 18px; }
.main > .board + .panel { margin-bottom: 18px; }
.setup-panel { margin-bottom: 18px; }
.steps-row { display: flex; flex-wrap: wrap; gap: 4px 28px; padding-left: 18px; }
.table-wrap.flush { border: 0; border-radius: 0 0 var(--radius-m) var(--radius-m); }
.mini-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.mini-list li { display: flex; justify-content: space-between; gap: 8px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.check-inline input { width: auto; margin: 0; }
.cell-state .state { font-size: 12px; }

/* 가용률 막대 (표 칸) */
.avail { display: grid; gap: 4px; min-width: 150px; }
.avail-num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.avail-flag { margin-left: 6px; font-size: 11.5px; font-weight: 600; border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; }
.meter { position: relative; display: block; height: 6px; background: var(--surface-3); border-radius: 3px; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--s-up); }
.meter-bad .meter-fill { background: var(--s-down); }
.meter-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--violet-ink); border-radius: 1px; }

/* 일별 막대·타임라인 */
.bar-ok { fill: var(--s-up); }
.bar-bad { fill: var(--s-down); }
.bar-none { fill: var(--s-unknown); }
.chart-hit { fill: transparent; cursor: default; outline: none; }
.chart-hit.on, .chart-hit:focus-visible { fill: var(--ink); fill-opacity: 0.06; }
.chart-target { stroke: var(--violet-ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart-target-label { fill: var(--violet-ink); font-weight: 600; }
.chart-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw-ok { background: var(--s-up); }
.sw-bad, .sw-critical { background: var(--s-down); }
.sw-warning { background: var(--s-degraded); }
.sw-none { background: var(--s-unknown); }
.sw-target { height: 0 !important; border-top: 2px dashed var(--violet-ink); border-radius: 0 !important; vertical-align: 3px !important; }
.sw-open { background: repeating-linear-gradient(135deg, var(--s-down) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--s-down); }
.tl-bar.tl-critical { fill: var(--s-down); }
.tl-bar.tl-warning, .tl-bar.tl-info { fill: var(--s-degraded); }
.tl-bar.tl-open { stroke: var(--surface); stroke-width: 2; }
.tl-label { fill: var(--ink-2); font-size: 12px; }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--accent); }
.chart-table table { margin-top: 8px; }
table.data.compact td, table.data.compact th { padding: 5px 10px; }
figure.chart.body { margin: 0; }

/* 설정 패널·메일 미리보기 */
.panel-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.panel-foot .spacer { flex: 1; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sheet.sheet-wide { width: min(860px, 100vw); }
.mail-preview { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--radius-s); background: #f3f5f9; color-scheme: light; }
table.data th.num { text-align: right; }
/* 24시간 타임라인 (HTML) */
.tl-wrap { position: relative; }
.tl { display: grid; gap: 6px; }
.tl-row, .tl-axis { display: grid; grid-template-columns: 38% 1fr; gap: 12px; align-items: center; }
.tl-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 16px; border-radius: 4px; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); background-color: var(--field); }
.tl-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.tl-bar.tl-critical { background: var(--s-down); }
.tl-bar.tl-warning, .tl-bar.tl-info { background: var(--s-degraded); }
.tl-bar.tl-open { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0 3px, transparent 3px 6px); }
.tl-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl-ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

/* ── S5: 보고서·API 키 ─────────────────────────────────── */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.report-note { margin: -2px 0 12px; font-size: 13px; }
.report-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.report-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--radius-m); background: #f3f5f9; display: block; color-scheme: light; }
tr.dim td { color: var(--muted); }
.usage-bars { display: flex; align-items: flex-end; gap: 2px; height: 60px; margin: 4px 0 16px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--field); }
.usage-bars span { flex: 1; min-width: 3px; background: var(--accent); border-radius: 2px 2px 0 0; }
.usage-bars span.has-err { background: var(--s-degraded); }

/* ── S6: DB 상세 ───────────────────────────────────────── */
.banner-info { background: var(--accent-soft); border-color: rgba(0, 85, 255, 0.35); border-left-color: var(--point); color: var(--ink); }
.banner-warn { background: color-mix(in srgb, var(--s-degraded) 10%, var(--surface)); border-color: color-mix(in srgb, var(--s-degraded) 40%, transparent); border-left-color: var(--s-degraded); color: var(--ink); }
.banner-bad { background: color-mix(in srgb, var(--s-down) 10%, var(--surface)); border-color: color-mix(in srgb, var(--s-down) 40%, transparent); border-left-color: var(--s-down); color: var(--ink); }
.banner + .banner { margin-top: -6px; }
.warn-text { color: var(--s-degraded); font-weight: 600; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 16px; margin-top: 12px; }
figure.chart.mini { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px 8px; background: var(--field); }
figure.chart.mini .chart-title { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
figure.chart.mini .chart-title b { color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; }
.mini-empty { font-size: 12.5px; padding: 30px 0; text-align: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; margin-top: 18px; align-items: start; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.main > .split + .grid-2, .main > .panel + .split { margin-top: 18px; }
code.q { display: block; max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
code.hint { display: block; margin-top: 4px; padding: 6px 10px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s); white-space: pre-wrap; word-break: break-all; font-size: 12px; }
ul.checklist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
ul.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; }
ul.checklist li small { display: block; color: var(--muted); }
ul.checklist .mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #07140d; }
ul.checklist li.ok .mark { background: var(--s-up); }
ul.checklist li.bad .mark { background: var(--s-degraded); }
.facts dd.dd-small { font-size: 15px; font-weight: 500; letter-spacing: var(--track); line-height: 1.4; }

/* ── S7: 서버 상세·에이전트 ───────────────────────────── */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 20px; margin: 0; padding: 16px 20px 20px; }
.kv > div { min-width: 0; }
.kv > div.wide { grid-column: 1 / -1; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 3px 0 0; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.small { font-size: 12px; }
.mono.small { font-weight: 400; }
.th-list { list-style: none; margin: 0; padding: 4px 20px 4px; display: grid; gap: 0; }
.th-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.th-list li:last-child { border-bottom: 0; }
.th-list li b { font-weight: 500; text-align: right; color: var(--ink); }
.th-list li b.muted { font-weight: 400; }
.meter-warn .meter-fill { background: var(--s-degraded); }
tr.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--s-down); }
tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--s-degraded); }
ol.steps { padding-left: 20px; margin: 0 0 16px; display: grid; gap: 8px; }
ol.steps li b { display: block; }
ol.steps li span { color: var(--ink-2); font-size: 13px; }
.secret-box.cmd code { display: block; margin-top: 6px; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; line-height: 1.5; }
.agent-lost { color: var(--s-down); font-weight: 600; }

/* ── S9: 원격 작업 ───────────────────────────────────── */
.btn-group { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.btn-danger-ghost { color: var(--danger); }
.panel-sub { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0; padding: 16px 20px 8px; border-top: 1px solid var(--line); }
code.cmd-line { display: block; margin-top: 8px; padding: 10px 12px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
.run-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.run-badge::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.run-ok { color: var(--s-up); }
.run-bad { color: var(--s-down); }
.run-bad::before { border-radius: 1px; }
.run-warn { color: var(--s-degraded); }
.run-muted { color: var(--muted); }
.run-muted::before { background: transparent; border: 2px solid currentColor; }
.run-live { color: var(--accent); }
.run-live::before { animation: run-pulse 1.2s ease-in-out infinite; }
@keyframes run-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .run-live::before { animation: none; } }
.run-head { display: grid; gap: 4px; margin-bottom: 4px; }
.run-head p { margin: 0; }
.run-out-title { font-size: 13px; font-weight: 500; color: var(--muted); margin: 10px 0 8px; }
pre.run-output { margin: 0; min-height: 120px; max-height: 52vh; overflow: auto; padding: 12px 14px; background: #070a10; color: #d4dcec; border: 1px solid var(--line); border-radius: var(--radius-s); letter-spacing: 0; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
pre.run-output:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.data td .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel > .banner { margin: 16px 20px; }

/* ── S10: 유지보수·예약 ─────────────────────────────── */
.panel-sub.first { border-top: 0; }
tr.row-off td { opacity: 0.6; }
.schedule-preview { margin-top: 4px; font-size: 13px; }
.schedule-preview.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.note.schedule-preview { display: block; font-size: 12.5px; color: var(--ink); background: var(--violet-soft); border: 1px solid rgba(139, 92, 246, 0.35); border-radius: var(--radius-s); padding: 10px 14px; }
.pick-group { margin-bottom: 14px; }
.pick-group h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 0 8px; }
.pick-list { display: grid; gap: 6px; }
.pick-item { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer; }
.pick-item:hover, .pick-item:focus-visible { border-color: var(--point); background: var(--accent-soft); box-shadow: var(--glow); }
.pick-item span { font-size: 12.5px; color: var(--muted); }
.sched-history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.sched-history h3 { font-size: 13px; color: var(--violet-ink); font-weight: 500; margin: 0 0 8px; }

/* ── S11: 배치·자체 감시·모의 장애 ──────────────────── */
.chip-drill { background: var(--violet-soft); border-color: rgba(139, 92, 246, 0.45); color: var(--violet-ink); font-weight: 600; margin-left: 6px; }
pre.code-sample { margin: 8px 0; padding: 12px 14px; background: var(--field); letter-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; }
.howto { margin-top: 12px; }
.howto .plain-list { margin-top: 8px; gap: 4px; }
.secret-box.cmd .btn { margin-top: 6px; }
.drill-row { grid-template-columns: 1fr 2fr 1fr 0.8fr; }
@media (max-width: 720px) { .drill-row { grid-template-columns: 1fr; } }
.panel > .body > .feed { margin-top: 12px; border-top: 1px solid var(--line); }
.panel > .body > .feed li { padding-left: 0; padding-right: 0; align-items: center; }
table.runs td:not(:last-child), table.runs th { white-space: nowrap; }
table.runs td:last-child { min-width: 160px; }
.split > *, .stack > * { min-width: 0; }
.howto .plain-list li, .howto code { overflow-wrap: anywhere; }
/* ── S12: 설정 YAML ──────────────────────────────────── */
textarea.mono { font-family: var(--font-mono); letter-spacing: 0; font-size: 12.5px; line-height: 1.5; tab-size: 2; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.diff-list, .err-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.err-list { margin-top: 6px; }
.diff-list code { font-size: 12px; background: var(--surface-3); padding: 0 4px; border-radius: 3px; }
.diff-before { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.diff-after { font-weight: 600; overflow-wrap: anywhere; }
#import-result > header { flex-wrap: wrap; gap: 8px; }
table.yaml-diff th, table.yaml-diff td:not(:last-child) { white-space: nowrap; }
table.yaml-diff td:last-child { min-width: 220px; }
