/* Khione — Aeolus 와 같은 어두운 테마 토큰 */
:root {
  --bg: #0d1117;
  --panel: #131a22;
  --panel2: #18212b;
  --line: #26313d;
  --text: #d6dee8;
  --muted: #8592a3;
  --accent: #6cc5e8;
  --ok: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --bad: #d03b3b;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad, .err { color: var(--bad); }

.top { height: 46px; display: flex; align-items: center; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--line);
  background: #0f151c; position: sticky; top: 0; z-index: 10; }
.brand b { font-size: 15px; letter-spacing: .5px; color: var(--accent); margin-right: 8px; }
.brand span { color: var(--muted); }
.tabs { display: flex; gap: 2px; }
.tabs a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 4px; font-weight: 600; }
.tabs a:hover { color: var(--text); background: var(--panel2); }
.tabs a.on { color: #fff; background: #1d4d63; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top-right select { width: 260px; margin: 0; }
.session { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.session button { padding: 3px 9px; font-size: 12px; }
.synth { font-size: 11px; padding: 2px 7px; border-radius: 9px; border: 1px solid #6b5a2a; color: var(--warn); white-space: nowrap; }

.page { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: calc(100vh - 46px); }
.page.full { grid-template-columns: minmax(0, 1fr); }
.page.ops { grid-template-columns: 320px minmax(0, 1fr) 320px; }
.panel { background: var(--panel); padding: 10px 14px 30px; border-right: 1px solid var(--line); overflow-y: auto; }
.panel.right { border-right: 0; border-left: 1px solid var(--line); }
.main { padding: 12px 18px 40px; overflow-x: hidden; }
h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 16px 0 6px; }
h2:first-child { margin-top: 4px; }
h3 { font-size: 13px; margin: 0 0 6px; font-weight: 600; }

select, input, button, textarea { font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }
input, select, textarea { width: 100%; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); }
button { cursor: pointer; padding: 6px 10px; }
button:hover { border-color: var(--accent); }
button.primary { background: #1d5f78; border-color: #2a7d9c; color: #fff; }
button.good { background: #1f5a2f; border-color: #2e7d45; color: #fff; }
button.danger { background: #5a1f1f; border-color: #7d2e2e; color: #fff; }
button:disabled { opacity: .45; cursor: default; }
button.mini { padding: 2px 8px; font-size: 11.5px; }
label { display: block; color: var(--muted); font-size: 11.5px; margin: 6px 0 2px; }
label > input, label > select { margin-top: 2px; font-size: 13px; color: var(--text); }
label.check { display: inline-flex; gap: 4px; align-items: center; color: var(--text); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.btns { display: flex; gap: 8px; margin-top: 10px; }
.btns button { flex: 1; }
fieldset { border: 1px solid var(--line); border-radius: 5px; margin: 8px 0; padding: 4px 10px 8px; }
legend { color: var(--muted); font-size: 11.5px; padding: 0 4px; }
.nlres { margin-top: 8px; padding: 6px 8px; border-left: 3px solid var(--accent); background: #13242d; border-radius: 3px; font-size: 12px; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.card.rec { border-color: #2a7d9c; background: #122733; }
.card h3 .tag { font-weight: 400; }
ul.reasons { margin: 4px 0 0; padding-left: 18px; }
ul.reasons li { margin: 2px 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.kpi .l { color: var(--muted); font-size: 11.5px; }
.kpi .v { font-size: 21px; font-family: var(--mono); font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .s { color: var(--muted); font-size: 11px; }

/* tables */
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; background: #111820; position: sticky; top: 0; }
td.r, th.r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr.sel td { background: #142f3c; }
tr.rec td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.cmp td:first-child { white-space: nowrap; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.badge { font-size: 10.5px; padding: 1px 7px; border-radius: 8px; border: 1px solid; white-space: nowrap; display: inline-block; }
.badge.ok { color: var(--ok); border-color: #2e6b46; }
.badge.no { color: var(--bad); border-color: #6b2e2b; }
.badge.warn { color: var(--warn); border-color: #6b5a2a; }
.badge.info { color: var(--accent); border-color: #2a6578; }
.st-합격 { color: var(--ok); } .st-불합격 { color: var(--bad); } .st-진행 { color: var(--warn); } .st-미착수 { color: var(--muted); }

/* charts */
.chart { position: relative; }
.chart svg { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); margin: 0 0 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: #0b1016ee; border: 1px solid var(--line); border-radius: 5px;
  padding: 6px 8px; font-size: 11.5px; min-width: 170px; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.tip b { float: right; margin-left: 10px; font-weight: 500; }

/* gantt */
.gantt { position: relative; }
.gantt .row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 90px; align-items: center; gap: 8px; min-height: 40px; }
#cl select { min-width: 78px; }
.gantt .track { position: relative; height: 18px; background: #101820; border-radius: 3px; }
.gantt .bar { position: absolute; top: 0; height: 18px; background: #24485a; border-radius: 3px; overflow: hidden; }
.gantt .bar .pg { height: 100%; background: #3987e5; }
.gantt .bar span { position: absolute; left: 6px; top: 1px; font-size: 11px; color: #fff; white-space: nowrap; }
.gantt input { width: 70px; padding: 2px 4px; }
.gantt .today { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--warn); }

/* alarms */
.alarms { list-style: none; margin: 0; padding: 0; }
.alarms li { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 4px; padding: 6px 8px; margin-bottom: 6px;
  background: var(--panel2); cursor: pointer; }
.alarms li.crit { border-left-color: var(--bad); }
.alarms li.warn { border-left-color: var(--warn); }
.alarms li.info { border-left-color: #3987e5; }
.alarms .when { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.lvl { font-size: 10.5px; font-weight: 600; margin-right: 4px; }
.lvl.crit { color: var(--bad); } .lvl.warn { color: var(--warn); } .lvl.info { color: #6da7ec; }

/* twin */
.twin { background: #0a0f14; border: 1px solid var(--line); border-radius: 6px; position: relative; }
.twin svg { display: block; width: 100%; height: auto; }
.twin text { font-family: inherit; }
.twinbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.twinbar input[type=range] { flex: 1; }
.twinbar .clock { font-family: var(--mono); font-size: 16px; min-width: 64px; }
.flow { stroke-dasharray: 8 7; animation: flow 1.2s linear infinite; }
.flow.rev { animation-direction: reverse; }
.flow.stop { animation: none; stroke-dasharray: none; opacity: .35; }
@keyframes flow { to { stroke-dashoffset: -30; } }
.scale { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.scale .bar { width: 140px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #2a78d6, #19a0b0, #c9c26a, #e3743f, #d03b3b); }

.rec-card { border: 1px solid #2a7d9c; background: #10232d; border-radius: 6px; padding: 10px 12px; margin: 6px 0 12px; }
.rec-card .big { font-size: 20px; font-family: var(--mono); }
.log { font-size: 11.5px; color: var(--muted); max-height: 180px; overflow-y: auto; }
.note { font-size: 11.5px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 8px; margin: 6px 0; }
pre.json { background: #0a0f14; border: 1px solid var(--line); border-radius: 6px; padding: 10px; max-height: 520px; overflow: auto;
  font-size: 11.5px; font-family: var(--mono); }
.toast { position: fixed; right: 16px; bottom: 16px; background: #1d4d63; color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 50; }

/* login */
body.loginPage { display: grid; place-items: center; min-height: 100vh; }
.loginBox { width: min(340px, calc(100vw - 32px)); padding: 26px 24px 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; }
.loginBox h1 { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.loginBox h1 b { color: var(--accent); letter-spacing: .5px; margin-right: 4px; }
.loginBox p.muted { margin: 0 0 14px; font-size: 12px; }
.loginBox label { margin: 10px 0 2px; }
.loginBox input { width: 100%; padding: 7px 8px; }
.loginBox button { width: 100%; margin-top: 16px; padding: 8px; }
.loginBox .err { min-height: 1.4em; margin: 10px 0 0; color: var(--bad); font-size: 12px; }

@media (max-width: 900px) {
  .page, .page.ops { grid-template-columns: minmax(0, 1fr); }
  .top { flex-wrap: wrap; height: auto; padding: 6px 16px; }
  .top-right select { width: 180px; }
}
