:root {
  --bg: #f4f6f5; --surface: #fff; --ink: #1c2b28; --muted: #7c8a86;
  --line: #e3e8e6; --brand: #1f6f5c; --brand-weak: #e4efeb; --danger: #c2453b;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 18px; }
.brand span { color: var(--brand); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

.tabs { display: flex; gap: 4px; padding: 10px 20px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.tab {
  border: none; background: none; padding: 10px 16px; font-size: 14px; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

main { max-width: 1100px; margin: 20px auto; padding: 0 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; color: var(--ink); background: var(--surface);
}
.row { display: flex; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 14px; }

button {
  padding: 8px 16px; border: none; border-radius: 8px; background: var(--brand);
  color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
button:disabled { opacity: .45; cursor: default; }
button.ghost { background: var(--brand-weak); color: var(--brand); }
button.ghost:disabled { background: var(--line); color: var(--muted); }

.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
.chip { display: inline-block; background: var(--brand-weak); color: var(--brand);
  border-radius: 6px; padding: 2px 8px; margin: 2px 4px 2px 0; font-size: 13px; }
.code { color: var(--muted); font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat .n { font-size: 28px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.warn .n { color: var(--danger); }

tr.click { cursor: pointer; }
tr.click:hover { background: var(--brand-weak); }
button.sm { padding: 4px 10px; font-size: 13px; }
table.kv { width: auto; }
table.kv th { text-align: left; color: var(--muted); font-weight: 500; padding-right: 20px; white-space: nowrap; }
table.kv td { font-weight: 500; }

button.danger { background: var(--danger); }
.danger-zone { margin-top: 18px; padding: 14px; border: 1px solid #f0d4d1;
  border-radius: 10px; background: #fdf5f4; display: flex; flex-direction: column; gap: 10px; }
.dz-title { font-size: 12px; font-weight: 700; color: var(--danger); }

.genq { padding: 12px 0; border-bottom: 1px solid var(--line); }
.genq:last-child { border-bottom: none; }
.genq-h { font-weight: 600; margin-bottom: 6px; }
.genq-o { margin: 4px 0 8px 18px; padding: 0; }
.genq-o li { margin: 2px 0; }
.genq-o li.ok { color: var(--brand); font-weight: 600; }
