/* 입시넷 업무 시스템 — 화면 스타일
 * 출처: mockup/assets/app.css (설계 기준). 설계안 전용인 띠·범위 배지만 빼고 그대로 가져왔다.
 * 톤: 운영 시스템형 — 흰 바탕 · 가는 선 · 작은 모서리(6·8px) · 넉넉한 줄 간격 · 550/650/750 굵기
 * 글자 크기 단계: Seed Design (daangn/seed-design, Apache-2.0)
 * 브랜드: 입시넷 보고서 확정 디자인(2026-06-25)의 남색 — 표 머리 #202d57 · 강조 칸 #415383 · 합계 줄 #e9effb
 */

/* 글꼴은 CDN 이 아니라 이 서버에서 준다. 렌더 컨테이너가 PDF 를 만들 때 밖으로 나가지 않아야
 * 글자가 바뀌지 않는다. 가변 폰트 한 벌(2MB)이라 subset 파일이 빠질 일이 없다.
 * Pretendard v1.3.9 · SIL Open Font License 1.1 (orioncactus/pretendard) */
@font-face {
  font-family: "Pretendard Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 45 920;
  src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations");
}

:root {
  /* 팔레트 — 화면 안 인라인 스타일도 이 이름을 쓴다 */
  --gray-00: #fff; --gray-100: #f7f8fa; --gray-200: #f0f2f5; --gray-300: #e8ebef; --gray-400: #d9dee5;
  --gray-500: #c5ccd5; --gray-600: #98a1ad; --gray-700: #7b8592; --gray-800: #5d6875; --gray-900: #364250; --gray-1000: #202731;
  --blue-100: #edf3fc; --blue-200: #dbe6f4; --blue-300: #c9d8ee; --blue-600: #4f7fc4; --blue-700: #2a5ea8; --blue-800: #285689; --blue-900: #2f4f78;
  --green-100: #eaf6ef; --green-300: #cfe7da; --green-700: #18755d; --green-900: #1f5e4b;
  --yellow-100: #fff6e6; --yellow-300: #ecd6ad; --yellow-500: #d2a24a; --yellow-700: #946013; --yellow-900: #6f4a12;
  --red-100: #fff2f0; --red-300: #efcfc9; --red-700: #b34236; --red-900: #8f352b;

  /* 입시넷 남색 */
  --brand-900: #202d57; --brand-800: #19244a; --brand-700: #415383; --brand-500: #6f7fa8;
  --brand-300: #b7c2dd; --brand-200: #d5ddef; --brand-100: #e9effb; --brand-50: #f5f8fd; --brand-dot: #fa3637;

  /* 의미 색 */
  --ink: #202731; --text: #364250;
  --fg-neutral: #202731; --fg-muted: #5d6875; --fg-subtle: #7b8592; --fg-placeholder: #98a1ad;
  --fg-brand: var(--brand-900); --fg-informative: #27508f; --fg-positive: #18755d; --fg-warning: #946013; --fg-critical: #b34236;
  --bg-page: #f7f8fa; --bg-layer: #fff; --bg-fill: #f5f7f9; --bg-weak: #f0f2f5; --bg-hover: #fafbfd; --bg-head: #f8f9fb;
  --stroke-weak: #d9dee5; --stroke-subtle: #e0e4e9; --stroke-soft: #edf0f3; --stroke-strong: #b9c3d0;
  --focus: #0059c7;
  --air: clamp(0px, calc((100vh - 760px) * .08), 18px); /* 화면 높이가 760px보다 남으면 간격이 넓어진다 (985px 이상 18px) */

  /* 간격 · 모서리 */
  --x1: 4px; --x1_5: 6px; --x2: 8px; --x2_5: 10px; --x3: 12px; --x4: 16px; --x5: 20px; --x6: 24px; --x8: 32px; --x10: 40px; --x12: 48px; --x14: 56px;
  --r1: 4px; --r1_5: 5px; --r2: 6px; --r2_5: 8px; --r3: 8px; --r4: 8px; --r5: 10px; --r6: 12px; --r-full: 9999px;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg-page);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--fg-informative); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; display: block; }
