/* 뚝딱 관리실. 게임과 헷갈리지 않게 차분한 업무 화면으로 한다(게임의 남보라·금색을 쓰지 않는다) */
:root {
  --bg: #f3f4f2; --paper: #ffffff; --ink: #1d2421; --muted: #5d6863; --line: #d9dedb; --side: #e9ecea;
  --accent: #2f6b5a; --accent-soft: #e2eee9; --warn: #a6561c; --warn-soft: #f7e9dd; --bad: #a23434; --bad-soft: #f6e1e1;
  --f-body: "Noto Sans KR", system-ui, sans-serif; --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141917; --paper: #1c2220; --ink: #e4e9e6; --muted: #9aa6a0; --line: #323b37; --side: #181e1c;
    --accent: #7cc4ac; --accent-soft: #213a32; --warn: #e0a273; --warn-soft: #3a2a1d; --bad: #e58e8e; --bad-soft: #3d2323;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.6 var(--f-body); }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 700; text-wrap: balance; }
h1 { font-size: 24px; } h2 { font-size: 20px; } h3 { font-size: 15px; }
p { margin: 0; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn { font: inherit; font-size: 13.5px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 13px; background: var(--paper); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn:focus-visible, .chip:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn.warn { border-color: var(--warn); color: var(--warn); }
.btn.bad { border-color: var(--bad); color: var(--bad); }
.btn.bad.fill { background: var(--bad); color: var(--paper); }
.btn:disabled { opacity: .5; cursor: default; }
.link { font: inherit; font-size: 12.5px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }

/* 로그인 */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.gate-box { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 28px; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.gate-box p { color: var(--muted); }

/* 틀 */
.app { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.side .brand { font-size: 16px; font-weight: 700; padding: 2px 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.side a { padding: 7px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.side .who { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.tag { font-size: 11px; font-weight: 500; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 1px 6px; width: fit-content; }
.main { padding: 22px max(16px, 2.4vw) 40px; display: flex; flex-direction: column; gap: 18px; min-width: 0; max-width: 1180px; }

/* 한눈에 */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 1px; }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi b { font-family: var(--f-mono); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }

/* 찾기 */
.search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search input { flex: 1; min-width: 200px; }
input, textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; }
textarea { min-height: 64px; resize: vertical; }
.chip { font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--muted); background: var(--paper); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.tbl { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 500; color: var(--muted); font-size: 12px; background: var(--side); position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 180px; }
tbody tr.go { cursor: pointer; }
tbody tr.go:hover td { background: var(--accent-soft); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.pill { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.ban { background: var(--bad-soft); color: var(--bad); }
.pill.guest { color: var(--muted); border: 1px solid var(--line); }
.pos { color: var(--accent); } .neg { color: var(--bad); }
.adm { color: var(--warn); font-weight: 500; }

/* 한 사람 */
.head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.head h2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card > h3 { font-size: 13px; color: var(--muted); font-weight: 500; }
dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 5px 16px; font-size: 13.5px; }
dt { color: var(--muted); } dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.spark { width: 100%; height: 64px; display: block; }
.back { width: fit-content; }

/* 창 */
.dlg { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); padding: 0; width: min(460px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(10, 14, 12, .45); }
.dlg form { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { color: var(--muted); font-size: 12.5px; }
.note { font-size: 12.5px; color: var(--muted); }
.alert { font-size: 13px; color: var(--bad); background: var(--bad-soft); border-radius: 6px; padding: 8px 10px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check input { width: auto; margin-top: 3px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-size: 13.5px; max-width: calc(100vw - 32px); z-index: 20; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { width: 100%; flex-direction: row; align-items: center; padding-bottom: 4px; }
  .side .who { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; gap: 10px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
