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

.sel-app { max-width: 1400px; margin: 0 auto; padding: 18px 40px 70px; display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 18px; align-items: start; }
.sel-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sel-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }


/* 입력 (엑셀처럼 라벨 | 값 | 단위) */
.sr-list { display: flex; flex-direction: column; gap: 8px; }
.sr { display: grid; grid-template-columns: 158px minmax(0, 1fr); align-items: center; gap: 10px; }
.sr label { font-size: 15px; font-weight: 700; color: #0f172a; }
.sr-name { cursor: pointer; user-select: none; }
.sr-name i { font-style: normal; font-size: 13px; color: #93c5fd; margin-left: 2px; transition: color 0.2s; }
.sr-name:hover i, .sr.open .sr-name i { color: var(--main-color); }
.sr.open .sr-name { color: var(--main-color); }
.sr-note { margin: -2px 0 4px; padding: 9px 12px; font-size: 13px; line-height: 1.6; color: #334155; background: #f1f5f9; border-left: 3px solid var(--main-color); border-radius: 0 6px 6px 0; }
.lf-input { display: flex; align-items: center; border: 1.5px solid #93c5fd; border-radius: 6px; overflow: hidden; background: #eff6ff; }
.lf-input:focus-within { border-color: var(--main-color); box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1); }
.lf-input input { flex: 1; min-width: 0; border: none; outline: none; padding: 9px 10px; font-size: 17px; font-weight: 800; color: var(--main-color); text-align: center; background: transparent; font-family: inherit; }
.lf-input span { flex: 0 0 70px; padding: 0 6px; font-size: 13px; font-weight: 700; color: #1e40af; background: #dbeafe; align-self: stretch; display: flex; align-items: center; justify-content: center; border-left: 1px solid #bfdbfe; }

.sr-need label { color: var(--main-color); }
.lf-input input::placeholder { color: #93c5fd; font-weight: 600; font-size: 14px; }
.empty-msg { padding: 22px 10px !important; text-align: center !important; color: #64748b !important; font-size: 14px; font-weight: 600; }
.empty-msg small { display: block; margin-top: 6px; font-size: 12.5px; color: #94a3b8; font-weight: 500; }


.motion { margin-top: 16px; padding-top: 14px; border-top: 1px dashed #e2e8f0; }
.motion h3 { font-size: 13.5px; font-weight: 800; color: #475569; margin: 0 0 8px; }
.mo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mo-grid div { background: #f0fdf4; border: 1px solid #dcfce7; border-radius: 5px; padding: 6px 9px; }
.mo-grid span { display: block; font-size: 11.5px; color: #64748b; }
.mo-grid b { font-size: 14px; color: #0f172a; }

/* 축방향 하중 */
.load-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.load-table th, .load-table td { border: 1px solid #e2e8f0; padding: 6px 6px; text-align: center; }
.load-table small { color: #64748b; font-weight: 600; }
.load-table th { background: #f1f5f9; font-weight: 800; color: #334155; }
.load-table td.f { font-weight: 800; color: #0f172a; }
.load-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.load-sum div { border-radius: 8px; padding: 12px 14px; background: linear-gradient(135deg, var(--main-color), #0284c7); color: #fff; }
.load-sum span { display: block; font-size: 12.5px; opacity: 0.85; }
.load-sum b { font-size: 21px; font-weight: 800; }

/* 선정 결과: 크고 확실하게 */
.sel-result { border-top: 4px solid var(--main-color); padding: 24px 26px 26px; }
.sel-result > h2 { font-size: 19px; }
.dt-name { font-size: 14px; color: #64748b; font-weight: 600; margin-left: 4px; }

.verdict { display: flex; align-items: center; gap: 18px; border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; color: #fff; }
.verdict:empty { display: none; }
.verdict.pass { background: linear-gradient(135deg, #15803d, #22c55e); }
.verdict.fail { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.vd-icon { flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.22); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; }
.vd-text b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.vd-text span { display: block; font-size: 15px; font-weight: 600; opacity: 0.95; margin-top: 3px; }
.vd-text { flex: 1; min-width: 0; }
.vd-dwg { flex-shrink: 0; background: #fff; color: #0f172a; font-size: 15px; font-weight: 800; padding: 12px 20px; border-radius: 8px; text-decoration: none; box-shadow: 0 4px 10px rgba(0,0,0,0.12); transition: transform 0.2s; }
.vd-dwg:hover { transform: translateY(-2px); color: var(--main-color); }
@media (max-width: 700px) { .verdict { flex-wrap: wrap; } .vd-dwg { width: 100%; text-align: center; } }

.dt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dt-grid:empty { display: none; }
.dt-box { border: 1px solid #e2e8f0; border-top: 5px solid #22c55e; border-radius: 10px; padding: 16px 18px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.dt-box h4 { margin: 0 0 10px; font-size: 16px; font-weight: 800; color: #0f172a; display: flex; justify-content: space-between; align-items: center; }
.dt-box h4 .ok, .dt-box h4 .ng-tag { font-size: 13px; padding: 3px 10px; }
.dt-box .cmp { display: flex; flex-direction: column; padding: 2px 0; }
.dt-box .cmp span { font-size: 13px; color: #64748b; font-weight: 600; }
.dt-box .cmp b { font-size: 28px; font-weight: 800; color: #0f172a; white-space: nowrap; letter-spacing: -0.5px; }
.dt-box .cmp.lim { flex-direction: row; justify-content: space-between; align-items: baseline; border-top: 1px dashed #cbd5e1; margin-top: 8px; padding-top: 8px; }
.dt-box .cmp.lim b { font-size: 17px; color: #475569; letter-spacing: 0; }
.dt-box .s { font-size: 12px; color: #94a3b8; margin-top: 8px; line-height: 1.5; }
.dt-box.ng { border-top-color: #ef4444; background: #fff5f5; }
.dt-box.ng .cmp:first-of-type b { color: #b91c1c; }

/* 판정 표시 */
.ok, .ng-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 800; }
.ok { background: #dcfce7; color: #15803d; }
.ng-tag { background: #fee2e2; color: #b91c1c; }

/* 규격별 결과 표 */
.res-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #e2e8f0; }
.res-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 17px; font-weight: 800; color: var(--main-color); margin: 0; padding: 0; border: none; }
.res-head h2 small { font-size: 12.5px; font-weight: 600; color: #64748b; }
.res-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.res-filter select { padding: 6px 8px; font-size: 13.5px; border: 1px solid #cbd5e1; border-radius: 5px; font-family: inherit; }
.res-filter .chk { font-size: 13px; font-weight: 700; color: #334155; display: flex; align-items: center; gap: 5px; cursor: pointer; }
/* 너트 선택: 작게 */
.res-scroll { max-height: 380px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 6px; }
.res-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.res-table th { position: sticky; top: 0; background: #f1f5f9; color: #334155; font-weight: 800; padding: 10px 8px; border-bottom: 2px solid var(--main-color); font-size: 14px; line-height: 1.25; z-index: 1; }
.res-table td { padding: 9px 8px; text-align: center; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.res-table td:first-child { font-weight: 800; color: #0f172a; text-align: left; padding-left: 12px; }
.res-table tbody tr { cursor: pointer; }
.res-table tbody tr:hover td { background: #f8fbff; }
.res-table tbody tr.sel td { background: #e0efff; }
.res-table td .ok, .res-table td .ng-tag { font-size: 13px; padding: 3px 10px; }
.res-table td .why { display: block; font-size: 11.5px; color: #b91c1c; margin-top: 2px; }
.res-table tr.nodata td { color: #94a3b8; }


@media (max-width: 1100px) {
    .sel-app { grid-template-columns: 1fr; }
    .dt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .sel-app { padding: 14px 16px 40px; }
    .sr { grid-template-columns: 120px minmax(0, 1fr); }
}
