/* AI VTuber operations console.
   No Figma exists for this screen. Tokens, type scale and components are copied from the company precedent
   knps-agent admin/DESIGN.md v2 (2026-10-18), which itself only reuses 조가은's tokens. No new colors or sizes.
   The design standard for this site is a CTO decision (admin design doc, section 8); swap this file when it changes. */

:root {
  color-scheme: light dark;
  --bg: #f7f9f7; --bg-top: #e9fcde; --surface: #ffffff; --raised: #eef2ef; --sunken: #f7f9f7;
  --ink: #11151c; --ink-2: #3a474a; --muted: #546363; --line: #eef2ef; --line-strong: #dde4df;
  --accent: #125c56; --accent-soft: #eeffe5; --focus: #057a67;
  --ok: #146b3c; --ok-bg: #e7f5ed; --ok-line: #b7dfc7;
  --warn: #795400; --warn-bg: #fff3cd; --warn-line: #e8c65c;
  --bad: #ac2437; --bad-bg: #fdebed; --bad-line: #eeb8bf;
  --neutral: #546363; --neutral-bg: #eef2ef; --neutral-line: #dde4df;
  --shadow-1: 0 1px 2px rgba(27, 42, 33, 0.06), 0 4px 16px rgba(27, 42, 33, 0.06);
  --shadow-2: 0 8px 32px rgba(27, 42, 33, 0.14);
  --r-sm: 8px; --r-md: 10px; --r-lg: 16px; --r-xl: 20px; --r-full: 999px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1412; --bg-top: #13271e; --surface: #161e1b; --raised: #1e2925; --sunken: #121916;
    --ink: #e8efeb; --ink-2: #c6d2cc; --muted: #9fb0a9; --line: #232e2a; --line-strong: #2f3c37;
    --accent: #8fe0bf; --accent-soft: #173027; --focus: #8fe0bf;
    --ok: #8fdcb0; --ok-bg: #15301f; --ok-line: #24543a;
    --warn: #f2cd6b; --warn-bg: #33290f; --warn-line: #6a5317;
    --bad: #f5a3ad; --bad-bg: #3a1a1f; --bad-line: #6e2c36;
    --neutral: #b4c0bb; --neutral-bg: #1f2925; --neutral-line: #2f3b36;
    --shadow-1: none; --shadow-2: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 22px; letter-spacing: -0.2px; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.unit, .muted { color: var(--muted); }
.caption { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
[hidden] { display: none !important; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }
.brand { background: var(--bg-top); border-radius: var(--r-lg); padding: 14px 16px; font-weight: 700; font-size: 16px; line-height: 24px; letter-spacing: -0.4px; }
.brand small { display: block; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); letter-spacing: -0.2px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav .group { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); padding: 12px 12px 4px; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; }
.nav a:hover { background: var(--raised); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.who { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; word-break: break-all; }
.main { min-width: 0; }
.head { background: linear-gradient(var(--bg-top), var(--bg)); padding: 24px 32px 16px; }
.head h1 { margin: 0; font-size: 20px; line-height: 27px; font-weight: 700; letter-spacing: -0.4px; }
.head p { margin: 4px 0 0; color: var(--muted); }
.content { padding: 0 32px 40px; display: flex; flex-direction: column; gap: 16px; }

/* ---- verdict & states ---- */
.verdict { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--neutral-line); border-radius: var(--r-xl); padding: 16px 24px; }
.verdict .sym { flex: none; width: 44px; height: 44px; border-radius: var(--r-full); display: grid; place-items: center; font-weight: 700; font-size: 20px; background: var(--neutral-bg); color: var(--neutral); }
.verdict h2 { margin: 0; font-size: 22px; line-height: 30px; font-weight: 700; }
.verdict p { margin: 0; color: var(--muted); }
.verdict .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.verdict.ok { border-color: var(--ok-line); } .verdict.ok .sym { background: var(--ok-bg); color: var(--ok); }
.verdict.warn { border-color: var(--warn-line); } .verdict.warn .sym { background: var(--warn-bg); color: var(--warn); }
.verdict.bad { border-color: var(--bad-line); } .verdict.bad .sym { background: var(--bad-bg); color: var(--bad); }
.state, .error, .notice, .report { border-radius: var(--r-lg); padding: 12px 16px; border: 1px solid var(--neutral-line); background: var(--surface); }
.state { color: var(--muted); }
.error { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad); }
.notice { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.report { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }

/* ---- cards, tables, pills ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 20px 24px; min-width: 0; }
@media (prefers-color-scheme: dark) { .card { border: 1px solid var(--line); } }
.card h3 { margin: 0 0 12px; font-size: 16px; line-height: 24px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.card h3 .caption { font-weight: 500; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--sunken); color: var(--muted); font-size: 13px; line-height: 20px; font-weight: 600; text-align: left; padding: 8px 12px; white-space: nowrap; }
td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td .row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--r-full); padding: 0 8px; font-size: 12px; line-height: 20px; font-weight: 600; border: 1px solid var(--neutral-line); background: var(--neutral-bg); color: var(--neutral); white-space: nowrap; }
.pill.ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.pill.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.pill.bad { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.speech { font-size: 16px; line-height: 24px; }

/* ---- controls ---- */
button.btn, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: background 0.12s; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--raised); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; }
.btn.danger { color: var(--bad); border-color: var(--bad-line); font-weight: 600; }
.btn.stop { min-height: 48px; padding: 0 20px; background: var(--bad); border-color: var(--bad); color: var(--surface); font-weight: 700; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .label { font-size: 13px; line-height: 20px; font-weight: 600; }
.field .hint { font-size: 12px; line-height: 16px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="number"], select, textarea { min-height: 40px; padding: 8px 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); width: 100%; }
textarea { min-height: 96px; resize: vertical; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline > .field { flex: 1 1 180px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.error-text { color: var(--bad); font-size: 12px; line-height: 16px; }
.list-plain { margin: 0; padding-left: 18px; }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(var(--bg-top), var(--bg) 320px); padding: 16px; }
.login .card { max-width: 440px; width: 100%; display: flex; flex-direction: column; gap: 16px; padding: 32px; }
.login h1 { margin: 0; font-size: 20px; line-height: 27px; letter-spacing: -0.4px; }
.login p { margin: 0; color: var(--ink-2); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav .group { display: none; }
  .who { margin-top: 0; flex-direction: row; flex-wrap: wrap; align-items: center; padding-top: 12px; }
  .head { padding: 16px; }
  .content { padding: 0 16px 32px; }
  .verdict { flex-wrap: wrap; padding: 16px; }
  .verdict .actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
form.plain { display: contents; }
.stale .card, .stale .table-wrap { opacity: 0.6; }
