:root {
  --bg: #f6f5f2; --panel: #fff; --ink: #1d1d1b; --muted: #77746d; --line: #e4e1da;
  --accent: #6b4f3a; --accent-ink: #fff; --danger: #b3261e; --ok: #2e7d32; --warn: #a26900;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
textarea { min-height: 120px; resize: vertical; }
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--ink); }
button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--danger); }
button.link { border: 0; background: none; color: var(--muted); padding: 0; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
.err { color: var(--danger); min-height: 1em; }
.muted { color: var(--muted); font-size: 12px; }

.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 340px; background: var(--panel); padding: 32px; border-radius: 12px; border: 1px solid var(--line); }
.login-card h1 { margin: 0 0 16px; font-size: 22px; }
.login-card h1 small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.login-card button { width: 100%; margin-top: 8px; }

.app { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.side { background: #2b2420; color: #eee; display: flex; flex-direction: column; padding: 18px 0; }
.brand { font-weight: 700; padding: 0 18px 18px; font-size: 16px; }
.brand span { display: block; font-weight: 400; font-size: 11px; color: #aaa; }
.side nav a { display: block; padding: 10px 18px; color: #ddd; text-decoration: none; }
.side nav a.on, .side nav a:hover { background: #ffffff14; color: #fff; }
.side-foot { margin-top: auto; padding: 18px; font-size: 12px; display: flex; justify-content: space-between; color: #aaa; }
.side-foot .link { color: #aaa; }
.view { padding: 24px 28px; max-width: 1200px; }
.view h2 { margin: 0 0 4px; font-size: 20px; }
.view .sub { color: var(--muted); margin: 0 0 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.card .k { color: var(--muted); font-size: 12px; }
.card .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 500; background: #faf9f6; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: #eee; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; background: #eee; }
.tag.ok { background: #e6f4ea; color: var(--ok); }
.tag.no { background: #fbe9e7; color: var(--danger); }
.tag.warn { background: #fff4e0; color: var(--warn); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.links a { display: inline-block; margin: 4px 10px 4px 0; color: var(--accent); }

.modal { position: fixed; inset: 0; background: #0006; display: grid; place-items: center; z-index: 10; }
.modal-box { background: #fff; border-radius: 12px; padding: 22px; width: min(760px, 94vw); max-height: 90vh; overflow: auto; }
.modal-box h3 { margin-top: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20; }
.notice { background: #fff8ec; border: 1px solid #f0dcb4; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .brand, .side-foot { display: none; }
  .side nav { display: flex; overflow-x: auto; }
  .side nav a { white-space: nowrap; padding: 8px 10px; }
  .view { padding: 16px; }
  .row { grid-template-columns: 1fr; }
  table { font-size: 12px; }
}
