/* 젠테라 월간 보고 — 기존 IR 보고서 디자인 시스템 준용
   토큰 출처: docs 레포 주주/ir/public/style.css
   흰 종이(#fafafa) + 검은 헤더 밴드(#050505) + 초록 강조(#10b981), Inter/JetBrains Mono */
:root {
  --ink: #1a1a2e;
  --ink-soft: #374151;
  --muted: #6b7280;
  --dim: #9ca3af;

  --paper: #ffffff;
  --paper-soft: #fafafa;
  --ground: #f1f2f4;
  --line: #e5e7eb;
  --line-strong: #d1d5db;

  --black: #050505;
  --accent: #10b981;
  --accent-soft: #ecfdf5;
  --accent-border: #a7f3d0;
  --accent-deep: #065f46;
  --info-soft: #eff6ff;
  --info-ink: #1e40af;
  --danger: #b91c1c;

  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 20px 60px -15px rgba(16, 24, 40, .22);
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--ground); min-height: 100%; }
body {
  font-family: 'Noto Sans KR', 'Inter', -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--dim); }
::selection { background: var(--accent-soft); }

/* ── 상단 바 (검정 밴드) ──────────────────── */
.topbar {
  background: var(--black); color: #fff;
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; position: relative;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.wordmark { display: flex; align-items: center; gap: 14px; }
.wordmark .logo { font-weight: 700; letter-spacing: .09em; font-size: 14px; }
.wordmark .divider { color: rgba(255, 255, 255, .25); font-weight: 300; }
.wordmark .service { font-size: 12px; color: rgba(255, 255, 255, .7); font-family: var(--mono); letter-spacing: .05em; }
.topbar .session { font-size: 12px; color: rgba(255, 255, 255, .6); display: flex; gap: 16px; align-items: center; }
.topbar .session .pill {
  border: 1px solid var(--accent-border); background: rgba(16, 185, 129, .12);
  border-radius: 6px; padding: 4px 12px; color: #6ee7b7; font-weight: 600;
  font-size: 12px;
}
.session-link { transition: color .15s; }
.session-link:hover { color: var(--accent); }

/* ── 앱 레이아웃 (사이드바 + 본문) ────────── */
.app-layout { display: flex; align-items: flex-start; min-height: calc(100vh - 60px); }
.sidebar {
  width: 260px; min-width: 260px; background: var(--black); color: #fff;
  height: calc(100vh - 60px); position: sticky; top: 60px;
  padding: 22px 14px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.sidebar:empty { display: none; }
.sidebar-label {
  font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .45);
  padding: 4px 12px 10px;
}
.side-item {
  display: block; padding: 11px 13px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  color: rgba(255, 255, 255, .68); border: 1px solid transparent; transition: all .15s; position: relative;
}
.side-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side-item.on {
  background: rgba(16, 185, 129, .12); color: #fff; border-color: var(--accent-border); font-weight: 600;
}
.side-item.on::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  background: var(--accent); border-radius: 0 2px 2px 0;
}
.side-item .side-sub { display: block; font-size: 11px; color: rgba(255, 255, 255, .4); margin-top: 2px; font-family: var(--mono); }
.sidebar-foot {
  margin-top: auto; padding: 14px 13px 4px; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 12px; color: rgba(255, 255, 255, .4); display: flex;
  justify-content: space-between; align-items: center; gap: 8px;
}
.sidebar-foot a { transition: color .15s; }
.sidebar-foot a:hover { color: var(--accent); }
.main-content { flex: 1; min-width: 0; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; margin-right: 2px; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; }
.nav-toggle span + span { margin-top: 4px; }
.scrim { display: none; }

.page { max-width: 1060px; margin: 0 auto; padding: 28px 20px 72px; }
/* 급여 대장에 야근·자녀보육·조정 칸이 붙는 달은 실지급액까지 한눈에 보이게 넓힌다 */
.page.wide { max-width: 1280px; }

