/*
 * 하나소방 관리자 (PC) — XD "플로우 1" (1920 기준) 수치 그대로
 * 왼쪽 메뉴 210 / 윗줄 100 / 내용 상자 머리 71 / 표 폭 1331 가운데
 */
:root {
  --blue: #2279dc;
  --blue-line: #1e6bc2;
  --line: #dddddd;
  --card-line: #dcdcdc;
  --bg: #f5f7fa;
  --th: #f4f6f9;
  --text: #222222;
  --title: #212121;
  --muted: #808080;
  --gray: #9e9e9e;
  --gray-btn: #bbbbbb;
  --red: #dc2222;
  --sub-bg: #f9fcff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

/* ---------- 틀 ---------- */
.adm { display: flex; min-height: 100vh; }
.adm-side { width: 210px; flex: none; background: #fff; border-right: 1px solid var(--line); }
.adm-logo { display: flex; align-items: center; justify-content: center; height: 101px; border-bottom: 1px solid var(--line); }
.adm-logo img { width: 62px; height: 60px; object-fit: contain; }
.m-group .m-top { display: flex; align-items: center; justify-content: center; height: 60px; padding: 0 8px; text-align: center; font-size: 16px; font-weight: 500; color: #111; }
.m-group .m-top:hover { color: var(--blue); }
.m-group.on .m-top { background: var(--blue); color: #fff; font-weight: 600; }
.m-subs { background: var(--sub-bg); padding: 9px 0 8px; }
.m-subs a { display: block; height: 35px; line-height: 35px; padding-left: 30px; font-size: 14px; font-weight: 500; color: #111; }
.m-subs a.on { color: var(--blue); font-weight: 600; }
.m-subs a:hover { color: var(--blue); }
.m-logout button { display: block; width: 100%; height: 60px; border: 0; background: none; cursor: pointer; font-size: 16px; font-weight: 500; color: #111; }
.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-top { height: 101px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); }
.adm-top h1 { font-size: 20px; font-weight: 700; color: #111; margin: 0; }
.adm-top .who { color: var(--gray); font-size: 13px; text-decoration: none; }
.adm-top a.who:hover { color: var(--blue); text-decoration: underline; }
.adm-body { padding: 29px 20px 60px; }

/* ---------- 내용 상자 ---------- */
.card { background: #fff; border: 1px solid var(--card-line); border-radius: 4px; margin-bottom: 20px; }
.card-h { height: 71px; padding: 0 29px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; color: var(--title); }
.card-h .sub { font-size: 14px; font-weight: 400; color: var(--gray); }
.card-h .r { margin-left: auto; display: flex; gap: 6px; }
.card.only-h .card-h { border-bottom: 0; }
.card-h.wide { padding-right: max(29px, calc((100% - 1331px) / 2)); }
.card-b { padding: 29px max(30px, calc((100% - 1331px) / 2)) 56px; }
.card-b.form { padding: 29px 29px 16px; }
.flash { background: #eaf3fd; border: 1px solid #bcd7f6; color: #1b5fae; padding: 12px 18px; border-radius: 4px; margin-bottom: 16px; }
.err { background: #fff0f0; border: 1px solid #f2c0c0; color: var(--red); padding: 12px 18px; border-radius: 4px; margin-bottom: 16px; }
.hint { color: var(--gray); font-size: 13px; }
.hint-red { color: var(--red); font-size: 14px; font-weight: 600; }

/* ---------- 버튼 (34 / 44) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-width: 61px; padding: 0 16px; border: 1px solid var(--blue); background: var(--blue); color: #fff; border-radius: 0; cursor: pointer;
  font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { background: #1b6bc6; }
.btn.ico { min-width: 119px; }
.btn .i { width: 20px; height: 20px; flex: none; }
.btn.line { background: #fff; color: var(--blue); }
.btn.line:hover { background: #f2f8ff; }
.btn.gray { background: var(--gray-btn); border-color: var(--gray-btn); color: #fff; }
.btn.red { background: #fff; border-color: var(--red); color: var(--red); }
.btn.sm { height: 28px; min-width: 0; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; min-width: 118px; font-size: 14px; font-weight: 600; }
.btn.lg.short { min-width: 78px; }
.btn-row { display: flex; justify-content: center; gap: 10px; margin: 30px 0 10px; }
.btn-row form { display: contents; }

/* ---------- 목록 위 도구줄 ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .l, .toolbar .r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inp, .sel { height: 34px; border: 1px solid var(--line); border-radius: 0; padding: 0 14px; background: #fff; font-size: 14px; color: #111; }
.inp::placeholder { color: var(--muted); }
.inp.search { width: 250px; }
.inp.wide { width: 475px; max-width: 100%; }
.sel { padding-right: 34px; -webkit-appearance: none; appearance: none; font-weight: 500; color: var(--text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23222'/%3E%3C/svg%3E") right 12px center / 10px auto no-repeat; }
.sel.filter { width: 103px; }
.inp:focus, .sel:focus, textarea:focus { outline: none; border-color: var(--blue); }
textarea.inp { height: auto; padding: 10px 14px; width: 100%; resize: vertical; }
.toolbar + .hint { margin: -6px 0 16px; }

/* ---------- 표: 머리 55 / 줄 68 ---------- */
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
table.list th, table.list td { border: 1px solid var(--line); text-align: center; }
table.list th { height: 55px; padding: 0 10px; background: var(--th); font-size: 16px; font-weight: 600; color: var(--text); }
table.list td { height: 68px; padding: 6px 10px; font-size: 14px; color: var(--text); }
table.list td.l { text-align: left; }
table.list th.chk-col, table.list td.chk-col { width: 50px; }
.select-all-bar { margin: 0 0 12px; padding: 10px 16px; background: #eef5fd; border: 1px solid #cfe1f6; color: var(--text); font-size: 14px; text-align: center; }
.select-all-bar[hidden] { display: none; }
.link-btn { border: 0; background: none; color: var(--blue); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0 4px; }
table.list th.no-col { width: 50px; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: #f7fbff; }
table.list .empty { color: var(--gray); height: 120px; }
.chk { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 0; border: 1px solid var(--line); background: #fff; vertical-align: middle; cursor: pointer; display: inline-grid; place-content: center; }
.chk:checked { background: var(--blue); border-color: var(--blue-line); }
.chk:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.chk:disabled { background: #f1f1f1; cursor: default; }
.dot { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.dot::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: currentColor; flex: none; }
.dot.on { color: var(--blue); }
.dot.off { color: var(--gray); }
table.list td.pct, table.summary td.pct, .pct { color: var(--blue); font-weight: 600; }
.sort-btn { width: 53px; height: 34px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: inline-grid; place-content: center; }
.sort-btn::before { content: ""; border: 5px solid transparent; }
.sort-btn.down::before { border-top: 7px solid #363644; border-bottom: 0; }
.sort-btn.up::before { border-bottom: 7px solid #363644; border-top: 0; }
.sort-btn:hover { border-color: var(--blue); }
.under-table { display: flex; justify-content: flex-end; gap: 6px; margin-top: 16px; }
.under-table .btn { min-width: 78px; }

/* ---------- 쪽번호 30x30 ---------- */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 60px; }
.pager a { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--blue); color: var(--blue); background: #fff; font-size: 16px; font-weight: 500; }
.pager a.on { background: var(--blue); color: #fff; }
.pager a.pg-arrow { font-size: 0; }
.pager a.pg-arrow::before { content: ""; width: 6px; height: 6px; border-left: 1.5px solid var(--blue); border-bottom: 1.5px solid var(--blue); transform: translateX(1px) rotate(45deg); }
.pager a.pg-arrow.next::before { transform: translateX(-1px) rotate(-135deg); }
.pager .pg-gap { width: 30px; }

/* ---------- 입력 양식 (라벨 126 / 두 번째 칸 684) ---------- */
.fgrid { display: grid; grid-template-columns: 126px 558px 126px 1fr; column-gap: 0; row-gap: 20px; align-items: center; }
.fgrid.view { row-gap: 18px; }
.fgrid label.k, .fgrid .k { color: var(--blue); font-size: 14px; font-weight: 600; }
.fgrid .v { font-size: 16px; font-weight: 500; letter-spacing: .03em; color: var(--text); }
.fgrid .full { grid-column: 2 / 5; }
.fgrid .inp { width: 475px; max-width: 100%; }
.checks { display: flex; gap: 24px; align-items: center; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; letter-spacing: .03em; cursor: pointer; }
.note-red { color: var(--red); font-size: 14px; font-weight: 600; }

/* ---------- 팝업 (폭 367) ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-bg.on { display: flex; }
.modal { background: #fff; width: 367px; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.modal-h { height: 61px; display: flex; justify-content: space-between; align-items: center; padding: 0 20px 0 30px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 700; color: #111; }
.modal-h button { width: 30px; height: 30px; border: 0; background: none; cursor: pointer; position: relative; font-size: 0; }
.modal-h button::before, .modal-h button::after { content: ""; position: absolute; left: 4px; top: 14px; width: 23px; height: 1px; background: #000; transform: rotate(45deg); }
.modal-h button::after { transform: rotate(-45deg); }
.modal-b { padding: 24px 20px 10px; }
.modal-b .row { margin-bottom: 20px; }
.modal-b .row > label, .modal-b .row > .lb { display: block; font-size: 14px; font-weight: 500; color: #111; margin-bottom: 8px; }
.modal-b .inp, .modal-b .sel { width: 100%; border-color: var(--card-line); font-size: 13px; font-weight: 500; }
.modal-b .inp::placeholder { color: var(--gray); }
.modal-b .checks { gap: 30px; }
.modal-b .file { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.modal-b .file input[type=file] { font-size: 14px; }
.modal-b .file input[type=file]::file-selector-button { height: 29px; padding: 0 12px; border: 1px solid var(--gray); background: #eee; font: inherit; font-weight: 500; cursor: pointer; margin-right: 8px; }
.modal-f { display: flex; justify-content: center; gap: 6px; padding: 26px 20px 14px; }
.modal-msg { text-align: center; padding: 46px 20px 10px; font-weight: 700; font-size: 18px; line-height: 1.5; }
.modal-msg b { color: var(--blue); }
.rd { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; display: inline-grid; place-content: center; cursor: pointer; }
.rd:checked::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }

/* ---------- 로그인 (563x447) ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { width: 563px; max-width: calc(100% - 32px); background: #fff; padding: 16px 29px 38px; border: 1px solid #eeeefa; border-radius: 10px; text-align: center; }
.login-box img { width: 94px; height: 90px; object-fit: contain; margin-bottom: 16px !important; }
.login-box p { color: var(--gray); font-size: 14px; font-weight: 500; margin: 0 0 22px; padding-top: 20px; border-top: 1px solid var(--card-line); }
.login-box hr { display: none; }
.login-box .inp { width: 100%; height: 62px; margin-bottom: 12px; border-color: var(--card-line); border-radius: 4px; padding: 0 24px; font-size: 18px; }
.login-box .inp::placeholder { color: var(--gray); }
.login-box .btn { width: 100%; height: 62px; margin-top: 14px; border-radius: 4px; font-size: 18px; font-weight: 500; }
.login-box .err { text-align: left; }

/* ---------- 현황 요약 (머리 55 / 줄 56) ---------- */
table.summary { width: 100%; border-collapse: collapse; margin-bottom: 80px; border: 1px solid var(--line); }
table.summary th, table.summary td { border: 1px solid var(--line); text-align: center; }
table.summary th { height: 55px; background: var(--th); font-size: 16px; font-weight: 600; }
table.summary td { height: 56px; font-size: 14px; }

/* ---------- 서식 종이 (1240 폭) ---------- */
.paper-wrap { padding: 30px 0 0; }
.paper { width: 1240px; max-width: 100%; margin: 0 auto; padding: 190px 122px 120px; border: 1px solid #111; background: #fff; color: var(--text); font-size: 14px; }
.paper.agency { padding: 105px 74px 110px; }
.paper .form-no { font-size: 14px; font-weight: 500; color: var(--text); letter-spacing: .097em; margin-bottom: 40px; }
.paper .form-no em { font-style: normal; color: var(--blue); }
.paper h2 { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .03em; margin: 0 0 30px; }
.paper .mark-note { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.paper table { width: 100%; border-collapse: collapse; border: 2px solid var(--gray); }
.paper th, .paper td { border: 1px solid var(--line); padding: 0 12px; }
.paper th { font-weight: 500; font-size: 16px; letter-spacing: .03em; }
.paper .c { text-align: center; }
.paper .head th, .paper .head td { height: 53px; font-size: 16px; font-weight: 500; letter-spacing: .03em; }
.paper .items { margin-top: 14px; }
.paper .items .hrow th { height: 63px; font-size: 16px; font-weight: 700; letter-spacing: .1em; border-bottom: 2px solid var(--gray); }
.paper .items td { height: 42px; font-size: 14px; letter-spacing: .1em; }
.paper .items th.cat { font-size: 16px; font-weight: 700; letter-spacing: .1em; line-height: 25px; width: 82px; }
.paper .items td.sub { text-align: center; font-size: 14px; font-weight: 500; letter-spacing: .1em; line-height: 18px; width: 129px; }
.paper .items td.ans { width: 337px; text-align: center; border-left: 1px solid var(--gray); }
.paper .items tr.cat-end td, .paper .items tr.cat-end th { border-bottom: 1px solid var(--gray); }
.paper .items .note-row th { font-size: 16px; font-weight: 700; letter-spacing: .1em; height: 84px; }
.paper .note-desc { font-size: 14px; letter-spacing: .1em; line-height: 18px; }
.paper .box { display: inline-block; width: 18px; height: 18px; border: 1px solid var(--line); background: #fff; vertical-align: -4px; margin-right: 6px; position: relative; }
.paper .box.on { background: var(--blue); border-color: var(--blue-line); }
.paper .box.on::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg); }
.paper .opts { white-space: nowrap; display: inline-flex; gap: 22px; align-items: center; }
.paper .opts label { cursor: pointer; display: inline-flex; align-items: center; }
.paper .opts input { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 0 6px 0 0; border: 1px solid var(--line); background: #fff; display: inline-grid; place-content: center; cursor: pointer; }
.paper .opts input:checked { background: var(--blue); border-color: var(--blue-line); }
.paper .opts input:checked::after { content: ""; width: 5px; height: 9px; border: 2px solid #fff; border-top: 0; border-left: 0; transform: translateY(-1px) rotate(45deg); }
.paper .size-note { text-align: right; font-size: 14px; font-weight: 500; letter-spacing: .1em; margin-top: 14px; }
.paper .inp, .paper .sel { height: 34px; font-size: 14px; }
.paper .sign-img { height: 36px; vertical-align: middle; }
/* 대행 점검표 */
.paper.agency h2 { margin-bottom: 42px; }
.paper.agency table th { background: #eee; }
.paper.agency .head th, .paper.agency .head td { height: 53px; }
.paper.agency .head th { width: 179px; }
.paper.agency .items { margin-top: 0; border-top: 0; }
.paper.agency .items .hrow th { height: 55px; font-weight: 500; letter-spacing: .03em; }
.paper.agency .items th.cat { width: 180px; font-weight: 500; letter-spacing: .03em; line-height: 20px; background: #fff; border-right: 1px solid var(--gray); }
.paper.agency .items td { height: 80px; font-size: 16px; letter-spacing: .03em; }
.paper.agency .items td.det { width: 353px; border-left: 1px solid var(--gray); font-size: 14px; }
.paper.agency .items tr.cat-end td, .paper.agency .items tr.cat-end th { border-bottom: 2px solid var(--gray); }
.paper.agency .opts { gap: 6px; margin-left: 14px; }
.paper .opts.paren label { gap: 0; }
.paper .opts.paren .box, .paper .opts.paren input { margin: 0 2px 0 2px; }
.paper textarea.inp { resize: none; }
.paper.agency .item-desc { padding-left: 16px; font-size: 14px; }
.paper .sign-tbl { width: 719px; margin: 32px 0 0 auto; }
.paper .sign-tbl th { width: 179px; background: #eee; font-size: 16px; font-weight: 500; }
.paper .sign-tbl td { height: 52px; font-size: 16px; font-weight: 500; letter-spacing: .03em; }
.paper-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; }
.paper-foot .brand { display: flex; gap: 14px; align-items: center; font-size: 24px; font-weight: 700; letter-spacing: .03em; }
.paper-foot .brand img { width: 52px; height: 50px; object-fit: contain; }
.paper-foot .addr { text-align: right; font-size: 22px; font-weight: 500; letter-spacing: .03em; line-height: 33px; }

/* 대금청구서 */
.paper.invoice { padding: 190px 146px 140px; font-size: 18px; }
.paper.invoice h2 { width: fit-content; margin: 0 auto 92px; font-size: 56px; letter-spacing: .65em; margin-right: auto; padding-left: .65em; border-bottom: 2px solid #111; line-height: 66px; padding-bottom: 6px; }
.paper.invoice table th { width: 179px; background: #eee; font-size: 18px; font-weight: 500; letter-spacing: .1em; text-align: center; }
.paper.invoice table td { height: 72px; font-size: 18px; font-weight: 500; letter-spacing: .03em; padding: 0 16px; }
.paper.invoice .amt { display: flex; align-items: center; }
.paper.invoice .amt .won { flex: 0 0 300px; }
.paper.invoice .amt .total { border-left: 1px solid var(--line); padding-left: 16px; height: 72px; display: flex; align-items: center; gap: 20px; flex: 1; }
.paper.invoice .amt .vat { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.paper.invoice .msg { text-align: center; margin: 132px 0 108px; font-size: 26px; font-weight: 500; }
.paper.invoice .when { text-align: center; font-size: 26px; font-weight: 500; margin-bottom: 92px; }
.paper.invoice .from { display: grid; grid-template-columns: 132px 1fr; margin-left: 130px; font-size: 26px; font-weight: 500; line-height: 53px; }
.paper.invoice .from .lb { width: 112px; text-align: justify; text-align-last: justify; white-space: nowrap; }
.paper.invoice .from .lb.head { text-align: left; text-align-last: left; }
.paper.invoice .from .vv { font-weight: 400; }
.paper.invoice .to { display: flex; justify-content: center; gap: 40px; margin-top: 230px; font-size: 30px; }
.paper.invoice .to span { border-bottom: 2px solid #111; padding: 0 0 4px; display: flex; gap: 40px; }
.paper.invoice .to b { font-weight: 600; }
.paper.invoice .stamp { height: 60px; vertical-align: middle; margin-left: 10px; }

@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff; }
  .adm-side, .adm-top, .no-print, .flash { display: none !important; }
  .adm-body { padding: 0; }
  .card, .paper-wrap { border: 0; padding: 0; margin: 0; }
  /* 서식 종이(1240) = A4 150dpi 크기 → 여백 없는 A4 한 장에 그대로 줄여 찍음, 길면 admin.js 가 더 줄임 */
  @page paper { size: A4; margin: 0; }
  .paper { page: paper; border: 0; width: 1240px; max-width: none; margin: 0 auto; zoom: var(--pz, .64); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .paper .opts input:not(:checked) + span { color: #999; }
  .paper.invoice .amt .vat { gap: 10px; white-space: nowrap; padding-right: 4px; }
  table.list th, table.list td { height: auto; padding: 6px; }
}
