:root { --head:#1e3a5f; --blue:#2563eb; --red:#dc2626; --orange:#c2410c; --green:#15803d; --teal:#0d9488; --text:#1f2937; --muted:#6b7280; --line:#e2e8f0; --bg:#eef1f6; --stripe:#f7f9fc; --sel:#dbeafe; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "맑은 고딕", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
header { display: flex; align-items: center; gap: 12px; padding: 10px 18px; color: #fff; background: linear-gradient(90deg, var(--head), var(--blue)); flex-wrap: wrap; }
header h1 { font-size: 19px; margin: 0; white-space: nowrap; }
header .sub { color: #bfdbfe; font-size: 12px; }
header .grow { flex: 1; }
header .who { color: #dbeafe; font-size: 13px; }
header button { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.4); }
nav.tabs { display: flex; gap: 6px; padding: 10px 18px 0; flex-wrap: wrap; }
nav.tabs button { border-radius: 18px; padding: 7px 18px; background: #fff; border: 1px solid #cbd5e1; }
nav.tabs button.on { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: bold; }
main { padding: 10px 18px 24px; }
.card { background: #fff; border: 1px solid #d8dee8; border-radius: 8px; padding: 12px; margin-bottom: 12px; }
button { cursor: pointer; border-radius: 16px; border: 1px solid #cbd5e1; background: #fff; padding: 6px 14px; min-height: 32px; }
button:hover { filter: brightness(.96); }
button:disabled { opacity: .5; cursor: default; }
button.blue { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: bold; }
button.red { background: var(--red); border-color: var(--red); color: #fff; font-weight: bold; }
button.green { background: var(--green); border-color: var(--green); color: #fff; font-weight: bold; }
button.teal { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: bold; }
input, select { border: 1px solid #94a3b8; border-radius: 4px; padding: 5px 7px; background: #fff; min-height: 32px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
input.num { text-align: right; }
input[type=checkbox], input[type=radio] { min-height: 0; vertical-align: middle; }
.row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 8px; }
.row label.cap { font-weight: bold; color: var(--head); }
.status { color: var(--muted); font-size: 13px; }
.err { color: var(--red); }
.ok { color: var(--green); }
.tbl { overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 6px 8px; border-bottom: 1px solid #f1f4f8; white-space: nowrap; text-align: left; }
th { position: sticky; top: 0; background: #f3f6fa; color: var(--muted); font-size: 13px; z-index: 1; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.memo { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
tbody tr:nth-child(even) { background: var(--stripe); }
tbody tr.mark { background: #fef3c7; }
tbody tr.total { background: #e2e8f0; font-weight: bold; }
tbody tr.carry { color: var(--muted); font-weight: bold; }
tbody tr.click { cursor: pointer; }
.t-입금 { color: #0e7490; } .t-출금 { color: #b45309; } .neg { color: var(--red); }
.list-h { max-height: 46vh; }
.sum { font-weight: bold; margin: 8px 2px; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.tile { flex: 1 1 170px; background: #f8fafc; border-left: 4px solid var(--blue); border-radius: 8px; padding: 8px 12px; }
.tile .k { color: var(--muted); font-size: 12px; }
.tile .v { font-size: 20px; font-weight: bold; text-align: right; }
.dim { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 10px; }
.dlg { background: #fff; border-radius: 10px; width: min(680px, 100%); max-height: 96vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.dlg h2 { margin: 0; padding: 14px 18px; font-size: 18px; color: #fff; background: linear-gradient(90deg, var(--head), var(--blue)); border-radius: 10px 10px 0 0; }
.dlg h2.edit { background: linear-gradient(90deg, var(--head), var(--orange)); }
.dlg .body { padding: 14px 18px; }
.dlg .foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 18px 16px; background: #f8fafc; border-radius: 0 0 10px 10px; }
.dlg .foot .left { margin-right: auto; }
.form { display: grid; grid-template-columns: 96px 1fr; gap: 8px 10px; align-items: center; }
.form > label { font-weight: bold; }
.form .pair { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form .hint { grid-column: 2; color: var(--muted); font-size: 12px; margin-top: -4px; }
.pick-list { border: 1px solid #94a3b8; border-radius: 4px; max-height: 170px; overflow: auto; }
.pick-list div { padding: 5px 8px; cursor: pointer; display: grid; grid-template-columns: 1fr 120px 80px; gap: 6px; }
.pick-list div.on { background: var(--sel); }
.pick-list div span:not(:first-child) { color: var(--muted); }
.picked { font-weight: bold; color: var(--green); }
.login { max-width: 380px; margin: 9vh auto; background: #fff; border-radius: 10px; box-shadow: 0 6px 30px rgba(0,0,0,.12); overflow: hidden; }
.login h1 { margin: 0; padding: 18px 22px; font-size: 20px; color: #fff; background: linear-gradient(90deg, var(--head), var(--blue)); }
.login form { padding: 18px 22px 22px; display: grid; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 20px; z-index: 60; }
@media (max-width: 720px) {
  header { padding: 8px 10px; } main { padding: 8px; } nav.tabs { padding: 8px 8px 0; }
  .form { grid-template-columns: 1fr; } .form .hint { grid-column: 1; }
  .dlg { max-height: 100vh; border-radius: 0; } .dim { padding: 0; }
  .pick-list div { grid-template-columns: 1fr 110px; } .pick-list div span:last-child { display: none; }
  .hide-m { display: none; }
  th, td { padding: 5px 6px; } td { white-space: normal; min-width: 64px; } td.n { white-space: nowrap; }
}
@media print { header, nav.tabs, .row, button { display: none !important; } body { background: #fff; } .tbl { max-height: none !important; overflow: visible; } }
button.deposit { background: #059669; border-color: #059669; color: #fff; font-weight: bold; }
button.deposit-soft { background: #ecfdf5; border-color: #6ee7b7; color: #059669; font-weight: bold; }
.dlg h2.dep { background: linear-gradient(90deg, #065f46, #059669); }
