/* gc-admin 콘솔 — 내부 운영 도구. 시스템 폰트·라이트/다크 자동. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --fg: #191f28; --fg-muted: #6b7684; --fg-subtle: #8b95a1;
  --line: #e5e8eb; --primary: #3182f6; --primary-weak: #e8f3ff; --danger: #e5503c;
  --p1: #e5503c; --p2: #3182f6; --p3: #8b95a1;
  --done: #12b76a; --doing: #f79009; --dropped: #98a2b3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418; --surface: #1b2127; --fg: #e5e8eb; --fg-muted: #9aa4af; --fg-subtle: #6b7684;
    --line: #2c333a; --primary: #4a9cff; --primary-weak: #16273c; --danger: #ff6a55;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 -apple-system, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
#app { max-width: 880px; margin: 0 auto; padding: 20px 16px 60px; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; }
input, textarea, select { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
textarea { width: 100%; resize: vertical; min-height: 140px; }

/* 로그인 */
.login-wrap { display: flex; flex-direction: column; align-items: center; padding-top: 12vh; gap: 20px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card .sub { color: var(--fg-muted); font-size: 13px; margin: -4px 0 10px; }
.btn-primary { background: var(--primary); color: #fff; padding: 11px 16px; font-weight: 700; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; color: var(--fg-muted); padding: 8px 12px; }
.btn-ghost:hover { color: var(--fg); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 2px 0 0; }

/* 헤더 + 상단 네비 */
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.top .who { color: var(--fg-subtle); font-size: 13px; margin-left: auto; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-btn { background: transparent; color: var(--fg-muted); padding: 8px 13px; font-size: 15px; border-radius: 10px; }
.nav-btn.on { background: var(--surface); color: var(--fg); font-weight: 800; border: 1px solid var(--line); }
.nav-btn:hover { color: var(--fg); }

/* 필터 탭 */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { background: var(--surface); border: 1px solid var(--line); color: var(--fg-muted); padding: 7px 13px; border-radius: 999px; font-size: 14px; }
.tab.on { background: var(--primary-weak); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.tab .n { font-size: 12px; opacity: .85; margin-left: 3px; }

/* 새 항목 폼 */
.new-form { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.new-form .row { display: flex; gap: 8px; }
.new-form input[name=title] { flex: 1; }

/* 항목 카드 */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.item-head { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.item-title { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.item.done .item-title, .item.dropped .item-title { color: var(--fg-muted); font-weight: 500; }
.pill { font-size: 11.5px; font-weight: 700; padding: 2.5px 8px; border-radius: 999px; white-space: nowrap; }
.pill.p1 { color: var(--p1); background: color-mix(in srgb, var(--p1) 12%, transparent); }
.pill.p2 { color: var(--p2); background: color-mix(in srgb, var(--p2) 12%, transparent); }
.pill.p3 { color: var(--p3); background: color-mix(in srgb, var(--p3) 14%, transparent); }
.pill.st-open { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.pill.st-doing { color: var(--doing); background: color-mix(in srgb, var(--doing) 14%, transparent); }
.pill.st-done { color: var(--done); background: color-mix(in srgb, var(--done) 13%, transparent); }
.pill.st-dropped { color: var(--dropped); background: color-mix(in srgb, var(--dropped) 16%, transparent); }
.item-date { color: var(--fg-subtle); font-size: 12px; white-space: nowrap; }
.item-body { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.item-body pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 13.5px/1.6 inherit; color: var(--fg); }
.item-body .meta { color: var(--fg-subtle); font-size: 12.5px; }
.item-body .resolution { background: color-mix(in srgb, var(--done) 8%, transparent); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.controls select { padding: 7px 10px; }
.btn-danger { background: transparent; color: var(--danger); padding: 8px 12px; }
.empty { color: var(--fg-subtle); text-align: center; padding: 48px 0; }
.saving { opacity: .55; pointer-events: none; }

/* v2 — 환경 pill·필터·테이블(멤버/요청 로그) */
.pill.area { color: var(--fg-muted); background: color-mix(in srgb, var(--fg-muted) 12%, transparent); }
.tab-select { border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--fg-muted); }
.new-form .row.wrap { flex-wrap: wrap; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--fg-subtle); font-size: 12px; font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td .pill { margin-left: 5px; }
.muted { color: var(--fg-muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
tr.suspended td { opacity: .55; }
tr.bad td { background: color-mix(in srgb, var(--danger) 7%, transparent); }
tr.warn td { background: color-mix(in srgb, var(--doing) 6%, transparent); }
.actions button { padding: 5px 9px; font-size: 12.5px; white-space: nowrap; }
