/* =========================================================
   가공도면 작성 (file_draw.html 전용)
   ========================================================= */
/* 제목줄 · 카드 · 입력칸 · 버튼 등 공통 모양은 css/tool.css (볼나사의 선정과 같이 씀) */

.sheet-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 2px solid #0f172a; }
.sheet-tag { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: #fff; background: #0f172a; padding: 3px 8px; border-radius: 2px; }
.sheet-title { font-size: 15px; font-weight: 800; color: #0f172a; }
.sheet-date { margin-left: auto; font-size: 12px; color: #64748b; }

.app { max-width: 1400px; margin: 0 auto; display: flex; gap: 18px; padding: 18px 40px 60px; align-items: flex-start; }

.panel { width: 270px; flex-shrink: 0; }
.field { margin-bottom: 16px; }
.listbox { border: 1.5px solid #93c5fd; border-radius: 6px; overflow: hidden; background: #fff; }
.listbox div { padding: 9px 12px; font-size: 15px; font-weight: 600; color: #1e293b; cursor: pointer; border-bottom: 1px solid #e0ecff; }
.listbox div:last-child { border-bottom: none; }
.listbox div.active { background: var(--main-color); color: #fff; }
.listbox div.active { font-weight: 800; }
.listbox div:hover:not(.active) { background: #eff6ff; }
.listbox div.empty { color: #94a3b8; font-size: 13px; font-weight: 500; cursor: default; }
.listbox div.empty:hover { background: none; }

.btn-row { display: flex; gap: 8px; margin-top: 20px; }
.btn-quote { margin-top: 8px; }
.btn-quote:disabled { background: #64748b; border-color: #64748b; cursor: wait; }
/* 견적 문의용 PDF를 만들 때(화면 캡처) 인쇄와 같은 모양으로 */
.pdf-capture .dim-overlay input { border-color: transparent !important; background: transparent !important; }
.pdf-capture .dim-overlay input::placeholder, .pdf-capture .spec-row input::placeholder { color: transparent; }
.quote-hint { margin: 6px 0 0; text-align: center; }

.notice { margin-top: 16px; border-top: 1px dashed #e2e8f0; padding-top: 12px; }

.drawing-wrap { flex: 1; max-width: 1100px; padding: 24px; }

.dwg-stage { position: relative; width: 100%; }
.dwg-img { display: block; width: 100%; height: auto; user-select: none; }
.dim-overlay {
    position: absolute; transform: translate(-50%, -50%);
    width: 54px;
}
.dim-overlay input {
    width: 100%; border: 1px solid transparent; background: transparent;
    font-size: 15px; font-weight: 800; color: var(--main-color); text-align: center;
    border-radius: 3px; padding: 1px 2px; font-family: inherit;
}
.dim-overlay input:hover { border-color: #93c5fd; background: #f0f7ff; }
.dim-overlay input:focus { border-color: #2563eb; background: #fff; outline: none; }
.dim-overlay input:placeholder-shown { border: 1px dashed #93c5fd; background: #f0f7ff; }
.dim-overlay input::placeholder { color: #94a3b8; font-size: 12px; font-weight: 600; }

.disclaimer { margin-top: 14px; font-size: 12.5px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 12px; text-align: center; font-weight: 600; }
.field-note { margin: 6px 0 0; font-size: 12.5px; color: #64748b; }

.spec-groups { margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.spec-group { border: 1px solid #cbd5e1; border-radius: 6px; overflow: hidden; background: #fff; }
.spec-group h4 { margin: 0; padding: 5px 10px; font-size: 12px; font-weight: 800; color: #fff; background: var(--main-color); letter-spacing: 0.5px; }
.spec-row { display: flex; align-items: center; border-top: 1px solid #f1f5f9; }
.spec-row:first-of-type { border-top: none; }
.spec-row label { flex: 0 0 112px; white-space: nowrap; padding: 4px 8px; font-size: 12px; font-weight: 700; color: #475569; background: #f8fafc; align-self: stretch; display: flex; align-items: center; }
.spec-row input {
    flex: 1; min-width: 0; margin: 3px 6px; border: 1px solid #e2e8f0; border-radius: 3px; padding: 3px 6px;
    font-size: 13px; font-weight: 700; color: var(--main-color); text-align: center; font-family: inherit;
}
.spec-row input:focus { border-color: #2563eb; outline: none; background: #f0f7ff; }

/* 주문 정보: 규격 · 수량 · 전체길이를 한 줄로 */
.order-row { margin-top: 16px; display: flex; align-items: stretch; border: 1.5px solid var(--main-color); background: #eaf3ff; }
.order-row .spec-row { flex: 1; border-top: none; border-left: 1px solid #c7dcf5; }
.order-row .spec-row:first-child { border-left: none; }
.order-row .spec-row label { flex-basis: 80px; background: #dbeafe; color: #1e3a8a; font-size: 13px; }
.order-row .spec-row input { margin: 5px 8px; padding: 5px 6px; border-color: #93c5fd; background: #fff; font-size: 14px; }

@media (max-width: 900px) {
    .app { flex-direction: column; align-items: stretch; padding: 14px 16px 40px; }
    .panel { width: auto; }
    .drawing-wrap { padding: 14px; overflow-x: auto; min-width: 0; max-width: 100%; }
    .dwg-stage { min-width: 760px; }
    .spec-groups { grid-template-columns: repeat(2, 1fr); }
    .order-row { flex-wrap: wrap; }
    .order-row .spec-row { flex: 1 1 100%; border-left: none; border-top: 1px solid #c7dcf5; }
}
@media (max-width: 480px) {
    .spec-groups { grid-template-columns: 1fr; }
}

@page { size: A4 landscape; margin: 8mm; }

@media print {
    body { background: #fff; }
    #header, #footer, .tool-title-bar, .panel, .btn-row { display: none !important; }
    html, body { width: auto; min-width: 0; }
    .app { display: block; padding: 0; margin: 0; max-width: none; }
    .drawing-wrap { max-width: none; width: auto; overflow: visible; }
    .dwg-stage { min-width: 0; width: 85%; margin: 0 auto; }  /* A4 가로 한 장에 맞춤 */
    .order-row { margin-top: 6px; }
    .disclaimer { margin-top: 8px; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .drawing-wrap { box-shadow: none; padding: 0; }
    .spec-groups { grid-template-columns: repeat(4, 1fr); }
    .order-row { flex-wrap: nowrap; }
    .order-row .spec-row { flex: 1; border-top: none; border-left: 1px solid #c7dcf5; }
    .dim-overlay input { border-color: transparent !important; background: transparent !important; }
    .dim-overlay input::placeholder, .spec-row input::placeholder { color: transparent; }
}
