/* 화면 디자인 — Asana 레퍼런스 디자인 시스템(2026)을 ERP 에 맞게 옮긴 것(2026-09-30 하나 님 요청).
   가져온 것: 흰 바탕 + 먹색(#0d0d0d) 글, 검은 알약(pill) 버튼, 그림자 대신 가는 선(#e7e7e7), 가벼운(300) 큰 제목,
   시그니처 색은 회사 로고 남색(#1b365d — 하나 님 요청). 남색이 화면을 덮지 않게(2026-09-30 하나 님 요청):
   꽉 찬 남색은 화면마다 가장 중요한 버튼 하나(등록 · 저장 · 확정)에만, 작은 버튼은 흰 바탕 + 남색 테두리,
   현재 메뉴는 옅은 남색 바탕. 보조색은 남색과 어울리는 샴페인 골드(GP · 현행 · 예정 표시), 코랄은 주의 표시에만. 바꾼 것: 글꼴은 한글이 되는 Pretendard(OFL, fonts/LICENSE.txt),
   간격은 자료가 많은 업무 화면이라 마케팅 페이지(80~120px)보다 촘촘하게. 로고·이름은 쓰지 않는다. */

@font-face { font-family: 'Pretendard'; font-weight: 300; font-display: swap; src: url('/fonts/Pretendard-Light.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 400; font-display: swap; src: url('/fonts/Pretendard-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 500; font-display: swap; src: url('/fonts/Pretendard-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 600; font-display: swap; src: url('/fonts/Pretendard-SemiBold.woff2') format('woff2'); }

:root {
  --brand: #1b365d;
  --brand-hover: #2e4b78;
  --brand-soft: #e9eef6;
  --brand-line: #c5cfdc;
  --gold: #b08d57;
  --gold-soft: #f5eee2;
  --gold-deep: #7a5c2e;
  --info-soft: #e6eef7;
  --info-deep: #2c4a70;
  --ink: #0d0d0d;
  --heading: #0d0e10;
  --body: #646f79;
  --muted: #9ca6af;
  --hairline: #e7e7e7;
  --surface: #f3f3f3;
  --surface-alt: #fafafa;
  --hover-dark: #6e6e6e;
  --coral: #f06a6a;
  --coral-blush: #ffeaec;
  --coral-deep: #690031;
  --sky: #cbefff;
  --violet: #222875;
  --green: #24a651;
  --input-border: #e1e1e1;
  --input-hover: #c6c6c6;
  --focus-ring: #4075cf;
  --radius-card: 16px;
  --radius-modal: 20px;
  --pill: 100px;
  --fast: 100ms;
  --standard: 200ms;
  --ease-enter: cubic-bezier(0.2, 0.6, 0.25, 1);
  font-family: 'Pretendard', 'Helvetica Neue', Helvetica, 'Malgun Gothic', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
/* header 처럼 display 를 준 요소도 hidden 속성이면 숨긴다(로그인 화면 머리글, IC 결과 칸 전환). */
[hidden] { display: none !important; }
body { margin: 0; background: #fff; }
::selection { background: var(--sky); }

/* ---------- 머리글 ---------- */
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 12px 28px; background: #fff; border-bottom: 1px solid var(--hairline);
}
header form { margin: 0; }
.brand { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 6px; color: var(--body); }
.brand span, .brand-strong { color: var(--brand); font-weight: 600; }
.brand::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 3px 3px 0 -1px var(--gold); margin-right: 4px; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px;
  padding: 8px 16px; border-radius: var(--pill); transition: background var(--fast);
}
nav a:hover { background: var(--surface); }
nav a.on { background: var(--brand-soft); color: var(--brand); }
#who { font-size: 13px; color: var(--body); }

/* ---------- 본문 ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 36px 28px 80px; }
h1 { font-size: 32px; font-weight: 300; letter-spacing: -0.01em; line-height: 1.2; margin: 0; color: var(--heading); }
h2 { font-size: 20px; font-weight: 400; letter-spacing: -0.01em; margin: 0; color: var(--heading); }
h3 { font-size: 12px; font-weight: 500; color: var(--body); margin: 6px 0; letter-spacing: 0.02em; }
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.bar .grow, .grow { flex: 1; }
.muted { color: var(--body); }
.help { color: var(--body); font-size: 13px; line-height: 1.6; margin: 6px 0 14px; }
label .help { margin: 4px 0 0; font-size: 12px; }
.empty { padding: 36px 24px; text-align: center; color: var(--body); margin: 0; }

.card { background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius-card); overflow-x: auto; }
.card.pad, .pad { padding: 18px 22px; }
.block { margin-top: 36px; }
.block > .bar { margin-bottom: 12px; }

/* ---------- 표 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--hairline); white-space: nowrap; vertical-align: middle; }
th { font-weight: 500; color: var(--body); font-size: 12px; letter-spacing: 0.02em; background: var(--surface-alt); }
tbody tr { transition: background var(--fast); }
tbody tr:hover { background: var(--surface-alt); }
tr:last-child td, tr:last-child th { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 160px; line-height: 1.5; }
td.actions-cell { text-align: right; white-space: nowrap; }
td.actions-cell button, td.actions-cell .button { margin-left: 4px; }
table.kv th { width: 220px; background: transparent; font-size: 13px; }
table.kv tbody tr:hover { background: transparent; }

/* ---------- 태그(배지) ---------- */
.tag {
  display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 9999px;
  background: var(--info-soft); color: var(--info-deep); text-decoration: none; white-space: nowrap;
}
.tag.gold { background: var(--gold-soft); color: var(--gold-deep); }
.tag.warn { background: var(--coral-blush); color: var(--coral-deep); }
.tag.done { background: var(--surface); color: var(--body); }
.tag.ok { background: #e4efe7; color: #466451; }

/* ---------- 버튼(모두 알약) ---------- */
button, .button {
  font: inherit; font-size: 14px; font-weight: 500; border: 0; border-radius: var(--pill);
  height: 40px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}
button:hover, .button:hover { background: var(--brand-hover); }
button.sub, .button.sub { background: var(--surface); color: var(--ink); }
button.sub:hover, .button.sub:hover { background: var(--hairline); }
button.danger { background: var(--coral-blush); color: var(--coral-deep); }
button.danger:hover { background: #ffd6da; }
button.sm, .button.sm { height: 32px; padding: 0 14px; font-size: 13px; }
button.sm:not(.sub):not(.danger), .button.sm:not(.sub) {
  background: #fff; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-line);
}
button.sm:not(.sub):not(.danger):hover, .button.sm:not(.sub):hover { background: var(--brand-soft); }
button.sm:not(.sub):not(.danger):disabled { background: #fff; }

/* 세그먼트(보드 / 전체 목록 같은 보기 전환) — 고른 칸만 흰색으로 떠오른다. */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border-radius: var(--pill); }
.seg a { padding: 6px 14px; border-radius: var(--pill); color: var(--body); font-size: 13px; font-weight: 500; text-decoration: none; transition: background var(--fast), color var(--fast); }
.seg a:hover { color: var(--ink); }
.seg.seg-wrap { flex-wrap: wrap; border-radius: 18px; margin-bottom: 18px; }
h1.fund-title { font-size: 28px; }
.seg a.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10); }
button:disabled, button:disabled:hover { opacity: 0.3; cursor: default; background: var(--brand); }
button.sub:disabled { background: var(--surface); }
a.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; cursor: pointer; }
a.link:hover { text-decoration-color: var(--brand); color: var(--brand); }

/* ---------- 입력 ---------- */
select, input, textarea {
  font: inherit; font-size: 14px; color: #000; width: 100%;
  min-height: 36px; padding: 6px 12px; border: 1px solid var(--input-border); border-radius: 6px; background: #fff;
  transition: border-color var(--fast), box-shadow var(--fast);
}
select:hover, input:hover, textarea:hover { border-color: var(--input-hover); }
select:focus, input:focus, textarea:focus { outline: none; border-color: #888; box-shadow: 0 0 0 2px var(--focus-ring); }
textarea { line-height: 1.5; resize: vertical; }
.bar select { width: auto; min-width: 150px; }
.bar input.scope-folder { width: 14em; }
.bar input.search-input { width: 22em; max-width: 100%; }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- 대화상자 ---------- */
dialog {
  border: 0; border-radius: var(--radius-modal); padding: 0; width: min(720px, calc(100vw - 32px));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10), 0 0 0 1px var(--hairline);
}
dialog[open] { animation: dialog-in var(--standard) var(--ease-enter); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(13, 13, 13, 0.35); }
dialog form { padding: 28px; }
dialog h2 { font-size: 24px; font-weight: 300; margin: 0 0 18px; }
dialog h2 .muted { font-size: 16px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fields .full { grid-column: 1 / -1; }
label span, .field-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--ink); }
label em { color: var(--coral); font-style: normal; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
label.check span { display: inline; margin: 0; font-weight: 400; }
.doc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; margin-top: 8px; }
/* 조직도 — 상급자(manager_id)를 따라가는 중첩 목록. 따로 그리는 라이브러리 없이 들여쓰기로 보여 준다. */
.org-tree, .org-tree ul { list-style: none; margin: 0; padding-left: 28px; }
.org-tree { padding-left: 0; }
.org-tree li { margin: 10px 0; border-left: 1px solid var(--hairline); padding-left: 14px; }
.org-tree > li { border-left: 0; padding-left: 0; }
.org-node { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--hairline); border-radius: 10px; background: #fff; }
.org-node.blocked { opacity: 0.55; }
input.count { width: 72px; }

/* ---------- 알림 ---------- */
.error { color: var(--coral-deep); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
main > p.error, .block > p.error {
  background: var(--coral-blush); padding: 12px 18px; border-radius: 12px; margin: 0 0 16px;
}
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 8px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: var(--pill); font-size: 14px; font-weight: 500;
  opacity: 0; transition: opacity var(--standard) var(--ease-enter), transform var(--standard) var(--ease-enter); pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 로그인 ---------- */
.login { max-width: 560px; margin: 14vh auto; padding: 0 20px; }
.login h1 { font-size: 44px; white-space: nowrap; font-weight: 300; letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 14px; color: var(--body); }
.login h1 .brand-strong { font-weight: 500; }
.login p { font-size: 17px; }
.login .stack { display: grid; gap: 10px; margin-top: 32px; }
.login .stack .button { height: 52px; font-size: 16px; }

/* ---------- 요약 숫자 ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tile { background: var(--surface-alt); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 18px 20px; }
.tile span { display: block; font-size: 12px; font-weight: 500; color: var(--body); margin-bottom: 8px; }
.tile b { font-size: 24px; font-weight: 300; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tile.dates b { font-size: 18px; white-space: nowrap; }
.tile small { display: block; color: var(--body); margin-top: 6px; font-size: 12px; }
a.link-tile { color: var(--ink); text-decoration: none; transition: border-color var(--fast), background var(--fast); }
a.link-tile:hover { background: #fff; }
a.link-tile.on { background: #fff; border-color: var(--brand); }

/* ---------- 딜 보드 ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; }
.column { background: var(--surface); border-radius: var(--radius-card); padding: 14px; min-height: 240px; }
.column h2 { font-size: 14px; font-weight: 500; margin: 2px 4px 12px; }
.deal-card {
  display: block; background: #fff; border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  color: var(--ink); text-decoration: none; font-size: 13px; transition: box-shadow var(--standard) var(--ease-enter);
}
.deal-card:hover { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); border-color: var(--brand-line); }
.deal-card b { font-size: 15px; font-weight: 500; }
.deal-card small { display: block; color: var(--body); margin-top: 4px; }
.deal-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 10px 0 8px; }
.deal-card dt { color: var(--muted); }
.deal-card dd { margin: 0; }
.deal-card .round { border-top: 1px solid var(--hairline); padding-top: 8px; font-size: 12px; }
.empty-column { text-align: center; font-size: 13px; color: var(--muted); }

/* 투자관리 하위 메뉴 · 3칸 보드 */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin: -4px 0 22px; }
.subnav a { color: var(--body); text-decoration: none; font-weight: 500; padding: 10px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a.on { color: var(--brand); border-bottom-color: var(--brand); }
.board.board-3 { grid-template-columns: repeat(3, minmax(260px, 1fr)); }
.column-head { margin: 2px 4px 12px; }
.column-head h2 { margin: 0 0 4px; font-size: 16px; font-weight: 500; color: var(--brand); }
.column-head small { display: block; color: var(--body); font-size: 12px; line-height: 1.5; }
.error-inline { color: var(--coral-deep); }

/* 투자계약 */
.ai-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.ai-bar .help { margin: 6px 0 0; }
small.cell-note { display: block; color: var(--body); font-size: 12px; margin-top: 3px; }
tr.sub-row td { background: var(--surface-alt); padding-top: 8px; }
pre.terms { margin: 4px 0 0; font: inherit; font-size: 13px; white-space: pre-wrap; line-height: 1.6; }
.evidence { font-size: 12px; color: var(--body); margin-top: 6px; line-height: 1.5; }
.evidence .tag { font-size: 11px; padding: 1px 7px; margin-right: 4px; }
.notice { background: var(--coral-blush); color: var(--coral-deep); padding: 10px 14px; border-radius: 10px; font-size: 13px; margin: 0 0 10px; }
.alloc { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.alloc input { width: 170px; }
dialog.wide { width: min(960px, calc(100vw - 32px)); }

/* 운용지시 · 중복 확인 */
td.mono, .mono { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.dup-group { padding: 14px 18px; border-bottom: 1px solid var(--hairline); }
.dup-group:last-child { border-bottom: 0; }
.dup-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.dup-item { display: block; border: 1px solid var(--hairline); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: var(--surface-alt); transition: border-color var(--fast), background var(--fast); }
.dup-item.kept { background: #fff; border-color: var(--brand-line); }
.dup-item .dup-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dup-item .dup-head input { width: 16px; height: 16px; }
.dup-item > .muted { display: block; font-size: 13px; }
.dup-flag { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--gold-deep); background: var(--gold-soft); border-radius: 9999px; padding: 2px 9px; }
details > summary { cursor: pointer; color: var(--brand); font-weight: 500; }

.line-row { display: grid; grid-template-columns: 80px 1.2fr 2fr 1fr 150px; gap: 6px; margin-bottom: 8px; }
.line-row .manual { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.line-row .manual[hidden] { display: none; }
.asset-row { display: grid; grid-template-columns: 150px 1fr 90px 1fr 1.4fr; gap: 6px; align-items: center; margin-bottom: 6px; font-size: 13px; }
@media (max-width: 800px) { .line-row, .asset-row, .line-row .manual { grid-template-columns: 1fr; } }

/* ---------- IC 회차 ---------- */
.round-block { padding: 18px 22px; border-bottom: 1px solid var(--hairline); }
.round-block:last-child { border-bottom: 0; }
.round-block > .bar { margin-bottom: 10px; }
.round-block > .bar b { font-size: 16px; font-weight: 500; }
.round-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
ul.checklist { list-style: none; padding: 0; margin: 0; font-size: 13px; }
ul.checklist li { padding: 3px 0; }
ul.checklist li.ok { color: var(--green); }
ul.checklist li.no { color: var(--coral-deep); }
ul.checklist li.optional { color: var(--muted); }
pre.detail { margin: 0; font: inherit; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-width: 520px; color: var(--body); }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 800px) {
  header { padding: 10px 16px; gap: 10px; }
  main { padding: 24px 16px 60px; }
  h1 { font-size: 26px; }
  .board, .board.board-3 { grid-template-columns: 1fr; }
  .fields, .round-body, .doc-row { grid-template-columns: 1fr; }
  .login h1 { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
