:root {
  --navy: #1b3a5c; --navy-dark: #12283f; --accent: #2f80ed; --bg: #f4f6f8; --card: #fff;
  --text: #1f2933; --muted: #6b7785; --line: #e3e7ea; --ok: #1e8e3e; --warn: #d97706; --bad: #c62828;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.3; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
p { margin: 0 0 10px; }
button, input, select, textarea { font: inherit; }

.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; min-height: 58px; gap: 16px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.brand-mark { background: #fff; color: var(--navy); border-radius: 6px; padding: 2px 7px; font-size: 13px; letter-spacing: 1px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a, .nav button { color: #dbe4ee; padding: 8px 12px; border-radius: 8px; background: none; border: 0; cursor: pointer; font-size: 14px; }
.nav a.active, .nav a:hover, .nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav .nav-user { color: #9fb3c8; font-size: 13px; padding: 0 8px; }
.nav .nav-badge { background: #e53935; color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 6px; margin-left: 4px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 18px; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 10px; }
  .nav.open { display: flex; }
  .nav a, .nav button { text-align: left; }
}

.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.tight { padding: 14px 16px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); padding: 12px 4px; display: flex; gap: 12px; align-items: center; }
.list li:first-child { border-top: 0; }
.list li a.item { color: var(--text); flex: 1; min-width: 0; }
.list li a.item:hover .t { color: var(--accent); }
.list .t { font-weight: 600; }
.list .m { color: var(--muted); font-size: 13px; margin-top: 2px; }
.list .unread .t::before { content: ""; display: inline-block; width: 7px; height: 7px; background: #e53935; border-radius: 50%; margin-right: 7px; vertical-align: middle; }

.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef1f4; color: #4b5563; white-space: nowrap; vertical-align: middle; }
.badge.navy { background: #e3ebf5; color: var(--navy); }
.badge.ok { background: #e6f4ea; color: var(--ok); }
.badge.warn { background: #fdf1e0; color: var(--warn); }
.badge.bad { background: #fdecea; color: var(--bad); }
.badge.pin { background: #fff3cd; color: #8a6d0b; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; }
.btn:hover { background: var(--navy-dark); }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid #c8d2dc; }
.btn.secondary:hover { background: #f1f4f7; }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.form-row .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c8d2dc; border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47,128,237,.35); border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: normal !important; }
.check input { margin-top: 4px; }
.inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; color: #4b5563; font-weight: 600; font-size: 13px; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #f8fafc; }

.prose { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.meta { color: var(--muted); font-size: 13px; }
.attachments a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 4px 6px 0 0; font-size: 13px; color: var(--text); background: #fafbfc; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert.info { background: #e8f1fd; color: #1a4d8f; }
.alert.ok { background: #e6f4ea; color: #1e6b31; }
.alert.warn { background: #fdf1e0; color: #8a4b08; }
.alert.bad { background: #fdecea; color: #8e1c1c; }

.vote-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 14px; }
@media (max-width: 560px) { .vote-options { grid-template-columns: 1fr; } }
.vote-option { position: relative; border: 2px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; text-align: center; font-weight: 700; font-size: 16px; background: #fff; }
.vote-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.vote-option:has(input:focus-visible) { outline: 2px solid var(--accent); }
.vote-option.approve.selected { border-color: var(--ok); background: #e6f4ea; color: var(--ok); }
.vote-option.reject.selected { border-color: var(--bad); background: #fdecea; color: var(--bad); }
.vote-option.abstain.selected { border-color: #6b7785; background: #eef1f4; color: #3d4852; }
.consent-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #3d4852; white-space: pre-wrap; margin-bottom: 12px; }

.bar { height: 22px; background: #eef1f4; border-radius: 6px; overflow: hidden; display: flex; }
.bar span { height: 100%; }
.bar .approve { background: var(--ok); } .bar .reject { background: var(--bad); } .bar .abstain { background: #9aa5b1; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.cond { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 14px; }
.cond .mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.cond .mark.ok { background: var(--ok); } .cond .mark.no { background: #c2c9d1; }
.receipt { border: 2px dashed #c8d2dc; border-radius: 10px; padding: 16px; background: #fbfcfd; }
.receipt dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.receipt dt { color: var(--muted); } .receipt dd { margin: 0; font-weight: 600; }

.login-wrap { max-width: 420px; margin: 40px auto; }
.login-wrap .brand-big { text-align: center; margin-bottom: 20px; }
.login-wrap .brand-big .name { font-size: 22px; font-weight: 700; color: var(--navy); }
.code-input { font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 700; }

.chat { display: flex; flex-direction: column; gap: 10px; }
.chat .msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; background: #eef1f4; }
.chat .msg.admin { align-self: flex-end; background: #e3ebf5; }
.chat .msg .who { font-size: 12px; color: var(--muted); margin-bottom: 3px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 50; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--navy); }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.section-head h1 { margin: 0; }
@media print { .topbar, .footer, .btn, .nav { display: none !important; } .card { border: 0; } }
