* { box-sizing: border-box; margin: 0; }
body { font-family: 'Malgun Gothic', 'Segoe UI', sans-serif; background: #f4f5f7; color: #24292f; font-size: 14px; }
.layout { display: flex; min-height: 100vh; }

.sidebar { width: 190px; background: #1f2937; color: #e5e7eb; padding: 16px 0; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { font-size: 13px; font-weight: bold; padding: 0 18px 16px; color: #9ca3af; border-bottom: 1px solid #374151; margin-bottom: 10px; }
.sidebar a { display: block; padding: 11px 18px; color: #d1d5db; text-decoration: none; font-size: 14px; }
.sidebar a:hover { background: #374151; }
.sidebar a.active { background: #2563eb; color: #fff; }

main { flex: 1; padding: 24px; max-width: 1100px; }
h1 { font-size: 20px; margin-bottom: 16px; }
h2 { font-size: 16px; margin: 18px 0 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
.card .label { font-size: 12px; color: #6b7280; }
.card .value { font-size: 24px; font-weight: bold; margin-top: 4px; }
.card.warn { background: #fef3c7; border-color: #fcd34d; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
th { background: #f9fafb; color: #6b7280; font-size: 12px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f5f8ff; }

.chip { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 9px; }
.chip.pri { background: #dbeafe; color: #1d4ed8; }
.chip.gov { background: #ede9fe; color: #6d28d9; }
.chip.done { background: #d1fae5; color: #047857; }
.chip.doing { background: #dbeafe; color: #1d4ed8; }
.chip.todo { background: #f3f4f6; color: #6b7280; }
.chip.hold { background: #fee2e2; color: #b91c1c; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; }
.form-grid h2 { grid-column: 1 / -1; margin: 6px 0 0; font-size: 14px; color: #2563eb; border-bottom: 1px solid #eee; padding-bottom: 6px; }
.field label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit; }

button { padding: 8px 16px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; font-family: inherit; }
button:hover { background: #f3f4f6; }
button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
button.primary:hover { background: #1d4ed8; }
button.sm { padding: 4px 10px; font-size: 12px; }

.detail-grid { display: flex; gap: 16px; align-items: flex-start; }
.pipeline { width: 210px; flex-shrink: 0; }
.stage { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; margin-bottom: 6px; cursor: pointer; border: 1px solid transparent; background: #fff; border-color: #e5e7eb; }
.stage.sel { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
.stage .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.stage .dot.done { background: #10b981; }
.stage .dot.doing { background: #2563eb; }
.stage .dot.todo { background: #d1d5db; }
.stage .nm { flex: 1; font-size: 13px; }
.stage .cnt { font-size: 11px; color: #9ca3af; }

.panel { flex: 1; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px; min-width: 0; }
.check-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 4px; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.check-item input { margin-top: 3px; }
.check-item.done span { color: #9ca3af; text-decoration: line-through; }

.info-bar { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.info-bar b { font-size: 16px; }
.muted { color: #6b7280; font-size: 12px; }

.review-box { border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; margin-top: 12px; background: #fafafa; }
.review-box table { border: none; }
.review-box td { padding: 5px 8px; }

.fee-row { display: flex; gap: 8px; align-items: center; margin: 4px 0; }

.note-item { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; margin: 6px 0; }
.note-item input { margin: 0; flex-shrink: 0; }
.note-date { font-size: 11px; color: #6b7280; background: #f3f4f6; padding: 2px 8px; border-radius: 6px; flex-shrink: 0; }
.note-text { flex: 1; font-size: 14px; }
.note-item.done .note-text { color: #9ca3af; text-decoration: line-through; }
.note-del { border: none; background: none; color: #9ca3af; cursor: pointer; font-size: 15px; padding: 2px 6px; flex-shrink: 0; }
.note-del:hover { color: #dc2626; }

.owner-strip { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 16px; margin-bottom: 14px; display: flex; gap: 26px; flex-wrap: wrap; font-size: 13px; align-items: center; }
.owner-strip a { color: #2563eb; text-decoration: none; }

.rv-verdict { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.rv-verdict .big { font-size: 22px; font-weight: bold; padding: 10px 22px; border-radius: 10px; background: #dbeafe; color: #1d4ed8; white-space: nowrap; }
.rv-verdict .big.permit { background: #ede9fe; color: #6d28d9; }
.rv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0 4px; }
.rv-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; }
.rv-card .t { font-size: 11px; color: #6b7280; }
.rv-card .v { font-size: 18px; font-weight: bold; margin: 3px 0 2px; }
.rv-card .s { font-size: 11px; color: #6b7280; line-height: 1.5; }
.rv-h { font-size: 14px; margin: 16px 0 6px; }
.rv-duties { list-style: none; padding: 0; margin: 4px 0; }
.rv-duties li { padding: 8px 12px; background: #fef3c7; border-radius: 7px; margin: 5px 0; font-size: 13px; color: #78350f; }
.rv-sub { border: none; }
.rv-sub td { padding: 6px 8px; font-size: 13px; border-bottom: 1px solid #f0f0f0; }

.doc-sheet { background: #fff; max-width: 210mm; margin: 0 auto; padding: 18mm 16mm; border: 1px solid #e5e7eb; border-radius: 4px; font-size: 14px; line-height: 1.9; color: #000; font-family: 'Malgun Gothic', sans-serif; }
.doc-sheet h1 { text-align: center; font-size: 26px; letter-spacing: 10px; margin: 0 0 26px; }
.doc-sheet h3 { font-size: 15px; margin: 18px 0 6px; }
.doc-tbl { width: 100%; border-collapse: collapse; margin: 6px 0; }
.doc-tbl th, .doc-tbl td { border: 1px solid #444; padding: 7px 9px; font-size: 13px; background: #fff; }
.doc-tbl th { background: #f3f4f6; font-weight: normal; width: 110px; text-align: center; }
.ed { min-width: 50px; display: inline-block; border-bottom: 1px dashed #60a5fa; padding: 0 4px; }
.ed:focus { outline: 1.5px solid #2563eb; background: #eff6ff; }
.doc-sign { text-align: right; margin: 14px 30px 4px 0; font-size: 15px; }
.doc-date { text-align: center; margin: 16px 0; }

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ed { border-bottom: none; background: none; }
  .owner-strip { display: none; }
  .doc-sheet { border: none; border-radius: 0; padding: 0; max-width: none; }
  .sidebar, .no-print, button { display: none !important; }
  main { padding: 0; max-width: none; }
  .review-box { border: none; background: #fff; }
  body { background: #fff; }
}
