:root {
  --brand: #1e3a5f; --brand-2: #2b5283; --brand-soft: #e8eef6;
  --bg: #f4f6f9; --panel: #ffffff; --line: #dde3ea; --line-2: #eef1f5;
  --text: #1b2430; --muted: #6b7684; --input-bg: #fffbe8; --input-fg: #1d4ed8;
  --ok: #157347; --ok-soft: #e3f4ea; --warn: #b45309; --warn-soft: #fef3e2; --bad: #c62828; --bad-soft: #fdecec;
  --purple: #6d28d9; --purple-soft: #efe9fd;
  --radius: 8px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Segoe UI", system-ui, sans-serif;
  --mono: "Consolas", "Segoe UI Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 13.5px; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); }
.boot { padding: 40px; color: var(--muted); }

/* ── 앱 골격 ── */
.app { display: grid; grid-template-rows: auto 1fr; height: 100vh; }
.top { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--brand); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; background: #fff; border-radius: 6px; padding: 4px 10px; line-height: 0; }
.brand img { height: 30px; width: auto; display: block; }
.auth-logo { text-align: center; margin: -6px 0 22px; }
.auth-logo img { width: 100%; max-width: 320px; height: auto; display: inline-block; }
.auth .auth-sub { text-align: center; margin: 0 0 20px; color: var(--muted); font-size: 12.5px; }
.auth .box h1 { text-align: center; }
.top .ctl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .95; }
.top select, .top input { background: #fff; color: var(--text); border: 0; border-radius: 6px; padding: 5px 8px; }
.top .icon-btn { background: rgba(255,255,255,.14); border: 0; color: #fff; border-radius: 6px; padding: 4px 9px; cursor: pointer; }
.top .icon-btn:hover { background: rgba(255,255,255,.25); }
.spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.body { display: grid; grid-template-columns: 196px 1fr; min-height: 0; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 12px 8px; overflow-y: auto; }
.side h6 { margin: 14px 10px 6px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.side a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.side a:hover { background: var(--line-2); }
.side a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.side .n { margin-left: auto; font-size: 11px; background: var(--bad); color: #fff; border-radius: 9px; padding: 0 6px; }
main { overflow: auto; padding: 18px 22px 60px; min-width: 0; }

/* ── 공통 ── */
.page-h { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 20px; letter-spacing: -.4px; }
.page-h .sub { color: var(--muted); }
.page-h .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.panel h2 { font-size: 14.5px; margin: 0 0 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--line-2); }
.btn.primary { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.btn.primary:hover { background: var(--brand); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.danger { color: var(--bad); border-color: #f3c4c4; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.st-open { background: #e6ecf3; color: #3b536e; }
.st-sub { background: var(--warn-soft); color: var(--warn); }
.st-rev { background: var(--purple-soft); color: var(--purple); }
.st-closed { background: var(--ok-soft); color: var(--ok); }
.st-conf { background: #1e3a5f; color: #fff; }
.top .st-conf { background: #fff; color: #1e3a5f; }
.cat-재료비 { background: #e7f0fb; color: #1d4f91; }
.cat-외주비 { background: #f1e9fb; color: #6b2fb0; }
.cat-노무비 { background: #e4f5ec; color: #17693e; }
.cat-경비 { background: #fdf1e2; color: #9a5a0a; }
.cat-미분류 { background: var(--bad-soft); color: var(--bad); }
.banner { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid; }
.banner.lock { background: #f3f5f8; border-color: var(--line); color: #3b4756; }
.banner.warn { background: var(--warn-soft); border-color: #f5d9b0; color: #7a4206; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 120px; }
.chip b { display: block; font-size: 16px; margin-top: 2px; font-family: var(--mono); }
.chip.click { cursor: pointer; }
.chip.click:hover { border-color: var(--brand-2); }
.chip.bad b { color: var(--bad); }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.neg { color: var(--bad); }
.over { color: var(--bad); font-weight: 700; }
.zero { color: #b3bcc7; }
input.in, select.in, textarea.in { background: var(--input-bg); color: var(--input-fg); border: 1px solid #ecdfa8; border-radius: 4px; padding: 4px 6px; width: 100%; }
input.in:focus, select.in:focus, textarea.in:focus { outline: 2px solid #93b4e6; outline-offset: -1px; background: #fff; }
input.in.num { text-align: right; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12px; color: var(--muted); }
.field input:not([type=checkbox]), .field select, .field textarea { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }

/* ── 표 ── */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: calc(100vh - 290px); }
.tbl-wrap.free { max-height: none; }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.8px; }
table.t th { position: sticky; top: 0; z-index: 2; background: #f0f3f7; color: #3a4655; font-weight: 600; text-align: center; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 4px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tbody tr:hover td { background: #f8fafc; }
table.t tr.sel td { background: #eef4fd !important; }
table.t tr.cathead td { background: #f7f9fb; font-weight: 700; color: var(--brand); }
table.t tr.subtotal td { background: #f3f6fa; font-weight: 700; border-top: 1px solid var(--line); }
table.t tr.grand td { background: var(--brand-soft); font-weight: 800; color: var(--brand); border-top: 2px solid var(--brand-2); }
table.t tr.addrow td { background: #fffdf3; border-bottom: 2px solid #ecdfa8; }
table.t td.click { cursor: pointer; }
table.t td.click:hover { background: #e8f0fb; text-decoration: underline; }
table.t tfoot td { position: sticky; bottom: 0; background: #f0f3f7; font-weight: 700; border-top: 1px solid var(--line); }
table.t .w-chk { width: 30px; text-align: center; }
table.t td.ro { color: #3b4756; }
.sticky-l { position: sticky; left: 0; z-index: 1; background: inherit; }
table.t td { white-space: nowrap; }
table.t td.wrap { white-space: normal; min-width: 220px; }
.sheet table.r th { white-space: nowrap; }
table.ledger td input.in, table.ledger td select.in { padding: 3px 5px; }
table.ledger td:nth-child(4) input { min-width: 128px; }
table.ledger td:nth-child(5) input { min-width: 190px; }
table.ledger td:nth-child(6) input { min-width: 100px; }
table.ledger td:nth-child(7) select { min-width: 230px; }
table.ledger td:nth-child(9) input { min-width: 120px; }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: #eef4fd; border: 1px solid #c9daf3; border-radius: var(--radius); margin-bottom: 10px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar select, .toolbar input[type=search] { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--brand-2); color: #fff; }

/* ── 실행예산 월별 증감 ── */
.bp-wrap { max-height: max(380px, calc(100vh - 300px)); }
table.bp td, table.bp th { white-space: nowrap; }
table.bp .bp-stk { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 190px; border-right: 2px solid var(--line); }
table.bp thead .bp-stk { z-index: 4; background: #f0f3f7; }
table.bp tr.cathead .bp-stk { background: #f7f9fb; }
table.bp tr.subtotal .bp-stk { background: #f3f6fa; }
table.bp tr.grand .bp-stk { background: var(--brand-soft); }
table.bp th.bp-cur { background: #fff1d6; color: #8a4b00; }
table.bp td.bp-cur { background: #fffaf0; }
table.bp th.bp-future { color: #9aa4b1; }
table.bp td.bp-future input { opacity: .75; }
table.bp .bp-eff { background: #eef4fd; }
table.bp th.bp-eff { background: #dce8f8; color: var(--brand); }
input.bp-adj { width: 92px; }

/* ── 인사 관리 ── */
table.t tr.click-row { cursor: pointer; }
table.t tr.click-row:hover td { background: #eef4fd; }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: #f7f9fb; color: var(--text); }

/* ── 원가내역: 다른 사람 입력분(읽기 전용) ── */
table.t tr.locked td { color: #5b6573; background: #fafbfc; }
table.t tr.locked td.w-chk { font-size: 11px; }

/* ── 원가내역: 저장 전 변경 ── */
table.t td.chg input.in, table.t td.chg select.in { background: #ffe8cc; border-color: #f59f00; color: #8a4b00; font-weight: 600; }
table.t tr.dirty td:first-child { box-shadow: inset 3px 0 0 #f59f00; }
table.t tr.newrow td { background: #fff4e0; }
table.t tr.newrow td:first-child { box-shadow: inset 3px 0 0 #f59f00; }
.savebar { position: sticky; bottom: 0; z-index: 6; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 10px 14px;
  background: #fff8e6; border: 1px solid #f5d9b0; border-radius: var(--radius); box-shadow: 0 -4px 14px rgba(0,0,0,.08); }

/* ── 공수 관리 ── */
.mh-wrap { overflow: auto; max-height: calc(100vh - 250px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.mh { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.mh th, table.mh td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 2px 3px; text-align: center; white-space: nowrap; background: #fff; }
table.mh thead th { position: sticky; top: 0; z-index: 3; background: #f0f3f7; font-weight: 600; color: #3a4655; height: 24px; }
table.mh thead tr:nth-child(2) th { top: 24px; font-weight: 400; font-size: 11px; }
table.mh .stk { position: sticky; z-index: 2; text-align: left; }
table.mh thead .stk { z-index: 4; }
table.mh .s0 { left: 0; min-width: 30px; width: 30px; text-align: center; }
table.mh .s1 { left: 30px; min-width: 88px; }
table.mh .s2 { left: 118px; min-width: 76px; }
table.mh .s3 { left: 194px; min-width: 52px; border-right: 2px solid var(--line); }
table.mh th.sat, table.mh td.sat { background: #f2f6ff; }
table.mh th.sun, table.mh td.sun { background: #fff2f2; color: #b42318; }
table.mh td.tot { font-family: var(--mono); font-weight: 700; background: #f7f9fb; min-width: 44px; }
table.mh td.mdv { font-family: var(--mono); min-width: 30px; cursor: default; }
table.mh td.mdv.ovr { color: var(--purple); font-weight: 800; }
table.mh td.note { position: relative; }
table.mh td.note::after { content: ''; position: absolute; right: 0; top: 0; border-top: 7px solid #e8590c; border-left: 7px solid transparent; }
input.mhc { width: 32px; border: 0; background: var(--input-bg); color: var(--input-fg); text-align: center; padding: 3px 0; font-family: var(--mono); font-size: 12px; border-radius: 2px; }
input.mhc:focus { outline: 2px solid #93b4e6; background: #fff; }
input.mhc.bad { background: var(--bad-soft); color: var(--bad); }
table.mh tr.team-sub td { background: #f3f6fa; font-weight: 700; font-family: var(--mono); }
table.mh tfoot td { position: sticky; background: var(--brand-soft); font-weight: 800; color: var(--brand); font-family: var(--mono); }
table.mh tfoot tr.grand td { bottom: 24px; border-top: 2px solid var(--brand-2); }
table.mh tfoot tr.cnt td { bottom: 0; background: #eef2f7; font-weight: 600; color: #3a4655; height: 24px; }
table.mh tfoot .stk { z-index: 3; }

/* ── 갑지 ── */
.report { max-width: 1060px; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 30px; }
.sheet-lh { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 10px; margin-bottom: 18px;
  border-bottom: 3px solid #0a5c9b; box-shadow: 0 3px 0 -1px #f2b705; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sheet-lh img { height: 46px; width: auto; display: block; }
.sheet-lh-r { text-align: right; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.sheet-title { text-align: center; margin-bottom: 4px; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.sheet-sub { text-align: center; color: var(--muted); margin-bottom: 18px; font-size: 12px; }
.sheet h3 { font-size: 14px; margin: 22px 0 8px; color: var(--brand); border-left: 4px solid var(--brand-2); padding-left: 8px; }
.sheet table.r { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.sheet table.r th, .sheet table.r td { border: 1px solid #cfd7e1; padding: 6px 8px; }
.sheet table.r th { background: #eef2f7; font-weight: 600; text-align: center; }
.sheet table.r td.lbl { background: #f7f9fb; font-weight: 600; white-space: nowrap; }
.sheet table.r tr.tot td { background: var(--brand-soft); font-weight: 800; }
.head-grid { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.approval { border-collapse: collapse; }
.approval th, .approval td { border: 1px solid #cfd7e1; text-align: center; width: 92px; }
.approval th { background: #eef2f7; padding: 4px; font-size: 12px; }
.approval td { height: 62px; font-size: 12px; vertical-align: middle; }
.approval td .nm { font-weight: 700; }
.approval td .dt { color: var(--muted); font-size: 10.5px; }
.approval .side-h { width: 28px; writing-mode: vertical-rl; letter-spacing: 4px; background: #eef2f7; font-weight: 700; }
.check-ok { color: var(--ok); font-weight: 700; }
.check-bad { color: var(--bad); font-weight: 700; }
.check-info { color: var(--warn); font-weight: 700; }
.wf { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.history { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; color: #3b4756; max-height: 140px; overflow: auto; }
.history li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.remark { white-space: pre-wrap; min-height: 22px; }

/* ── 대시보드 ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h3 { margin: 0 0 2px; font-size: 16px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.kpi { background: #f7f9fb; border-radius: 6px; padding: 8px 10px; }
.kpi span { font-size: 11.5px; color: var(--muted); }
.kpi b { display: block; font-family: var(--mono); font-size: 14.5px; margin-top: 2px; }
.strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.strip button { border: 0; border-radius: 4px; padding: 5px 0; font-size: 11px; cursor: pointer; }
.strip button.cur { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.bar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-2); }
.bar > i.over { background: var(--bad); }

/* ── 로그인 / 모달 / 토스트 ── */
.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #1e3a5f, #2b5283 60%, #3d6aa3); padding: 16px; }
.auth .box { background: #fff; border-radius: 12px; padding: 28px 30px; width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.auth h1 { margin: 0 0 4px; font-size: 20px; }
.auth p { margin: 0 0 18px; color: var(--muted); }
.auth .btn { width: 100%; padding: 9px; margin-top: 6px; }
.err { color: var(--bad); min-height: 18px; font-size: 12.5px; margin-top: 6px; }
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,35,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { max-width: 1180px; }
.modal, .modal .mb { min-width: 0; }
.modal .mh { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal .mh h2 { margin: 0; font-size: 16px; }
.modal .mh .x { margin-left: auto; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal .mb { padding: 16px 18px; overflow: auto; }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
textarea.paste { width: 100%; height: 150px; font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #1f2937; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 420px; animation: tin .2s ease-out; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.empty { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { display: flex; overflow-x: auto; padding: 6px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side h6 { display: none; }
  .side a { white-space: nowrap; }
  main { padding: 14px 16px 60px; }
  .cards { grid-template-columns: 1fr; }
  .grid2, .grid3, .head-grid { grid-template-columns: 1fr; }
}

/* ── 인쇄 (갑지) ── */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .top, .side, .no-print, #toasts { display: none !important; }
  .app, .body { display: block; height: auto; }
  main { padding: 0; overflow: visible; }
  .sheet { border: 0; box-shadow: none; padding: 0; }
  input.in, textarea.in { border: 0; background: none; color: var(--text); padding: 0; resize: none; }
  .report { max-width: none; }
}

/* ───────── 월마감 차트 ───────── */
.print-only { display: none; }
.vz-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.vz-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; min-width: 0; }
.vz-kpi .k { font-size: 12px; color: var(--muted); }
.vz-kpi .v { font-size: 21px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.vz-kpi .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.vz-kpi .s b { color: var(--text); }
.vz-down, .vz-kpi .s b.vz-down { color: var(--bad); }
.vz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.vz-grid > .panel { margin: 0; min-width: 0; }
.vz-wide { grid-column: 1 / -1; }
@media (max-width: 980px) { .vz-grid { grid-template-columns: minmax(0, 1fr); } }
.vz-card h2 { margin-bottom: 2px; }
.vz-cap { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.vz-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #52514e; margin-bottom: 6px; }
.vz-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.vz-leg i.ln { width: 16px; height: 0; border-top: 2px solid; border-radius: 0; vertical-align: 3px; }
.vz-leg i.ln.dash { border-top-style: dashed; }
.vz-host { width: 100%; min-height: 250px; }
svg.vz { display: block; max-width: 100%; height: auto; font-family: var(--font); }
.vz-ax { font-size: 11px; fill: #898781; font-variant-numeric: tabular-nums; }
.vz-ax.cur { fill: var(--text); font-weight: 700; }
.vz-lbl { font-size: 11.5px; fill: #52514e; font-weight: 600; }
.vz-hit { fill: transparent; }
.vz-hit:hover { fill: rgba(30, 58, 95, .05); }
.vz-tip { position: fixed; z-index: 60; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(16, 24, 40, .16); padding: 8px 10px; font-size: 12px; min-width: 180px; }
.vz-tip b.t { display: block; margin-bottom: 4px; }
.vz-tip .r { display: flex; gap: 14px; justify-content: space-between; line-height: 1.65; }
.vz-tip .r span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.vz-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.vz-tip .sep { border-top: 1px solid var(--line-2); margin-top: 3px; padding-top: 3px; }
.vz-bul { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.vz-bul .nm { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.vz-bul .nm i, .vz-chk .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.vz-trk { position: relative; height: 16px; background: #eef0f2; border-radius: 4px; margin-top: 8px; }
.vz-trk .f { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.vz-trk .mk { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #3d3c39; border-radius: 1px; }
.vz-trk .none { position: absolute; left: 8px; top: 0; font-size: 11px; line-height: 16px; color: var(--muted); }
.vz-bul .meta { grid-column: 2; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.vz-over { color: var(--bad); font-weight: 700; }
.vz-crow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 56px; gap: 10px; align-items: center; margin-top: 12px; font-size: 12.5px; }
.vz-crow .lb { font-weight: 600; line-height: 1.2; }
.vz-crow .tt { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.vz-comp { display: flex; gap: 2px; height: 30px; border-radius: 4px; overflow: hidden; }
.vz-comp > div { display: flex; align-items: center; padding: 0 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; min-width: 2px; }
.vz-comp.empty { background: #eef0f2; color: var(--muted); align-items: center; padding: 0 10px; font-size: 12px; }
.vz-tbl summary { font-size: 12px; color: var(--brand-2); cursor: pointer; margin-top: 10px; width: max-content; }
.vz-tbl .tbl-wrap { margin-top: 6px; }
.vz-chk { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 18px; }
.vz-chk li { display: flex; gap: 10px; align-items: flex-start; }
.vz-chk .ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.vz-chk .ic.ok { background: #157347; } .vz-chk .ic.bad { background: var(--bad); } .vz-chk .ic.info { background: #fab219; color: #0b0b0b; }
@media print {
  .print-only { display: block; margin-bottom: 8px; font-size: 13px; }
  .vz-tip, .vz-tbl { display: none !important; }
  .vz-grid { grid-template-columns: 1fr 1fr; }
  .vz-card, .vz-kpi { break-inside: avoid; box-shadow: none; }
}
/* ───────── 기성 입금 관리 ───────── */
.rc-filter { gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.rc-filter label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.rc-filter select { min-width: 170px; }
table.rc td { vertical-align: middle; }
table.rc tr.rc-site td { background: var(--brand-soft); color: var(--brand); font-weight: 700; padding-top: 8px; padding-bottom: 8px; }
table.rc tr.rc-bill td { background: #f7f8fa; border-top: 1px solid var(--line); }
table.rc tr.rc-row .rc-ind { padding-left: 22px; }
table.rc input.in, table.rc select.in { width: 100%; }
.rc-prog { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-bar { width: 110px; height: 8px; background: #e6e9ee; border-radius: 4px; overflow: hidden; flex: none; }
.rc-bar > div { height: 100%; background: var(--ok); border-radius: 0 4px 4px 0; }
/* ───────── 자산 관리 ───────── */
.ast-cats .chip { min-width: 128px; }
.ast-cats .chip b { font-size: 15px; }
.chip.on { border-color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-2); }
.ast-val { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 10px; padding: 10px 12px; background: #f7f8fa; border: 1px solid var(--line-2); border-radius: 8px; }
.ast-val span { display: block; }
.ast-val b { font-size: 15px; font-family: var(--mono); }
/* ───────── 메뉴 구성 ───────── */
.mn-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .mn-wrap { grid-template-columns: minmax(0, 1fr); } }
.mn-sec { padding: 10px 12px; }
.mn-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.mn-head input.mn-name { flex: 1; width: auto; min-width: 140px; font-weight: 700; font-size: 14px; }
.mn-head .danger { margin-left: auto; }
.mn-list { display: flex; flex-direction: column; gap: 4px; min-height: 38px; border-radius: 6px; }
.mn-list.drop-in { outline: 2px dashed var(--brand-2); outline-offset: 2px; }
.mn-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
@media (max-width: 700px) { .mn-item { flex-wrap: wrap; } }
.mn-item.dragging { opacity: .45; }
.mn-item.drop-before { box-shadow: 0 -3px 0 var(--brand-2); }
.mn-item.drop-after { box-shadow: 0 3px 0 var(--brand-2); }
.mn-grip { cursor: grab; color: var(--muted); font-size: 16px; padding: 0 2px; user-select: none; }
.mn-def { width: 150px; flex: none; font-size: 12.5px; }
.mn-item input.mn-lbl { flex: 1 1 140px; width: auto; min-width: 120px; }
.mn-item select.mn-mv { flex: none; width: 150px; }
.mn-empty { padding: 10px; font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; text-align: center; }
.mn-prev { position: sticky; top: 0; }
.mn-side { position: static; width: auto; height: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 0; }
.mn-side a { cursor: default; }
/* ───────── 매뉴얼 ───────── */
.mu-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .mu-wrap { grid-template-columns: minmax(0, 1fr); } .mu-toc { position: static !important; max-height: none !important; } }
.mu-toc { position: sticky; top: 0; max-height: calc(100vh - 140px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 0; }
.mu-toc h6 { margin: 10px 14px 4px; font-size: 11px; color: var(--muted); text-transform: none; }
.mu-toc a { display: block; padding: 5px 14px; color: var(--text); text-decoration: none; font-size: 13px; border-left: 3px solid transparent; }
.mu-toc a:hover { background: var(--brand-soft); }
.mu-toc a.on { border-left-color: var(--brand-2); background: var(--brand-soft); font-weight: 700; }
.mu-toc a.dim { opacity: .35; }
.mu-sech { font-size: 12px; font-weight: 700; color: var(--brand); margin: 6px 2px 8px; letter-spacing: .02em; }
.mu-ch { line-height: 1.75; scroll-margin-top: 8px; transition: box-shadow .3s; }
.mu-ch.mu-flash { box-shadow: 0 0 0 3px var(--brand-2); }
.mu-h { display: flex; align-items: center; gap: 10px; }
.mu-h h2 { margin: 0; font-size: 17px; }
.mu-h .btn, .mu-h .badge { margin-left: auto; }
.mu-who { font-size: 12px; color: var(--muted); margin: 4px 0 2px; }
.mu-ch h3 { font-size: 14px; margin: 14px 0 4px; color: var(--brand); }
.mu-ch ul, .mu-ch ol { margin: 4px 0; padding-left: 22px; }
.mu-ch p { margin: 4px 0; }
.mu-ch code { background: #f1f3f6; border-radius: 4px; padding: 1px 5px; font-family: var(--mono); font-size: 12px; }
.mu-tip, .mu-warn { margin: 6px 0; padding: 7px 10px; border-radius: 6px; font-size: 12.5px; }
.mu-tip { background: var(--brand-soft); }
.mu-warn { background: var(--warn-soft); color: #7a3e06; }
.mu-in { background: var(--input-bg); border: 1px solid #ecdfa8; padding: 0 5px; border-radius: 3px; }
.mu-chg { background: #ffe3c2; padding: 0 5px; border-radius: 3px; }
.mu-ok { color: var(--ok); font-weight: 700; }
.mu-t { margin: 6px 0; max-width: 820px; }
.mu-t td { white-space: normal; }
@media print { .mu-wrap { display: block; } .mu-ch { break-inside: avoid-page; box-shadow: none; } .mu-ch .btn { display: none; } .print-only { display: block; } }
/* ───────── QuickBooks 연동 ───────── */
.banner.qb { background: #e9f3ff; border: 1px solid #b9d6f6; color: #123f6e; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qb-note { margin: -4px 0 10px; display: flex; align-items: center; gap: 8px; }
.qb-stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.qb-stat > div { background: #f7f8fa; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
.qb-stat span { display: block; font-size: 12px; color: var(--muted); }
.qb-stat b { display: block; margin-top: 2px; }
.qb-stat small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.qb-copy { display: flex; gap: 6px; margin: 6px 0; max-width: 620px; }
.qb-copy input { font-family: var(--mono); font-size: 12px; background: #f7f8fa; color: var(--text); border-color: var(--line); }
.qb-way { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; line-height: 1.7; }
.qb-way h3 { margin: 0 0 4px; font-size: 14px; color: var(--brand); }
.qb-api { margin-bottom: 10px; background: #e9f3ff; border-color: #b9d6f6; }
details.qb-file { margin-bottom: 10px; }
details.qb-file > summary { cursor: pointer; font-size: 12.5px; color: var(--brand-2); margin-bottom: 8px; }
table.qd select.in { min-width: 130px; }
/* ───────── 원가 조회 ───────── */
.cq-f { display: flex; flex-direction: column; gap: 10px; }
.cq-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.cq-row > label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cq-row input[type=month].in { width: 150px; }
.cq-row select.in { width: auto; min-width: 150px; }
.cq-row .cq-q { flex: 1 1 380px; }
.cq-row .cq-q input { width: 100%; font-size: 14px; padding: 6px 10px; }
.cq-pre button { font-size: 12px; }
.cq-tabs { margin: 4px 0 10px; }
.cq-tabs button { font-weight: 600; }
.cq-ex { background: var(--brand-soft); border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; color: var(--brand); }
.cq-drill { display: flex; align-items: center; gap: 8px; background: #fff7e0; border: 1px solid #f3dc9a; border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
.cq-t mark { background: #ffe58a; color: inherit; padding: 0 1px; border-radius: 2px; }
.cq-t tr.sub td { background: #f3f5f8; font-weight: 700; }
.cq-t tr.cathead td { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.cq-t td.click-cell { cursor: pointer; }
.cq-t td.click-cell:hover { background: #e9f3ff; }
.cq-piv .stk { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 200px; }
.cq-piv tr.sub .stk, .cq-piv tr.cathead .stk { background: inherit; }.btn.primary.pulse { box-shadow: 0 0 0 3px rgba(43, 82, 131, .28); }
.cq-dirty { color: var(--warn); font-weight: 600; }
.cq-start { padding: 40px 10px; }
.hr-sub { font-size: 13.5px; margin: 14px 0 6px; color: var(--brand); border-top: 1px solid var(--line-2); padding-top: 10px; }

/* ───────── 본사비 관리 ───────── */
.hq-tabs { margin-bottom: 12px; }
.hq-tabs button { font-weight: 600; }
.hq-tip { background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 7px 10px; margin-bottom: 10px; }
.hq-h3 { font-size: 13.5px; margin: 14px 0 6px; }
tr.hq-future td { color: var(--muted); }
table.hq-ent input.in, table.hq-ent select.in { width: 100%; }
/* ───────── 한국 지급 원가 ───────── */
.kr-rates { padding: 10px 14px; }
.kr-rate-grid { display: grid; grid-template-columns: repeat(12, minmax(70px, 1fr)); gap: 6px; }
@media (max-width: 1100px) { .kr-rate-grid { grid-template-columns: repeat(6, minmax(70px, 1fr)); } }
.kr-rate { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); }
.kr-rate.on span { color: var(--brand); font-weight: 700; }
.kr-rate input.in { padding: 3px 5px; font-size: 12.5px; }
.kr-filter { gap: 12px; margin: 8px 0 10px; flex-wrap: wrap; }
.kr-filter label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.kr-filter select.in { width: auto; min-width: 140px; }
table.kr-t input.in, table.kr-t select.in { width: 100%; min-width: 80px; }
table.kr-t td { vertical-align: middle; }
/* ───────── 계좌 · 카드 관리 ───────── */
.fin-f { gap: 12px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.fin-f label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.fin-f select.in { width: auto; min-width: 130px; }
input.fin-stmt { width: 130px; }
table.fin-t input.in, table.fin-t select.in { width: 100%; min-width: 90px; }
table.fin-acc input.in, table.fin-acc select.in { width: 100%; min-width: 70px; }
/* ───────── 연차 관리 ───────── */
input.lv-in { width: 70px; }
table.lv-t td { vertical-align: middle; }
