:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e1e4ea;
  --text: #1c2330;
  --muted: #687284;
  --brand: #1f5eff;
  --brand-ink: #ffffff;
  --ok: #16794c;
  --ok-bg: #e5f5ec;
  --wait: #8a5a00;
  --wait-bg: #fff4dc;
  --bad: #c22b2b;
  --bad-bg: #fde8e8;
  --done: #3c4a63;
  --done-bg: #e8ecf4;
  --high: #c22b2b;
  --medium: #c76a00;
  --low: #5b6b85;
  --info: #8a94a6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c;
    --surface: #181d26;
    --surface-2: #1d2330;
    --line: #2a3242;
    --text: #e6e9ef;
    --muted: #96a0b2;
    --brand: #5b8cff;
    --ok: #4cc38a;
    --ok-bg: #133325;
    --wait: #f0b552;
    --wait-bg: #3a2c10;
    --bad: #ff6b6b;
    --bad-bg: #3d1717;
    --done: #b7c2d8;
    --done-bg: #262e3d;
    --high: #ff6b6b;
    --medium: #f0a14a;
    --low: #9fb0cc;
    --info: #7d879a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
h1:focus { outline: none; }
h1 { font-size: 1.45rem; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
small { font-size: 0.82em; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.bad { color: var(--bad); }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); font-weight: 800; }
.brand.big { font-size: 1.15rem; margin-bottom: 18px; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.topnav a.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.who form { margin: 0; }
.content { flex: 1; padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }
.disclaimer { padding: 10px 24px; color: var(--muted); font-size: 0.82rem; border-top: 1px solid var(--line); background: var(--surface); text-align: center; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 0.92rem; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 3px 9px; font-size: 0.82rem; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.82rem; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill.wait { background: var(--wait-bg); color: var(--wait); border-color: transparent; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pill.done { background: var(--done-bg); color: var(--done); border-color: transparent; }
.pill.muted { color: var(--muted); }

.sev { display: inline-block; min-width: 38px; text-align: center; padding: 1px 6px; border-radius: 6px; font-size: 0.78rem; font-weight: 700; color: #fff; }
.sev.high { background: var(--high); }
.sev.medium { background: var(--medium); }
.sev.low { background: var(--low); }
.sev.info { background: var(--info); }

.grid { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.grid th, .grid td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { background: var(--surface-2); font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.grid tr:last-child td { border-bottom: none; }
.grid.compact td { padding: 6px 10px; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .actions { white-space: nowrap; }
.grid .actions .btn { margin-left: 4px; }
.timeline td:nth-child(2) { width: 64px; }
.timeline .time { width: 80px; font-variant-numeric: tabular-nums; color: var(--muted); }
.timeline tr.server td { background: var(--surface-2); }
.timeline .detail { color: var(--muted); font-size: 0.8rem; word-break: break-all; }
.thumbs { display: flex; gap: 8px; margin-top: 6px; }
.thumbs img { width: 160px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.crumbs { margin: 0 0 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 14px 0; }
.toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.88rem; }
.toolbar .spacer { flex: 1; }
.live-dot { color: var(--ok); font-size: 0.85rem; }
.summary { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0; }

.board-head, .detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.counters { display: flex; flex-wrap: wrap; gap: 8px; }
.counters span { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 0.88rem; }
.counters b { font-size: 1.05rem; margin-left: 4px; font-variant-numeric: tabular-nums; }
.counters .bad b { color: var(--bad); }
.status-strip { display: flex; flex-wrap: wrap; gap: 6px; }

.alerts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.alert { border: none; border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 0.88rem; cursor: pointer; color: #fff; background: var(--low); animation: pop 0.25s ease-out; }
.alert.high { background: var(--high); }
.alert.medium { background: var(--medium); }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); padding: 10px 12px; color: var(--text); box-shadow: var(--shadow); min-height: 108px; }
.card:hover { text-decoration: none; border-color: var(--brand); }
.card.ok { border-left-color: var(--ok); }
.card.wait { border-left-color: var(--wait); }
.card.bad { border-left-color: var(--bad); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--bad-bg); }
.card.done { border-left-color: var(--done); }
.card.muted { opacity: 0.6; }
.card-top { display: flex; align-items: baseline; gap: 6px; }
.card-top .num { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 22px; }
.card-top .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-top .level { font-size: 0.75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.card-state { margin: 4px 0; font-weight: 600; }
.card.bad .card-state { color: var(--bad); }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.82rem; }
.badge { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 8px; font-weight: 600; }
.card-alert { margin-top: 4px; font-size: 0.82rem; color: var(--bad); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; margin: 16px 0; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel h2 small { font-weight: 400; margin-left: 6px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.action-row .grow { flex: 1; min-width: 180px; }
.code-box { background: var(--wait-bg); color: var(--wait); border-radius: 8px; padding: 6px 12px; }
.code-box b { font-size: 1.3rem; letter-spacing: 0.15em; font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: 0.88rem; margin: 4px 0 0; }
.exceptions { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.exceptions summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 10px; font-size: 0.9rem; }
.form-error { color: var(--bad); margin: 6px 0; }
.radio-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.radio.on { border-color: var(--brand); background: var(--surface-2); }
.radio input { margin-top: 4px; }

.lanes { margin-bottom: 14px; }
.lane { display: flex; align-items: center; gap: 10px; height: 22px; }
.lane-label { width: 140px; font-size: 0.8rem; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-track { position: relative; flex: 1; height: 12px; background: var(--surface-2); border-radius: 6px; }
.lane .bar { position: absolute; top: 0; height: 12px; border-radius: 6px; background: var(--low); }
.lane .bar.high { background: var(--high); }
.lane .bar.medium { background: var(--medium); }
.lane.axis .lane-track { background: none; display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); height: auto; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 8px 30px rgba(16, 24, 40, 0.08); display: flex; flex-direction: column; gap: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.88rem; }
.login-card .hint { color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 20px; background: var(--wait-bg); color: var(--wait); z-index: 100; }
