/* Pretendard (SIL Open Font License 1.1) — static/fonts/Pretendard-LICENSE.txt. 외부 CDN 없이 자체 제공 */
@font-face {
  font-family: "Pretendard";
  src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations"), url("/static/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #152033;
  --muted: #5b6b82;
  --line: #e3e8ef;
  --navy: #16324f;
  --navy-2: #0f243b;
  --accent: #1f8a70;
  --accent-2: #166b56;
  --warn: #c47b16;
  --danger: #c0392b;
  --info: #2b6cb0;
  --chip: #eef3f8;
  --shadow: 0 8px 24px rgba(15, 36, 59, 0.08);
  --radius: 14px;
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #e8eef5;
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); display: grid; place-items: center;
  font-weight: 800; color: white; letter-spacing: -0.04em;
}
.brand strong { display: block; font-size: 15px; }
.brand span { display: block; font-size: 11px; opacity: .7; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  color: #d5deea; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; font-size: 14px;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav .sec { font-size: 11px; letter-spacing: .08em; color: #8ea0b5; padding: 16px 12px 6px; }
.sidebar .who { margin-top: auto; padding: 12px; background: rgba(255,255,255,.06); border-radius: 12px; font-size: 12px; }
.main { flex: 1; padding: 28px 32px 48px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 9px 14px;
  font-weight: 600; font-size: 13px; cursor: pointer;
  background: var(--navy); color: #fff; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.accent { background: var(--accent); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 750; margin-top: 4px; letter-spacing: -0.03em; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr:hover td { background: #fafbfd; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--chip); border-radius: 999px; padding: 3px 9px;
  font-size: 12px; color: var(--navy);
}
.chip.ok { background: #e5f6ef; color: #146c4d; }
.chip.warn { background: #fff4de; color: #8a5a00; }
.chip.bad { background: #fdecea; color: #9b1c1c; }
.chip.info { background: #e7f0fb; color: #1d4f91; }
.chip.gray { background: #eef0f3; color: #4a5568; }
form.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; color: var(--ink); background: #fff;
}
textarea { min-height: 88px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row.r3 { grid-template-columns: 1fr 1fr 1fr; }
.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.flash.ok { background: #e5f6ef; color: #146c4d; }
.flash.err { background: #fdecea; color: #9b1c1c; }
.flash.info { background: #e7f0fb; color: #1d4f91; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(900px 400px at 20% -10%, #1f8a70 0%, transparent 50%), var(--navy-2); }
.login-card { width: 420px; background: #fff; border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 6px; }
.muted { color: var(--muted); font-size: 13px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 10px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); position: absolute; left: -5px; top: 16px;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { min-width: 240px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.split { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.doc-list a { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.confirm-hero { max-width: 860px; margin: 32px auto; }
@media (max-width: 1100px) {
  .grid.cols-4, .split, .row.r3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .layout { display: block; }
  .sidebar { position: relative; height: auto; width: auto; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2, .split, .row, .row.r3 { grid-template-columns: 1fr; }
}

/* ---- v2 ---- */
.chip.danger { background: #fdecea; color: #9b1c1c; }
.badge { margin-left: auto; background: #e25c4b; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.danger-text { color: var(--danger) !important; }
.ct { margin: 0 0 10px; }
fieldset.specset { border: 1px dashed #c9d4e2; border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; background: #fafcff; }
fieldset.specset[hidden] { display: none; }
fieldset.specset legend { font-weight: 700; font-size: 13px; color: var(--navy); padding: 0 6px; }
fieldset.specset p { margin: 0; }
label.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); }
label.inline input { width: auto; }
.field { display: grid; gap: 6px; }
.flabel { font-size: 12px; color: var(--muted); font-weight: 600; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 0; }
table.kv th { width: 38%; background: #f7f9fc; }
.doc-list { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 6px 0; flex-wrap: wrap; }
.doc-list a { display: inline; border: 0; padding: 0; }
.doc-list form { margin-left: auto; }
tr.deleted td { opacity: .5; text-decoration: line-through; }
tr.issue td { background: #fff6f5; }
.confirm-hero.wide { max-width: 1180px; padding: 0 16px; }
.confirm-hero { padding: 0 16px; }
pre.mailbody { white-space: pre-wrap; font: inherit; font-size: 12px; background: #f7f9fc; padding: 10px; border-radius: 8px; }
details summary { cursor: pointer; }
small { font-weight: 500; }
.toolbar .search { flex: 1 1 280px; width: auto; }
.toolbar select { width: auto; min-width: 130px; }
.btn { white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; background: #f7f9fc; }
.tablewrap { overflow-x: auto; }
.card.report h3 { scroll-margin-top: 16px; }

/* v3.0 발송 메일 제목 · 각서 양식 */
.mailcard { margin-bottom: 14px; }
.mailrow { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.mailrow > label:first-of-type { flex: 1 1 360px; }
.mailrow .chkline { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; padding-bottom: 10px; }
.mailrow .chkline input { width: auto; }
.pledge-status { font-size: 13px; line-height: 2; }
.inline-form { margin: 0; }
.inline-form select { min-width: 170px; }

/* v3.1 메일 내용 직접 작성 */
.mailbody { flex: 1 1 100%; margin-top: 4px; }
.mailbody > summary { cursor: pointer; font-weight: 600; color: var(--accent, #1b5fbf); padding: 4px 0; }
.mailbody textarea { width: 100%; font-family: inherit; font-size: 13px; line-height: 1.55; margin-top: 6px; }
.mailbody code { background: #eef3fa; padding: 1px 5px; border-radius: 4px; margin-right: 2px; }
pre.mailpreview { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.65; background: #fff; border: 1px solid #e5eaf0; border-radius: 8px; padding: 14px; }

/* v3.1 직원 수정·삭제 요청 */
details.delreq { display: inline-block; vertical-align: top; }
details.delreq > summary { list-style: none; display: inline-block; cursor: pointer; }
details.delreq > summary::-webkit-details-marker { display: none; }
details.delreq[open] form { margin-top: 6px; padding: 10px; border: 1px solid #f0d2d2; border-radius: 8px; background: #fffafa; min-width: 260px; }
form.editing { outline: 2px solid var(--accent, #1b5fbf); outline-offset: -2px; }
td.nowrap { white-space: nowrap; }

/* v3.2 각서 양식 버전 관리 */
.formver .chkline { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 600; }
.formver .chkline input { width: auto; margin-top: 3px; }
.formver .chkline .muted { font-weight: 400; }
.formver table tr.muted td { color: var(--muted); }