/* ── 입구(로그인) ─────────────────────────── */
.stage { display: flex; align-items: center; justify-content: center; padding: 8vh 20px 40px; }
.gate {
  width: 432px; max-width: 100%;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 44px 42px 38px;
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.gate::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), transparent); }
.gate .brand { font-weight: 700; letter-spacing: .12em; font-size: 13px; color: var(--ink); margin-bottom: 26px; }
.gate h1 { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 9px; }
.gate .lead { font-size: 13.5px; color: var(--muted); margin-bottom: 24px; line-height: 1.75; }
.gate .hint { font-size: 12px; color: var(--dim); margin-top: 20px; line-height: 1.75; }
.foot { text-align: center; padding: 26px; font-size: 12px; color: var(--dim); }
.error {
  color: var(--danger); font-size: 13px; margin: 12px 0 0;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 9px 12px;
}

/* ── 폼 ───────────────────────────────────── */
.field { margin-top: 14px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 11px 14px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, .14);
}
.gate .field input { font-size: 16px; }
.gate .field input[type="password"] { letter-spacing: .22em; }
.enter {
  width: 100%; margin-top: 20px; background: var(--black); color: #fff;
  border: none; border-radius: 8px; padding: 13px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .15s, transform .05s; font-family: inherit;
}
.enter:hover { background: var(--accent-deep); }
.enter:active { transform: translateY(1px); }
textarea { resize: vertical; line-height: 1.6; }

