/* ============================================================
   급여대장 자동화 — 유쾌한프로젝트 디자인 언어 (Sage)
   drop-in 스타일시트 · 기존 HTML 클래스명 그대로 사용
   교체 방법: 기존 <style>의 tokens/app.css 블록을 지우고
             <link rel="stylesheet" href="payroll.css"> 로 연결
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;500;600;700&family=DM+Mono:wght@400;500;600&display=swap');

:root {
  /* ----- 표면 (warm off-white) ----- */
  --bg:            #fbfaf7;
  --bg-sub:        #f5f4f0;
  --bg-soft:       #faf9f5;
  --surface:       #ffffff;
  --surface-2:     #faf8f3;

  /* ----- 라인 ----- */
  --line:          #eae6dc;
  --line-soft:     #f2efe8;
  --line-strong:   #dcd5c5;

  /* ----- 텍스트 ----- */
  --text-1:        #1f2a24;
  --text-2:        #5a6660;
  --text-3:        #8a9089;
  --text-4:        #b0a89e;

  /* ----- 액센트 (Sage) ----- */
  --accent:        #5a9874;
  --accent-hover:  #4a8664;
  --accent-soft:   #e3efe7;
  --accent-soft-2: #cfe5d6;
  --accent-text:   #3d6f54;

  /* ----- 시맨틱 (채도 낮춤) ----- */
  --warm:          #cf9b6c;
  --warm-soft:     #f5e6d3;
  --warm-text:     #8b5e30;
  --danger:        #c4624c;
  --danger-soft:   #f5dfd7;
  --danger-text:   #8b3825;
  --info:          #5378a8;
  --info-soft:     #dfe7f1;
  --info-text:     #345a85;
  --success:       #5a9874;
  --success-soft:  #e3efe7;
  --success-text:  #3d6f54;
  --orange:        #cf9b6c;
  --orange-soft:   #f5e6d3;
  --orange-text:   #8b5e30;

  /* alias — 기존 토큰명 호환 (인라인 var(--orange) 등) */
  --fg-1: var(--text-1);  --fg-2: var(--text-2);  --fg-3: var(--text-3);
  --bg-base: var(--bg);   --bg-surface: var(--surface);
  --bg-subtle: var(--bg-sub);  --bg-muted: var(--bg-sub); --bg-2: var(--bg-sub);
  --border: var(--line);  --border-1: var(--line); --border-2: var(--line-soft);
  --border-strong: var(--line-strong);
  --warning: var(--warm); --warning-light: var(--warm-soft);
  --success-light: var(--success-soft); --danger-light: var(--danger-soft);
  --orange-light: var(--orange-soft); --accent-light: var(--accent-soft);
  --gray: var(--text-3); --gray-light: var(--bg-sub);
  --slate-50: var(--bg-soft); --navy-800: var(--text-1);

  /* ----- 폰트 ----- */
  --font:      'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --text-xxs: 10px; --text-xs: 11px; --text-sm: 12px; --text-base: 13px;
  --text-md: 14px; --text-lg: 15px; --text-xl: 17px; --text-2xl: 20px;
  --text-3xl: 22px; --text-display: 26px;

  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-black: 700;

  --ls-tight: -0.02em; --ls-snug: -0.01em; --ls-wide: 0.02em; --ls-wider: 0.04em; --ls-widest: 0.06em;

  /* ----- 라운드 / 그림자 ----- */
  --radius-sm: 7px;  --radius: 9px;  --radius-lg: 13px;  --radius-xl: 18px;  --radius-pill: 999px;
  --appbar-h: 58px;   /* sticky appbar 높이 — 표 헤더 sticky top 보정용(헤더가 appbar 뒤로 숨는 것 방지) */

  --shadow-xs: 0 1px 2px rgba(40,44,40,0.04);
  --shadow:    0 1px 3px rgba(40,44,40,0.05), 0 1px 2px rgba(40,44,40,0.03);
  --shadow-md: 0 6px 16px -8px rgba(40,44,40,0.12), 0 1px 2px rgba(40,44,40,0.04);
  --shadow-accent-glow: 0 4px 14px -4px rgba(90,152,116,0.4);
  --shadow-focus-ring: 0 0 0 3px rgba(90,152,116,0.16);

  --dur-fast: 0.13s; --ease-out: ease;
}

