/* 개체관리카드 인쇄 — 바탕 화면\양평\개체관리카드.html 의 양식에서 옮겨 왔다
   (앱 화면과 이름이 겹치지 않게 sheet→a4, card→pcard, back→cback, grid→cgrid, dots→cdots, days→cdays, foot→cfoot, nophoto→cnophoto) */

.printbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 12px 0; }
.printbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.printbar select, .printbar input { font: inherit; font-size: 14px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
.printbar input[type=number] { width: 84px; }
.pscope { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; background: var(--room-bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px; }
.pscope .names { color: var(--muted); font-size: 13px; }
.pnote { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0 0 14px; }
#print-host { overflow-x: auto; }

/* 직접 고르기 */
.picker { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.pk-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.pk-head .sub { white-space: normal; font-size: 12px; }
.pk-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; }
.pk-room { border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.pk-room.some { border-color: var(--accent); }
.pk-rname { display: flex; gap: 6px; align-items: center; cursor: pointer; margin-bottom: 4px; }
.pk-rname input { width: 20px; height: 20px; accent-color: var(--accent); }
.pk-rname .sub { margin-left: auto; font-size: 12px; }

/* A4 시트 */
.a4 { width: 210mm; min-height: 297mm; background: #fff; color: #1d2320; margin: 0 auto 16px; padding: 8mm;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .14); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4mm;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
.a4.roomsheet { display: block; }

/* 기존 양식 (한글 문서 재현) */
.pcard { display: flex; border: .4mm solid #000; background: #fff; overflow: hidden; break-inside: avoid; page-break-inside: avoid; }
.pcard .photowrap { flex: 0 0 42%; position: relative; display: flex; align-self: stretch; }
.pcard .cphoto { width: 100%; background: #e9ece7; object-fit: cover; display: block; align-self: stretch; }
.pcard .cphoto.ph { display: flex; align-items: center; justify-content: center; color: #9aa49e; font-size: 9pt; }
.pcard .qrbox { position: absolute; left: 1px; bottom: 1px; background: #fff; padding: 1px; border-radius: 1px; line-height: 0; }
.pcard .qr { display: block; }
.pcard table { flex: 1 1 auto; width: auto; border-collapse: collapse; table-layout: fixed; }
.pcard td { border: .3mm solid #000; text-align: center; padding: 1px 2px; font-weight: 700; line-height: 1.15; word-break: break-all; vertical-align: middle; }
.pcard td.lbl { background: #eef3ea; }
.pcard td.dis { color: #c00000; }
.pcard .socbox { display: inline-block; padding: 1px 8px; border-radius: 2px; color: #fff; font-weight: 700; }
.pcard .socbox.높음 { background: #1e7a3c; } .pcard .socbox.중간 { background: #e8b317; color: #3a2d00; }
.pcard .socbox.낮음 { background: #cf3030; } .pcard .socbox.관찰 { background: #d9ddd8; color: #333; }
.fail { color: #c22a2a !important; background: #fdeaea; }
.cutwrap { position: relative; padding: 1.5mm; box-sizing: border-box; }
.cutwrap::after { content: ""; position: absolute; inset: 0; border: .2mm dashed #b9c0b6; pointer-events: none; }

/* 새 앞면 */
.c2 { background: #fff; border: .35mm solid #2a322c; display: flex; flex-direction: column; overflow: hidden; break-inside: avoid; page-break-inside: avoid; color: #1d2320; }
.c2 .band { height: 3.2em; display: flex; align-items: center; gap: .9em; padding: 0 1em; color: #fff; flex: 0 0 auto; }
.c2 .band.높음 { background: #1e7a3c; } .c2 .band.중간 { background: #d99a00; color: #2a1f00; }
.c2 .band.낮음 { background: #c22a2a; } .c2 .band.관찰 { background: #5a6660; }
.c2 .band .lvl { font-size: 1.38em; font-weight: 900; letter-spacing: .05em; white-space: nowrap; }
.c2 .band .how { font-size: 1.04em; font-weight: 700; line-height: 1.2; min-width: 0; }
.c2 .band .cdots { margin-left: auto; display: flex; gap: .35em; flex: 0 0 auto; }
.c2 .band .cdots i { width: .9em; height: .9em; border-radius: 50%; background: #fff; opacity: .35; }
.c2 .band .cdots i.on { opacity: 1; }
.c2 .b2 { flex: 1 1 auto; display: flex; min-height: 0; }
.c2 .ph { flex: 0 0 40%; position: relative; background: #e9ece7; display: flex; }
.c2 .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c2 .ph .cnophoto { width: 100%; display: flex; align-items: center; justify-content: center; color: #9aa49e; font-size: 1em; }
.c2 .qrbox { position: absolute; left: .55em; bottom: .55em; background: #fff; padding: .25em; line-height: 0; box-shadow: 0 0 0 .05em rgba(0, 0, 0, .22); }
.c2 .info { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; padding: .85em 1.05em 0; }
.c2 .nm { display: flex; align-items: baseline; gap: .7em; border-bottom: .3mm solid #2a322c; padding-bottom: .5em; }
.c2 .nm .n { font-size: 1.9em; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.c2 .nm .no { font-size: 1.04em; font-weight: 700; color: #5a6660; margin-left: auto; white-space: nowrap; }
.c2 .cgrid { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 0 .7em; margin-top: .6em; font-size: 1.07em; line-height: 1.75; }
.c2 .cgrid .k { color: #6b7670; white-space: nowrap; }
.c2 .cgrid .v { font-weight: 800; }
.c2 .rfid { margin-top: .4em; font-size: .92em; color: #8a938c; font-variant-numeric: tabular-nums; }
.c2 .hnd { margin-top: .6em; font-size: .97em; line-height: 1.5; }
.c2 .hnd h5 { margin: 0 0 .2em; font-size: .88em; letter-spacing: .06em; color: #6b7670; font-weight: 800; }
.c2 .hnd ul { margin: 0; padding-left: 1.1em; }
.c2 .hnd li { margin-bottom: .12em; font-weight: 600; }
.c2 .alert { margin-top: auto; margin-bottom: .5em; background: #fdeaea; border-left: .45em solid #c22a2a; padding: .45em .7em; font-size: 1.04em; font-weight: 800; color: #8e1b1b; line-height: 1.35; }
.c2 .alert.ok { background: #eef3ea; border-left-color: #1e7a3c; color: #2a5a36; font-weight: 700; }
.c2 .care { flex: 0 0 auto; border-top: .3mm solid #2a322c; display: flex; height: 3.9em; }
.c2 .care .lab { flex: 0 0 auto; padding: 0 .8em; display: flex; flex-direction: column; justify-content: center; background: #f2f5f0; border-right: .3mm solid #c3ccc4; }
.c2 .care .lab b { font-size: .95em; white-space: nowrap; }
.c2 .care .lab span { font-size: .8em; color: #6b7670; white-space: nowrap; }
.c2 .care .cdays { flex: 1 1 auto; display: grid; grid-template-columns: repeat(7, 1fr); }
.c2 .care .d { border-right: .2mm dotted #b9c2ba; display: flex; flex-direction: column; }
.c2 .care .d:last-child { border-right: none; }
.c2 .care .d .dn { font-size: .78em; text-align: center; color: #8a938c; padding-top: .2em; }
.c2 .care .d .bx { flex: 1; display: flex; align-items: center; justify-content: center; gap: .3em; }
.c2 .care .d .bx u { width: .85em; height: .85em; border: .18mm solid #9aa49e; border-radius: .1em; display: block; }

/* 뒷면 */
.c2.cback { padding: 1.1em 1.4em .95em; }
.c2.cback h3 { margin: 0; font-size: 1.65em; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; color: #1d2320; }
.c2.cback .tag { font-size: 1.07em; color: #2f6b3f; font-weight: 700; margin: .2em 0 .7em; }
.c2 .two { display: grid; grid-template-columns: 1fr 1fr; gap: .9em; font-size: .97em; line-height: 1.45; }
.c2 .two h4 { margin: 0 0 .25em; font-size: .9em; letter-spacing: .03em; color: #6b7670; font-weight: 700; }
.c2 .two ul { margin: 0; padding-left: 1.2em; }
.c2 .two li { margin-bottom: .15em; }
.c2 .two .warn h4 { color: #a33; }
.c2 .obs { margin-top: .6em; background: #f2f5f0; padding: .45em .7em; font-size: .92em; line-height: 1.5; color: #3c453e; }
.c2 .obs b { color: #1d2320; }
.c2 .cfoot { margin-top: auto; display: flex; align-items: flex-end; gap: .9em; border-top: .3mm solid #c3ccc4; padding-top: .55em; }
.c2 .cfoot .t { font-size: .9em; line-height: 1.5; color: #4a544d; }
.c2 .cfoot .t b { font-size: 1.04em; color: #1d2320; }
.c2 .cfoot .q { margin-left: auto; text-align: center; line-height: 0; }
.c2 .cfoot .q span { display: block; font-size: .78em; color: #6b7670; margin-top: .2em; line-height: 1.2; }

/* 방 현황표 */
.rs-title { text-align: center; font-size: 17pt; font-weight: 700; letter-spacing: -.02em; background: #eef3ea; border: .4mm solid #7a9a7f; border-radius: 3mm; padding: 3mm; margin: 0; color: #1d2320; }
.rs-asof { text-align: right; font-size: 9pt; color: #444; margin: 2mm 0 3mm; }
.rs-legend { width: 100%; border-collapse: collapse; margin-bottom: 4mm; font-size: 9.5pt; color: #1d2320; }
.rs-legend td { border: .3mm solid #7a9a7f; padding: 1.4mm 3mm; }
.rs-legend td:first-child { width: 18mm; text-align: center; font-weight: 700; color: #fff; }
.rs-legend tr.높음 td:first-child { background: #1e7a3c; }
.rs-legend tr.중간 td:first-child { background: #e8b317; color: #3a2d00; }
.rs-legend tr.낮음 td:first-child { background: #cf3030; }
.rs-legend tr.관찰 td:first-child { background: #d9ddd8; color: #333; }
.rs-grid { display: flex; flex-wrap: wrap; gap: 3mm; }

/* 인쇄할 때는 카드만 */
@page { size: A4; margin: 8mm; }
@media print {
  body { background: #fff; }
  body > *:not(#print-view) { display: none !important; }
  #print-view > *:not(#print-host) { display: none !important; }
  #print-view { padding: 0; max-width: none; }
  #print-host { overflow: visible; }
  .a4 { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; page-break-after: always; }
  .a4:last-child { page-break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