/* ── 보고서 머리 (검정 밴드 위 흰 종이) ──── */
.report-head {
  background: var(--black); color: #fff; border-radius: var(--radius);
  padding: 34px 34px 30px; display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 16px; flex-wrap: wrap; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.report-head::after {
  content: ""; position: absolute; left: 34px; right: 34px; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
/* 헤더 격자 텍스처 (원본 report-header::before) */
.report-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background-size: 20px 20px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, .02) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255, 255, 255, .02) 1px, transparent 1px);
}
.report-head > * { position: relative; }
.report-head .eyebrow {
  font-size: 11px; letter-spacing: .12em; font-weight: 600; margin-bottom: 12px;
  color: var(--accent); font-family: var(--mono); text-transform: uppercase;
}
.report-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; color: #fff; }
.report-head .sub { color: rgba(255, 255, 255, .68); font-size: 13px; margin-top: 12px; }
.recipient { text-align: right; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.recipient .tag {
  background: rgba(16, 185, 129, .12); color: #6ee7b7; border: 1px solid var(--accent-border);
  font-weight: 600; font-size: 12px; padding: 5px 12px; border-radius: 6px; white-space: nowrap;
}
.recipient .issued { font-size: 12px; color: rgba(255, 255, 255, .5); }

/* ── 월 선택 ──────────────────────────────── */
.month-row { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.month-chip {
  background: var(--paper); border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 15px; font-size: 13px; color: var(--muted); font-weight: 500; transition: all .15s;
}
.month-chip:hover { border-color: var(--accent-border); color: var(--accent-deep); background: var(--accent-soft); }
.month-chip.active { background: var(--black); border-color: var(--black); color: #fff; font-weight: 600; }

/* ── 지표 카드 ────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 16px; position: relative; overflow: hidden; transition: border-color .15s;
}
.kpi:hover { border-color: var(--line-strong); }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.kpi .label {
  font-size: 12.5px; color: var(--muted); margin-bottom: 9px; font-weight: 500;
}
.kpi .value { font-size: 23px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .value .unit { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi .delta { font-size: 12px; margin-top: 8px; color: var(--dim); }
.kpi .delta.up { color: var(--accent-deep); font-weight: 600; }

/* ── 카드(흰 종이) ────────────────────────── */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 30px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.card h2 {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 5px;
  padding-left: 12px; position: relative;
}
.card h2::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px;
  background: var(--accent); border-radius: 2px;
}
.card .desc { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.65; padding-left: 12px; }
.card > ul:not(.note-list), .card > ol { margin: 8px 0 0 12px; padding-left: 20px; list-style-position: outside; }
.card > ul:not(.note-list) > li, .card > ol > li { margin: 4px 0; }
.subhead {
  font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 10px;
}
.two-col-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 12px; }
.two-col-inner > * { min-width: 0; }

/* ── 표 (검은 머리행 + 모노 캡션) ─────────── */
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.roadmap-compare { table-layout: fixed; width: 100%; }
table.roadmap-compare th, table.roadmap-compare td { white-space: normal; text-align: left; vertical-align: top; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.65; }

/* R16 계획과 월별 보고 현황을 하나의 시간축에 배치 */
.roadmap-gantt { --gantt-label: 230px; --gantt-dev: #607d9d; --gantt-test: #b7791f; --gantt-operation: #16816b; position: relative; color: var(--ink-soft); }
.gantt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0 8px; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; }
.gantt-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-swatch { width: 18px; height: 8px; border-radius: 2px; }
.gantt-swatch.development { background: var(--gantt-dev); }
.gantt-swatch.testing { background: var(--gantt-test); }
.gantt-swatch.operation { background: var(--gantt-operation); }
.gantt-snapshot-key { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.gantt-expand { flex-shrink: 0; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); font: inherit; font-size: 12px; color: var(--ink-soft); cursor: pointer; }
.gantt-caption { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.gantt-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 8px; max-height: 880px; }
.gantt-grid { min-width: 930px; }
.gantt-axis { display: grid; grid-template-columns: var(--gantt-label) minmax(0,1fr); position: sticky; top: 0; z-index: 8; background: var(--paper); border-bottom: 1px solid var(--line-strong); }
.gantt-axis-label { font-size: 12px; font-weight: 600; padding: 20px 14px; position: sticky; left: 0; background: var(--paper); z-index: 9; border-right: 1px solid var(--line); }
.gantt-years { display: flex; height: 26px; font-size: 12px; background: var(--paper-soft); }
.gantt-years span { text-align: center; border-right: 1px solid var(--line); padding: 3px; }
.gantt-month-labels { display: grid; grid-template-columns: repeat(var(--gantt-months),1fr); height: 31px; font-size: 11px; }
.gantt-month-labels span { text-align: center; padding: 6px 0; border-left: 1px solid var(--line); }
.gantt-month-labels .current-month { background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; }
.gantt-group { background: var(--paper-soft); padding: 7px 14px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.gantt-row { display: grid; grid-template-columns: var(--gantt-label) minmax(0,1fr); border-bottom: 1px solid var(--line); min-height: 102px; }
.gantt-project { position: sticky; left: 0; z-index: 5; padding: 12px 14px; background: var(--paper); border-right: 1px solid var(--line); }
.gantt-project-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink); font-weight: 600; }
.gantt-project-heading b { color: var(--accent-deep); font-family: var(--mono); white-space: nowrap; }
.gantt-project-note { margin-top: 5px; font-size: 11px; line-height: 1.65; color: var(--muted); word-break: keep-all; }
.gantt-unreported { color: var(--dim); font-weight: 400; font-size: 11px; white-space: nowrap; }
.prj-dot.unknown, .sr-dot.unknown { background: var(--dim); }
.ppct.project-unreported, .sr-project-pct.sr-project-unreported { color: var(--muted); font-size: 11px; font-weight: 400; font-family: inherit; }
.gantt-track { position: relative; min-height: 102px; background: repeating-linear-gradient(to right,var(--line) 0,var(--line) 1px,transparent 1px,transparent calc(100% / var(--gantt-months))); }
.gantt-current-guide { position: absolute; left: var(--gantt-now); top: 0; bottom: 0; border-left: 1px dashed var(--accent); opacity: .65; }
.gantt-lane-label { position: absolute; left: 6px; font-size: 10px; color: var(--dim); z-index: 1; background: var(--paper); padding: 0 2px; }
.plan-label { display: none; }.actual-label { top: 76px; }
.gantt-bar { position: absolute; height: 16px; line-height: 16px; font-size: 11px; border-radius: 3px; color: var(--paper); text-align: center; white-space: nowrap; overflow: hidden; padding: 0 2px; min-width: 3px; }
.gantt-bar.development { top: 8px; background: var(--gantt-dev); }
.gantt-bar.testing { top: 28px; background: var(--gantt-test); }
.gantt-bar.operation { top: 48px; background: var(--gantt-operation); }
.gantt-no-plan { position: absolute; left: 14%; top: 25px; color: var(--dim); font-size: 11px; }
.gantt-snapshot { position: absolute; top: 75px; display: flex; align-items: center; gap: 6px; font-size: 11px; line-height: 18px; white-space: nowrap; transform: translateX(-4px); }
.gantt-snapshot i { width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%; background: var(--accent); }
.gantt-snapshot > span { padding: 0 5px; background: var(--accent-soft); color: var(--accent-deep); border-radius: 3px; }
.gantt-snapshot.progress i { background: var(--info-ink); }.gantt-snapshot.progress > span { background: var(--info-soft); color: var(--info-ink); }
.gantt-snapshot.waiting i, .gantt-snapshot.unknown i { background: var(--dim); }.gantt-snapshot.waiting > span, .gantt-snapshot.unknown > span { background: var(--paper-soft); color: var(--muted); }
.roadmap-gantt.gantt-expanded { position: fixed; inset: 14px; padding: 20px; z-index: 2000; background: var(--paper); box-shadow: var(--shadow-md); border-radius: 10px; }
.gantt-expanded .gantt-scroll { max-height: calc(100vh - 130px); }
@media (max-width: 860px) { .roadmap-gantt { --gantt-label: 200px; }.gantt-toolbar { align-items: flex-start; }.gantt-grid { min-width: 930px; } }
@media print { .gantt-expand { display: none; }.gantt-scroll { max-height: none; overflow: visible; border: 0; }.gantt-grid { min-width: 0; }.roadmap-gantt { --gantt-label: 170px; }.gantt-axis, .gantt-project { position: static; }.gantt-row { break-inside: avoid; }.gantt-bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }.gantt-snapshot { font-size: 9px; }.gantt-project-note { font-size: 9px; } }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 4px 0 0; }
thead tr { background: var(--black); }
th {
  text-align: right; font-size: 12px; color: #fff; font-weight: 500;
  padding: 11px 12px; white-space: nowrap;
}
th:first-child { border-radius: 6px 0 0 6px; }
th:last-child { border-radius: 0 6px 6px 0; }
th.l, td.l { text-align: left; }
td {
  text-align: right; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  font-variant-numeric: tabular-nums; color: var(--ink-soft);
}
td.l { white-space: normal; word-break: keep-all; }
tbody tr:hover td { background: var(--paper-soft); }
tr.total td {
  border-top: 2px solid var(--ink); border-bottom: none; font-weight: 700; color: var(--ink);
  background: var(--accent-soft); padding-top: 13px; padding-bottom: 13px;
}
tr.total:hover td { background: var(--accent-soft); }
td .name { font-weight: 600; color: var(--ink); }
td .role { color: var(--dim); font-size: 12px; margin-left: 7px; }