/* ============================================================
   BASE
============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
/* 세로 스크롤바 자리를 항상 예약 — 탭 전환 시 내용 높이가 달라져도(스크롤바 생김/사라짐)
   가운데 정렬 레이아웃이 좌우로 흔들리지 않게(결과화면 스텝레일 떨림 방지). */
html { overflow-y: scroll; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent-text); text-decoration: none; }
.mono, code, pre { font-family: var(--font-mono); }

h1,.h1{font-size:var(--text-3xl);font-weight:var(--fw-bold);letter-spacing:var(--ls-tight);color:var(--text-1)}
h2,.h2{font-size:var(--text-2xl);font-weight:var(--fw-bold);letter-spacing:var(--ls-tight);color:var(--text-1)}
h3,.h3{font-size:var(--text-xl);font-weight:var(--fw-bold);color:var(--text-1)}
h4,.h4{font-size:var(--text-lg);font-weight:var(--fw-bold);letter-spacing:var(--ls-snug);color:var(--text-1)}

/* ============================================================
   APPBAR — 더 이상 navy 그라데이션 아님: 라이트 + 세이지 마크
============================================================ */
.appbar {
  background: var(--surface);
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.appbar .brand {
  color: var(--text-1);
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  margin-right: 24px;
  display: inline-flex; align-items: center; gap: 9px;
}
/* 세이지 사각 마크 (브랜드 앞) */
.appbar .brand::before {
  content: "₩";
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.appbar .brand span { color: var(--accent-text); }
/* 상단 내비 — 알약형 세그먼트 그룹 */
.appbar .appnav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-sub);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.appbar .appnav a {
  color: var(--text-2);
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  padding: 6px 15px;
  border-radius: var(--radius-pill);
  background: transparent;
  line-height: 1.4;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.appbar .appnav a:hover { color: var(--text-1); background: var(--surface); }
.appbar .appnav a.active {
  color: var(--accent-text);
  background: var(--surface);
  font-weight: var(--fw-semibold);
  box-shadow: 0 1px 2px rgba(31, 42, 36, 0.10);
}
.appbar .spacer { flex: 1; }
.appbar .meta { color: var(--text-3); font-size: var(--text-sm); font-family: var(--font-mono); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 26px 28px 60px; }

/* ============================================================
   PAGE HEAD
============================================================ */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.page-title { font-size: var(--text-2xl); font-weight: var(--fw-bold); color: var(--text-1); letter-spacing: var(--ls-tight); }
.page-subtitle { font-size: var(--text-base); color: var(--text-3); margin-top: 4px; }
.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   TABS — 라운드 pill 세그먼트 (밑줄 → 알약형)
============================================================ */
.tabs {
  display: inline-flex; gap: 3px; margin-bottom: 22px;
  background: var(--bg-sub); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 4px; flex-wrap: wrap;
}
.tabs .tab {
  appearance: none; border: none; background: transparent; cursor: pointer;
  font-size: var(--text-base); font-weight: var(--fw-medium); color: var(--text-2);
  padding: 8px 16px; border-radius: var(--radius); margin: 0;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all var(--dur-fast) var(--ease-out);
}
.tabs .tab:hover { color: var(--text-1); background: var(--surface-2); }
.tabs .tab.active {
  color: var(--accent-text); background: var(--surface);
  font-weight: var(--fw-semibold); box-shadow: var(--shadow-xs);
}
.tabs .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.tabs .dot.danger { background: var(--danger); }
.tabs .dot.ok { background: var(--success-text); }

/* 마감 요약 바 — 검토할 N건을 탭 위 한 줄로 */
.close-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--surface); font-size: var(--text-base); }
.close-bar.ok { background: var(--success-soft); border-color: var(--success-soft); }
.close-bar.warn { background: var(--warm-soft); border-color: #e8d4ad; }
.close-bar .jumpchip { cursor: pointer; border: none; font: inherit; }

/* 전면 리디자인: 좌측 스텝 레일 + 본문 2단 레이아웃 */
.result-layout { display: flex; gap: 18px; align-items: flex-start; }
.result-main { flex: 1 1 auto; min-width: 0; }
.steprail { flex: 0 0 198px; position: sticky; top: calc(var(--appbar-h) + 14px);
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 10px; box-shadow: var(--shadow-xs); }
.steprail .rail-head { font-weight: 700; font-size: var(--text-sm); padding: 6px 10px 10px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.steprail .rail-head.ok { color: var(--success-text); }
.steprail .rail-head.warn { color: var(--danger-text); }
.steprail .step { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; cursor: pointer; font: inherit; color: var(--text-2); transition: all 0.12s ease; }
.steprail .step:hover { background: var(--bg-soft); color: var(--text-1); }
.steprail .step.active { background: var(--accent-soft); border-color: var(--accent-soft-2);
  color: var(--accent-text); font-weight: 600; }
.steprail .step .st-num { flex: 0 0 22px; width: 22px; height: 22px; line-height: 22px;
  text-align: center; border-radius: 50%; background: var(--bg-sub); color: var(--text-3);
  font-size: 12px; font-weight: 700; font-family: var(--font-mono); }
.steprail .step.active .st-num { background: var(--accent); color: #fff; }
.steprail .step .st-label { flex: 1 1 auto; }
.steprail .step .st-badge { margin-left: auto; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: var(--radius-pill); }
.steprail .step .st-badge.bad { background: var(--danger-soft); color: var(--danger-text); }
.steprail .step .st-badge.good { background: var(--success-soft); color: var(--success-text); }
.steprail .step .dot.st-badge { padding: 0; width: 7px; height: 7px; }
.steprail .rail-foot { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.steprail .rail-stat { padding: 7px 10px; border-radius: var(--radius); font-size: 12px;
  font-weight: 600; text-align: center; background: var(--bg-sub); color: var(--text-3); }
.steprail .rail-stat.todo { background: var(--warm-soft); color: var(--warm-text); font-weight: 700; }
.steprail .rail-stat.done { background: var(--success-soft); color: var(--success-text); }
@media (max-width: 860px) {
  .result-layout { flex-direction: column; }
  .steprail { flex-basis: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .steprail .rail-head { width: 100%; border-bottom: none; margin-bottom: 0; padding-bottom: 4px; }
  .steprail .step { width: auto; }
  .steprail > .btn { margin-top: 0 !important; }
}
.tab-panel { animation: fadein .15s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* ============================================================
   CARD
============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  padding: 22px; margin-bottom: 18px;
}
.card > .card-title {
  font-size: var(--text-lg); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; color: var(--text-1);
}
.card > .card-sub { font-size: var(--text-base); color: var(--text-3); margin: -8px 0 16px; line-height: 1.6; }

/* ============================================================
   STAT GRID
============================================================ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 15px 17px; box-shadow: var(--shadow-xs);
}
.stat .k {
  font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-3);
  letter-spacing: var(--ls-wider); text-transform: uppercase;
}
.stat .v {
  font-size: var(--text-display); font-weight: var(--fw-bold); color: var(--text-1);
  letter-spacing: var(--ls-tight); margin-top: 5px; line-height: 1.1;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.stat .v.sm { font-size: var(--text-xl); }
.stat .u { font-size: var(--text-sm); color: var(--text-3); margin-left: 3px; font-weight: var(--fw-medium); font-family: var(--font); }

/* ============================================================
   TABLE
============================================================ */
.tbl-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table.dt { width: 100%; border-collapse: collapse; background: var(--surface); font-size: var(--text-base); }
table.dt th {
  padding: 11px 13px; background: var(--bg-sub); border-bottom: 1px solid var(--line);
  font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-3);
  letter-spacing: var(--ls-wide); text-transform: uppercase; text-align: right; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.dt th.l, table.dt td.l { text-align: left; }
table.dt td {
  padding: 10px 13px; border-bottom: 1px solid var(--line-soft); text-align: right;
  white-space: nowrap; font-variant-numeric: tabular-nums; font-family: var(--font-mono);
  font-size: var(--text-base); color: var(--text-1);
}
table.dt td.l { font-family: var(--font); }
table.dt tbody tr:hover td { background: var(--bg-soft); }
table.dt tr:last-child td { border-bottom: none; }
table.dt tr.row-warn { background: var(--danger-soft); }
table.dt tr.row-warn:hover td { background: var(--danger-soft); }
table.dt tr.row-leave { box-shadow: inset 3px 0 0 var(--warm); }
table.dt tr.row-join { box-shadow: inset 3px 0 0 var(--accent); }
/* 결과 표: 성명(첫 열) 가로스크롤 시 좌측 고정 */
.result-main table.dt th:first-child, .result-main table.dt td:first-child {
  position: sticky; left: 0; z-index: 2; background: var(--surface); }
.result-main table.dt thead th:first-child { z-index: 3; background: var(--bg-sub); }
.result-main table.dt tr.row-warn td:first-child { background: var(--danger-soft); }
.result-main table.dt tr.row-leave td:first-child { box-shadow: inset 3px 0 0 var(--warm); }
.result-main table.dt tr.row-join td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* 정산 추적: 퇴사자별 표 칸너비 고정 → 사람이 달라도 세로줄이 딱 맞도록 */
table.dt.settle-dt { table-layout: fixed; min-width: 660px; }
table.dt.settle-dt th:nth-child(1), table.dt.settle-dt td:nth-child(1) { width: 17%; }
table.dt.settle-dt th:nth-child(2), table.dt.settle-dt td:nth-child(2) { width: 19%; }
table.dt.settle-dt th:nth-child(3), table.dt.settle-dt td:nth-child(3) { width: 22%; }
table.dt.settle-dt th:nth-child(4), table.dt.settle-dt td:nth-child(4) { width: 21%; }
table.dt.settle-dt th:nth-child(5), table.dt.settle-dt td:nth-child(5) { width: 21%; }
table.dt tfoot td {
  font-weight: var(--fw-bold); border-top: 1px solid var(--line-strong);
  background: var(--bg-sub); color: var(--text-1);
}
.neg { color: var(--danger-text); }

/* ============================================================
   BADGE
============================================================ */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: var(--radius-pill); font-size: var(--text-xs);
  font-weight: var(--fw-semibold); white-space: nowrap; letter-spacing: var(--ls-snug);
}
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.ok     { background: var(--success-soft); color: var(--success-text); }
.badge.warn   { background: var(--warm-soft); color: var(--warm-text); }
.badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.badge.orange { background: var(--orange-soft); color: var(--orange-text); }
.badge.gray   { background: var(--bg-sub); color: var(--text-2); }

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  padding: 9px 17px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-family: var(--font);
  font-size: var(--text-base); font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-snug); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-accent-glow); transform: translateY(-1px); }
.btn.sec { background: var(--surface); border-color: var(--line-strong); color: var(--text-1); }
.btn.sec:hover { background: var(--surface-2); border-color: var(--text-3); box-shadow: var(--shadow-xs); transform: none; }
.btn.sm { padding: 6px 12px; font-size: var(--text-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   FORMS
============================================================ */
label.caps, .label-uppercase {
  display: block; font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-3);
  margin-bottom: 6px; letter-spacing: var(--ls-wider); text-transform: uppercase;
}
input[type=text], input[type=number], input[type=date], select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); font-size: var(--text-base); color: var(--text-1);
  background: var(--surface); font-family: var(--font); transition: all var(--dur-fast) var(--ease-out);
}
input.num, td input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus-ring); }
input::placeholder { color: var(--text-4); }
input:disabled { background: var(--bg-sub); color: var(--text-3); }
.field { margin-bottom: 12px; }
.grid { display: grid; gap: 12px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3,1fr); }
.grid.c4 { grid-template-columns: repeat(4,1fr); }

