/*
 * 웹·모바일 공용 컴포넌트 스타일
 * 웹 web/head.jsp, 모바일 m/include.jsp 가 CSS 목록 맨 끝에서 싣는다.
 * 두 화면 이상의 JSP \3c style> 에 똑같이 복사돼 있던 규칙을 모았다(git show 4d736e036:docs/CLEAN_CSS.md Phase 3).
 * 여기 있는 클래스·ID 는 이 파일을 쓰던 화면에만 있다. 이름이 겹치는 요소를 새로 만들면 이 규칙이 같이 걸린다.
 */

/* ===== 체크박스 공통(웹·모바일, 2026-10-26) =====
   브라우저 기본(13px·진한 테두리) 대신 16px 둥근 칸 + 얇은 회색 선(1px), 체크하면 파랑 바탕에 흰 체크.
   모든 <input type="checkbox"> 에 걸린다. :where() 로 명시도를 0 으로 둬서 화면이 여백·정렬만 바꿀 수 있다.
   체크박스를 숨기고 라벨·가짜 칸으로 그리던 꾸밈형(.checkbox · .checkbox_wrap · fake-input · #remember)과 인라인 크기는 2026-10-28 모두 지웠다 — 새로 만들지 않는다.
   점검 결과 체크박스(.chk-rslt-checkbox — 양호·해당없음·불량 색)는 아래 따로 둔다. 인쇄 화면(work-plan-form-print.jsp)만 인쇄용 모양을 따로 쓴다 */
:where(input[type="checkbox"]:not(.chk-rslt-checkbox)) {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0 4px 0 0;
    border: 1px solid var(--color-border-check);
    border-radius: 4px;
    background: var(--color-bg-white) center / 12px 12px no-repeat;
    vertical-align: -3px;
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}
:where(input[type="checkbox"]:not(.chk-rslt-checkbox)):hover:not(:disabled) { border-color: var(--color-bg-check-active); }
:where(input[type="checkbox"]:not(.chk-rslt-checkbox)):focus-visible { outline: 2px solid var(--color-border-field-label-active); outline-offset: 1px; }
:where(input[type="checkbox"]:not(.chk-rslt-checkbox)):checked {
    border-color: var(--color-bg-check-active);
    background-color: var(--color-bg-check-active);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
}
:where(input[type="checkbox"]:not(.chk-rslt-checkbox)):indeterminate {
    border-color: var(--color-bg-check-active);
    background-color: var(--color-bg-check-active);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Cline x1='4' y1='8' x2='12' y2='8'/%3E%3C/svg%3E");
}
:where(input[type="checkbox"]:not(.chk-rslt-checkbox)):disabled { cursor: default; background-color: var(--color-bg-check-disabled); }
:where(input[type="checkbox"]:not(.chk-rslt-checkbox)):checked:disabled { opacity: .5; background-color: var(--color-bg-check-active); }

/* ===== 근로자 사진 (web/worker/workerList.jsp, m/worker/workerInfo.jsp, m/worker/workerFormModal.jsp) ===== */
.worker-photo-avatar {
    position: relative;
    width: 150px;
    height: 150px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #f1f3f5;
    overflow: hidden;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.worker-photo-avatar img { width: 100%; height: 100%; object-fit: cover; }
.worker-photo-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
/* 사진이 없을 때 쓰는 기본 인물 이미지 — 웹·모바일 모든 목록·등록 화면이 같은 이미지(/img/common/user-default.svg)와 같은 모양 */
img.photo-default { object-fit: contain; padding: 14%; background: #f5f7fa; }
.worker-photo-upload-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    color: var(--color-text-inverse); text-align: center;
    font-size: 12px; padding: 5px 0;
    cursor: pointer; user-select: none;
}
.worker-photo-upload-bar:hover { background: rgba(0, 0, 0, 0.7); }

/* ===== 작업허가서 협력업체 서명 (web/permit/form.jsp, m/permit/form.jsp·worker-form.jsp) ===== */
.ptnr-sign-container {
    position: relative;
}

/* ===== 작업허가서 조치 첨부 썸네일 (web/permit/act-modal.jsp, m/permit/act-form.jsp) ===== */
#gridActAttach img {
    height: 30px;
    width: 55px;
}

/* ===== 점검 결과 체크박스 — 양호/해당없음/불량 (web/const-equip/check.jsp, m/const-equip/const-equip-check.jsp,
   m/main-manage/check-form.jsp, m/sub-manage/check-form.jsp, m/permit/act-item-modal.jsp) ===== */
.chk-rslt-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 20px !important;
    height: 20px !important;
    border: 1px solid var(--color-border-check); /* 공통 체크박스와 같은 얇은 선(예전 2px) */
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    margin: 0;
    transition: none;
}
.chk-rslt-checkbox:checked {
    border-color: transparent;
}
.chk-rslt-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-text-inverse);
    font-size: 14px;
    font-weight: bold;
}
.chk-rslt-checkbox.chk-good:checked { background-color: var(--color-status-good); }
.chk-rslt-checkbox.chk-na:checked { background-color: var(--color-status-na); }
.chk-rslt-checkbox.chk-bad:checked { background-color: var(--color-status-danger); }