/* ── 요약 목록 ────────────────────────────── */
.note-list { list-style: none; margin-top: 12px; }
.note-list li {
  padding: 11px 0 11px 20px; position: relative; font-size: 13.5px;
  border-bottom: 1px solid var(--line); line-height: 1.65; color: var(--ink-soft);
}
.note-list li:last-child { border-bottom: none; padding-bottom: 2px; }
.note-list li::before {
  content: ""; position: absolute; left: 2px; top: 19px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}

/* ── 프로젝트 현황 (상태 점 + 짧은 막대 + 하위 태그) ── */
.projects { display: flex; flex-direction: column; }
.prj-row { padding: 17px 0; border-bottom: 1px solid var(--line); }
.prj-row:last-child { border-bottom: none; padding-bottom: 2px; }
.prj-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.prj-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 2px; background: #3b82f6; }
.prj-dot.done { background: var(--accent); }
.prj-dot.progress { background: #3b82f6; }
.prj-dot.waiting { background: #94a3b8; }
.pname { font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: -.01em; }
.prj-group {
  font-size: 10.5px; font-family: var(--mono); color: var(--dim); letter-spacing: .04em;
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px;
}
.prj-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pbar { width: 110px; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pfill { display: block; height: 100%; background: #3b82f6; border-radius: 99px; }
.pfill.done { background: var(--accent); }
.pfill.waiting { background: #94a3b8; }
.ppct { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }
.pmeta { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--dim); line-height: 1.65; margin-top: 7px; padding-left: 17px; }
.pmeta > span:first-child {
  font-weight: 600; color: var(--muted); font-size: 12px;
}
.pmeta .pnote { color: var(--ink-soft); font-size: 13px; }
.prj-subs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; padding-left: 17px; }
.sub-tag {
  display: inline-flex; align-items: center; padding: 3px 9px; font-size: 11px; font-weight: 600;
  background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; border-radius: 5px;
}
.sub-tag.done { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-border); }
.sub-tag.progress { background: var(--info-soft); color: var(--info-ink); border-color: #bfdbfe; }
.sub-tag.waiting { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }

/* 보고서 머리 코너 액센트 */
.corner { position: absolute; width: 12px; height: 12px; border: 1px solid rgba(255, 255, 255, .18); }
.corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }

/* 나란한 2단 카드 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col > * { min-width: 0; margin-bottom: 16px; }

/* ── 첨부 ─────────────────────────────────── */
.files { display: flex; flex-direction: column; gap: 8px; }
.file {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 9px; padding: 12px 15px; gap: 12px;
  transition: border-color .15s, background .15s;
}
.file:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.file .meta { display: flex; align-items: center; gap: 13px; min-width: 0; }
.file .ext {
  width: 40px; height: 40px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-deep);
  font-size: 9.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--mono); border: 1px solid var(--accent-border);
}
.file .fname { font-weight: 500; font-size: 13.5px; word-break: break-all; color: var(--ink); }
.file .fsize { font-size: 12px; color: var(--dim); margin-top: 1px; }
.file .dl {
  border: 1px solid var(--ink); color: var(--ink); background: #fff; border-radius: 7px;
  padding: 7px 16px; font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: all .15s;
}
.file .dl:hover { background: var(--black); color: #fff; }

/* ── 고지 ─────────────────────────────────── */
.notice { font-size: 12px; color: var(--dim); line-height: 1.8; }
.notice b { color: var(--muted); font-weight: 600; }

/* ── 관리자 상단 메뉴 ─────────────────────── */
.adminnav {
  max-width: 1100px; margin: 20px auto 0; padding: 0 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.adminnav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.adminnav-links a {
  padding: 9px 17px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: var(--paper); border: 1px solid var(--line); transition: all .15s;
}
.adminnav-links a:hover { border-color: var(--accent-border); color: var(--accent-deep); background: var(--accent-soft); }
.adminnav-links a.on { background: var(--black); border-color: var(--black); color: #fff; }
.adminnav-logout { font-size: 12.5px; color: var(--dim); transition: color .15s; }
.adminnav-logout:hover { color: var(--danger); }

/* ── 요율 설정 ────────────────────────────── */
.set-input {
  width: 190px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 14px;
  font-size: 14px; text-align: right; font-variant-numeric: tabular-nums;
  background: #fff; color: var(--ink); font-family: inherit; transition: all .15s;
}
.set-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); }
.set-table td { padding: 12px 10px; vertical-align: middle; }
.set-table tbody tr:hover td { background: transparent; }
.set-table .set-label { font-weight: 500; font-size: 14px; color: var(--ink); }
.set-table .set-hint { color: var(--dim); font-size: 12px; margin-top: 2px; }

/* ── 탭 · 버튼 · 모달 ─────────────────────── */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab {
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 17px;
  font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.tab:hover { border-color: var(--accent-border); color: var(--accent-deep); background: var(--accent-soft); }
.tab.active { background: var(--black); border-color: var(--black); color: #fff; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.minibtn {
  background: var(--black); color: #fff; border: none; border-radius: 7px; padding: 8px 15px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .15s;
}
.minibtn:hover { background: var(--accent-deep); }
.minibtn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.minibtn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }
input.cell {
  width: 84px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 13px;
  text-align: right; font-variant-numeric: tabular-nums; font-family: inherit;
  background: #fff; color: var(--ink); transition: all .15s;
}
input.cell:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); }
.dot-ok { color: var(--accent); font-size: 11px; }
/* 칸 많은 표(급여 입력·급여 대장)는 촘촘하게 */
#pay-table th, #pay-table td, table.dense th, table.dense td { padding: 9px 7px; }
#pay-table th, table.dense th { font-size: 10px; }
table.dense { font-size: 12.5px; }
table.dense td.l { min-width: 96px; }