.num, .r { font-variant-numeric: tabular-nums; white-space: nowrap; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* 글자 */
.t2 { font-size: 12px; line-height: 1.5; } .t3 { font-size: 13px; line-height: 1.5; } .t4 { font-size: 14px; line-height: 1.5; }
.t5 { font-size: 16px; line-height: 1.45; } .t6 { font-size: 18px; line-height: 1.4; } .t7 { font-size: 20px; line-height: 1.4; }
.t8 { font-size: 22px; line-height: 1.35; } .t9 { font-size: 24px; line-height: 1.35; } .t10 { font-size: 26px; line-height: 1.35; }
.t12 { font-size: 32px; line-height: 1.3; }
.bold { font-weight: 700; } .medium { font-weight: 550; }
.muted { color: var(--fg-muted); } .subtle { color: var(--fg-subtle); } .brand { color: var(--fg-brand); }
.pos { color: var(--fg-positive); } .warn { color: var(--fg-warning); } .crit { color: var(--fg-critical); } .info { color: var(--fg-informative); }

/* 배치 */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.chev { color: #a3abb5; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.g-side { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.divider { height: 1px; background: var(--stroke-subtle); border: 0; margin: 0; }

/* ── 운영자 (PC) ─────────────────────────────── */
body.ops { min-width: 1240px; }
.ops-shell {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, #fff 0 239px, var(--stroke-subtle) 239px 240px, transparent 240px);
}
#sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--stroke-subtle); padding: 22px 12px 16px;
}
/* 로고 옆에 작은 이름표 — 밑에 따로 떨어뜨리면 두 덩이로 읽힌다(2026-09-21) */
.side-brand { display: flex; align-items: center; gap: 9px; padding: 0 14px 18px; }
.side-brand:hover { text-decoration: none; }
.side-brand img { height: 28px; width: auto; display: block; }
.side-brand span { position: relative; top: 2px; padding-left: 10px; font-size: 12.5px; line-height: 1.3;
  font-weight: 550; letter-spacing: -.1px; color: #7c8695; white-space: nowrap; }
.side-brand span::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 13px;
  transform: translateY(-50%); background: var(--stroke-soft); }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 6px 14px; border-radius: var(--r2);
  color: #555f6d; font-size: 16px; line-height: 1.4; font-weight: 450;
}
.nav-item .ic { width: 19px; height: 19px; color: #747e8a; }
.nav-item:hover { color: #1b2c55; text-decoration: none; }
.nav-item.is-active { color: #161d27; font-weight: 750; }
.nav-item.is-active .ic { color: var(--ink); }
.nav-divider { height: 1px; background: #e4e6eb; margin: 10px 14px; flex: none; }
.side-label { margin: 0 14px 4px; font-size: 12px; line-height: 1.5; color: #8a94a0; font-weight: 550; }
/* 메뉴 오른쪽 작은 표시 — 설계안의 범위 배지 자리. 개수 같은 것을 붙일 때 쓴다 */
.nav-tag {
  margin-left: auto; font-style: normal; display: inline-flex; align-items: center; padding: 1px 6px; border-radius: var(--r1);
  font-size: 12px; line-height: 1.5; font-weight: 550; background: var(--bg-weak); color: #66707e;
}
.side-bottom {
  margin-top: 12px; padding: 12px 14px 0; border-top: 1px solid var(--stroke-subtle);
  display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.6; color: #646f7a;
}
.side-bottom a { color: #52606e; }

.workspace { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 24px; min-height: 60px; padding: 10px 28px;
  background: #fff; border-bottom: 1px solid var(--stroke-subtle);
}
.breadcrumb { font-size: 14px; color: #68717c; white-space: nowrap; flex: none; }
.breadcrumb span { margin: 0 8px; color: #a3abb5; }
.breadcrumb strong { color: #343e4b; font-weight: 550; }
.global-search {
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 350px; min-width: 175px; min-height: 38px; padding: 7px 12px;
  background: #f6f7f9; border: 1px solid #e6e8ed; border-radius: var(--r2); color: #687481; font-size: 14px;
}
.global-search .ic { width: 18px; height: 18px; }
kbd { margin-left: auto; font: inherit; font-size: 12px; line-height: 1.4; border: 1px solid #dce0e6; border-radius: 4px; background: #fff; color: #6b7683; padding: 1px 5px; white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 22px; white-space: nowrap; }
.top-task { color: #394757; font-size: 15px; }
.top-task:hover { color: var(--ink); text-decoration: none; }
.top-task b { display: inline-block; margin-left: 7px; min-width: 23px; padding: 1px 6px; border-radius: 5px; background: #edf1f5; color: #334b67; font-size: 13px; text-align: center; }
.top-user { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #394757; }
.top-user .avatar { width: 32px; height: 32px; font-size: 13px; }
.top-user b { font-weight: 650; }
.top-user small { font-size: 13px; color: var(--fg-subtle); }

.ops-main { flex: 1; width: 100%; max-width: 1800px; padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-head h1 { font-size: 32px; line-height: 1.35; font-weight: 750; letter-spacing: -1px; color: var(--ink); }
.page-head h1 .badge { letter-spacing: 0; }
.page-head p { margin-top: 6px; font-size: 15px; line-height: 1.55; color: #6b7582; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 한 화면 틀 — 모든 운영자 화면을 스크롤 없이 (1440×760 · 1366×720 기준) */
.ops-main.fit {
  gap: calc(12px + var(--air) * .6); padding-top: calc(14px + var(--air)); padding-bottom: calc(12px + var(--air));
}
.fit .page-head { align-items: center; }
.fit .page-head > div:first-child { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.fit .page-head h1 { font-size: 28px; white-space: nowrap; flex-shrink: 0; }
/* 저장 문구가 길어도 머리가 두 줄이 되지 않게 — 한 줄로 자르고 전문은 title(static/entry.js) */
.fit .page-head .actions { flex-wrap: nowrap; }
.fit .page-head .actions > .btn { flex-shrink: 0; }
.fit .page-head [data-save-state] { max-width: 360px; min-width: 0; white-space: nowrap; }
.fit .page-head [data-save-state] > :first-child { flex-shrink: 0; }
.fit .page-head [data-save-state] > [data-bind] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fit .page-head p { margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fit .metrics { padding: calc(12px + var(--air) * .5) 0; }
.fit .kpi { gap: 2px; }
.fit .kpi-value { font-size: 28px; line-height: 1.25; }
.fit .kpi-foot { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fit .kpi .bar { margin: 4px 0 2px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: calc(12px + var(--air) * .6); align-items: stretch; }
.dash-col { display: flex; flex-direction: column; gap: calc(12px + var(--air) * .6); min-width: 0; }
.fit .card { padding: calc(14px + var(--air) * .5) calc(18px + var(--air) * .3); }
.fit .card.flat { padding: 0; }
.fit .card.flat > .card-head { padding: calc(14px + var(--air) * .5) calc(18px + var(--air) * .3) 0; }
.fit .card-head { margin-bottom: calc(8px + var(--air) * .4); }
.fit .card-head h2 { font-size: 18px; letter-spacing: -.4px; }
.fit .tbl td { padding-top: calc(8px + var(--air) * .3); padding-bottom: calc(8px + var(--air) * .3); }
.fit .tbl .avatar { width: 30px; height: 30px; font-size: 13px; }
/* 운영 홈 거래처별 표 — 거래처(최대 5곳)를 쪽 넘김 없이 한 화면에. 표 틀이 카드에 남는 높이를 가져가고
 * 표가 그 높이를 채워 늘어난 만큼 줄이 고르게 높아진다. 기본 줄은 촘촘하게 둔다 — 1366×720 에 5줄
 * 줄 높이 상한 88px — 거래처가 적으면 줄이 300px 넘게 늘었다(1곳 · 1920×1000 에서 469px, 2026-09-15 실측).
 * 표 틀 높이를 「머리 41px(실측) + 줄 수(--rows, 템플릿) × 88px + 테두리」로 막고, 남는 높이는 표 아래
 * 카드 안 빈 자리가 된다. 카드는 그대로 아래까지 찬다(.card.grow-y) */
.home-tbl { flex: 1 0 auto; display: flex; flex-direction: column;
  max-height: calc(41px + var(--rows, 5) * 88px + 2px); }
.home-tbl > .tbl { flex: 1 0 auto; }
.fit .home-tbl .tbl td { padding-top: 5px; padding-bottom: 5px; }
/* 가로 — 칸이 일곱이라 1366×720 · 1440×760 · 1440×900 에서 표 안이 넘쳐 마지막 칸 단추가 잘렸다(2026-09-15 실측,
 * 거래처 5곳 · 가장 긴 말 조합에서 23~30px). 옆 여백을 8px 로 줄이고, 남는 모자람은 거래처 칸이 받는다 —
 * max-width: 0 이면 그 칸의 글자 폭이 표 최소 폭에 들지 않아 이름·설명 줄이 「…」로 줄어든다(이름은 title 풍선) */
.fit .home-tbl .tbl th, .fit .home-tbl .tbl td { padding-left: 8px; padding-right: 8px; }
.home-tbl .tbl td:first-child { max-width: 0; width: 30%; }
.home-tbl .cell-name > div { min-width: 0; }
.home-tbl .cell-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* 긴 이름이 두 줄이 되어 줄 높이가 늘지 않게 */
.home-tbl .cell-name small { overflow: hidden; text-overflow: ellipsis; }
.home-tbl ~ .spring { flex-grow: 0; }
.upcoming { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.upcoming > div { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--stroke-soft); border-radius: var(--r2); min-width: 0; }
.upcoming > div > div { min-width: 0; }
.upcoming b { display: block; font-size: 14px; font-weight: 650; color: #344150; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* 긴 제목이 여러 줄이 되면 1366×720 에서 스크롤이 생긴다 */
.upcoming small { display: block; font-size: 13px; color: #73808d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed.compact .feed-item { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; }
.feed.compact .icon-box { width: 30px; height: 30px; }
.feed.compact .icon-box .ic { width: 16px; height: 16px; }
.feed.compact .feed-item b { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; }
.feed.compact .feed-item b time { flex: none; margin: 0; font-size: 12px; font-weight: 450; color: #8a94a1; }
.feed.compact .feed-item p { margin-top: 1px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed.compact .feed-item b > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fit .grid { gap: calc(12px + var(--air) * .6); }
.fit .list-row { padding: calc(10px + var(--air) * .3) 0; }

/* 아래까지 채우기 — 높이가 남으면 .fill 덩어리가 화면 아래까지 늘고, 안의 카드도 같이 늘어난다
 * .col = 세로로 쌓기 · .grow-y = 남는 높이를 가져감 · <i class="spring"></i> = 아래로 밀기(최소 10px) */
.fill { flex: 1 0 auto; min-height: 0; }
.fit .grid.fill { align-items: stretch; }
.col { display: flex; flex-direction: column; min-width: 0; }
.grow-y { flex: 1 0 auto; }
.spring { display: block; flex: 1 0 var(--spring, 10px); }

/* 위에서 가로로 고르기 — 거래처 등 (고른 것은 남색 테두리) */
.toolbar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.toolbar .spacer { flex: 1; }
.picker { display: flex; gap: 8px; min-width: 0; }
.pick {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 7px 16px 7px 8px; text-align: left;
  border: 1px solid var(--stroke-weak); border-radius: var(--r2_5); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.pick:hover { border-color: var(--stroke-strong); text-decoration: none; }
.pick .avatar { width: 32px; height: 32px; font-size: 13px; }
.pick b { display: block; font-size: 15px; line-height: 1.35; font-weight: 650; }
.pick small { display: block; font-size: 12px; line-height: 1.4; color: var(--fg-subtle); }
.pick.is-on { border-color: var(--brand-900); box-shadow: inset 0 0 0 1px var(--brand-900); background: #fbfcfe; }
.pick.add { border-style: dashed; color: var(--fg-muted); padding-left: 14px; font-size: 14px; font-weight: 550; }
.pick.add .ic { width: 16px; height: 16px; }
/* 거래처가 많을 때 — 템플릿이 개수로 클래스를 붙인다(4곳 .is-dense · 5곳부터 3곳만 두고 나머지는 .pick-more 선택)
 * 1366 폭에서 기간 선택·배지·버튼과 한 줄에 들어가게 부제를 숨기고 여백을 줄인다.
 * 높이는 같은 줄의 선택 칸과 같다 — 기본 42px, 월 작업 화면(.month-work)은 --ctl-h 40px(아래 「월 작업 화면」) */
.toolbar > .picker ~ :not(.spacer):not(.help) { flex-shrink: 0; }
/* 이름이 아주 길어 그래도 모자라면 거래처 칸이 줄고 이름 끝이 「…」로 잘린다(전체 이름은 title). 옆 칸과 겹치지 않는다 */
.picker > .pick { min-width: 0; }
.picker > .pick > span:last-child { min-width: 0; }
.picker > .pick b, .picker > .pick small { overflow: hidden; text-overflow: ellipsis; }
.picker > .pick.add { flex: none; }
.picker.is-dense { gap: 6px; }
.picker.is-dense .pick { min-height: 42px; gap: 8px; padding: 4px 12px 4px 6px; }
.picker.is-dense .pick .avatar { width: 28px; height: 28px; font-size: 12px; }
.picker.is-dense .pick b { max-width: 8.5em; font-size: 14px; }
.picker.is-dense .pick small { display: none; }
.pick-more { display: flex; flex: 0 1 auto; min-width: 7.5em; }
.pick-more .select { width: auto; min-width: 0; max-width: 11em; height: 42px; padding-right: 8px; border-radius: var(--r2_5); font-size: 14px; font-weight: 550; color: var(--fg-muted); text-overflow: ellipsis; }
.pick-more .select.is-on { border-color: var(--brand-900); box-shadow: inset 0 0 0 1px var(--brand-900); background: #fbfcfe; color: var(--ink); font-weight: 650; }

/* 이름 — 값 줄 */
.kv { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px 12px; align-items: center; margin: 0; }
.kv > dt { font-size: 14px; line-height: 1.45; font-weight: 650; color: #2c3745; }
.kv > dd { margin: 0; min-width: 0; font-size: 14px; line-height: 1.5; }
.logo-slot { width: 48px; height: 48px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px dashed var(--gray-500); border-radius: var(--r3); background: var(--bg-fill); color: var(--fg-placeholder); }

/* 쪽 넘김 — 목록은 한 쪽만 보인다 */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; font-size: 13px; color: var(--fg-subtle); }
.pager .pages { display: flex; gap: 4px; }
.pager .pages > * { min-width: 30px; height: 30px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--stroke-weak); border-radius: var(--r2); background: #fff; color: #384553; font-size: 13px; }
.pager .pages > .is-on { border-color: var(--brand-900); color: var(--brand-900); font-weight: 650; }
[hidden] { display: none !important; }

/* 모달 — <dialog class="modal" id="…"> 머리(.modal-head) · 몸(.modal-body) · 발(.modal-foot)
 * 여는 버튼: data-modal="아이디" · 닫기: data-close 또는 바깥 누르기 · 크기: .sm 420 · 기본 520 · .wide 760 */
dialog.modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid #dce3eb; border-radius: 12px;
  background: #fff; color: var(--text); box-shadow: 0 18px 65px rgba(20, 41, 69, .14); overflow: hidden;
}
dialog.modal.sm { width: min(420px, calc(100vw - 32px)); }
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal.xl { width: min(1080px, calc(100vw - 32px)); }   /* 세 단 창 — 보고서 발송(발송 대상 · 알림톡 · 미수 안내 문자) */
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(20, 35, 60, .32); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; }
.modal-head h2 { font-size: 20px; line-height: 1.4; font-weight: 700; letter-spacing: -.45px; color: var(--ink); }
.modal-head .sub { display: block; margin-top: 3px; font-size: 14px; line-height: 1.5; color: #74808c; }
.modal-x { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid #e4e8ee; border-radius: var(--r2); background: #f7f9fb; color: #748092; cursor: pointer; }
.modal-x .ic { width: 16px; height: 16px; }
.modal-x:focus-visible { outline: 2px solid #b9c9e3; outline-offset: 1px; } /* 모달이 열릴 때 닫기 버튼에 가는 초점 — 옅게 */
.modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 2px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: #f8f9fb; border-top: 1px solid #e5e9ee; }
.modal-foot .spacer { flex: 1; }
.modal .list-row { padding: 10px 0; }

/* 달별 반 창(templates/ops/_months_modal.html) — 달마다 한 줄 「2026년 7월 · 광고비 12,345 · [반]」, 맨 아래 「이번 달 이후」.
 * 바꾼 줄은 옅게 칠한다(static/entry.js monthsCount) */
.months-list { display: flex; flex-direction: column; }
.months-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 184px; align-items: center; gap: 12px; padding: 6px 8px; border-bottom: 1px solid var(--stroke-soft); border-radius: var(--r2); }
.months-row > b { font-size: 14px; font-weight: 650; color: #2c3745; white-space: nowrap; }
.months-row .months-amt { font-size: 13px; color: var(--fg-subtle); font-variant-numeric: tabular-nums; white-space: nowrap; }
.months-row .select { width: 100%; height: 32px; padding: 0 8px; font-size: 14px; }
.months-row.is-changed { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand-900); }
.months-row.is-next { margin-top: 8px; border: 1px solid var(--stroke-weak); }
/* 창 머리 안내 줄 — 창이 값을 받기 전(빈 글)에는 아이콘만 남지 않게 감춘다 */
#m-months .notice-line:has(> [data-months-note]:empty) { display: none; }

/* 알림톡 미리보기 — 모달 안에서 보낼 내용을 보여 줄 때 */
.msg-preview { padding: 14px 16px; border-radius: var(--r2_5); background: #f5f7f9; border: 1px solid var(--stroke-soft); font-size: 14px; line-height: 1.65; color: var(--ink); }
.msg-preview > b { display: block; margin-bottom: 6px; font-weight: 700; }
.msg-preview .msg-btn { display: block; margin-top: 12px; padding: 8px; border-radius: var(--r2); background: #fff; border: 1px solid var(--stroke-weak); text-align: center; font-weight: 650; color: var(--ink); }

/* 풍선 설명 — <span class="tip" tabindex="0" data-icon="help" aria-label="설명"><span class="tip-body">…</span></span>
 * 마우스를 올리거나 누르면 뜬다 (.left = 오른쪽으로 펼침 · .up = 위로). 가로 스크롤이 있는 표 안에는 두지 않는다 */
.tip { position: relative; display: inline-flex; align-items: center; color: #8a97a8; cursor: help; vertical-align: middle; }
.tip .ic { width: 16px; height: 16px; }
.tip-body {
  position: absolute; z-index: 30; top: calc(100% + 8px); right: -8px; width: max-content; max-width: 380px; padding: 10px 12px;
  border-radius: var(--r2); background: #1f2a3d; color: #fff; font-size: 13px; line-height: 1.55; font-weight: 450; letter-spacing: 0;
  white-space: normal; text-align: left; box-shadow: 0 8px 24px rgba(20, 41, 69, .18);
  opacity: 0; visibility: hidden; transform: translateY(-2px); transition: opacity .12s, transform .12s; pointer-events: none;
}
.tip-body.left { right: auto; left: -8px; }
.tip-body.up { top: auto; bottom: calc(100% + 8px); }
.tip:hover .tip-body, .tip:focus .tip-body, .tip:focus-within .tip-body { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.tip-body::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* 아이콘과 풍선 사이 틈 — 마우스가 건너가도 안 닫히게 */
.tip-body.up::before { top: auto; bottom: -10px; }
.tip-body a { color: #a9c8ff; text-decoration: underline; text-underline-offset: 2px; }

/* 줄 메뉴 — <details class="menu"><summary aria-label="메뉴" data-icon="more"></summary><div class="menu-list">…</div></details>
 * .up = 위로 펼침(표 아래쪽 줄). 메뉴 항목에 data-modal을 달면 모달이 열린다 */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r2); color: #748092; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .ic { width: 18px; height: 18px; }
.menu > summary:hover, .menu[open] > summary { background: #f2f4f7; }
.menu-list { position: absolute; z-index: 30; right: 0; top: calc(100% + 4px); min-width: 150px; padding: 4px; border: 1px solid #dce3eb; border-radius: var(--r2_5); background: #fff; box-shadow: 0 8px 24px rgba(20, 41, 69, .12); display: flex; flex-direction: column; }
.menu.up .menu-list { top: auto; bottom: calc(100% + 4px); }
.menu-list > * { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r1); background: none; color: #384553; font-size: 14px; line-height: 1.4; text-align: left; cursor: pointer; white-space: nowrap; }
.menu-list > *:hover { background: #f5f7f9; text-decoration: none; }
.menu-list > .danger { color: var(--fg-critical); }
.menu-list .ic { width: 16px; height: 16px; }
@media (max-width: 1400px) { .dash-grid { grid-template-columns: minmax(0, 1fr) 300px; } .fit .tbl th, .fit .tbl td { padding-left: 10px; padding-right: 10px; } }
@media (max-height: 780px) { .nav-item { padding-top: 5px; padding-bottom: 5px; } .side-brand { padding-bottom: 14px; } } /* 메뉴가 하나 늘어도 노트북 높이에 들어가게 */
@media (max-height: 730px) { .nav-item { padding-top: 4px; padding-bottom: 4px; } .side-brand { padding-bottom: 12px; } }

/* 카드 */
.card { background: #fff; border: 1px solid var(--stroke-subtle); border-radius: var(--r3); padding: 20px 22px 22px; min-width: 0; }
.card.flat { padding: 0; overflow: hidden; }
.card.concept { border-style: dashed; border-color: #c9d0d9; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 20px; line-height: 1.4; font-weight: 700; letter-spacing: -.45px; color: #2a333f; }
.card-head h3 { font-size: 17px; line-height: 1.4; font-weight: 700; letter-spacing: -.3px; color: #2a333f; }
.card-head .sub { font-size: 14px; line-height: 1.5; color: #74808c; }
.card-head > div > .sub { display: block; margin-top: 4px; }
.card.flat > .card-head { padding: 20px 22px 0; }

/* 숫자 — 네 칸을 한 줄 카드로 묶는다 (.metrics) */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--stroke-subtle); border-radius: var(--r3); padding: 19px 0; }
.metrics > .card { border: 0; border-radius: 0; padding: 0 24px; border-right: 1px solid #e8ebef; }
.metrics > .card:last-child { border-right: 0; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.5; color: #677382; }
.kpi-label .ic { order: 2; margin-left: auto; width: 19px; height: 19px; color: #8a97a8; }
.kpi-value { font-size: 36px; line-height: 1.35; font-weight: 700; letter-spacing: -.8px; color: #202e42; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 15px; font-weight: 450; color: #75818d; margin-left: 6px; letter-spacing: 0; }
.kpi-foot { font-size: 13px; line-height: 1.55; color: #7a8592; }

/* 버튼 — 기본은 흰 바탕 테두리, 주 버튼만 남색. 아이콘과 글 사이 7px(고객 10-26 A320 · 아래 「정돈」) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px;
  border: 1px solid transparent; border-radius: var(--r2); font-size: 15px; line-height: 1.4; font-weight: 550;
  cursor: pointer; white-space: nowrap; background: transparent; color: #384553; transition: background-color .12s, border-color .12s;
}
.btn:hover { text-decoration: none; }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.btn-primary:hover:where(:not(:disabled)) { background: var(--brand-800); border-color: var(--brand-800); }
.btn-outline { background: #fff; border-color: var(--stroke-weak); color: #384553; }
.btn-outline:hover:where(:not(:disabled)) { background: #f5f7f9; border-color: var(--stroke-strong); }
.btn-neutral { background: var(--bg-weak); border-color: #e3e7ec; color: #384553; }
.btn-neutral:hover:where(:not(:disabled)) { background: #e9edf1; }
.btn-ghost { color: var(--fg-informative); padding-left: 8px; padding-right: 8px; }
.btn-ghost:hover:where(:not(:disabled)) { text-decoration: underline; text-underline-offset: 4px; }
.btn-critical { background: #fff5f3; border-color: #e9c9c4; color: var(--fg-critical); }
.btn-sm { min-height: 36px; padding: 6px 11px; font-size: 14px; }
.btn-xs { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-sm .ic, .btn-xs .ic { width: 15px; height: 15px; }
.btn-lg { min-height: 52px; padding: 13px 20px; gap: 8px; border-radius: var(--r2_5); font-size: 17px; font-weight: 650; }
.btn-lg .ic { width: 20px; height: 20px; }
.btn-block { width: 100%; }
/* 누를 수 없는 단추(선택 0줄의 「선택 삭제」 · 1/1 쪽의 이전·다음 등) — 흐리게, 금지 커서. 마우스를 올려도 색이 그대로다(위 :hover:where(:not(:disabled)) — :where 라 화면별 규칙과의 우선순위는 그대로). */
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
/* 누른 뒤 처리 중인 단추 — 「업로드 중…」(m/upload · 자료실) · 「수집 중」(광고비 자동 수집) · 비밀번호 「변경」 보낸 뒤 ·
 * 포스팅 행 추가 · 선택 줄 삭제. 진행 상태를 알리는 글이라 덜 흐리게(남색 단추 흰 글자 4.5:1), 기다림 커서.
 * 스크립트가 disabled 와 함께 aria-busy="true" 를 붙이고 뗀다. 화면마다 따로 정하지 않는다(위 규칙보다 뒤 — 같은 우선순위) */
.btn[aria-busy="true"] { opacity: .65; cursor: progress; }

/* 뱃지 — 옅은 바탕 태그. 아이콘과 글 사이 6px(고객 10-26 A320 — 웍스 전체 · 창 · 휴대폰 화면 같은 값, 아래 「정돈」) */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--r1_5);
  font-size: 13px; line-height: 1.45; font-weight: 550; white-space: nowrap; font-style: normal; letter-spacing: 0;
}
.badge.sm { padding: 2px 6px; font-size: 12px; }
.badge .ic { width: 14px; height: 14px; }
.b-neutral { background: #f0f2f5; color: #66707e; }
.b-brand { background: #edf1f8; color: #34467a; }
.b-info { background: #edf3fc; color: #315d92; }
.b-pos { background: #eaf6ef; color: #20765c; }
.b-warn { background: #fff5e4; color: #8d651e; }
.b-crit { background: #fff0ee; color: #ad4038; }
.b-outline { background: #fff; box-shadow: inset 0 0 0 1px #e2e6eb; color: #768190; }

/* 상태 점 */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--gray-600); }
.dot-pos { background: #2f9b6f; } .dot-warn { background: #d2a24a; }
.dot-crit { background: #c4574a; } .dot-info { background: #4f7fc4; } .dot-brand { background: var(--brand-900); }

/* 설계 메모 — 화면 예시에서 제안·설계안을 표시할 때만 */
.memo {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--r1_5);
  border: 1px dashed #aab6cf; background: #f6f8fc; color: #4a5c86; font-size: 12px; line-height: 1.5; font-weight: 550;
}
.memo .ic { width: 13px; height: 13px; }

/* 표 */
.table-wrap { border: 1px solid var(--stroke-subtle); border-radius: var(--r3); overflow-x: auto; background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.tbl th {
  background: var(--bg-head); color: #667482; font-weight: 550; font-size: 13px; line-height: 1.45;
  text-align: left; padding: 11px 12px; border-bottom: 1px solid #e5e9ed; white-space: nowrap;
}
.tbl td { padding: 12px 12px; border-bottom: 1px solid var(--stroke-soft); vertical-align: middle; color: var(--text); }
.tbl tbody tr:not(.total):not(.is-selected):hover > td:not(.auto) { background: var(--bg-hover); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl th.auto { background: #edf3fc; color: #315d92; }
.tbl td.auto { background: #f7faff; color: #2f4f78; }
.tbl tr.total td { background: var(--brand-100); color: var(--brand-900); font-weight: 700; }
.tbl tr.is-selected td { background: #f6f8fc; }
.tbl .cell-name { display: flex; align-items: center; gap: 12px; }
.tbl .cell-name b { display: block; font-weight: 650; color: #2c3745; }
.tbl .cell-name small { display: block; font-size: 13px; line-height: 1.5; color: #7b8592; white-space: nowrap; }

/* 입력 */
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 15px; line-height: 1.45; font-weight: 650; color: #2c3745; }
.help { font-size: 13px; line-height: 1.5; color: var(--fg-subtle); }
.input, .select {
  height: 42px; padding: 0 12px; border: 1px solid var(--stroke-weak); border-radius: var(--r2); background: #fff;
  font-size: 15px; line-height: 1.45; color: #303c4a; display: flex; align-items: center; gap: 8px; width: 100%;
}
.input::placeholder { color: #818a95; }
.input:focus, .input.is-focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(0, 89, 199, .12); }
.select { justify-content: space-between; cursor: pointer; white-space: nowrap; }
.select .ic { color: #7b8592; }
.input.search { background: #f6f7f9; border-color: #e6e8ed; color: #687481; }
.cell-input {
  height: 36px; width: 100%; min-width: 88px; padding: 0 10px; border: 1px solid #dde2e8; border-radius: var(--r1_5);
  background: #fff; text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; color: #303c4a;
}
.cell-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(0, 89, 199, .12); }
.cell-input.is-empty { background: #fff8eb; border-color: #e8d4af; }
.cell-input.is-auto { background: #f2f6fd; border-color: #cddbef; color: #2f4f78; }

/* 입력 표 — 광고비 입력 · 포스팅 입력의 <table class="tbl entry"> (2026-10 수정 요청 A105 「구성은 그대로, 완성도만」 ①②)
 * 칸 테두리는 평소 옅게, 마우스를 올리거나 입력할 때 진하게 — 값이 든 칸이 눈에 띄게.
 * 노란 칸(is-empty · 빈 칸) · 파란 칸(is-auto · 자동) · 빨간 칸(is-error)은 평소에도 제 색 테두리다.
 * 빨간 칸은 마우스를 올려도 빨간 테두리 그대로 — input · select 같게(올림 규칙에서 is-error 를 뺀다).
 * 0 은 옅은 회색(is-zero — static/entry.js 가 붙이고 뗀다). 합계 줄 위는 굵은 줄.
 * 칸 너비 · 줄 여백 · 첫 칸 강조처럼 화면마다 다른 것은 각 템플릿 <style> 에 둔다 */
.tbl.entry { table-layout: fixed; }
.entry .cell-input { min-width: 0; padding: 0 8px; font-size: 14px; }
.entry .cell-input, .entry .select { border-color: var(--stroke-soft); transition: border-color .12s; }
.entry .cell-input.is-empty { border-color: #e8d4af; }
.entry .cell-input.is-auto { border-color: #dfe7f3; }
.entry .cell-input:not([readonly]):not(.is-error):hover, .entry .select:not(.is-error):hover { border-color: var(--stroke-strong); }
.entry .cell-input:focus, .entry .select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(0, 89, 199, .12); }
.entry .cell-input.is-error, .entry .select.is-error { border-color: #d98b80; background: var(--red-100); }
.entry .is-zero { color: var(--gray-500); }
.entry .cell-input.is-auto.is-zero { color: #a9bbd3; }
.entry tr.total td { border-top: 2px solid var(--brand-200); }
.entry tr.total td.is-zero { color: var(--brand-300); }
/* 머리줄 고정 — 쪽 넘김이 없어(포스팅 16~18줄 · 광고비 반 7~8개) 화면을 내려도 머리줄이 위에 붙는다.
 * 감싼 카드 · 표 틀의 overflow 를 clip 으로 — hidden · auto 는 스크롤 상자가 되어 머리줄이 화면이 아니라
 * 그 상자(늘어나기만 하는 상자)에 붙어 움직이지 않는다. clip 도 둥근 모서리는 그대로 자른다.
 * 입력 표는 가로로 넘치지 않는다(table-layout: fixed · body.ops 최소 폭 1240px).
 * 머리 아래 줄은 그림자로 — 겹친 칸 테두리(collapse)는 붙은 머리줄을 따라오지 않는다.
 * 위로 Tab 해 머리줄 밑으로 들어간 칸은 머리 높이만큼 띄워 보인다(scroll-margin-top · 광고비 두 줄 머리 59px · 포스팅 41px) */
.card.flat:has(.tbl.entry), .table-wrap:has(> .tbl.entry) { overflow: clip; }
.tbl.entry thead th { position: sticky; top: 0; z-index: 2; border-bottom-width: 0; box-shadow: inset 0 -1px 0 #e5e9ed; }
.tbl.entry :is(.cell-input, .select) { scroll-margin-top: 72px; }

/* 월 작업 화면 — 광고비 입력 · 포스팅 입력 · 보고서(만들기 · 보낸 보고서)의 글자 크기 · 굵기 · 간격 (수정 요청 A105 ④)
 * 세 화면이 같은 값을 쓴다. 화면마다 다른 것만 각 템플릿 <style> 에 두고, 거기서도 크기 · 색은 아래 이름으로 쓴다.
 *   제목 28px 750 · 제목 옆 설명 15px          .fit .page-head (위) — 세 화면 같음
 *   카드 머리 18px 700 · 그 옆 작은 설명 13px   --card-title-fs · --help-fs
 *   칩 줄(거래처 칩 옆 달 · 기간 고르기) 40px · 14px — 버튼(40px) · 보기 전환(.seg 40px)과 같은 높이.
 *     같은 줄의 촘촘한 칩(.picker.is-dense · 4곳부터) · 「그 밖의 거래처」 선택(.pick-more · 5곳부터)도 40px
 *   보조 문구(표 위·아래 줄 · 단위 · 칸 설명) 13px 옅은 회색, 그 안 굵은 글 650 진한 회색
 *   간격 — 덩어리 사이는 .fit 의 gap · 카드 안 여백 위아래 14px 좌우 18px · 표와 아래 줄 사이 10px (높이가 남으면 --air 만큼 넓어진다)
 * 보고서 종이(static/report.css · templates/report/*)는 7·8월 기존 서식이라 여기 넣지 않는다.
 * 화면 <main> 에 .month-work 를 붙인다(템플릿의 {% block main_class %}). */
:root {
  --card-title-fs: 18px;
  --help-fs: 13px; --help-fg: var(--fg-subtle); --help-strong-fg: var(--fg-muted);
  --ctl-h: 40px; --ctl-fs: 14px;
  --card-pad-y: calc(14px + var(--air) * .5); --card-pad-x: calc(18px + var(--air) * .3);
  --foot-gap: calc(10px + var(--air) * .3);
}
.month-work .toolbar > form > .select { height: var(--ctl-h); font-size: var(--ctl-fs); }
.month-work .picker.is-dense .pick { min-height: var(--ctl-h); }
.month-work .pick-more .select { height: var(--ctl-h); font-size: var(--ctl-fs); }
.month-work .panel { padding: var(--card-pad-y) var(--card-pad-x); }
.month-work .foot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; margin-top: var(--foot-gap); }
.month-work .foot-row .help, .month-work .foot-row .t3 { font-size: var(--help-fs); color: var(--help-fg); }

/* 정돈 — 운영 화면 전체와 그 창(고객 10-26 수정요청 A237~A240 · A261~A265 · A314~A322 · image9~16 — 「별도 언급 없는 웍스 전체」).
 * <main> 에 .tidy 가 붙는다 — templates/base.html 기본값이고, main_class 를 바꾼 화면(광고비 입력 · 포스팅 입력 · 효율 지표 ·
 * 광고비 자동 수집 · 보고서)은 그 화면이 붙인다. 처음(10-27)에는 그 네 화면만이었고, 홈 · 거래처 · 보고서 · 자료실 · 일정 ·
 * 알림톡 · 설정 · 광고그룹 반 지정으로 넓혔다.
 *   안내 줄  「알림 아이콘 + 내용」 한 꼴. 아이콘 14px · 아이콘과 글 사이 7px · 글이 두 줄이 되어도 둘째 줄이 글 첫 자리에 선다.
 *           <div class="notice-lines"><p class="notice-line" data-icon="info" data-size="14"><span>내용</span></p></div>
 *           아이콘 색만 뜻을 따른다 — .is-warn(알림) · .is-pos(확인) · .is-muted(내부용 · 보조). 글은 모두 옅은 회색이다.
 *           글만 있던 쪽 안내 · 회색 안내 상자(.note)도 이 꼴이고, 창(모달) 안 정보 안내도 같다 — 창 안 오류 · 경고 상자
 *           (.note.crit · .note.warn)와 입력칸 아래 칸 설명(.help)은 그대로 둔다
 *   정렬    머리와 값은 칸마다 같은 쪽(사용자 10-26 효율 지표 · 10-28 홈 「포스팅이 너무 오른쪽 · 보고서 · 알림톡은 가운데」).
 *           금액(원 · 광고비 · 집행 금액 · 콜당 비용 · 잔액 · 충전액 · 이월액)은 오른쪽 .r — 금액 입력칸(data-money)도.
 *           첫 칸(반 · 거래처 · 캠페인 · 보고서 · 시각처럼 줄을 가리키는 칸)과 긴 글(내용 · 비고 · 링크 · 폴더 · 장소 · 설명)과
 *           고르기 칸(select)은 왼쪽 — class 없음. 첫 칸은 무엇이든 왼쪽이다(안내 줄 첫 자리 = 첫 칸 글자).
 *           나머지 짧은 칸(건수 · 개수 · 크기 · 상태 배지 · 날짜 · 기간 · 휴대폰 · 등록자 · 수신인 · 스위치)은 가운데 .c.
 *           줄 끝 단추 칸(머리 비어 있음)은 오른쪽 .r. 「… 없음」 한 칸 빈 줄(td.empty)은 가운데.
 *           칸 안 flex 묶음 · 입력칸 글자도 칸 쪽에 선다(아래 「표 정렬」)
 *   첫 글자  표 위 탭 · 표 위 · 아래 안내 줄 · 쪽 넘김 줄의 첫 자리를 표 첫 칸 글자 자리에.
 *           --tbl-text-x = 표 테두리 1px + 머리 칸 여백(표 밖에서 재는 줄) · --tbl-cell-x = 칸 여백만(표와 같은 카드 안의 줄).
 *           기본 표는 칸 여백 12px(1400px 아래 10px — 위 「.fit .tbl」) · 입력 표(.tbl.entry)는 14px. 칸 여백이 다른 표는 그 화면이 고친다
 *   여백    표와 그 위 · 아래 줄 사이는 --notice-gap 하나 · 안내 줄끼리는 6px
 *   아이콘   아이콘과 글 사이 6~7px — 배지 6px · 단추 7px(위 「뱃지」 · 「버튼」 기본값이라 창 · 휴대폰 화면도 같다) ·
 *           위아래로 쌓인 배지 사이 4px
 * 보고서 종이(static/report.css · templates/report/*)와 PDF 는 넣지 않는다(A240). */
:root { --tbl-text-x: 15px; --notice-gap: calc(14px + var(--air) * .3); }
.tidy { --tbl-cell-x: 12px; --tbl-text-x: calc(var(--tbl-cell-x) + 1px); }
@media (max-width: 1400px) { .tidy { --tbl-cell-x: 10px; } }
.tidy:has(.tbl.entry) { --tbl-text-x: 15px; }   /* 입력 표(광고비 · 포스팅 입력) — 칸 여백 14px, 1400px 아래도 그대로 */
.notice-lines { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tidy .notice-lines { margin-top: var(--notice-gap); padding-left: var(--tbl-text-x); }
/* 표 위 안내 — 표와의 사이는 아래쪽에. 덩어리 사이 간격(.fit · .dash-col 의 gap 12px + --air × .6)이 있는 자리면
 * 그 간격에서 모자란(넘는) 만큼만 더해 사이를 --notice-gap 하나로 맞춘다(광고비 자동 수집 · 광고그룹 — 설정 MYBOX 와 같은 값) */
.tidy .notice-lines.is-above { margin-top: 0; margin-bottom: var(--notice-gap); }
.tidy > .notice-lines.is-above, .tidy .dash-col > .notice-lines.is-above { margin-bottom: calc(var(--notice-gap) - 12px - var(--air) * .6); }
/* 짧은 안내 둘을 한 줄에 — 줄을 하나 덜 써 화면이 넘치지 않게(광고비 입력 검색광고 · 1440×760). 좁으면 다음 줄로 */
.notice-lines.is-row { flex-direction: row; flex-wrap: wrap; column-gap: 24px; }
.notice-line { display: flex; align-items: flex-start; gap: 7px; min-width: 0; margin: 0; font-size: var(--help-fs); line-height: 1.5; font-weight: 450; color: var(--help-fg); }
.notice-line > .ic { flex: none; width: 14px; height: 14px; margin-top: 2.5px; color: #6f8fb8; }
.notice-line.is-warn > .ic { color: var(--fg-warning); }
.notice-line.is-pos > .ic { color: var(--fg-positive); }
.notice-line.is-muted > .ic { color: var(--fg-subtle); }
.notice-line > span { min-width: 0; }
.notice-line a { white-space: nowrap; }
/* 표 정렬 — 머리(th)와 값(td)이 칸마다 같은 쪽이다. 정렬은 칸의 class 하나로 정한다(위 「표」 .tbl .r · .tbl .c — th 에도 붙인다).
 * 칸 안이 flex 묶음이면 text-align 이 닿지 않는다 — 아이콘 + 글 묶음(.row — 머리의 「↻ 네이버 광고비」 등)은 여기서 칸 쪽으로
 * 세우고, 그 밖의 묶음은 그 화면이 세운다(보고서 발송일 .down-st · 설정 수신인 .recv-btn).
 * 입력칸은 제 글자를 칸 쪽에 둔다(금액 입력칸은 기본이 오른쪽 · 가운데 칸의 건수 · 날짜 입력은 가운데).
 * 규칙 전체와 시험: docs/개발-메모.md 「화면 표 정렬」 */
.tbl th.r > .row, .tbl td.r > .row { justify-content: flex-end; }
.tbl th.c > .row, .tbl td.c > .row { justify-content: center; }
.tbl td.c > .cell-input { text-align: center; }
.tidy .tbl td.empty { text-align: center; color: var(--fg-subtle); }
/* 입력 표 머리는 칸이 좁으면 줄을 바꾼다 — 「G 유튜브/디맨드젠」은 「/」 뒤에서(템플릿 <wbr>) */
.tidy .tbl.entry th { white-space: normal; word-break: keep-all; }
/* 표 위 탭 줄 — 첫 탭 글자를 표 첫 칸 글자에, 오른쪽 끝 풍선 설명을 표 마지막 칸 글자 끝에 맞춘다(탭 안 여백 3px) */
.tidy .card-tabs { padding-left: calc(var(--card-pad-x) + var(--tbl-text-x) - 3px); padding-right: calc(var(--card-pad-x) + var(--tbl-text-x)); }
/* 카드 밖 탭 줄(알림톡) — 같은 맞춤. 카드 안 여백 대신 카드 테두리부터 잰다 */
.tidy > .tabs { padding-left: calc(var(--tbl-text-x) - 3px); padding-right: var(--tbl-text-x); }
/* 표 아래 버튼 줄 — 표와의 사이는 안내 줄과 같다 */
.tidy .foot-row { margin-top: var(--notice-gap); }
.tidy .foot-row + .notice-lines { margin-top: 10px; }
/* 위아래로 쌓인 배지 사이 */
.tidy .badge-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* 칩 · 탭 · 보기 전환 · 스위치 */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: var(--r2);
  border: 1px solid var(--stroke-weak); background: #fff; font-size: 14px; line-height: 1.45; font-weight: 550;
  color: #4a5563; white-space: nowrap; cursor: pointer;
}
.chip.sm { min-height: 32px; padding: 4px 10px; }
.chip:hover { text-decoration: none; border-color: var(--stroke-strong); background: #f7f9fb; }
.chip .ic { width: 15px; height: 15px; }
.chip.is-on { background: #edf1f8; border-color: var(--brand-300); color: var(--brand-900); font-weight: 650; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid #dce2e9; }
.tab-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 3px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  font-size: 15px; line-height: 1.5; font-weight: 550; color: #74808e; cursor: pointer;
}
.tab-item:hover { text-decoration: none; color: #1b2c55; }
.tab-item.is-on { color: #26384f; border-bottom-color: var(--brand-900); font-weight: 650; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #edf0f4; border: 1px solid #e1e5eb; border-radius: var(--r2); }
.seg > * {
  min-height: 32px; padding: 5px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--r1); font-size: 14px; line-height: 1.45; font-weight: 550;
  color: #6b7786; cursor: pointer; white-space: nowrap;
}
.seg > .is-on { background: #fff; border-color: #dce1e8; color: #27394f; font-weight: 650; }
.seg .ic { width: 15px; height: 15px; }
.switch { width: 38px; height: 22px; border-radius: var(--r-full); background: #c5ccd5; position: relative; flex: none; display: inline-block; }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(20, 41, 69, .22); transition: left .15s;
}
.switch.is-on { background: var(--brand-900); }
.switch.is-on::after { left: 18px; }
.switch.lg { width: 48px; height: 28px; }
.switch.lg::after { width: 24px; height: 24px; }
.switch.lg.is-on::after { left: 22px; }
.check { width: 18px; height: 18px; border-radius: var(--r1); border: 1px solid var(--gray-500); background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.check.is-on { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.check .ic { width: 12px; height: 12px; }

/* 목록 · 아바타 · 아이콘 상자 */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 13px; padding: 15px 0; border-bottom: 1px solid var(--stroke-soft); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row b { display: block; font-weight: 650; color: #344150; }
.list-row small { display: block; font-size: 14px; line-height: 1.5; color: #73808d; margin-top: 3px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #eef2f7; color: #4a6283; box-shadow: inset 0 0 0 1px #dfe5ec;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 650; flex: none;
}
.avatar.lg { width: 44px; height: 44px; font-size: 17px; }
/* 거래처 로고가 있는 동그라미(_shell.html client_avatar) — 흰 바탕에 로고 전체가 보이게 contain.
 * 가로로 긴 글자 로고도 읽히게 안쪽 여백은 테두리 1px 만 둔다(그림이 테두리를 덮지 않는다) */
.avatar.has-logo { background: #fff; padding: 1px; overflow: hidden; }
.avatar.has-logo img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.icon-box {
  width: 34px; height: 34px; border-radius: var(--r2_5); display: inline-flex; align-items: center; justify-content: center;
  background: #f7f9fc; border: 1px solid #e2e8ef; color: #527197; flex: none;
}
.icon-box .ic { width: 18px; height: 18px; }
.icon-box.brand { background: #f1f4fa; border-color: var(--brand-200); color: var(--brand-900); }
.icon-box.info { background: #f2f6fd; border-color: #d3e1f4; color: #315d92; }
.icon-box.pos { background: #f1f9f4; border-color: #cfe7da; color: #18755d; }
.icon-box.warn { background: #fffaf0; border-color: #f0dfbd; color: #946013; }
.icon-box.crit { background: #fff5f1; border-color: #f0dad2; color: #b75644; }

/* 안내 상자 */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r2); background: #f5f7f9; font-size: 14px; line-height: 1.6; color: #4f5b68; }
.note .ic { width: 16px; height: 16px; margin-top: 3px; }
.note.info { background: #f2f6fd; color: #2f4f78; }
.note.warn { background: #fff8eb; color: #7a5518; }
.note.pos { background: #eff8f3; color: #1f6a52; }
.note.crit { background: #fff5f3; color: #9c3b30; }

/* 진행 막대 */
.bar { height: 6px; border-radius: 3px; background: #e9edf2; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-900); border-radius: 3px; }

/* 흐름 목록 (자동으로 된 일) */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 13px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--stroke-soft); }
.feed-item:last-child { border-bottom: 0; }
.feed-item b { display: block; font-weight: 650; font-size: 15px; line-height: 1.5; color: #344150; }
.feed-item p { font-size: 14px; line-height: 1.5; color: #73808d; margin-top: 3px; }
.feed-item time { display: block; font-size: 13px; line-height: 1.5; color: #8a94a1; margin-top: 4px; }

/* 단계 */
.step { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r3); background: #fff; border: 1px solid var(--stroke-subtle); min-width: 0; }
.step-no { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* 보고서 미리보기 종이 */
.paper { background: #fff; border: 1px solid var(--stroke-subtle); border-radius: var(--r3); box-shadow: 0 1px 2px rgba(20, 41, 69, .04), 0 12px 32px rgba(20, 41, 69, .06); padding: 28px; }
.paper-title { font-size: 20px; line-height: 1.4; font-weight: 700; color: #282e3a; }
.paper-rule { height: 2px; background: #262d47; margin: 12px 0 18px; }
.paper .sec { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--brand-900); color: #fff; font-size: 11px; font-weight: 700; }
table.ptbl { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.4; }
.ptbl th { background: var(--brand-900); color: #fff; font-weight: 700; padding: 8px 10px; text-align: right; }
.ptbl th:first-child { text-align: left; }
.ptbl th.key { background: var(--brand-700); }
.ptbl td { padding: 8px 10px; border-bottom: 1px solid var(--gray-300); text-align: right; font-variant-numeric: tabular-nums; }
.ptbl td:first-child { text-align: left; font-weight: 700; }
.ptbl td.key { background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.ptbl tr.total td { background: var(--brand-100); color: var(--brand-900); font-weight: 700; }

/* ── 거래처 (휴대폰) ─────────────────────────── */
body.m { background: #eef0f3; display: flex; flex-direction: column; min-height: 100vh; }
.phone {
  max-width: 430px; margin: 0 auto; flex: 1 0 auto; width: 100%; background: #fff; position: relative;
  display: flex; flex-direction: column; box-shadow: 0 0 0 1px var(--stroke-subtle);
}
.m-top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 6px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--stroke-subtle);
}
.m-top h1 { font-size: 18px; line-height: 1.35; font-weight: 700; letter-spacing: -.3px; color: var(--ink); }
.m-top .logo { height: 22px; width: auto; display: block; margin-left: 10px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r2); color: var(--ink); flex: none;
}
.icon-btn:hover { background: var(--bg-fill); text-decoration: none; }
.m-body { flex: 1; padding: 20px 16px 120px; display: flex; flex-direction: column; gap: 28px; }
.m-section { display: flex; flex-direction: column; gap: 12px; }
.m-section > h2 { font-size: 20px; line-height: 1.4; font-weight: 700; letter-spacing: -.45px; color: var(--ink); }
.m-section > .sub { font-size: 14px; line-height: 1.5; color: var(--fg-subtle); margin-top: -6px; }
.m-title { font-size: 26px; line-height: 1.35; font-weight: 750; letter-spacing: -.8px; color: var(--ink); }
.m-text { font-size: 16px; line-height: 1.5; }
.m-caption { font-size: 14px; line-height: 1.5; color: var(--fg-muted); }
.m-big { font-size: 32px; line-height: 1.3; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.8px; }
.m-card { border-radius: var(--r6); background: #f5f7f9; padding: 20px; }
.m-card.white { background: #fff; border: 1px solid var(--stroke-subtle); }
.m-card.navy { background: var(--brand-900); color: #fff; }
.m-row {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 13px 0;
  border-bottom: 1px solid var(--stroke-soft); font-size: 16px; line-height: 1.45; color: var(--ink);
}
.m-row:last-child { border-bottom: 0; }
.m-row:hover { text-decoration: none; }
.m-row small { display: block; font-size: 13px; line-height: 1.5; color: var(--fg-subtle); margin-top: 2px; }
.m-row .amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.m .seg > * { min-height: 36px; padding: 6px 18px; font-size: 15px; }
/* 아래 탭 — 칸 수는 서버가 넘기는 탭 수를 따른다 (지금은 홈·자료·일정 3칸) */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; z-index: 10;
  height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: #fff; border-top: 1px solid var(--stroke-subtle);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #7b8592; font-size: 12px; line-height: 1.4; font-weight: 550; }
.tab:hover { text-decoration: none; }
.tab.is-active { color: var(--ink); font-weight: 700; }
/* 아래 탭이 없는 화면 — 막대 자리만큼 비워 두지 않는다(로그인 화면과 같은 아래 여백) */
.phone.no-tabbar .m-body { padding-bottom: calc(16px + var(--air) + env(safe-area-inset-bottom)); }

/* 로그아웃 — 위 막대(직원) · 휴대폰 위 줄(거래처). 폼 하나에 버튼 하나 */
.logout-form { display: flex; margin: 0; }
.m-top .logout-form { margin-left: 6px; }
.m-top .logout-form .btn { min-height: 40px; }

/* 도넛 */
.donut { position: relative; width: 128px; height: 128px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 14px; line-height: 1.5; white-space: nowrap; }
.legend-row i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.legend-row b { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
}
