/* REFAD 워크툴 — 홈(프로그램 선택) · 스탭 관리 탭(staff.js) · 스탭 지원 페이지(apply.html).
   styles.css 의 변수·.card·.btn·.form 을 그대로 쓰고 여기엔 추가 클래스만 둔다. 흑백 BI, 상태색은 --ok/--stop/--warn 만. */

/* ── 홈: 프로그램 선택 ── */
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.home-tile {
  display: flex; flex-direction: column; gap: 6px; text-align: left; min-height: 150px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; color: var(--text);
}
.home-tile:hover, .home-tile:focus-visible { border-color: var(--ink); outline: none; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
/* 상단 작은 제목 줄은 그 프로그램의 바탕색 알약을 달고 있다(타일 ↔ 화면 바탕색이 같음). styles.css --page-* */
.home-tile .t-kicker { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: .04em; background: var(--page-home); border: 1px solid var(--line); }
.home-tile[data-go="list"] .t-kicker { background: var(--page-qr); }
.home-tile[data-go="cue"] .t-kicker { background: var(--page-cue); }
.home-tile[data-go="staff"] .t-kicker { background: var(--page-staff); }
.home-tile .t-title { font-size: 18px; font-weight: 800; }
.home-tile .t-desc { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.home-tile .t-meta { margin-top: auto; font-size: 12.5px; color: var(--text-2); }
.home-tile .t-meta b { color: var(--text); }
.home-foot { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.home-foot button { background: none; border: 0; padding: 8px 0; min-height: 36px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
@media (max-width: 700px) { .home-grid { grid-template-columns: 1fr; } .home-tile { min-height: 0; } }

/* ── 스탭 탭 공통 ── */
.st-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.st-nav button { padding: 9px 14px; min-height: 40px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 13.5px; }
.st-nav button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.st-nav .st-nav-right { margin-left: auto; display: flex; gap: 6px; }
.st-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.st-head h2 { font-size: 18px; flex: 1 1 auto; min-width: 0; word-break: keep-all; }
.st-head .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.st-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; text-align: left; }
.st-kpi:hover { border-color: var(--ink); }
.st-kpi .k-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.st-kpi .k-val { font-size: 24px; font-weight: 800; margin-top: 2px; }
.st-kpi .k-sub { font-size: 12px; color: var(--text-2); }
.st-kpi.warn .k-val { color: var(--warn); }
.st-kpi.stop .k-val { color: var(--stop); }
.st-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.st-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.st-table td { padding: 10px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.st-table tr:last-child td { border-bottom: none; }
.st-table tr.clickable { cursor: pointer; }
.st-table tr.clickable:hover td { background: #fafafb; }
.st-table .num { text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.st-link { background: none; border: 0; padding: 7px 0; margin: -7px 0; min-height: 32px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; font-weight: 600; }
.st-sub { font-size: 12px; color: var(--muted); }
.st-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.st-filters input, .st-filters select { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; }
.st-filters input { flex: 1 1 200px; min-width: 0; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); color: var(--text-2); background: #fff; white-space: nowrap; }
.chip-white { background: #e7f4ec; color: var(--ok); border-color: #cfe9d8; }
.chip-black { background: #fdecea; color: var(--stop); border-color: #f5c6c1; }
.chip-warn { background: #fff8e1; color: var(--warn); border-color: #f3e2a0; }
.chip-ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-good { background: #eef4ff; color: #2b4f9e; border-color: #cfdcf5; }
.chip-bad { background: #fdecea; color: var(--stop); border-color: #f5c6c1; }
.chip-tag { cursor: pointer; }
.chip-tag.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.st-copy { display: flex; gap: 8px; align-items: flex-start; }
.st-copy pre { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-all; font-family: Pretendard, system-ui, sans-serif; font-size: 13px; line-height: 1.6; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 420px; overflow: auto; }
.st-linkbox { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.st-linkbox code { font-size: 13px; background: var(--bg); padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); }
/* 공고 폼: 지급일 칸 + "차주 금요일로" 버튼 */
.st-paydate { display: flex; gap: 6px; align-items: center; }
.st-paydate input { flex: 1 1 auto; min-width: 0; }
.st-paydate .btn { white-space: nowrap; }
/* 링크 생성하기 직후: 공고 코드·지원 링크·복사 박스(공고 화면 맨 위) */
.st-created { border: 2px solid var(--ink); }
.st-created-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.st-created-head h2 { font-size: 17px; flex: 1 1 auto; min-width: 0; }
.st-created-code { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.st-created-code b { font-size: 28px; font-weight: 800; letter-spacing: .12em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.st-created-link code { display: block; font-size: 15px; background: var(--bg); padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); word-break: break-all; margin-bottom: 10px; }
.st-created .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.st-bar { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--ink); }
.st-bar i.full { background: var(--ok); }
.role-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.role-sum .rs { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.role-sum .rs b { display: block; font-size: 14px; margin-bottom: 2px; }
.role-sum .rs .st-sub { display: block; margin-bottom: 6px; }

/* 지원자 카드 */
.ap-list { display: grid; gap: 10px; }
.ap { display: grid; grid-template-columns: 112px 1fr; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.ap.ap-black { border-color: #f5c6c1; background: #fffafa; }
.ap.ap-white { border-color: #cfe9d8; }
.ap-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start; }
.ap-photos img, .ap-photos .ph-empty { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); cursor: zoom-in; }
.ap-photos .ph-empty { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); cursor: default; }
.ap-photos img:only-child { grid-column: 1 / -1; aspect-ratio: 3/4; }
.ap-body { min-width: 0; }
.ap-name { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 15px; font-weight: 700; }
.ap-name .st-sub { font-weight: 500; }
.ap-info { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }
.ap-info b { color: var(--text); font-weight: 600; }
.ap-exp { font-size: 13px; margin-top: 6px; white-space: pre-wrap; word-break: keep-all; max-height: 4.8em; overflow: hidden; position: relative; }
.ap-exp.open { max-height: none; }
.ap-msg { font-size: 13px; color: var(--text-2); margin-top: 4px; font-style: italic; }
.ap-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.ap-acts .sp { flex: 1; }
.ap-panel { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.ap-panel .pf { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.ap-panel .pf > span:first-child { font-weight: 600; color: var(--text-2); }
.ap-panel .pf-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ap-panel input, .ap-panel select, .ap-panel textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; background: #fff; font-family: inherit; }
.ap-panel textarea { width: 100%; min-height: 56px; resize: vertical; }
.stars { display: inline-flex; gap: 0; }
/* 비어 있는 별은 흰 바탕에서 3:1 이상 보이게(#cfcfd4 는 1.55:1 로 안 보였다). 누르는 영역 32px, 휴대폰 40px */
.stars button { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: #8f8f98; width: 32px; height: 32px; padding: 0; }
.stars button.on { color: #e0a800; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; }
.seg-opt span { display: inline-block; padding: 9px 16px; font-size: 14px; cursor: pointer; border-right: 1px solid var(--line); min-width: 56px; text-align: center; }
.seg-opt:last-child span { border-right: 0; }
.seg-opt input:checked + span { background: var(--ink); color: #fff; }
.seg-sm .seg-opt span { padding: 6px 10px; font-size: 12.5px; min-width: 0; }
.suggest { font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: #fff8e1; border: 1px solid #f3e2a0; color: var(--warn); }
.suggest.black { background: #fdecea; border-color: #f5c6c1; color: var(--stop); }
.suggest.white { background: #e7f4ec; border-color: #cfe9d8; color: var(--ok); }
.hist-list { font-size: 12px; color: var(--muted); display: grid; gap: 2px; }

/* 공고 폼 */
.pf-roles { display: grid; gap: 10px; }
.pf-role { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafafb; display: grid; gap: 8px; }
.pf-role .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-role .row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pf-role-head { display: flex; align-items: center; gap: 8px; }
.pf-role-head b { flex: 1; font-size: 13.5px; }
.pf-role-head select.pf-preset { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12.5px; color: var(--text); max-width: 60%; }
.form .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.form .checks { display: flex; gap: 12px 16px; flex-wrap: wrap; }
.form textarea.short { min-height: 64px; }
@media (max-width: 640px) { .pf-role .row3, .pf-role .row4, .form .row3 { grid-template-columns: 1fr 1fr; } .ap { grid-template-columns: 88px 1fr; } }
/* 휴대폰·손가락 입력: 누르는 곳 44px (2026-10-30 검사에서 20~35px 짜리 버튼·입력칸 40여 종) */
@media (max-width: 560px), (pointer: coarse) {
  .st-nav button, .st-filters input, .st-filters select, .pf-role-head select.pf-preset { min-height: 44px; }
  .st-filters input, .st-filters select { font-size: 16px; }
  .chip-tag { padding: 9px 12px; font-size: 13px; min-height: 40px; display: inline-flex; align-items: center; }
  .ap-panel input, .ap-panel select, .ap-panel textarea { min-height: 44px; font-size: 16px; }
  .ap-panel .pf { grid-template-columns: 1fr; gap: 4px; }
  .stars button { width: 40px; height: 40px; font-size: 26px; }
  .st-link { min-height: 44px; display: inline-flex; align-items: center; margin: 0; padding: 0; }
  .seg-sm .seg-opt span { padding: 10px 12px; font-size: 14px; }
  .home-tile .t-kicker { font-size: 12px; }
  .consent-detail summary { min-height: 44px; display: flex; align-items: center; }
  .apply-foot a { display: inline-block; padding: 12px 6px; }
}
/* 좁은 폭의 표: 제목 칸이 한 글자씩 접히던 문제 → 표를 가로로 밀어 보게 하고 칸 안에서는 접지 않는다 */
@media (max-width: 560px) {
  .st-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .st-table td, .st-table th { white-space: nowrap; }
  .st-table td:first-child { max-width: 60vw; white-space: normal; min-width: 180px; }
}

/* 사람 상세 */
.pp-head { display: grid; grid-template-columns: 140px 1fr; gap: 16px; }
.pp-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start; }
.pp-photos img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.pp-photos img:first-child { grid-column: 1 / -1; }
.pp-info dl { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; font-size: 13.5px; }
.pp-info dt { color: var(--muted); font-weight: 600; } .pp-info dd { word-break: break-all; }
.memo { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.memo:last-child { border-bottom: none; }
.memo .st-sub { display: block; }
.memo.system { color: var(--text-2); }
@media (max-width: 560px) { .pp-head { grid-template-columns: 100px 1fr; } }

/* 사진 확대 */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; z-index: 300; cursor: zoom-out; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }

/* ── 지원 페이지(공개) ── */
.apply-body { background: var(--page-home); padding-bottom: 40px; } /* 외부 지원자 화면은 프로그램 색 구분이 필요 없어 기본 밝은 바탕 */
.apply { max-width: 560px; margin: 0 auto; padding: 16px; }
.apply-head { display: flex; align-items: center; gap: 10px; padding: 10px 2px 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.apply-head img { height: 26px; width: auto; }
.apply-card { padding: 18px; }
.apply-title { font-size: 20px; font-weight: 800; line-height: 1.35; word-break: keep-all; margin-bottom: 8px; }
.apply-intro { font-size: 14px; color: var(--text-2); margin-bottom: 10px; white-space: pre-wrap; }
.apply-meta { display: grid; gap: 4px; font-size: 13.5px; margin-bottom: 12px; }
.apply-meta div { display: grid; grid-template-columns: 72px 1fr; gap: 8px; }
.apply-meta dt { color: var(--muted); font-weight: 600; }
.apply-roles { display: grid; gap: 8px; }
.role { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafafb; }
.role-full { opacity: .75; }
.role-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.role-hc { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.role-line { font-size: 13.5px; margin-top: 3px; word-break: keep-all; }
.role-pay { font-weight: 700; }
.role-dim { color: var(--text-2); font-size: 13px; }
.apply-req { margin-top: 12px; font-size: 13px; color: var(--stop); }
.apply-manager { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.apply-closed { font-size: 15px; line-height: 1.7; color: var(--text-2); }
.apply .form, #apForm { display: grid; gap: 8px; }
#apForm h2 { font-size: 17px; }
#apForm input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), #apForm select, #apForm textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 16px; font-family: inherit; color: var(--text); }
#apForm textarea { resize: vertical; line-height: 1.5; }
#apForm input:focus, #apForm select:focus, #apForm textarea:focus { outline: none; border-color: var(--ink); }
#apForm .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#apForm .field-label { margin-top: 6px; }
#apForm .field-label em { font-style: normal; font-size: 12px; color: var(--stop); margin-left: 4px; font-weight: 700; }
.apply-checks { display: flex; gap: 10px 18px; flex-wrap: wrap; padding: 4px 0; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-slot { position: relative; aspect-ratio: 3/4; border: 1.5px dashed var(--line); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.photo-slot.busy::after { content: '줄이는 중…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.8); font-size: 13px; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-add { font-size: 14px; color: var(--text-2); font-weight: 600; }
.photo-del { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.apply-consent { display: grid; gap: 8px; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafafb; }
.apply-consent .check { align-items: flex-start; font-size: 14px; color: var(--text); }
.apply-consent .check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.apply-consent .check em { font-style: normal; font-size: 12px; color: var(--stop); margin-left: 4px; font-weight: 700; }
.consent-detail { font-size: 12.5px; color: var(--text-2); }
.consent-detail summary { cursor: pointer; font-weight: 600; }
.consent-detail ul { margin: 6px 0 0 16px; display: grid; gap: 4px; line-height: 1.55; }
.apply-receipt { font-size: 15px; margin: 8px 0; }
.apply-receipt b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; background: var(--bg); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); }
.apply-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }
.apply-foot a { color: var(--muted); }
@media (max-width: 420px) { #apForm .row2 { grid-template-columns: 1fr; } }