/* ── 주주 월간보고서: 기존 lifeengine-docs/viewer.html 구조 이식 ── */
.sr-page { width: 100%; max-width: 960px; margin: 0 auto; padding: 28px 20px 72px; }
.print-action {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  border: 0; border-radius: 999px; padding: 12px 20px;
  background: var(--black); color: #fff; font: inherit; font-weight: 700;
  cursor: pointer; box-shadow: var(--shadow-md);
}
.print-action:hover { background: var(--accent-deep); }
.sr-paper {
  overflow: hidden; background: #fff; color: #1a1a2e; border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.12), 0 20px 60px -15px rgba(16,24,40,.22);
}
.sr-head {
  position: relative; padding: 46px 54px; color: #fff;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}
.sr-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}
.sr-company { margin-bottom: 12px; color: #94a3b8; font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.sr-head h1 { margin: 0 0 22px; color: #fff; font-size: 32px; line-height: 1.25; font-weight: 800; letter-spacing: -.5px; }
.sr-meta { display: flex; flex-wrap: wrap; gap: 32px; }
.sr-meta > div { display: flex; flex-direction: column; gap: 3px; }
.sr-meta span { color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.sr-meta b { color: #e2e8f0; font-size: 14px; font-weight: 500; }
.sr-body { padding: 46px 54px; color: #2d3748; font-size: 15px; line-height: 1.8; }
.sr-body section > h1 {
  margin: 36px 0 18px; padding-bottom: 9px; border-bottom: 2px solid #e2e8f0;
  color: #1a1a2e; font-size: 22px; line-height: 1.35; font-weight: 800;
}
.sr-body section:first-child > h1 { margin-top: 0; }
.sr-body h2 {
  display: flex; align-items: center; gap: 8px; margin: 26px 0 11px;
  color: #2563eb; font-size: 17px; font-weight: 700;
}
.sr-body h2::before { content: ""; width: 4px; height: 18px; flex-shrink: 0; border-radius: 2px; background: linear-gradient(180deg,#3b82f6,#06b6d4); }
.sr-body hr { height: 1px; margin: 32px 0; border: 0; background: linear-gradient(90deg,transparent,#e2e8f0,transparent); }
.sr-body p { margin: 8px 0; color: #374151; }
.sr-body ul { margin: 8px 0; padding-left: 20px; }
.sr-body li { margin: 4px 0; color: #374151; font-size: 14px; }
.sr-body li::marker { color: #3b82f6; }
.sr-section-desc { color: #64748b !important; font-size: 13px; }

.sr-table-scroll { width: 100%; overflow-x: auto; }
.sr-body table { width: 100%; min-width: 580px; margin: 12px 0 20px; border-collapse: collapse; font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.sr-body thead tr { background: linear-gradient(135deg,#1a1a2e,#16213e); }
.sr-body th { padding: 12px 18px; color: #fff; font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.sr-body tbody tr { border-bottom: 1px solid #f1f5f9; }
.sr-body tbody tr:hover { background: #f8fafc; }
.sr-body td { padding: 10px 18px; color: #374151; text-align: left; white-space: normal; }
.sr-body th:nth-child(2), .sr-body td:nth-child(2) { width: 24%; text-align: right; font-variant-numeric: tabular-nums; }
.sr-body th:nth-child(3), .sr-body td:nth-child(3) { width: 34%; }
.sr-body tr.sr-total td { border-top: 2px solid #1a1a2e; border-bottom: 0; background: #eff6ff; color: #1a1a2e; }

.sr-project { padding: 16px 0; border-bottom: 1px solid #e2e8f0; }
.sr-project:last-child { border-bottom: 0; }
.sr-project-top { display: flex; align-items: center; gap: 12px; }
.sr-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #3b82f6; }
.sr-dot.done { background: #10b981; }
.sr-dot.waiting { background: #94a3b8; }
.sr-project-info { flex: 1; min-width: 0; }
.sr-project-name { color: #1e293b; font-size: 17px; font-weight: 700; }
.sr-project-group { display: inline-block; margin-left: 8px; padding: 1px 7px; border: 1px solid #e2e8f0; border-radius: 4px; color: #94a3b8; font: 10px/1.6 var(--mono); vertical-align: middle; }
.sr-project-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.sr-project-pct { color: #1e293b; font-size: 18px; font-weight: 800; }
.sr-project-date { max-width: 180px; color: #64748b; font-size: 13px; text-align: right; }
.sr-project-bar { width: 100px; height: 5px; overflow: hidden; border-radius: 3px; background: #e2e8f0; }
.sr-project-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg,#3b82f6,#06b6d4); }
.sr-project-bar span.done { background: #10b981; }
.sr-project-bar span.waiting { background: #94a3b8; }
.sr-project-desc { margin-top: 7px; padding-left: 20px; color: #374151; font-size: 14px; line-height: 1.65; }
.sr-project-subs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; padding-left: 20px; }
.sr-project-subs span { display: inline-flex; padding: 2px 9px; border: 1px solid #e2e8f0; border-radius: 20px; background: #f8fafc; color: #64748b; font-size: 11px; font-weight: 600; }
.sr-project-subs span.done { border-color: #d1fae5; background: #ecfdf5; color: #065f46; }
.sr-project-subs span.progress { border-color: #dbeafe; background: #eff6ff; color: #1e40af; }
.sr-notice { margin-top: 36px; padding-top: 22px; border-top: 1px solid #e2e8f0; }

@media (max-width: 860px) {
  .sr-page { padding: 16px 12px 48px; }
  .sr-head { padding: 30px 24px; }
  .sr-head h1 { font-size: 25px; }
  .sr-meta { gap: 18px; }
  .sr-body { padding: 28px 24px; font-size: 14px; }
  .sr-body section > h1 { font-size: 19px; margin-top: 28px; }
  .sr-project-top { align-items: flex-start; }
  .sr-project-name { font-size: 15px; }
  .sr-project-right { min-width: 78px; }
  .sr-project-bar { width: 76px; }
  .sr-project-date { max-width: 110px; font-size: 11px; }
  .sr-project-desc, .sr-project-subs { padding-left: 0; }
}

@media print {
  .sr-page { max-width: none; padding: 0; }
  .sr-paper { border-radius: 0; box-shadow: none; }
  .sr-head { padding: 24px 30px; }
  .sr-body { padding: 26px 30px; }
  .sr-project { break-inside: avoid; }
}
.modal {
  position: fixed; inset: 0; background: rgba(5, 5, 5, .55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal[hidden] { display: none; }
.tabpane[hidden] { display: none; }
.modal-box {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 30px; width: 640px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-box h2 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.admin-result {
  background: var(--paper-soft); border: 1px solid var(--line); border-radius: 8px; padding: 14px;
  font-size: 12px; white-space: pre-wrap; word-break: break-all; color: var(--ink-soft);
  font-family: var(--mono); line-height: 1.6;
}

/* ── 모바일 (관리·열람 모두 사용 가능하게) ── */
@media (max-width: 860px) {
  body { font-size: 14.5px; }
  .topbar { padding: 0 14px; height: 56px; }
  .wordmark { gap: 9px; }
  .wordmark .service { display: none; }
  .nav-toggle { display: block; }

  /* 사이드바 → 서랍식 */
  .app-layout { display: block; min-height: auto; }
  .sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0; z-index: 60;
    width: 78vw; max-width: 290px; height: auto;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 50px rgba(0, 0, 0, .55); }
  body.nav-open .scrim {
    display: block; position: fixed; inset: 56px 0 0; background: rgba(5, 5, 5, .5); z-index: 55;
  }
  .main-content { width: 100%; }
  .page { padding: 18px 12px 56px; max-width: 100%; }

  /* 카드·머리 */
  .report-head { padding: 22px 18px 20px; }
  .report-head::after { left: 18px; right: 18px; }
  .report-head h1 { font-size: 20px; }
  .report-head .sub { font-size: 11.5px; }
  .recipient { align-items: flex-start; text-align: left; }
  .card { padding: 18px 15px; }
  .card h2 { font-size: 15.5px; }
  .card .desc { font-size: 12.5px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 14px 14px 12px; }
  .kpi .value { font-size: 19px; }
  .two-col-inner, .two-col { grid-template-columns: 1fr; gap: 22px; }
  .two-col { gap: 0; }
  .admin-grid { grid-template-columns: 1fr; }
  .gate { padding: 30px 20px 26px; }
  .stage { padding: 5vh 14px 30px; }

  /* 프로젝트 */
  .prj-right { margin-left: 0; width: 100%; justify-content: flex-end; margin-top: 4px; }
  .pmeta, .prj-subs { padding-left: 0; }

  /* 표: 화면 밖으로 넘치지 않게 가로 스크롤 */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -15px; padding: 0 15px; }
  table { font-size: 12.5px; }
  th, td { padding: 8px 7px; }

  /* 급여 입력: 표 대신 직원별 카드 */
  .tabs { gap: 5px; }
  .tab { padding: 8px 12px; font-size: 12.5px; }
  .pay-meta { width: 100%; }
  .pay-meta input { flex: 1; min-width: 0; }
  input.cell { width: 100%; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { border-radius: 14px 14px 0 0; max-height: 92vh; padding: 22px 18px; width: 100%; }
  .row-between { gap: 8px; }
  .minibtn { padding: 8px 12px; font-size: 12.5px; }
}

/* 아주 좁은 화면 */
@media (max-width: 420px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .report-head h1 { font-size: 18.5px; }
  .adminnav-links a { font-size: 12.5px; }
}

/* ── 인쇄 (회계 제출·보관용) ──────────────── */
@media print {
  @page { size: A4 portrait; margin: 9mm; }
  html, body { background: #fff; }
  .topbar, .sidebar, .scrim, .print-action, .adminnav, .month-row, .tabs, .file .dl, .minibtn, .enter { display: none !important; }
  .app-layout { display: block; min-height: 0; }
  .main-content { width: 100%; }
  .page { max-width: 100%; padding: 0; }
  .report-head, .card { box-shadow: none; break-inside: auto; page-break-inside: auto; }
  .report-head { margin-bottom: 0; border-radius: 0; }
  .card { border: 0; border-radius: 0; margin: 0; padding: 16px 0; }
  .prj-row, .kpi, tr { break-inside: avoid; page-break-inside: avoid; }
  .report-head, thead tr, .kpi::after, .pfill, .note-list li::before, .card h2::before {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  table { page-break-inside: auto; font-size: 11.5px; }
  a { color: #000; }
}

/* 급여 입력 상단 월/지급일 */
.pay-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-meta label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.pay-meta input { border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 11px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); }
.pay-meta input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.14); }

/* 모바일 급여 입력 카드 */
.pay-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.pc-head { font-size: 15px; margin-bottom: 10px; }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.pc-field { display: block; }
.pc-field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pc-calc { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-calc b { color: var(--ink); }
.pc-net { margin-left: auto; color: var(--accent-deep); }

/* 표 밖에서도 직급 표기 간격 유지 */
.role { color: var(--dim); font-size: 12px; margin-left: 7px; font-weight: 500; }

@media (max-width: 860px) {
  /* 귀속월·지급일이 눌리지 않게 줄바꿈 배치 */
  .pay-meta { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 8px; align-items: center; }
  .pay-meta input { width: 100% !important; }
  .pay-meta .minibtn { grid-column: 1 / -1; justify-self: stretch; margin-top: 2px; }
  .card .row-between { align-items: flex-start; flex-direction: column; }
  .card .row-between .minibtn, .card .row-between > a.minibtn { align-self: stretch; text-align: center; }
}
