* { box-sizing: border-box; }
:root { --bg: #f4f6f9; --line: #e2e6ec; --text: #1f2933; --muted: #7b8794; --pri: #2456d6; --side: #1b2434; }
body { margin: 0; font: 14px/1.5 "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif; color: var(--text); background: var(--bg); display: flex; min-height: 100vh; }
a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }

aside { width: 210px; background: var(--side); color: #cbd2dc; flex-shrink: 0; }
.logo { padding: 18px 18px 14px; font-weight: 700; color: #fff; font-size: 16px; border-bottom: 1px solid #2c384d; }
.logo small { display: block; font-weight: 400; font-size: 12px; color: #8d9ab0; }
nav .sec { padding: 14px 18px 4px; font-size: 11px; color: #71809a; letter-spacing: .05em; }
nav a { display: block; padding: 7px 18px; color: #cbd2dc; }
nav a:hover { background: #26324a; text-decoration: none; }
nav a.on { background: var(--pri); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
header { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.who { display: flex; align-items: center; gap: 10px; }
.gsearch { display: flex; gap: 6px; flex: 1; max-width: 460px; }
.gsearch input { flex: 1; min-width: 0; }
mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }
main { padding: 24px; max-width: 1280px; width: 100%; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; overflow-x: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cards .card { margin: 0; }
.stat { display: block; color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--pri); }
.stat span { display: block; color: var(--muted); font-size: 13px; }
.stat b { font-size: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.grid2 .card { margin: 0 0 16px; }
.grid2 .wide { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: #f8f9fb; font-weight: 600; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.act { text-align: right; white-space: nowrap; }
tr.total td { font-weight: 700; background: #f8f9fb; }
tr.vfirst td { border-top: 2px solid var(--line); }
table.kv th { width: 110px; background: #f8f9fb; }
ul { margin: 0; padding-left: 18px; }
li { margin: 4px 0; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.inline { display: inline; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 6px 14px; border-radius: 6px; color: var(--text); }
.tab.on { background: var(--pri); color: #fff; }

input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #c9d0da; border-radius: 6px; background: #fff; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9cbf7; border-color: var(--pri); }
.form { max-width: 520px; }
.form.wide { max-width: none; }
.form label { display: block; margin-bottom: 12px; font-size: 13px; color: #52606d; }
.form label input, .form label select, .form label textarea { display: block; width: 100%; margin-top: 4px; color: var(--text); }
.form label.check input { display: inline; width: auto; margin-right: 6px; }
.form i { color: #d64545; font-style: normal; }
.form textarea { width: 100%; }
table.lines { margin-bottom: 12px; }
table.lines input, table.lines select { width: 100%; }

.btn { display: inline-block; padding: 7px 14px; border: 1px solid #c9d0da; border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; font: inherit; }
.btn:hover { background: #f1f3f6; text-decoration: none; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primary:hover { background: #1c46b3; }
.btn.danger { color: #c92a2a; border-color: #f1b5b5; }
button.link { background: none; border: 0; color: var(--pri); cursor: pointer; font: inherit; padding: 0; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.badge.blue { background: #e0eaff; color: #2456d6; }
.badge.green { background: #dcf5e4; color: #1d7a3e; }
.badge.red { background: #fde3e3; color: #c92a2a; }
.badge.gray { background: #e9ecf1; color: #52606d; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash.ok { background: #dcf5e4; color: #1d7a3e; }
.flash.err { background: #fde3e3; color: #c92a2a; }

.body { white-space: pre-wrap; word-break: break-word; padding: 12px 0; }
.comment { border-top: 1px solid var(--line); padding: 8px 0; }
.comment .body { padding: 2px 0 0; }

table.cal { table-layout: fixed; }
table.cal td { height: 96px; border: 1px solid var(--line); padding: 4px; }
table.cal th { text-align: center; }
table.cal td.off { background: #fafbfc; }
table.cal td.today { background: #eef3ff; }
table.cal .d { font-size: 12px; color: var(--muted); }
.ev { display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 4px; margin: 1px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.cal .ev { display: block; }
.ev.s-p { background: #e9ecf1; } .ev.s-c { background: #e0eaff; color: #2456d6; }
.ev.s-g { background: #fff0d1; color: #9a6400; } .ev.s-l { background: #dcf5e4; color: #1d7a3e; }
.ym { font-size: 16px; margin: 0 8px; }

body.login { align-items: center; justify-content: center; }
.loginbox { width: 340px; padding: 28px; }
.loginbox h1 { margin-bottom: 0; }
.loginbox label { display: block; margin: 14px 0 0; font-size: 13px; }
.loginbox input { display: block; width: 100%; margin-top: 4px; }
.loginbox .btn { width: 100%; margin-top: 18px; }

@media (max-width: 800px) {
  body { flex-direction: column; }
  aside { width: 100%; }
  nav { display: flex; flex-wrap: wrap; }
  nav .sec { display: none; }
  .row3 { grid-template-columns: 1fr; }
  main { padding: 14px; }
}

table.pay th, table.pay td { padding: 6px 6px; font-size: 13px; }
input.money { width: 96px; text-align: right; padding: 5px 6px; }
.big { font-size: 18px; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid3 .card { margin: 0 0 16px; }
.files { padding: 8px 0; border-top: 1px dashed var(--line); margin-top: 8px; }
.bell { padding: 2px 10px; border-radius: 12px; background: #eef1f5; color: var(--text); font-size: 13px; }
.bell.on { background: #d64545; color: #fff; }
tr.unread td { font-weight: 600; }
table.inv { margin-bottom: 10px; border: 1px solid #9aa5b1; }
table.inv th, table.inv td { border: 1px solid #9aa5b1; padding: 6px 8px; }
table.inv th { background: #f1f3f6; white-space: nowrap; width: 90px; }
table.inv th.side { width: 28px; white-space: normal; text-align: center; }
.invtitle { text-align: center; font-size: 20px; margin-bottom: 14px; }
@media print {
  aside, header, .noprint, h1 { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
}