/* ===== 메인 팝업 — 공지사항·중대재해속보 (WEB-INF/jsp/popup.jsp, 웹 대시보드·모바일 메인, 2026-10-28) =====
   흰 카드: 머리(제목 + 닫기) · 본문(사진, 글) · 바닥(한 달간 보지 않기 | 닫기). 뒤 화면은 어두운 막.
   PC 는 가운데 나란히(두 장 높이를 긴 쪽에 맞춘다), 좁은 화면(768px 이하)은 JS 가 한 장씩 보여 준다 */
.main-popup-backdrop { position: fixed; inset: 0; z-index: 1040; background-color: var(--color-bg-popup-backdrop); }
.main-popup-wrap {
    position: fixed; inset: 0; z-index: 1041;
    /* 한 줄 grid — 줄 높이는 가장 긴 카드, 카드는 그 높이로 늘어나 두 장 높이가 같다. 줄은 위쪽에 둔다(화면 높이로 늘이지 않는다) */
    display: grid; grid-auto-flow: column; grid-auto-columns: min(380px, 100%); align-items: stretch; align-content: start;
    justify-content: center; gap: 20px;
    padding: max(16px, 8vh) 16px 16px; pointer-events: none; /* 카드 밖은 막이 클릭을 받는다 */
}
.main-popup {
    pointer-events: auto;
    flex-direction: column; /* display 는 JS 가 flex 로 켠다 */
    width: 380px; max-width: 100%; max-height: calc(100vh - max(16px, 8vh) - 16px);
    overflow: hidden; border-radius: 12px;
    background-color: var(--color-bg-white); box-shadow: 0 12px 32px var(--color-shadow-popup);
}
.main-popup-head {
    display: flex; align-items: flex-start; gap: 8px; flex-shrink: 0;
    padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--color-border-light);
}
.main-popup-title {
    flex: 1; min-width: 0; margin: 0;
    font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--color-text-strong);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all;
}
.main-popup button { border: 0; background: none; padding: 0; cursor: pointer; }
.main-popup-close { flex-shrink: 0; --close-size: 20px; --close-line: 14px; } /* X 모양은 「모달 닫기 X」 */
.main-popup-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.main-popup-body > * { flex-shrink: 0; }
.main-popup-img {
    display: block; width: 100%; height: auto; max-height: min(537px, calc(100vh - 160px));
    object-fit: contain; background-color: var(--color-bg-subtle);
}
.main-popup-text {
    min-height: 160px; padding: 14px 16px;
    font-size: 12px; line-height: 1.6; color: var(--color-text-default); word-break: break-all;
}
/* 사진이 있으면 글은 세 줄만 — 나머지는 '자세히 보기' */
.main-popup-img + .main-popup-text {
    min-height: 0; padding: 10px 16px 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.main-popup .main-popup-more { display: block; margin: auto 16px 12px auto; padding-top: 6px; /* 늘어난 카드에서도 바닥 바로 위 */ font-size: 12px; font-weight: 500; color: var(--color-text-popup-link); }
.main-popup-more i { font-size: 10px; margin-left: 2px; }
.main-popup-foot {
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
    padding: 8px 16px; border-top: 1px solid var(--color-border-light); background-color: var(--color-bg-subtle);
}
.main-popup-hide { font-size: 12px; color: var(--color-text-subtle); }
.main-popup-done { font-size: 12px; font-weight: 500; color: var(--color-text-strong); }
.main-popup-hide:hover, .main-popup-done:hover { text-decoration: underline; }

/* ===== 모달 닫기 X (웹·모바일 모든 모달 머리 + 메인 팝업, 2026-10-28) =====
   Bootstrap .close 의 굵은 × 글자(24px·700, 글꼴마다 두께가 다르다) 대신 얇은 두 줄(1.5px)로 그린다.
   마크업은 그대로 <button type="button" class="close"><span aria-hidden="true">&times;</span></button>.
   버튼 크기·위치(누르는 범위)는 그대로 두고 × 글자만 숨긴다. 크기는 --close-size(칸)·--close-line(줄 길이)로 바꾼다 */
.modal .close, .main-popup-close { opacity: 1; text-shadow: none; color: var(--color-text-subtle); }
.modal .close:hover, .main-popup-close:hover { color: var(--color-text-strongest); }
.modal .close > span, .main-popup-close > span {
    position: relative; display: block;
    width: var(--close-size, 24px); height: var(--close-size, 24px); font-size: 0;
}
.modal .close > span::before, .modal .close > span::after,
.main-popup-close > span::before, .main-popup-close > span::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: var(--close-line, 18px); height: 1.5px; border-radius: 1px; background-color: currentColor;
}
.modal .close > span::before, .main-popup-close > span::before { transform: translate(-50%, -50%) rotate(45deg); }
.modal .close > span::after, .main-popup-close > span::after { transform: translate(-50%, -50%) rotate(-45deg); }
