:root {
  --bg: #eef1f6;
  --panel: #ffffff;
  --ink: #14203a;
  --muted: #5d6a85;
  --line: #d5dbe8;
  --accent: #1f4fd8;
  --accent-ink: #ffffff;
  --danger: #c62f2f;
  --head: #0c1630;
  --head-ink: #f3f6ff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1222;
    --panel: #131c33;
    --ink: #e8edf9;
    --muted: #93a0bf;
    --line: #26324f;
    --accent: #6f9bff;
    --accent-ink: #0b1222;
    --danger: #ff7b7b;
    --head: #070d1b;
    --head-ink: #f3f6ff;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Pretendard", "Noto Sans KR", system-ui, sans-serif;
}

header {
  background: var(--head);
  color: var(--head-ink);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: grid;
  gap: 20px;
}

section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

input,
select {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  width: 100%;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}

button.danger {
  color: var(--danger);
}

.login {
  max-width: 360px;
  margin: 64px auto;
}

.login form {
  display: grid;
  gap: 12px;
}

.msg {
  min-height: 1.4em;
  font-size: 14px;
  color: var(--muted);
}

.msg.err {
  color: var(--danger);
}

.tablewrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

td select {
  padding: 5px 6px;
  width: auto;
}

.hidden {
  display: none;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