/* 입사자/퇴사자 입력 박스 — 점선 강조를 토큰 색으로 */
[style*="border:1px dashed var(--accent)"] { border-color: var(--accent-soft-2) !important; background: var(--accent-soft) !important; border-radius: var(--radius-lg) !important; }
[style*="border:1px dashed var(--orange"] { border-color: var(--warm-soft) !important; background: var(--warm-soft) !important; border-radius: var(--radius-lg) !important; }
[style*="border:1px solid var(--border-2)"] { border-color: var(--line) !important; border-radius: var(--radius-lg) !important; background: var(--bg-soft); }

/* ============================================================
   FILE ROW · MISC
============================================================ */
.filerow { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.filerow:last-child { border-bottom: none; }
.filerow .fname { font-weight: var(--fw-semibold); flex: 0 0 290px; white-space: nowrap; color: var(--text-1); }
.filerow .fdesc { color: var(--text-3); font-size: var(--text-sm); flex: 1; }

.flag {
  font-size: var(--text-xs); color: var(--danger-text);
  background: var(--danger-soft); padding: 2px 8px; border-radius: var(--radius-pill);
  font-weight: var(--fw-semibold); cursor: help;
}
.muted { color: var(--text-3); }
.hr { height: 1px; background: var(--line); margin: 18px 0; border: none; }

details > summary {
  cursor: pointer; font-weight: var(--fw-semibold); color: var(--accent-text);
  padding: 9px 13px; list-style: none; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg-soft);
  display: inline-flex; align-items: center; gap: 7px;
  transition: all var(--dur-fast) var(--ease-out);
}
details > summary:hover { background: var(--accent-soft); border-color: var(--accent-soft-2); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; font-size: 11px; transition: transform var(--dur-fast); }
details[open] > summary::before { transform: rotate(90deg); }

