/* JOB MATCHING 관리자 시스템 — 화면설계서 v0.5 기준 목업 */
:root {
  --lnb: #0e1c3f;
  --lnb-on: #142a5c;
  --lnb-text: #c9d2e6;
  --accent: #f07b2a;
  --primary: #1a46a3;
  --primary-2: #143a8a;
  --red: #d7263d;
  --green: #12a150;
  --bg: #eef0f4;
  --panel: #ffffff;
  --head: #f6f7fa;
  --th: #f3f4f7;
  --text: #1f2430;
  --muted: #6b7385;
  --line: #dde1e8;
  --shadow: 0 1px 4px rgba(14, 28, 63, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- mockup bar ---------- */
.mock-bar {
  background: #222; color: #ddd; font-size: 12px; padding: 6px 16px;
  display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center;
}
.mock-bar b { color: #ffc61a; }
.mock-bar a { color: #ddd; }
.mock-bar a.on { color: #fff; font-weight: 700; text-decoration: underline; }
.mock-bar .grp { color: #888; }
.mock-bar .sid { margin-left: auto; color: #9fb4e8; font-family: Consolas, monospace; }

/* ---------- layout ---------- */
.app { display: flex; min-height: calc(100vh - 30px); }
.lnb { width: 210px; flex: none; background: var(--lnb); color: var(--lnb-text); padding-bottom: 24px; }
.lnb .brand { display: block; padding: 14px 16px 12px; color: #fff; }
.lnb .brand:hover { text-decoration: none; }
.lnb .brand b { display: block; font-size: 14px; letter-spacing: .3px; }
.lnb .brand small { font-size: 11px; color: #8d99b8; }
.lnb .d1 { display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  color: #fff; font-weight: 700; padding: 7px 16px; border-left: 3px solid transparent; }
.lnb a.d1:hover, .lnb .d2 a:hover { text-decoration: none; background: rgba(255,255,255,.05); }
.lnb .d1.on { background: var(--lnb-on); border-left-color: var(--accent); }
.lnb .d2 { display: none; }
.lnb .grp.open .d2 { display: block; }
.lnb .d2 a { display: block; color: var(--lnb-text); padding: 5px 16px 5px 28px; border-left: 3px solid transparent; font-size: 12.5px; }
.lnb .d2 a.on { background: var(--lnb-on); color: #fff; font-weight: 700; border-left-color: var(--accent); }

.main { flex: 1; min-width: 0; background: var(--panel); display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 28px; padding: 10px 28px; font-size: 12px; color: var(--muted); }
.top a { color: var(--muted); }
.ph { background: var(--head); border-bottom: 1px solid var(--line); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ph h1 { margin: 0; font-size: 17px; }
.ph small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.content { padding: 14px 16px 40px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-width: 62px; height: 28px; padding: 0 14px;
  border: 1px solid #a9b0bf; background: #fff; border-radius: 3px; cursor: pointer; font-size: 12px; color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.08); white-space: nowrap; }
.btn:hover { text-decoration: none; background: #f4f6fa; }
.btn.pri { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.btn.pri:hover { background: var(--primary-2); }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.btn.red:hover { background: #b81f33; }
.btn:disabled, .btn:disabled:hover { opacity: .45; cursor: not-allowed; }
.btn.pri:disabled:hover { background: var(--primary); }
.btn.red:disabled:hover { background: var(--red); }
.btn.lg { height: 32px; min-width: 92px; }
.btn.sm { height: 22px; min-width: 0; padding: 0 8px; font-size: 11.5px; box-shadow: none; }
.btn.wide { min-width: 104px; }
.btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }

/* ---------- search ---------- */
.search { background: var(--head); border-bottom: 1px solid var(--line); padding: 10px 16px;
  display: flex; gap: 12px; align-items: flex-end; margin: -14px -16px 0; }
.search .rows { flex: 1; display: grid; gap: 6px; }
.search .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.search label { color: var(--muted); min-width: 48px; }
.field { display: inline-flex; align-items: center; gap: 6px; }
.inp, .sel { height: 26px; border: 1px solid #9aa2b2; background: #fff; padding: 0 8px; border-radius: 2px; font-size: 12px; }
.inp::placeholder { color: #9aa2b2; }
.inp.date { width: 112px; }
.inp.kw { width: 282px; }
.inp.full { width: 100%; }
.inp.mid { width: 260px; }
.sel { min-width: 100px; }
.sel.mid { width: 260px; }
.sel.xs { min-width: 0; width: auto; }
.inp.num { width: 76px; text-align: right; }
.inp.amt { width: 140px; text-align: right; }
.inp:disabled { background: #f1f2f5; color: var(--muted); }
.ig { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.file { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.file input[type=file] { font-size: 11.5px; max-width: 100%; }
.file .fname { color: var(--text); }
textarea.inp { height: 64px; padding: 6px 8px; resize: vertical; width: 100%; }
.tilde { color: var(--muted); }

/* ---------- summary / table ---------- */
.sum { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 6px; }
.sum .sel { min-width: 76px; border-color: transparent; background: transparent; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--shadow); }
.tbl th { background: var(--th); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.tbl td.l { text-align: left; }
.tbl td.r { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tbody tr:hover td { background: #f8f9fc; }
.tbl.form td { text-align: left; }
.pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 2px 6px; margin-top: 12px; }
.pager a, .pager .gap { min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; color: var(--muted); border-radius: 4px; }
.pager a.pv { padding: 0 6px; }
.pager a.on { background: var(--lnb); color: #fff; font-weight: 700; }
.pager a:hover { text-decoration: none; background: #eef1f6; }
.pager a.on:hover { background: var(--lnb); }

/* 목록 하단: 1줄 = 엑셀 다운로드(왼쪽) | 등록·일괄 처리 버튼(오른쪽), 2줄 = 페이지 번호(가운데) — 슬라이드 배치 (v0.5) */
.lbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l r" "pg pg"; align-items: center; gap: 10px; margin-top: 10px; }
.lbar .pager { grid-area: pg; margin: 0; }
.lbar .lb-l { grid-area: l; justify-self: start; }
.lbar .lb-r { grid-area: r; justify-self: end; display: flex; gap: 6px; }
.lbar .lb-l:empty, .lbar .lb-r:empty { display: none; }
.tbl th.ck, .tbl td.ck { width: 32px; padding-left: 4px; padding-right: 4px; }
.tbl input[type=checkbox] { margin: 0; vertical-align: middle; cursor: pointer; }

/* 상태 표기 */
.st-warn { color: var(--red); font-weight: 600; }
.st-wait { color: var(--primary); font-weight: 700; }
.st-done { color: var(--muted); }

/* ---------- info grid (상세) ---------- */
.sec { display: flex; justify-content: space-between; align-items: flex-end; margin: 14px 0 4px; }
.sec h2 { margin: 0; font-size: 13.5px; }
.sec h2::before { content: "■ "; }
.sec:first-child { margin-top: 0; }
.info { width: 100%; border-collapse: collapse; box-shadow: var(--shadow); background: #fff; table-layout: fixed; }
.info th { width: 12%; background: var(--th); font-weight: 400; text-align: left; padding: 6px 8px; border: 1px solid var(--line); }
.info td { width: 38%; padding: 6px 8px; border: 1px solid var(--line); }
.info td[colspan] { width: auto; }
.info col.c-th { width: 12%; }
.info .inp { height: 24px; }
.radios { display: inline-flex; gap: 14px; }
.radios label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.note { color: var(--muted); font-size: 11.5px; margin: 6px 0 0; }
.box { border: 1px dashed #b9c0cf; background: #fafbfd; color: var(--muted); padding: 18px; min-height: 80px; }
.box[contenteditable] { outline: none; cursor: text; }
.box[contenteditable]:focus { border-style: solid; border-color: var(--primary); background: #fff; }
.box.preview { min-height: 120px; display: flex; align-items: center; justify-content: center; max-width: 480px; }
.err { color: var(--red); font-size: 11.5px; margin-top: 4px; min-height: 16px; }

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 11px; margin-top: 3px; }
.inp.cur { width: 96px; }
.inp[readonly] { background: #f6f7fa; }

/* ---------- 탭 (구직자 상세: 기본 정보 / 이력서) ---------- */
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #fff; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 18px 6px; cursor: pointer; color: var(--muted); font-size: 12.5px; margin-bottom: -1px; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.pane { display: none; }
.pane.on { display: block; }
/* 이력서 목록: 고른 이력서 행 강조 / 이력서 내용(읽기 전용) */
.tbl tbody tr.on td { background: #eef3fd; }
.info.rs col.c-th { width: 15%; }
.info.rs th { width: auto; }
.info.rs td { width: auto; line-height: 1.7; }
.info.rs .k { font-weight: 400; color: var(--muted); }

/* ---------- dashboard / stats ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.card { display: block; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 4px; padding: 10px 14px; color: var(--text); }
a.card:hover { text-decoration: none; border-color: var(--primary); }
.card small { display: block; color: var(--muted); font-size: 11.5px; }
.card b { display: block; font-size: 20px; color: var(--primary); line-height: 1.4; }
.card i { font-style: normal; color: var(--muted); font-size: 10.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.chart { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 4px; padding: 10px 14px 12px; }
.chart h3 { margin: 0 0 6px; font-size: 12.5px; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 3px; margin-right: 4px; vertical-align: middle; background: var(--c); }
.sample { color: var(--muted); font-size: 11px; font-weight: 400; }

/* ---------- login ---------- */
.login-wrap { min-height: calc(100vh - 30px); display: flex; align-items: center; justify-content: center; background: #f0f1f4; }
.login { width: 320px; background: #fff; border-radius: 8px; box-shadow: 0 4px 18px rgba(14,28,63,.14); padding: 32px 34px 26px; text-align: center; }
.login h1 { margin: 0; color: var(--primary); font-size: 19px; letter-spacing: .3px; }
.login h1 small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.login form { margin-top: 22px; text-align: left; }
.login .inp { width: 100%; height: 32px; margin-bottom: 6px; }
.login .chk { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin: 2px 0 12px; }
.login .btn { width: 100%; height: 34px; }
.login .links { margin-top: 14px; font-size: 11px; color: var(--muted); text-align: center; }
.login .links a { color: var(--muted); }

/* ---------- modal ---------- */
.dim { position: fixed; inset: 0; background: rgba(40, 44, 52, .55); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.dim.on { display: flex; }
.modal { width: 470px; max-width: 100%; background: #fff; border-radius: 3px; box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.modal .mh { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--head); border-bottom: 1px solid var(--line); }
.modal .mh h3 { margin: 0; font-size: 13.5px; }
.modal .mh button { background: none; border: 0; font-size: 16px; cursor: pointer; color: var(--muted); }
.modal.wide { width: 560px; }
.modal .ig .inp.amt { width: 110px; }
.modal .mb { padding: 12px 14px 14px; }
.modal .info th { width: 28%; }
.modal .info td { width: 72%; }
.modal .warn { color: #b45309; font-size: 11.5px; margin-top: 4px; display: none; }
.modal .warn.on { display: block; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #1f2430; color: #fff;
  padding: 9px 16px; border-radius: 4px; font-size: 12.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- 반응형 (데스크톱 1366px 은 위 규칙 그대로, 모바일 변경은 아래 미디어쿼리 안에서만) ---------- */
.lnb .toggle { display: none; }

@media (max-width: 900px) {
  /* 목업 바: 한 줄 가로 스크롤 */
  .mock-bar { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .mock-bar > * { flex: none; }

  /* LNB → 상단 바 + 토글 */
  .app { flex-direction: column; min-height: 0; }
  .lnb { width: 100%; padding-bottom: 0; }
  .lnb .lnb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 12px; }
  .lnb .brand { padding: 10px 16px; }
  .lnb .brand b, .lnb .brand small { display: inline; }
  .lnb .brand small { margin-left: 6px; }
  .lnb .toggle { display: inline-flex; align-items: center; gap: 8px; min-width: 0; height: 30px; padding: 0 10px;
    background: var(--lnb-on); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 3px; cursor: pointer; font-size: 12.5px; }
  .lnb .toggle .cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
  .lnb .toggle i { font-style: normal; font-size: 14px; line-height: 1; }
  .lnb .menu { display: none; padding-bottom: 10px; border-top: 1px solid rgba(255,255,255,.08); }
  .lnb.open .menu { display: block; }

  .top { gap: 16px; padding: 8px 16px; }
  .ph { flex-wrap: wrap; }
  .sec { flex-wrap: wrap; gap: 6px; }
  .btns { flex-wrap: wrap; }
  .legend { flex-wrap: wrap; }

  .cards { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }

  /* 검색 조건: 라벨 | 입력 2열, 버튼 줄은 오른쪽 */
  .search { flex-direction: column; align-items: stretch; }
  .search .row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px 8px; }
  .search .row > .inp, .search .row > .sel { width: 100%; min-width: 0; }
  .search .row > .field { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .search .row .inp.date { width: 100%; min-width: 0; }
  .search > .field { justify-content: flex-end; }
  .inp.kw { width: 100%; }

  /* 넓은 데이터 표: 표만 가로 스크롤, 셀은 줄바꿈 금지 */
  .tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tw .tbl th, .tw .tbl td { white-space: nowrap; }

}

@media (max-width: 560px) {
  /* 정보표(th/td 4열) → th | td 2열 그리드 */
  .info, .info tbody, .info tr { display: block; }
  .info colgroup { display: none; }
  .info tr { display: grid; grid-template-columns: 108px minmax(0, 1fr); }
  .info th { word-break: keep-all; }
  .info th, .info td, .info td[colspan], .modal .info th, .modal .info td { width: auto; min-width: 0; }
  .info th:empty, .info td:empty { display: none; }
  .info th + td { border-left: 0; }
  .info tr + tr th, .info tr + tr td, .info td + th, .info td + th + td { border-top: 0; }
  .info td { overflow-wrap: anywhere; }
  .info .inp.mid, .info .inp.date, .info .sel.mid { width: 100%; max-width: 100%; min-width: 0; }
  .info .ig { width: 100%; }
  .info .ig .sel:not(.xs) { flex: 1 1 120px; min-width: 0; }
  .info .file { width: 100%; }
  .info .ig .inp.amt { flex: 1 1 100px; width: auto; min-width: 0; }
  .info .ig .inp.cur { width: 72px; }
  .tabs { padding: 0 8px; }
  .tabs button { flex: 1; padding: 9px 8px 7px; }
  .info .field { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); width: 100%; }
  .info .sel { max-width: 100%; }
  .radios { flex-wrap: wrap; gap: 4px 14px; }

  .modal .mb { padding: 10px; }
  .modal { max-height: calc(100vh - 24px); overflow-y: auto; }
  .dim { padding: 12px; }
}
