/* =============================================================================
   안전보건체계 — 화면 공통 부품 (2026-10-09)   js/hs-common.js · hs-files-ui.js · hs-router.js 와 한 쌍
   접두사 .hs-* (공통). 업무별 CSS 는 자기 접두사(ppe- · hsp- · hso- · osh- · stop-)를 쓴다. 인쇄 전용 보기와 A4 쪽은 css/hs-print.css.
   edu.css(.sft-*)에서 이름만 바꿔 일반화했다. 색은 앱 토큰(--mint 등: 화면 테마 css/theme-apple*.css 가 화면에서 다시 정의)을 그대로 쓰고,
   이 파일은 배치·상태 색만 정한다.
   ========================================================================== */
.hs-wrap { max-width: 1100px; margin: 0 auto; }
.hs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.hs-head h2 { margin: 0; font-size: 20px; }
.hs-load { color: var(--ink-2); text-align: center; padding: 28px 8px; }
.hs-small { font-size: 12.5px; }
.hs-muted { color: var(--ink-2); }
.hs-help { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 8px 0; }
.hs-help-top { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; }
.hs-warn-t { color: #b42318; }
.hs-link { background: none; border: 0; padding: 0 2px; color: var(--mint-ink); font-weight: 700; text-decoration: underline; cursor: pointer; font-size: inherit; }
.hs-btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.hs-btnrow .btn-block { width: 100%; }
.hs-acts { margin-top: 4px; }
.hs-h3 { font-size: 15px; margin: 18px 0 8px; }
.hs-sub { margin: 14px 0 6px; font-size: 14px; }
.hs-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hs-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hs-err { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hs-confirm-msg { margin: 0; line-height: 1.55; white-space: pre-wrap; }

/* ---- 탭 ---- */
.hs-tabsrow:empty { display: none; }
.hs-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
.hs-tabs a { flex: 0 0 auto; padding: 11px 14px; font-weight: 700; font-size: 14.5px; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.hs-tabs a.is-on { color: var(--mint-ink); border-bottom-color: var(--mint); }
.hs-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.hs-subtabs button { border: 1px solid var(--line-strong); background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.hs-subtabs button.is-on { background: var(--mint); border-color: var(--mint); color: #fff; }
.hs-subtabs button i { font-style: normal; opacity: .8; margin-left: 2px; }

/* ---- 카드 · 칩 · 숫자 ---- */
.hs-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }
.hs-card-h { font-weight: 800; font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hs-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.hs-st-draft { background: var(--surface-2); color: var(--ink-2); }
.hs-st-open { background: var(--mint-tint); color: var(--mint-ink); border-color: var(--mint); }
.hs-st-prog { background: #e8f3ff; color: #0b5cad; border-color: #7db4ee; }
.hs-st-done { background: #f1f1f4; color: #3a3a3c; }
.hs-st-final { background: #e6f6ec; color: #17653a; border-color: #86cda0; }
.hs-st-warn { background: #fff4d6; color: #7a5200; border-color: #e5c36a; }
.hs-st-cancel { background: #fdecea; color: #a1281d; border-color: #f0a8a1; }
.hs-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 4px; }
.hs-stats > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 6px; text-align: center; }
.hs-stats b { display: block; font-size: 24px; line-height: 1.1; }
.hs-stats span { font-size: 12.5px; color: var(--ink-2); }
.hs-stats .is-ok b { color: #17653a; }
.hs-stats .is-warn b { color: #b45309; }
.hs-meter { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.hs-meter i { display: block; height: 100%; background: var(--mint); border-radius: 999px; }
.hs-empty { text-align: center; color: var(--ink-2); padding: 22px 8px; font-size: 14px; }

/* ---- 눌러서 열리는 목록 카드 ---- */
.hs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.hs-item { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0 0 8px; cursor: pointer; font: inherit; color: inherit; }
.hs-list .hs-item { margin: 0; }
.hs-item:hover { border-color: var(--mint); }
.hs-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hs-item-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.hs-item-nums b { font-size: 16px; color: var(--ink); margin-right: 3px; }
.hs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.hs-row:last-child { border-bottom: 0; }

/* ---- 폼 · 모달 ---- */
.hs-form .field input, .hs-form .field select, .hs-form .field textarea,
.hs-modalwrap .field input, .hs-modalwrap .field select, .hs-modalwrap .field textarea { width: 100%; }
.hs-modalwrap .field input[type="checkbox"], .hs-modalwrap .field input[type="radio"] { width: auto; }
.hs-modal-wide { max-width: 720px; width: 100%; }
.hs-modalwrap-top { z-index: 95; }   /* 전체 화면(인쇄 보기 · 서명 화면) 위에서 여는 확인·사유 창이 가려지지 않게 */
.hs-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.hs-filters input, .hs-filters select, .hs-modalwrap input[type="search"] { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 10px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
.hs-filters input[type="search"] { flex: 1 1 180px; min-width: 0; }
.hs-filters select { flex: 0 1 200px; min-width: 0; }
.hs-sum { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }

/* ---- 표(div 격자): 열 비율은 --hs-cols 로 업무가 정한다. 좁은 화면에서는 칸마다 한 줄, data-label 이 있으면 앞에 이름을 붙인다 ---- */
.hs-tbl { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.hs-tr { display: grid; grid-template-columns: var(--hs-cols, repeat(auto-fit, minmax(90px, 1fr))); gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.hs-tr:last-child { border-bottom: 0; }
.hs-th { background: var(--surface-2); font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
.hs-td-name b { display: block; }
.hs-td-name i { font-style: normal; font-size: 12px; color: var(--ink-2); }
.hs-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 0; font-size: 13px; color: var(--ink-2); }
/* ---- 표(<table>): 가로로 넘치면 옆으로 밀어 본다 ---- */
.hs-tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.hs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hs-table th, .hs-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.hs-table thead th { background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.hs-table tr:last-child td { border-bottom: 0; }
.hs-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- 목록에서 하나 고르기(.hs-pick) ---- */
.hs-pick { list-style: none; margin: 8px 0; padding: 0; max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.hs-pick li { border-bottom: 1px solid var(--line); }
.hs-pick li:last-child { border-bottom: 0; }
.hs-pick button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: #fff; border: 0; padding: 10px 12px; cursor: pointer; font: inherit; }
.hs-pick button.is-on { background: var(--mint-tint); }
.hs-pick button span { font-size: 12.5px; color: var(--ink-2); }
.hs-pick-empty { padding: 12px; color: var(--ink-2); text-align: center; font-size: 13px; }

/* ---- 직원 한 명 고르기(staffField) ---- */
.hs-staff { margin: 0 0 12px; }
.hs-staff-l { display: block; font-size: 13px; font-weight: 700; margin: 0 0 6px; }
/* 2026-10-09: 검색 칸 기본 모양(R3UI-1) — .field 밖(STOP 직원별 이력 등)에서도 브라우저 기본 22px 칸이 되지 않게. 16px = iOS 확대 방지 */
.hs-staff .staff-combo-input, .hs-staff-pick .staff-combo-input { display: block; width: 100%; box-sizing: border-box; min-height: var(--field-h, 44px); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.4; -webkit-appearance: none; appearance: none; }
.hs-staff .staff-combo-input:focus, .hs-staff-pick .staff-combo-input:focus { outline: 2px solid var(--mint); outline-offset: 0; border-color: var(--mint); }
.hs-staff-pick[hidden], .hs-staff-sel[hidden] { display: none; }
.hs-staff-sel { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--mint); background: var(--mint-tint); border-radius: var(--radius); padding: 8px 10px 8px 12px; }
.hs-staff-who { display: flex; flex-direction: column; min-width: 0; }
.hs-staff-who b { font-size: 15px; }
.hs-staff-who i { font-style: normal; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 첨부 파일 상자(filesBox) ---- */
.hs-fb-h { font-weight: 800; font-size: 14px; margin: 0 0 8px; }
.hs-fb-err { margin-bottom: 8px; }
.hs-fb-empty { color: var(--ink-2); font-size: 13px; padding: 10px 2px; }
.hs-fb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.hs-fb-photo { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.hs-fb-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.hs-fb-photo figcaption { font-size: 11.5px; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-fb-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.hs-fb-list { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.hs-fb-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.hs-fb-list li:last-child { border-bottom: 0; }
.hs-fb-ico { flex: 0 0 auto; min-width: 42px; text-align: center; padding: 4px 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 800; }
.hs-fb-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.hs-fb-info b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-fb-info i { font-style: normal; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-fb-acts { flex: 0 0 auto; display: flex; gap: 6px; }
.hs-fb-acts .btn { text-decoration: none; }
.hs-fb-pends { margin-top: 0; }
.hs-fb-pend.is-err .hs-fb-info i { color: #b42318; white-space: normal; }
.hs-fb-prog { flex: 0 0 90px; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hs-fb-prog i { display: block; height: 100%; width: 0; background: var(--mint); transition: width .15s linear; }
.hs-fb-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hs-fb-add { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.hs-fb-add.is-off { opacity: .5; cursor: not-allowed; }
.hs-fb-add:focus-within { outline: 2px solid var(--mint); outline-offset: 2px; }
.hs-fb-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.hs-fb-in:disabled { cursor: not-allowed; }
.hs-fb-count { font-size: 12.5px; color: var(--ink-2); }

/* ---- 좁은 화면(휴대폰) ---- */
@media (max-width: 720px) {
  .hs-stats { grid-template-columns: repeat(2, 1fr); }
  .hs-row3 { grid-template-columns: 1fr 1fr; }
  .hs-tr { grid-template-columns: minmax(0, 1fr); row-gap: 3px; }
  .hs-th { display: none; }
  .hs-tr > [data-label]::before { content: attr(data-label) ' '; color: var(--ink-2); font-size: 12px; margin-right: 4px; }
  .hs-fb-list li { flex-wrap: wrap; }
  .hs-fb-acts { flex: 1 1 100%; justify-content: flex-end; }
}
@media (max-width: 430px) {
  .hs-tabs a { padding: 11px 9px; font-size: 13.5px; }
  .hs-row2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---- 휴대폰 터치 크기(R3UI-2): 새 업무(body.hs-mod)의 버튼·칩·인라인 링크를 40px 이상으로. 안전보건체계 밖 화면은 바뀌지 않는다 ---- */
@media (max-width: 768px) {
  body.hs-mod .btn-sm, body.hs-mod .hs-subtabs button, body.hs-mod .ppe-tg, body.hs-mod .hs-fb-add, body.hs-mod .hs-fb-dismiss { min-height: 40px; }
  body.hs-mod .hs-subtabs button { padding-top: 8px; padding-bottom: 8px; }
  body.hs-mod .hs-link { display: inline-flex; align-items: center; vertical-align: middle; min-height: 40px; padding: 0 4px; }
}