/* ============================================================
   NOTICE
============================================================ */
.notice {
  padding: 13px 16px; border-radius: var(--radius); font-size: var(--text-base);
  margin-bottom: 14px; border: 1px solid transparent; line-height: 1.6;
}
.notice.err  { background: var(--danger-soft); color: var(--danger-text); border-color: #ecc9bd; }
.notice.ok   { background: var(--success-soft); color: var(--success-text); border-color: var(--accent-soft-2); }
.notice.info { background: var(--info-soft); color: var(--info-text); border-color: #c7d5e8; }
.notice b { font-weight: var(--fw-bold); }
/* notice 안의 인라인 변동 칩 */
.notice span[style*="background:#fff"] {
  background: var(--surface) !important; border-color: var(--line) !important;
  border-radius: var(--radius-pill) !important; font-family: var(--font-mono);
  color: var(--text-2); font-size: var(--text-sm) !important;
}

/* ============================================================
   STEP HEADER — 섹션 구분 (① ② ③)
============================================================ */
.step-h {
  font-size: var(--text-lg); font-weight: var(--fw-bold); color: var(--text-1);
  letter-spacing: var(--ls-snug); margin: 22px 0 12px; padding-bottom: 9px;
  border-bottom: 2px solid var(--accent-soft-2);
  display: flex; align-items: center; gap: 8px;
}
.step-h:first-child { margin-top: 0; }

/* ============================================================
   PRINT
============================================================ */
@media print {
  .appbar, .toolbar, .tabs, .btn, details > summary { display: none !important; }
  body, .wrap { background: #fff; }
  .card, .stat, .tbl-scroll { box-shadow: none; border-color: #ccc; }
  .tab-panel { display: block !important; }
}

/* ============================================================
   결과 화면 경량화 + 퇴사자 정산 카드 (.rcd) — 사용자 제공 디자인 2026-06
   범위는 .result-main 하위로 한정 → 홈·마스터 화면 불변.
============================================================ */

/* 카드 톤다운 */
.result-main .card { padding: 20px 22px; margin-bottom: 14px; box-shadow: none; border-color: var(--line); }
.result-main .card > .card-title { font-size: var(--text-md); margin-bottom: 12px; }
.result-main .card > .card-sub { margin: -6px 0 14px; }

/* ①②③ 섹션 헤더 — 무거운 밑줄 → 가벼운 컬러바 라벨 */
.result-main .step-h { display: flex; align-items: center; gap: 9px;
  font-size: var(--text-base); font-weight: var(--fw-bold); color: var(--text-2);
  letter-spacing: var(--ls-wide); border-bottom: none; padding-bottom: 0;
  margin: 26px 0 12px; text-transform: none; }
.result-main .step-h::before { content: ""; width: 4px; height: 14px; border-radius: 2px;
  background: var(--accent); flex-shrink: 0; }

/* 입력 그리드·라벨·인풋 밀도 낮춤 */
.result-main .grid { gap: 10px 14px; }
.result-main label.caps { margin-bottom: 4px; letter-spacing: var(--ls-wide);
  text-transform: none; color: var(--text-3); }
.result-main input[type=text], .result-main input[type=number],
.result-main input[type=date], .result-main select { padding: 8px 11px; }

/* notice·details 경량화 */
.result-main .notice { padding: 11px 14px; margin-bottom: 12px; border-radius: var(--radius-sm); }
.result-main .notice.ok { background: color-mix(in srgb, var(--success-soft) 55%, var(--surface)); }
.result-main .notice.info { background: color-mix(in srgb, var(--info-soft) 50%, var(--surface)); line-height: 1.5; }
.result-main details { margin-top: 10px; }
.result-main details > summary { padding: 8px 12px; font-size: var(--text-sm);
  background: var(--bg-soft); border-color: var(--line-soft); }
.result-main .hr { margin: 16px 0; }

/* 대사검토 인별 차인지급액(합계) 요약 행 — 각 사람 묶음을 구분선으로 닫음 */
.result-main .dt tr.cmp-net td { border-top: 1.5px solid var(--line-strong); font-weight: 600; }

/* ----- 퇴사자 정산 카드 ----- */
.rcd { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs); overflow: hidden; margin-bottom: 12px; }
.rcd-head { display: flex; align-items: center; gap: 11px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.rcd-av { width: 34px; height: 34px; border-radius: 10px; background: var(--warm-soft); color: var(--warm-text);
  display: flex; align-items: center; justify-content: center; font-weight: var(--fw-bold); font-size: var(--text-md); flex-shrink: 0; }
.rcd-name { font-size: var(--text-lg); font-weight: var(--fw-bold); color: var(--text-1); }
.rcd-name span { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-3); font-family: var(--font-mono); margin-left: 8px; }
.rcd-tag { margin-left: auto; font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--warm-text);
  background: var(--warm-soft); padding: 3px 11px; border-radius: var(--radius-pill); }
.rcd-cols { display: grid; grid-template-columns: 1.1fr 1fr; }
.rcd-col { padding: 16px 18px; }
.rcd-col-r { border-left: 1px solid var(--line); background: var(--bg-soft); }
.rcd-col-h { font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--text-3);
  letter-spacing: var(--ls-wider); text-transform: uppercase; margin-bottom: 13px; }
.rcd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rcd-grid2 .field label.caps, .rcd-grid4 .field label.caps { margin-bottom: 5px; }
.rcd-result { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; background: var(--accent-soft); border-radius: var(--radius); padding: 9px 14px; }
.rcd-result .l { font-size: var(--text-sm); color: var(--accent-text); font-weight: var(--fw-semibold); }
.rcd-result .l .muted2 { font-weight: var(--fw-regular); opacity: .6; font-size: var(--text-xs); }
.rcd-result .v { font-size: var(--text-lg); font-weight: var(--fw-bold); color: var(--accent-text);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.rcd-auto { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 13px; height: 38px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent-soft-2); }
.rcd-auto .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: var(--fw-bold);
  color: var(--accent-text); font-size: var(--text-md); }
.rcd-auto .cap { font-size: var(--text-xxs); color: var(--accent-text); opacity: .6; font-weight: var(--fw-medium); white-space: nowrap; }
.auto-tag { font-size: 9px; font-weight: var(--fw-bold); color: var(--accent-text); background: var(--accent-soft-2);
  padding: 1px 6px; border-radius: var(--radius-pill); margin-left: 5px; vertical-align: middle; letter-spacing: 0; }
.rcd-status { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm);
  border-radius: var(--radius); padding: 9px 12px; margin-bottom: 12px; line-height: 1.45; }
.rcd-status.ok { color: var(--success-text); background: var(--success-soft); }
.rcd-status.ok .chk { color: var(--success); font-weight: var(--fw-bold); }
.rcd-status.info { color: var(--info-text); background: var(--info-soft); }
.rcd-status b { font-weight: var(--fw-bold); }
.rcd-grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rcd-grid4.is-muted input { background: var(--bg-sub); border-style: dashed; border-color: var(--line); color: var(--text-4); }
@media (max-width: 760px) {
  .rcd-cols { grid-template-columns: 1fr; }
  .rcd-col-r { border-left: none; border-top: 1px solid var(--line); }
}
