/* ===== 기본 (checkin-pwa 동일 컨셉: 라이트 테마, 블루 액센트) ===== */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  height: 100%;
  font-family: 'Malgun Gothic', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: #f1f5f9; color: #0f172a;
}
button, input, select, textarea { font-family: inherit; font-size: 16px; }
button { border: none; cursor: pointer; }
.hidden { display: none !important; }
.req { color: #dc2626; font-weight: 700; }

/* ===== 로그인 화면 ===== */
#login-screen {
  min-height: 100dvh; background: #0f172a;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-wrap {
  background: white; border-radius: 20px; padding: 32px 28px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo { font-size: 40px; text-align: center; margin-bottom: 8px; }
.login-title { font-size: 20px; font-weight: 700; text-align: center; color: #0f172a; }
.login-sub { font-size: 13px; color: #64748b; text-align: center; margin-bottom: 24px; }
.login-fields { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 16px; color: #0f172a; background: #f8fafc; transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: #2563eb; background: white; }
.login-err { background: #fee2e2; color: #dc2626; border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.5; white-space: pre-line; }
.login-foot { font-size: 11px; color: #94a3b8; text-align: center; margin-top: 18px; line-height: 1.6; }
.btn-login {
  width: 100%; padding: 14px; background: #2563eb; color: white;
  font-size: 16px; font-weight: 700; border-radius: 12px; transition: background .15s; margin-top: 4px;
}
.btn-login:hover { background: #1d4ed8; }
.btn-login:active { background: #1e40af; }
.btn-login:disabled { background: #93c5fd; cursor: not-allowed; }

/* ===== 앱 골격 ===== */
#app { display: flex; flex-direction: column; height: 100dvh; }
.app-bar {
  position: sticky; top: 0; z-index: 10; background: #0f172a; color: white;
  padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15); flex-shrink: 0;
}
.app-bar-title { font-size: 16px; font-weight: 700; }
.app-bar-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.btn-icon { background: transparent; color: #94a3b8; font-size: 18px; padding: 6px 10px; border-radius: 6px; }
.btn-icon:hover { background: #1e293b; color: white; }
main#content {
  flex: 1; overflow-y: auto; padding: 16px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* ===== 하단 탭 바 ===== */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: white;
  border-top: 1px solid #e2e8f0; display: flex;
  padding-bottom: env(safe-area-inset-bottom); z-index: 10;
}
.tab {
  flex: 1; background: transparent; padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: #94a3b8; font-size: 11px;
}
.tab span:first-child { font-size: 22px; }
.tab.active { color: #2563eb; }

/* ===== 공통 ===== */
.section-title { font-size: 16px; font-weight: 800; color: #0f172a; margin: 2px 0 14px; }
.empty { text-align: center; color: #94a3b8; padding: 40px 0; font-size: 14px; }
.mine-sub { font-size: 13px; font-weight: 700; color: #475569; margin: 18px 0 8px; }

.btn-sm {
  padding: 8px 16px; background: #2563eb; color: white;
  font-size: 13px; font-weight: 700; border-radius: 8px; transition: background .15s;
}
.btn-sm:active { background: #1e40af; }
.btn-wide {
  width: 100%; padding: 14px; margin-top: 6px; margin-bottom: 10px;
  background: #2563eb; color: white; font-size: 15px; font-weight: 700; border-radius: 12px;
}
.btn-wide:active { background: #1e40af; }

/* ===== 공지 카드 ===== */
.notice-card {
  background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-left: 3px solid #e2e8f0;
}
.notice-card.pinned { border-left-color: #2563eb; background: #eff6ff; }
.notice-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.notice-head .pin { font-size: 13px; }
.notice-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.notice-body { font-size: 14px; color: #334155; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.notice-date { font-size: 11px; color: #94a3b8; margin-top: 8px; }

/* ===== 질문답변 ===== */
.qa-card {
  background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.qa-q { font-size: 14px; font-weight: 700; color: #0f172a; line-height: 1.5; }
.qa-help { font-size: 12px; color: #64748b; margin-top: 4px; line-height: 1.5; }
.qa-input {
  width: 100%; margin-top: 10px; padding: 11px 12px;
  border: 1.5px solid #e2e8f0; border-radius: 10px; background: #f8fafc;
  font-size: 15px; color: #0f172a; resize: vertical; min-height: 72px; line-height: 1.5;
  transition: border-color .15s, background .15s;
}
.qa-input:focus { outline: none; border-color: #2563eb; background: white; }
.qa-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.qa-saved { font-size: 12px; color: #16a34a; font-weight: 600; margin-right: auto; }

/* ===== 서류첨부 ===== */
.doc-card {
  background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-left: 3px solid #e2e8f0;
}
.doc-card.done { border-left-color: #16a34a; }
.doc-card.need { border-left-color: #f59e0b; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doc-name { font-size: 15px; font-weight: 700; color: #0f172a; }
.doc-status { font-size: 12px; font-weight: 700; color: #64748b; white-space: nowrap; }
.doc-card.done .doc-status { color: #16a34a; }
.doc-card.need .doc-status { color: #b45309; }
.doc-desc { font-size: 13px; color: #64748b; margin-top: 6px; line-height: 1.5; white-space: pre-wrap; }
.doc-files { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.doc-file {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px;
}
.doc-file a { font-size: 13px; color: #2563eb; text-decoration: none; word-break: break-all; flex: 1; }
.doc-del {
  background: #fee2e2; color: #dc2626; font-size: 13px; font-weight: 700;
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
}
.doc-del:active { background: #fecaca; }
.btn-upload {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; padding: 11px 16px; width: 100%;
  background: #eff6ff; color: #2563eb; border: 1.5px dashed #93c5fd; border-radius: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s;
}
.btn-upload:active { background: #dbeafe; }

/* ===== 내 제출현황 ===== */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.summary-box {
  display: flex; flex-direction: column; align-items: center;
  background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.summary-box span { font-size: 11px; color: #64748b; margin-bottom: 4px; }
.summary-box strong { font-size: 22px; font-weight: 800; color: #0f172a; }
.mine-row {
  background: white; border-radius: 10px; padding: 11px 14px; margin-bottom: 7px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.mine-q { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.mine-a { font-size: 13px; color: #334155; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.mine-a.ok { color: #166534; }
.mine-a.no { color: #b45309; font-weight: 600; }

/* ===== 섹션 헤더(제목 + 버튼) ===== */
.section-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 12px; }
.section-row .section-title { margin: 0; }
.qa-hint { font-size: 12px; color: #64748b; margin-bottom: 12px; line-height: 1.5; }

/* ===== 관리자 액션 버튼 (작게) ===== */
.admin-acts { display: flex; gap: 6px; }
.admin-acts button {
  background: #f1f5f9; color: #475569; border-radius: 6px;
  padding: 5px 10px; font-size: 12px; font-weight: 700;
}
.admin-acts button.del { background: #fee2e2; color: #dc2626; }
.tag-hidden { background: #e2e8f0; color: #64748b; font-size: 10px; padding: 2px 7px; border-radius: 6px; margin-left: 6px; }
.hidden-notice { opacity: 0.6; }

/* ===== 공지 푸터 (날짜 + 관리자 버튼) ===== */
.notice-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.notice-foot .notice-date { margin-top: 0; }

/* ===== 질문답변 (Q&A 게시판) ===== */
.qa-card {
  background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.qa-asker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 6px; }
.qa-date { margin-left: auto; font-weight: 400; color: #94a3b8; font-size: 11px; }
.qa-question { font-size: 14px; color: #0f172a; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.qa-answer { margin-top: 9px; background: #eff6ff; border-radius: 8px; padding: 9px 11px; font-size: 13px; color: #1e3a8a; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.qa-answer b { color: #2563eb; margin-right: 4px; }
.qa-pending { margin-top: 9px; font-size: 12px; color: #b45309; font-weight: 600; }
.qa-acts { display: flex; gap: 8px; margin-top: 10px; }
.qa-acts button { background: #2563eb; color: #fff; border-radius: 6px; padding: 6px 12px; font-size: 12px; font-weight: 700; }
.qa-acts button.del { background: #fee2e2; color: #dc2626; }

/* ===== 서류 항목별 작업자 완료 현황 ===== */
.dc-workers { margin-top: 10px; border-top: 1px solid #f1f5f9; padding-top: 8px; }
.dc-empty { font-size: 12px; color: #94a3b8; padding: 4px 0; }
.dc-w {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 4px; border-bottom: 1px solid #f1f5f9;
}
.dc-w:last-child { border-bottom: none; }
.dc-w-name { font-size: 13px; color: #0f172a; font-weight: 600; }
.dc-w-right { display: flex; align-items: center; gap: 10px; }
.dc-file { font-size: 12px; color: #2563eb; text-decoration: none; }
.dc-w-status { font-size: 12px; font-weight: 700; white-space: nowrap; }
.dc-w-status.done { color: #16a34a; }
.dc-w-status.no { color: #94a3b8; }

/* ===== 지원자 카드 (진행도) ===== */
.appl-card {
  background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); cursor: pointer;
}
.appl-card:active { background: #f8fafc; }
.appl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.appl-name { font-size: 15px; font-weight: 700; color: #0f172a; }
.appl-phone { font-size: 12px; color: #64748b; }
.appl-prog { margin-top: 10px; }
.bar { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: #2563eb; border-radius: 999px; transition: width .25s; }
.bar-fill.full { background: #16a34a; }
.appl-meta { font-size: 12px; color: #64748b; margin-top: 6px; }

/* ===== 지원자 상세 ===== */
.detail-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.detail-bar .admin-acts { margin-left: auto; }
.back-btn { background: #f1f5f9; color: #475569; border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 700; }
.detail-name { font-size: 17px; font-weight: 800; color: #0f172a; }
.detail-sub { font-size: 12px; color: #64748b; margin-bottom: 8px; }

/* ===== 폼 모달 ===== */
.modal-wrap {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
  animation: mfade .15s ease-out;
}
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: white; width: 100%; max-width: 500px;
  border-radius: 18px 18px 0 0; padding: 22px 20px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(0,0,0,0.25);
  max-height: 90dvh; overflow-y: auto;
  animation: mslide .2s ease-out;
}
@keyframes mslide { from { transform: translateY(100%);} to { transform: translateY(0);} }
@media (min-width: 600px) {
  .modal-wrap { align-items: center; padding: 20px; }
  .modal-card { border-radius: 16px; max-width: 460px; }
}
.modal-title { font-size: 17px; font-weight: 700; color: #0f172a; margin-bottom: 14px; }
.mfield { margin-bottom: 12px; }
.mfield label, .mstatic label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.mfield input, .mfield textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 15px; color: #0f172a; background: #f8fafc; font-family: inherit; line-height: 1.5;
}
.mfield input:focus, .mfield textarea:focus { outline: none; border-color: #2563eb; background: white; }
.mfield textarea { resize: vertical; min-height: 80px; }
.mcheck { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #0f172a; margin-bottom: 12px; cursor: pointer; }
.mcheck input { width: 18px; height: 18px; }
.mstatic { margin-bottom: 12px; }
.mstatic div { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; font-size: 14px; color: #0f172a; white-space: pre-wrap; line-height: 1.5; }
.modal-actions { display: flex; gap: 8px; margin-top: 8px; }
.modal-btn { flex: 1; padding: 13px; font-size: 15px; font-weight: 700; border-radius: 10px; }
.modal-btn.cancel { background: #f1f5f9; color: #475569; }
.modal-btn.submit { background: #2563eb; color: white; }
.modal-btn.submit:disabled { background: #cbd5e1; cursor: not-allowed; }

/* ===== 토스트 ===== */
.toast {
  position: fixed; left: 50%; bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: white; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; max-width: 90vw; text-align: center;
  white-space: normal; word-break: keep-all; z-index: 50; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #991b1b; }
