/* 새 대시보드 — 뉴모피즘(설계 docs/superpowers/specs/2026-10-27-neumorphism-design.md)의 색·글꼴·모양.
   바탕과 카드는 같은 색이고 그림자로 떠 있음 · 눌림을 나눈다. 에메랄드 녹색(#047857, 위 글자는 흰색)은 채움에만 쓴다: [처리] · + · 처리한 체크 · '지금' 선 · 오늘 표시 · '다음' 알약의 점.
   녹색 글자는 #065F46. 미수·놓침·늘어난 값은 빨강, 줄어든 값은 파랑(한국식). */
:root {
  /* 뉴모피즘(설계 2026-10-27): 바탕과 카드는 같은 색, 그림자로 떠 있음(--raise) · 눌림(--press)을 나눈다. 강조는 녹색 하나. */
  --ground: #E7ECF2;
  --surface: #E7ECF2;
  --surface-2: #E7ECF2;
  --line: #D2D9E3;
  --line-soft: #DCE2EA;
  --line-strong: #7C8696;
  --edge: #7C8696; /* 눌린 칸의 가장자리 — 바탕 대비 3:1 이상 */
  --ink: #1B2230;
  --ink-2: #3A4250;
  --ink-3: #545E70;
  --ink-4: #545E70;
  --side: #1A1D24;
  --side-2: #2E323B;
  --side-ink: #FFFFFF;
  --accent: #1A1D24; /* 링크와 데이터 색(진주점 · 이익 막대) */
  --accent-ink: #1A1D24;
  --accent-soft: #DCE2EA;
  --accent-select: #DCE2EA;
  --accent-fill: #047857; /* 에메랄드(2026-10-27 사장님 선택, 이전 #06BA06): 채움 · 표시에만 */
  --accent-text: #065F46; /* 녹색 글자 */
  --on-accent: #FFFFFF; /* 녹색 위 글자 · 아이콘 */
  --accent-tint: #D3ECE1; /* 찾은 말 · 고른 글 바탕 */
  --changwon: #6B7280;
  --chip: #DCE2EA;
  --seg-ground: #E7ECF2;
  --warn: #B42318;
  --warn-ink: #B42318;
  --warn-soft: #FDECEC;
  --up: #B42318;
  --down: #1D4ED8;
  --cost-bar: #7C8696;
  --raise: 10px 10px 22px #C5CEDB, -10px -10px 22px #FFFFFF;
  --raise-sm: 5px 5px 10px #C5CEDB, -5px -5px 10px #FFFFFF;
  --press: inset 5px 5px 10px #C5CEDB, inset -5px -5px 10px #FFFFFF;
  --press-sm: inset 3px 3px 6px #C5CEDB, inset -3px -3px 6px #FFFFFF;
  --card-shadow: var(--raise);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 24px;
  --font: "Pretendard Variable", Pretendard, "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 82px; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word; }
::selection { background: var(--accent-tint); color: var(--ink); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-4); }
.up { color: var(--up); }
.down { color: var(--down); }

/* 뼈대: 위쪽 머리줄(로고·메뉴·통합 검색·매출 입력) + 본문 + 휴대폰 아래 메뉴 */
.top { position: sticky; top: 0; z-index: 20; background: var(--ground); box-shadow: 0 8px 18px -12px #C5CEDB; }
.top-in { max-width: 1360px; height: 66px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--ink); color: #FFFFFF; display: grid; place-items: center; }
.logo-text b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.15; }
.logo-text small { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.top-nav { display: flex; gap: 2px; }
.top-nav a { display: flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 10px; color: var(--ink-2); font-size: 15.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.top-nav a:hover { background: var(--chip); color: var(--ink); }
.top-nav a[aria-current="page"] { background: var(--ground); box-shadow: var(--press); color: var(--accent-text); font-weight: 800; } /* 지금 메뉴: 눌린 알약에 진한 녹색 글자 */
.top-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-search { position: relative; display: block; }
.top-search svg { position: absolute; left: 12px; top: 11px; color: var(--ink-3); }
.top-search .input { width: 300px; height: 42px; padding: 0 14px 0 40px; background: var(--surface-2); }
.top-search .input:focus { border-color: var(--ink); background: var(--surface); }
.top-search .input::placeholder { color: var(--ink-3); }
.top-search-btn { display: none; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--ground); box-shadow: var(--raise-sm); cursor: pointer; }
.btn.top-entry { min-height: 42px; }
/* 머리줄 계정 단추(사람 아이콘 + 권한). 누르면 로그아웃 메뉴. 휴대폰은 아이콘만 */
.top-account { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--ground); box-shadow: var(--raise-sm); color: var(--ink); font-size: 14.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.top-account:hover { background: var(--chip); }
.top-account.top-misclo { width: auto; padding: 0 12px; text-decoration: none; } /* 미스클로 상황판 링크: 어느 폭에서도 글자 단추 */
.main { max-width: 1360px; margin: 0 auto; padding: 28px 28px 56px; display: flex; flex-direction: column; gap: 24px; }
.tabbar { display: none; }

/* 화면 머리: 큰 제목 옆에 설명, 오른쪽 끝에 단추(좁으면 줄을 바꾼다) */
.page-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 6px; }
.page-title { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.2; }
.page-note { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.page-head .actions { min-width: 0; max-width: 100%; margin-left: auto; }
.page-head .seg { max-width: 100%; background: var(--seg-ground); }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 버튼: 바탕 위에 떠 있는 단추(.btn), 녹색 채움(.btn-primary) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 0; border-radius: 15px; background: var(--ground); box-shadow: var(--raise-sm); color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform 0.12s var(--ease), background-color 0.15s var(--ease); }
.btn:hover { background: var(--chip); color: var(--ink); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { background: #036549; color: var(--on-accent); }
.btn:disabled { opacity: 0.6; cursor: default; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--chip); }
.link-btn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:active:not(:disabled) { transform: none; }
}

/* 입력 */
.input, .select { height: 46px; min-width: 0; padding: 0 14px; border: 1px solid var(--edge); border-radius: 14px; background: var(--ground); box-shadow: var(--press); font-size: 15px; }
.select { padding: 0 12px; }
.input.money, .input.number { text-align: right; }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--warn); }
.search { position: relative; flex-grow: 1; min-width: 180px; }
.search svg { position: absolute; left: 14px; top: 13px; color: var(--ink-4); }
.search .input { width: 100%; padding-left: 42px; }

/* 머리줄이 좁아질 때(사장님 메뉴는 자동매매까지 다섯 칸): 1239px 이하는 검색 칸과 메뉴 여백을 줄이고, 1100px 이하는 검색을 돋보기 단추로 접는다 */
/* 1239px 이하: 계정 단추는 아이콘만 — 사장님 머리줄(매출 입력까지)이 넘치지 않게 */
@media (max-width: 1239px) {
  .top-in { gap: 16px; }
  .top-nav a { padding: 0 11px; }
  .top-search .input { width: 220px; }
  .top-account { width: 42px; padding: 0; justify-content: center; }
  .top-account-name { display: none; }
}
/* 420px 이하 휴대폰과 768~960px: 머리줄 로고는 표시만 남긴다(로고는 그대로 오늘로 가는 링크다) */
@media (max-width: 420px), (min-width: 768px) and (max-width: 960px) {
  .top .logo-text { display: none; }
}
@media (max-width: 1100px) {
  .top-search { display: none; }
  .top-search-btn { display: inline-grid; }
  .top.searching .top-search { display: block; position: absolute; left: 0; right: 0; top: 100%; padding: 10px 16px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .top.searching .top-search .input { width: 100%; }
  .top.searching .top-search svg { left: 28px; top: 21px; }
}

/* 칩과 구간 선택 */
.chip-btn { height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--ground); font-size: 14.5px; font-weight: 500; cursor: pointer; box-shadow: var(--raise-sm); }
.chip-btn[aria-pressed="true"] { border-color: transparent; background: var(--ground); color: var(--accent-text); font-weight: 800; box-shadow: var(--press); }
.seg { display: inline-flex; gap: 4px; padding: 5px; border-radius: 16px; background: var(--ground); box-shadow: var(--press); }
.seg button { height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 15px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ground); box-shadow: var(--raise-sm); color: var(--accent-text); font-weight: 800; }

/* 카드 */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.card-pad { padding: 24px; }
.card-title { margin: 0; font-size: 19px; font-weight: 800; }
.filters { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row.wide { gap: 12px; }
.filter-label { margin-right: 6px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.grow { flex-grow: 1; }
.kpi-label { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.kpi-sub { font-size: 14px; color: var(--ink-4); }

/* 원장 표 */
.ledger { overflow: hidden; }
.ledger-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1.5fr) 112px 104px 120px 104px 44px; column-gap: 12px; align-items: center; min-height: 66px; padding: 10px 20px; border-top: 1px solid var(--line-soft); }
.ledger-head { min-height: 48px; border-top: 0; background: var(--surface-2); font-size: 13.5px; font-weight: 700; color: var(--ink-3); }
.ledger-foot { min-height: 62px; background: var(--surface-2); border-top: 1px solid var(--line); font-weight: 600; }
.ledger-foot .label { grid-column: span 3; font-size: 15px; }
.num { text-align: right; }
.cell-main { font-size: 15.5px; font-weight: 600; }
.cell-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-4); font-weight: 700; }
.cell-text { font-size: 15px; }
.stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stack.end { align-items: flex-end; }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.branch-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--accent); flex-shrink: 0; }
.branch-dot.changwon { background: var(--changwon); }
.client-link { padding: 0; border: 0; background: none; text-align: left; font-size: 15.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.client-link:hover { color: var(--accent); text-decoration: underline; }
/* 수금 꼬리표: 완납 회색 ✓, 미수금 빨강 채움 !, 부분입금 빨강 테두리 반쯤 찬 원 */
.pay { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.pay-완납 { background: var(--chip); color: var(--ink-2); }
.pay-미수금 { background: var(--warn); color: #FFFFFF; }
.pay-부분입금 { border: 1.5px solid var(--warn); background: var(--surface); color: var(--warn); }
.tag { align-self: flex-start; padding: 2px 7px; border-radius: 6px; background: var(--chip); color: var(--ink-3); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag.missing { background: var(--warn-soft); color: var(--warn-ink); }

/* 매출 원장 요약 카드(떠 있는 카드, 제목 앞 녹색 점): 왼쪽은 그 기간 매출·비용·순이익, 오른쪽은 미수와 지점 몫 */
.sum-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 40px; align-items: end; padding: 26px 32px; border-radius: 24px; background: var(--ground); box-shadow: var(--raise); }
.sum-title { margin: 0; font-size: 19px; font-weight: 800; }
.sum-title::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--accent-fill); vertical-align: 2px; }
.sum-big { margin: 4px 0 0; font-size: 34px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.2; }
.sum-line { margin: 6px 0 0; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.sum-line.small { margin-top: 2px; font-size: 14.5px; font-weight: 400; }
.sum-side { text-align: right; }
.sum-side .sum-line { margin-top: 4px; font-size: 14.5px; }
.sum-unpaid { margin: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 22px; font-weight: 800; }
.unpaid-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--warn); color: #FFFFFF; font-size: 13px; font-weight: 800; }
/* 큰 금액 뒤의 작은 단위(만원·원) */
.unit { margin-left: 3px; font-size: 17px; font-weight: 700; letter-spacing: 0; }
/* 1100px 이하: 미수·지점 몫을 아래로 내려 왼쪽 글이 좁아지지 않게 한다(오늘 화면도 이 폭부터 한 줄로 쌓는다) */
@media (max-width: 1100px) {
  .sum-card { grid-template-columns: minmax(0, 1fr); }
  .sum-side { text-align: left; }
  .sum-unpaid { justify-content: flex-start; }
}

.row-flash { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 46px; z-index: 5; min-width: 132px; padding: 6px; border: 0; border-radius: 14px; background: var(--ground); box-shadow: var(--raise-sm); display: flex; flex-direction: column; }
.menu button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 15px; white-space: nowrap; cursor: pointer; }
.menu button:hover { background: var(--chip); }
.menu button.danger { color: var(--warn-ink); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 20px; border-top: 1px solid var(--line-soft); font-size: 14.5px; color: var(--ink-3); }
.pager { display: flex; align-items: center; gap: 6px; }
.pager button { min-width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--ground); font-size: 15px; cursor: pointer; box-shadow: var(--raise-sm); }
.pager button[aria-current="page"] { border-color: transparent; background: var(--ground); color: var(--accent-text); font-weight: 800; box-shadow: var(--press); }
.pager button:disabled { color: #9AA3B2; box-shadow: none; cursor: default; }
.notice { margin: 0; padding: 48px 20px; text-align: center; font-size: 15.5px; line-height: 1.6; color: var(--ink-3); }
.notice.error { color: var(--warn-ink); }

/* 알림 */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 20px; border-radius: 14px; background: var(--side); color: var(--side-ink); font-size: 15px; box-shadow: 0 10px 30px rgba(30, 29, 26, 0.25); }
.toast button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--side-2); color: #FFFFFF; font-weight: 600; cursor: pointer; }
.toast button:focus-visible { outline-color: #FFFFFF; }

/* 입력 창 */
.entry { width: min(1040px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--raise); }
.entry::backdrop { background: rgba(231, 236, 242, 0.72); backdrop-filter: blur(3px); }
.entry form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.entry-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.4px; }
.entry-sub { font-size: 14.5px; color: var(--ink-4); }
.entry-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; align-items: start; padding: 24px 28px; }
.entry-col { display: flex; flex-direction: column; gap: 26px; }
.entry-section { display: flex; flex-direction: column; gap: 16px; }
.entry-section h3 { margin: 0; font-size: 18px; font-weight: 800; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.field { min-width: 0; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.field-label { padding: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field .input, .field .select { width: 100%; }
.field-error { font-size: 13.5px; color: var(--warn-ink); font-weight: 700; }
.field-error:empty { display: none; }
.field-hint { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent-ink); font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row button { height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--ground); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--raise-sm); }
.chip-row button[aria-pressed="true"] { border-color: transparent; background: var(--ground); color: var(--accent-text); box-shadow: var(--press); font-weight: 800; }
.branch-pick { display: flex; gap: 8px; }
.branch-pick label { flex: 1 1 0; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border: 0; border-radius: 10px; font-size: 15.5px; font-weight: 600; cursor: pointer; box-shadow: var(--raise-sm); }
.branch-pick label:has(input:checked) { border-color: transparent; background: var(--ground); box-shadow: var(--press); color: var(--accent-text); font-weight: 800; }
.branch-pick input, .check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.calc-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--ground); box-shadow: var(--press); }
.calc-box .k { font-size: 13.5px; color: var(--ink-3); font-weight: 700; }
.calc-box .v { font-size: 17px; font-weight: 600; }
.readout { height: 46px; padding: 0 14px; border-radius: 10px; background: var(--ground); box-shadow: var(--press-sm); display: flex; align-items: center; justify-content: flex-end; font-size: 15.5px; font-weight: 700; }
.pay-note { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; color: var(--warn-ink); }
.pay-note svg { flex-shrink: 0; }
/* 합계 띠: 떠 있는 띠. 순이익이 0보다 작으면 파랑(한국식 줄어든 값) */
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; align-items: center; margin: 0 28px 18px; padding: 20px 26px; border-radius: 20px; background: var(--ground); box-shadow: var(--raise-sm); color: var(--ink); }
.totals .k { font-size: 13.5px; font-weight: 700; color: var(--accent-text); }
.totals .v { font-size: 24px; font-weight: 800; }
.totals .v.neg { color: var(--down); }
.entry-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; border-top: 1px solid var(--line); }
.entry-message { font-size: 14px; color: var(--ink-4); }
.entry-message.error { color: var(--warn-ink); font-weight: 600; }

/* 손익 통계 */
.stats-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
/* 손익 통계 요약: 카드 하나에 네 칸, 칸 사이 세로 줄 */
.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 22px 0; }
.strip-cell { min-width: 0; padding: 0 28px; }
.strip-cell + .strip-cell { border-left: 1px solid var(--line); }
.strip-label { font-size: 14.5px; font-weight: 600; color: var(--ink-3); }
.strip-value { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; word-break: keep-all; }
.strip-value .unit { margin-left: 2px; font-size: 16px; }
.strip-sub { font-size: 14px; color: var(--ink-2); }
/* 올해를 볼 때 이번 달 이름 자리의 녹색 꼬리표 */
.month .name.now-tag { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--accent-fill); color: var(--on-accent); font-size: 13px; font-weight: 800; white-space: nowrap; }
.legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-3); }
.sw { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.months { display: flex; align-items: flex-end; gap: 10px; height: 284px; padding-top: 4px; }
.month { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.month:disabled { cursor: default; }
.month .amount { min-height: 16px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.month .bar { width: 100%; max-width: 48px; display: flex; flex-direction: column; gap: 2px; border-radius: 6px 6px 0 0; overflow: hidden; }
.month .bar .cost { background: var(--cost-bar); }
.month .bar .profit { background: var(--accent); }
.month .name { min-height: 24px; padding-top: 4px; font-size: 14px; color: var(--ink-3); }
.month .loss { font-size: 12px; font-weight: 700; color: var(--down); }
/* 손실 표시는 줄 밖에 달아 이름 아래로 늘어뜨린다. 줄 안에 두면 그 달 막대만 23px 위로 떠서 막대 바닥선이 어긋난다. */
.month { position: relative; }
.month .loss { position: absolute; top: 100%; left: 50%; margin-top: 2px; transform: translateX(-50%); white-space: nowrap; }
.month:hover:not(:disabled) .bar { outline: 2px solid var(--edge); }
.hbar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.hbar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.hbar.thick { height: 14px; }
.stack-bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; }
.stack-bar span + span { border-left: 2px solid var(--surface); }
.list-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 48px; gap: 10px; align-items: center; min-height: 46px; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.rank { width: 28px; height: 28px; border-radius: 8px; background: var(--chip); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.top-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 54px; }

/* 넓은 화면: 삭제한 건 보기의 되살리기 칸 */
@media (min-width: 1240px) {
  .ledger.deleted .ledger-row { grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1.5fr) 112px 104px 120px 104px 88px; }
}

/* 표 칸이 모자라는 폭(1240px 미만): 원장을 카드로 보여 준다. 고정 칸 너비만 680px 이라 이보다 좁으면 거래처·시공 내용 칸이 0 이 된다. */
/* 같은 폭에서 통계 요약은 두 칸씩, 통계 카드는 한 줄로 놓는다. */
@media (max-width: 1239px) {
  .ledger-head { display: none; }
  .ledger-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "client sales" "job pay" "date menu"; row-gap: 6px; padding: 14px 16px; }
  .ledger-row > .c-date { grid-area: date; font-size: 13.5px; color: var(--ink-4); font-weight: 700; }
  .ledger-row > .c-client { grid-area: client; }
  .ledger-row > .c-job { grid-area: job; }
  .ledger-row > .c-sales { grid-area: sales; }
  .ledger-row > .c-cost, .ledger-row > .c-profit { display: none; }
  .ledger-row > .c-pay { grid-area: pay; justify-self: end; }
  .ledger-row > .c-menu { grid-area: menu; justify-self: end; }
  .ledger-foot { grid-template-areas: none; }
  .ledger-foot .label { grid-column: auto; }
  .ledger-foot > .c-sales { grid-area: auto; }
  .ledger-foot > .c-pad { display: none; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .strip-cell:nth-child(odd) { border-left: 0; }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .span-8, .span-4 { grid-column: auto; }
  /* 연도가 많으면(실제 자료는 2015~2026) 구간 선택이 화면보다 넓어진다 — 칸 안에서 옆으로 밀어 본다.
     넓은 화면에서는 줄을 바꿔 다 들어가므로 두지 않는다(밀기 칸은 초점 테두리를 잘라 먹는다). */
  .page-head .seg { overflow-x: auto; }
}

/* 휴대폰 */
@media (max-width: 767px) {
  .top-in { height: 58px; padding: 0 16px; gap: 10px; }
  .top-nav, .logo-text small { display: none; }
  .btn.top-entry { display: none; } /* 휴대폰은 아래 메뉴 가운데 + 가 매출 입력 */
  .top-account { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .top-account-name { display: none; }
  .main { padding: 18px 16px 128px; gap: 18px; }
  .page-title { font-size: 26px; }
  .page-note { font-size: 15px; }
  .sum-card { padding: 22px 20px; border-radius: 20px; }
  .sum-big { font-size: 30px; }
  .kpi-strip { padding: 16px 0; }
  .strip-cell { padding: 0 16px; }
  .strip-value { font-size: 22px; }
  .filters { padding: 14px; }
  .months { gap: 4px; }
  /* 아래 메뉴(설계 2026-10-27 §3): 양옆 16px 띄운 떠 있는 막대, 가운데 녹색 + (매출 입력), 더보기는 막대 위에 뜨는 작은 목록 */
  .tabbar { position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: center; height: 72px; padding: 0 6px; border-radius: 26px; background: var(--ground); box-shadow: var(--raise); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; border: 0; background: none; color: var(--ink-2); font-family: inherit; font-size: 11.5px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; }
  .tab-ic { display: grid; place-items: center; width: 46px; height: 30px; border-radius: 10px; }
  .tab[aria-current="page"] { color: var(--accent-text); font-weight: 800; }
  .tab[aria-current="page"] .tab-ic { background: var(--ground); box-shadow: var(--press-sm); color: var(--accent-text); }
  .tab-add { justify-self: center; align-self: start; width: 60px; height: 60px; margin-top: -26px; border: 0; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); box-shadow: var(--raise); display: grid; place-items: center; cursor: pointer; }
  .tab-more-wrap { position: relative; display: grid; }
  .tab-more { position: absolute; right: 0; bottom: calc(100% + 16px); min-width: 172px; padding: 8px; border-radius: 18px; background: var(--ground); box-shadow: var(--raise); display: flex; flex-direction: column; gap: 4px; }
  .tab-more[hidden] { display: none; }
  .tab-more-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 12px; color: var(--ink); font-size: 16px; font-weight: 700; text-decoration: none; }
  .tab-more-item[aria-current="page"] { box-shadow: var(--press-sm); color: var(--accent-text); }
  .entry { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .entry form { height: 100%; max-height: 100dvh; }
  .entry-body { grid-template-columns: minmax(0, 1fr); row-gap: 26px; padding: 18px 16px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2:has(.branch-pick) { grid-template-columns: minmax(0, 1fr); }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0 16px 14px; padding: 14px 16px; }
  .totals .v { font-size: 19px; }
  .entry-head, .entry-foot { padding: 14px 16px; }
  .entry-foot .entry-message:not(.error) { display: none; }
  .toast { bottom: 126px; width: calc(100vw - 32px); justify-content: space-between; } /* 떠 있는 아래 메뉴의 + 단추(바닥에서 112px까지) 위 */
}

/* 2-1단계: 공통 조각 */
.card-head { gap: 12px; }
.card-note { margin: 0; padding: 14px 0 4px; font-size: 15px; color: var(--ink-3); }
.card-note.error { color: var(--warn-ink); }
.card-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.plain-list { margin: 0; padding: 0; list-style: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--chip); color: var(--ink-2); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.mini-kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-value { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; word-break: keep-all; }
.mini-value.warn { color: var(--warn); }
.seg-small button { height: 36px; padding: 0 12px; font-size: 14px; }

/* 오늘 (뉴모피즘 시안 C 타임라인) */
.today-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; }
.today-date { font-size: 17px; font-weight: 700; color: var(--accent-text); }
.remain { align-self: center; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--ground); box-shadow: var(--press-sm); color: var(--ink); font-size: 14.5px; font-weight: 700; line-height: 32px; white-space: nowrap; }
.remain b { color: var(--accent-text); font-size: 17px; font-weight: 800; }
.today-search { display: none; }
.today-status { margin: 0 0 0 auto; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.today-status > span { display: inline-flex; align-items: center; gap: 5px; }
.today-status .bad { color: var(--warn); font-weight: 700; }
/* 넓은 화면: 일정 카드 아래로 통화·문서(왼쪽), 먼저 챙길 일·받을 돈·연락할 곳·매출(오른쪽, 맨 위부터)이 따로 흐른다.
   두 번째 줄을 1fr 로 두어, 오른쪽 칸이 더 길어도 첫 줄은 일정 카드 높이 그대로다. */
.today-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 20px; align-items: start; }
.today-grid > .t-sched-card { grid-column: 1; grid-row: 1; }
.today-side { grid-column: 2; grid-row: 1 / span 2; }
.today-main { grid-column: 1; grid-row: 2; }
.today-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.t-card { padding: 22px 24px; }
.t-head { margin: 0 0 6px; display: flex; align-items: baseline; gap: 10px; font-size: 19px; font-weight: 800; }
.t-head small { font-size: 13.5px; font-weight: 700; color: var(--ink-3); }
.t-total { margin-left: auto; font-size: 20px; color: var(--warn); }
.t-note { margin: 0; padding: 10px 0 4px; font-size: 15px; color: var(--ink-3); }
.t-note.error { color: var(--warn); font-weight: 600; }
.t-card .card-link { margin-top: 4px; font-size: 14.5px; font-weight: 700; }
.chunk { white-space: nowrap; }

/* 오늘 타임라인의 떠 있는 '다음' 카드(설계 2026-10-27 §4): 처리하지 않은 첫 일정 하나만 뜬다. 위에 '10:30 · 다음' 눌린 알약과 남은 시간 · 장소 */
.now-pill { display: inline-flex; align-items: center; height: 30px; margin-right: 6px; padding: 0 12px; border-radius: 999px; background: var(--ground); box-shadow: var(--press-sm); color: var(--accent-text); font-size: 15px; font-weight: 800; letter-spacing: 0; vertical-align: 6px; }
.btn-big { min-height: 50px; padding: 0 22px; border-radius: 14px; font-size: 16.5px; }
.t-next { margin: 8px 0; padding: 20px 22px; border-radius: var(--radius); background: var(--ground); box-shadow: var(--raise); display: flex; flex-direction: column; gap: 10px; }
.t-next-top { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.t-next-when { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; box-shadow: var(--press-sm); color: var(--accent-text); font-size: 13.5px; font-weight: 800; white-space: nowrap; }
.t-next-when::before, .now-pill::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent-fill); } /* '다음' 알약의 녹색 점 */
.t-next-meta { min-width: 0; font-size: 14px; font-weight: 700; color: var(--ink-3); overflow-wrap: anywhere; }
.t-next-meta .late { color: var(--warn); }
.t-next-title { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.35; overflow-wrap: anywhere; }
/* 누르면 상세 창이 열리는 제목('다음' 카드 · 먼저 챙길 일) */
.t-next-open, .t-open { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; color: inherit; text-align: left; cursor: pointer; }
.t-next-open:hover, .t-open:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.t-next-open[aria-busy="true"], .t-open[aria-busy="true"] { opacity: 0.55; cursor: progress; }
.t-next-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.t-next-acts .btn { flex: 1 1 0; justify-content: center; }
.t-next-acts .btn-primary[data-busy] { background: var(--ground); box-shadow: var(--press); color: var(--accent-text); }
.t-next-then { margin: 2px 0 0; font-size: 15px; font-weight: 600; color: var(--ink-3); }
.t-next-then b { color: var(--ink); }
.t-next.t-next-end { margin: 4px 0 0; padding: 12px 0 4px; box-shadow: none; gap: 4px; }
.t-next-end .t-next-title { font-size: 19px; }

/* 처리 줄과 체크(그려진 원 26px, 누르는 자리 44px). 체크가 차오르는 것이 이 화면의 유일한 움직임이다. */
.t-list { margin: 0; padding: 0; list-style: none; }
.t-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.t-row:first-child { border-top: 0; }
.t-now:first-child + .t-row { border-top: 0; }
.t-sched .t-row { grid-template-columns: 58px 26px minmax(0, 1fr); padding: 10px 0; border-top: 0; }
.t-sched .t-time { order: -1; }
.t-time { font-size: 17px; font-weight: 700; line-height: 26px; white-space: nowrap; }
.t-main { margin: 0; min-width: 0; font-size: 16.5px; line-height: 26px; }
.t-main b { font-weight: 700; }
.t-main small { display: block; font-size: 14px; line-height: 20px; color: var(--ink-3); }
.t-main small .late { color: var(--warn); font-weight: 700; }
.t-amt { font-size: 16.5px; font-weight: 700; line-height: 26px; white-space: nowrap; text-align: right; }
.t-tag { display: inline-flex; align-items: center; height: 22px; margin-right: 4px; padding: 0 8px; border-radius: 6px; background: var(--ink); color: #FFFFFF; font-size: 12.5px; font-weight: 800; vertical-align: 1px; }
.t-tag.t-missed { background: var(--warn); }
.t-row.done .t-time, .t-row.done .t-main, .t-row.done .t-main b, .t-row.done .t-amt { color: var(--ink-3); font-weight: 600; }
.t-now { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; font-weight: 800; color: var(--accent-text); }
.t-now::after { content: ""; flex: 1; height: 4px; border-radius: 2px; background: var(--accent-fill); }
.hit { display: grid; place-items: center; width: 44px; height: 44px; margin: -9px; border-radius: 50%; cursor: pointer; }
.chk { appearance: none; -webkit-appearance: none; display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; margin: 0; border: 1px solid var(--edge); border-radius: 50%; background: var(--ground); cursor: pointer; transition: background-color 0.15s var(--ease); box-shadow: var(--press-sm); }
@media (hover: hover) { .chk:not(:disabled):not(:checked):hover { background: var(--accent-tint); } }
.chk:disabled { cursor: default; }
.hit:has(.chk:disabled) { cursor: default; }
.chk::after { content: ""; width: 11px; height: 6px; margin-top: -3px; border: solid var(--on-accent); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) scale(0); transition: transform 0.22s var(--ease); }
.chk:checked { border-color: var(--accent-fill); background: var(--accent-fill); box-shadow: var(--raise-sm); }
.chk:checked::after { transform: rotate(-45deg) scale(1); }
@media (prefers-reduced-motion: reduce) {
  .chk, .chk::after { transition: none; }
}

/* 통화 · 문서 · 돈 줄 */
.t-call { padding: 13px 0; border-top: 1px solid var(--line); }
.t-call:first-child { border-top: 0; }
.t-call-top { display: flex; align-items: baseline; gap: 10px; }
.t-call-top .who { min-width: 0; font-size: 16px; font-weight: 700; }
.t-call-top .who a, .t-money b a { color: var(--ink); }
.t-call-top .when { font-size: 14px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.t-call-top .t-amt { margin-left: auto; font-size: 16px; }
.t-gist { margin: 2px 0 0; font-size: 15.5px; color: var(--ink-2); }
.t-pr { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.t-doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.t-doc:first-child { border-top: 0; }
.t-kind { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--chip); color: var(--ink-2); font-size: 12.5px; font-weight: 800; }
.t-doc b { font-size: 15.5px; font-weight: 700; }
.t-doc small { display: block; font-size: 13.5px; color: var(--ink-3); font-weight: 700; }
.t-doc .t-amt { font-size: 15.5px; line-height: 22px; }
.t-money { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.t-money:first-child { border-top: 0; }
.t-money b { font-size: 16px; font-weight: 700; }
.t-money .t-amt { font-size: 16px; line-height: 24px; }
.t-money small { grid-column: 1 / -1; font-size: 14px; color: var(--ink-3); }
.t-money small.late { color: var(--warn); font-weight: 700; }
/* 입금 계좌: 지점 | 은행 번호 | 복사, 은행 번호 아래에 예금주 */
.t-acct { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.t-acct:first-child { border-top: 0; }
.t-acct b { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; }
.t-acct-no { font-size: 16px; font-weight: 700; }
.t-acct-no span { white-space: nowrap; } /* 번호는 하이픈에서 끊지 않는다 — 좁으면 은행과 번호 사이에서만 줄을 바꾼다 */
.t-acct small { grid-column: 2; font-size: 14px; color: var(--ink-3); }
.t-acct .btn { grid-column: 3; grid-row: 1 / span 2; min-height: 40px; padding: 0 14px; font-size: 14px; }

/* 이번 달 매출 */
.t-big { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.15; }
.t-big small { margin-left: 2px; font-size: 16px; font-weight: 700; letter-spacing: 0; }
.t-vs { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); }
.t-bar { display: flex; gap: 3px; height: 12px; margin: 14px 0 8px; }
.t-bar i { display: block; flex: 1 1 0; border-radius: 3px; background: var(--ink); }
.t-bar i.changwon { background: var(--changwon); }
.t-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 700; }
.t-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* 1100px 이하: 한 줄로 쌓는다. 순서는 일정(타임라인) → 먼저 챙길 일 → 받을 돈 → 연락할 곳 → 매출 → 통화 → 문서 → 입금 계좌.
   문서 순서는 일정 → 오른쪽 칸 → 왼쪽 칸이라, 이 폭에서는 키보드가 통화·문서보다 받을 돈·연락할 곳·매출을 먼저 지난다. */
@media (max-width: 1100px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .today-grid > .t-sched-card { grid-column: auto; grid-row: auto; }
  .today-col { display: contents; }
  .t-owe { order: 2; }
  .t-reach { order: 3; }
  .t-sales { order: 4; }
  .t-calls { order: 5; }
  .t-docs { order: 6; }
  .t-accounts { order: 7; }
}

@media (max-width: 767px) {
  .today-status { margin-left: 0; width: 100%; min-height: 1.5em; font-size: 12.5px; font-weight: 700; }
  .t-card { padding: 18px; border-radius: 18px; }
  .now-pill { height: 26px; font-size: 13.5px; vertical-align: 4px; font-weight: 700; }
  .btn-big { min-height: 46px; padding: 0 18px; font-size: 16px; }
  .t-big { font-size: 22px; }
  .today-search { position: relative; display: block; width: 100%; margin-top: 4px; }
  .today-search svg { position: absolute; left: 16px; top: 14px; color: var(--ink-3); }
  .today-search .input { width: 100%; height: 48px; padding-left: 46px; border-radius: 16px; }
  .t-next { margin: 8px -4px; padding: 18px 16px 16px; border-radius: 20px; }
  .t-next-title { font-size: 20px; }
  .t-sched .t-row { grid-template-columns: 48px 26px minmax(0, 1fr); column-gap: 10px; }
  /* 입금 계좌: 휴대폰에서는 지점을 번호 위로 올려 번호 칸을 넓힌다(320px 폭에서도 번호가 복사 버튼과 겹치지 않게) */
  .t-acct { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .t-acct b { grid-column: 1; grid-row: 1; }
  .t-acct-no { grid-column: 1; grid-row: 2; }
  .t-acct small { grid-column: 1; grid-row: 3; }
  .t-acct .btn { grid-column: 2; grid-row: 1 / span 3; }
}

/* 거래처 */
.clients-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.client-list-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.client-tools { display: flex; flex-direction: column; gap: 10px; }
.client-tools .search { min-width: 0; }
.client-row { width: 100%; min-height: 66px; padding: 10px 12px; border: 0; border-radius: 12px; background: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.client-row:hover { background: var(--chip); }
.client-row[aria-current="true"] { background: var(--accent-select); }
.client-amount { font-size: 15px; font-weight: 600; white-space: nowrap; }
.unpaid-text { font-size: 13.5px; font-weight: 700; color: var(--warn); white-space: nowrap; }
.client-detail { gap: 20px; min-width: 0; }
.client-head-card { gap: 18px; }
.client-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.client-title-row .actions { flex-shrink: 0; }
.client-name { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.2; }
.client-line { margin: 0; }
.timeline-card { gap: 6px; }
.timeline-card .card-head { flex-wrap: wrap; }
.timeline-row { display: grid; grid-template-columns: 76px 40px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.timeline-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--chip); color: var(--ink-3); display: flex; align-items: center; justify-content: center; }
.timeline-amount { font-size: 15px; font-weight: 600; white-space: nowrap; }
/* 타임라인 줄을 누르면 상세 창: 제목 단추가 줄 전체를 덮는다. 글자 크기 · 굵기는 .cell-main 그대로 */
.timeline-row { position: relative; }
.timeline-row:hover { background: var(--chip); }
.timeline-open { padding: 0; border: 0; background: none; font-family: inherit; line-height: inherit; color: inherit; text-align: left; cursor: pointer; }
.timeline-open::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.timeline-open:focus-visible { outline: none; }
.timeline-open:focus-visible::after { outline: 3px solid var(--accent-text); outline-offset: -3px; }

/* 거래처 '다음' 카드(떠 있는 카드, 눌린 '다음' 알약): 받을 돈 먼저, 없으면 다음 일정. 녹색 단추는 오른쪽(휴대폰은 아래) */
.next-card { display: flex; align-items: center; gap: 24px; padding: 24px 28px; border-radius: 24px; background: var(--ground); box-shadow: var(--raise); }
.next-text { flex-grow: 1; min-width: 0; }
.next-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.3; }
.next-title .now-pill { height: 28px; font-size: 14px; vertical-align: 4px; }
.next-meta { margin: 6px 0 0; font-size: 16px; font-weight: 600; color: var(--ink-3); }
.next-act { flex-shrink: 0; }
.next-act[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.back-link { display: none; align-self: flex-start; }

@media (max-width: 1239px) {
  .clients-layout { grid-template-columns: minmax(0, 1fr); }
  .clients-layout.has-key .client-list-card { display: none; }
  .clients-layout:not(.has-key) .client-detail { display: none; }
  .back-link { display: inline-flex; }
}

@media (max-width: 767px) {
  .client-title-row { flex-direction: column; }
  .client-name { font-size: 24px; }
  .timeline-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .timeline-icon { display: none; }
  .mini-value { font-size: 19px; }
  .mini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .next-card { flex-direction: column; align-items: stretch; gap: 16px; padding: 22px 20px; border-radius: 20px; }
  .next-title { font-size: 22px; }
}

@media (min-width: 1240px) {
  .client-detail { position: sticky; top: 90px; max-height: calc(100vh - 114px); overflow-y: auto; }
}

/* 900px 이하: 막대 위 금액은 겹치므로 숨기고, '지금' 꼬리표는 달 이름만 남긴다 */
@media (max-width: 900px) {
  .month .amount { display: none; }
  .now-word { display: none; }
  .month .name.now-tag { padding: 0 6px; }
}

/* 휴대폰: 달 칸이 22px 안팎이라 꼬리표가 옆 달 이름을 가리지 않게 글자에 붙인다 */
@media (max-width: 767px) {
  .month .name.now-tag { padding: 0 1px; }
}
/* 1340px 이상: 막대 위 금액(3,207만)이 칸 안에 한 줄로 들어간다. 더 좁으면 칸(48px 미만)보다 길어서, 한 줄로 두면 이웃 금액과 겹치므로 그대로 줄바꿈한다. */
@media (min-width: 1340px) {
  .month .amount { word-break: keep-all; }
}
/* 1240~1339px: 칸이 48px보다 좁아도 '3,207만'이 한 줄로 들어가도록 글자를 11px로 줄인다(12.5px 에서는 '만'만 아랫줄로 내려갔다). */
@media (min-width: 1240px) and (max-width: 1339px) {
  .month .amount { font-size: 11px; word-break: keep-all; font-weight: 700; }
}

/* 로그인 화면: 바탕 가운데 떠 있는 카드 하나 */
.login-body { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 420px; }
.login-card { padding: 32px 28px 28px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 14px; }
.login-title { margin: 12px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.login-lead { margin: 0; font-size: 15.5px; color: var(--ink-2); }
.login-asks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.login-row { display: flex; gap: 10px; }
.login-code { flex: 1 1 auto; min-width: 0; height: 50px; font-size: 22px; font-weight: 700; letter-spacing: 6px; text-align: center; }
.login-row .btn { min-height: 50px; }
.login-note { min-height: 22px; margin: 0; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.login-note.error { color: var(--warn-ink); }
.login-version { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-3); text-align: right; }
/* 변경 기록 창(계정 메뉴의 '버전 · 바뀐 점') */
.changes { display: flex; flex-direction: column; gap: 14px; max-height: min(60vh, 520px); overflow-y: auto; }
.changes-head { margin: 0 0 4px; font-size: 15px; font-weight: 800; color: var(--accent-text); }
.changes-list { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }

/* 자동매매(사장님만, 캔버스 v11 '자동매매' 보드): 봇 카드 두 장, 보유 종목·최근 청산 표. 녹색 강조는 없다(지금 메뉴만). */
.bots { display: flex; flex-direction: column; gap: 20px; }
.bots-error { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.5; color: var(--warn-ink); }
.bots-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.bot { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.bot-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bot-title h2 { margin: 0; font-size: 19px; font-weight: 800; }
.bot-ex { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--chip); color: var(--ink-2); font-size: 13.5px; font-weight: 800; }
.bot-mode { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border: 1.5px solid var(--ink); border-radius: 7px; font-size: 13px; font-weight: 700; }
.bot-status { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.bot-status svg { flex-shrink: 0; }
.bot-status.warn { color: var(--warn-ink); }
.bot-status.warn b { font-weight: 800; }
.bot-big { font-size: 32px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.15; }
.bot-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--ground); box-shadow: var(--press); }
.bot-cell-label { font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.bot-cell-value { font-size: 18px; font-weight: 800; }
.bot-cell-sub { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.bot-bars-head { display: flex; justify-content: space-between; gap: 4px 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.bot-bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; margin-top: 8px; }
.bot-bars span { flex: 1 1 0; border-radius: 2px; background: var(--cost-bar); }
.bot-bars span.now { background: var(--ink); }
.bot-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.bot-stats dt { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.bot-stats dd { margin: 0; font-size: 16px; font-weight: 800; }
.bot-note { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); font-weight: 700; }
.bots-table-card { overflow: hidden; }
.bots-table-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; padding: 20px 24px 14px; }
.table-scroll { overflow-x: auto; }
/* 상자가 카드 가장자리까지 차 있고 카드(overflow: hidden)가 바깥을 잘라 내므로, 키보드 초점 선(3px)은 안쪽으로 그린다 */
.table-scroll:focus-visible { outline-offset: -3px; }
.bots-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 15px; }
.bots-table th { height: 44px; padding: 0 12px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); font-size: 13.5px; font-weight: 700; text-align: left; white-space: nowrap; }
.bots-table td { height: 56px; padding: 8px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.bots-table th:first-child, .bots-table td:first-child { padding-left: 24px; }
.bots-table th:last-child, .bots-table td:last-child { padding-right: 24px; }
.bots-table .num { text-align: right; }
.bots-table b { font-weight: 800; }
.bots-foot { margin: 0; display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 14px; background: var(--ground); box-shadow: var(--press-sm); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.bots-foot svg { flex-shrink: 0; }
@media (max-width: 1100px) {
  .bots-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .bot { padding: 18px; gap: 16px; }
  .bot-big { font-size: 28px; }
  .bot-cells { gap: 8px; padding: 12px; }
  .bot-cell-value { font-size: 16px; }
  .bot-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .bots-table-head { padding: 18px 18px 12px; }
}

/* 통합 검색(/search): 종류별 묶음에 한 줄씩. 찾은 말은 연한 녹색 바탕(<mark>). 통화 줄은 드라이브 원문 파일로 열린다. */
.search-box { flex-grow: 0; max-width: 560px; }
.search-sum { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.search-group { overflow: hidden; }
.search-title { padding: 20px 24px 12px; }
.search-list { list-style: none; margin: 0; padding: 0; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 16px; padding: 14px 24px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
a.search-row:hover { background: var(--chip); }
.search-main { font-size: 16px; font-weight: 700; }
.search-sub, .search-snippet { grid-column: 1 / -1; font-size: 14px; color: var(--ink-3); }
.search-snippet { color: var(--ink-2); line-height: 1.6; overflow-wrap: anywhere; }
.search-snippet mark { padding: 0 1px; border-radius: 3px; background: var(--accent-tint); color: inherit; }
.search-end { grid-column: 2; grid-row: 1; font-size: 14.5px; font-weight: 700; text-align: right; white-space: nowrap; }
.search-open { font-weight: 600; color: var(--ink-2); }
.search-tag { display: inline-flex; margin-left: 8px; padding: 1px 7px; border-radius: 6px; background: var(--chip); color: var(--ink-2); font-size: 12.5px; font-weight: 700; vertical-align: 2px; }
.search-more { display: block; margin: 0; padding: 12px 24px 16px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); }
a.search-more { font-weight: 700; color: var(--ink); text-decoration: none; }
/* 묶음(overflow: hidden)이 바깥을 잘라 내므로, 키보드 초점 선(3px)은 안쪽으로 그린다 */
.search-row:focus-visible, .search-more:focus-visible { outline-offset: -3px; }
/* 예약 · 통화 줄은 단추다(누르면 상세 창). 날짜 말 검색은 맨 위에 읽은 기간을 쓴다. */
button.search-row { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--line); background: none; font-family: inherit; color: inherit; text-align: left; cursor: pointer; }
button.search-row:hover { background: var(--chip); }
.search-gist { color: var(--ink-2); }
.search-range { margin: 0; font-size: 18px; font-weight: 800; }
@media (max-width: 767px) {
  .search-title { padding: 18px 18px 10px; }
  .search-row { padding: 12px 18px; }
  .search-more { padding: 12px 18px 14px; }
}

/* 상세 창(설계 2026-10-10 §4): PC 는 오른쪽에서 열리는 520px 창, 767px 이하는 화면 전체 */
.detail { position: fixed; inset: 0 0 0 auto; width: min(520px, 100%); max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 20px 0 0 20px; background: var(--surface); color: var(--ink); box-shadow: var(--raise); }
.detail[open] { display: flex; flex-direction: column; }
.detail::backdrop { background: rgba(231, 236, 242, 0.72); backdrop-filter: blur(3px); }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 16px 24px; border-bottom: 1px solid var(--line); }
.detail-title { margin: 0; font-size: 22px; font-weight: 800; }
.detail-title:focus { outline: none; }
.detail-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 20px 24px 32px; }
.detail-lead { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.35; }
.detail-lead a { color: inherit; }
.detail-sub { margin: -12px 0 0; font-size: 15px; color: var(--ink-3); }
.detail-fields { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px 14px; margin: 0; }
.detail-fields dt { font-size: 14px; color: var(--ink-3); }
.detail-fields dd { margin: 0; font-size: 15.5px; font-weight: 600; overflow-wrap: anywhere; }
.detail-section h3 { margin: 0 0 8px; font-size: 15px; font-weight: 800; }
.detail-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; font-size: 15.5px; line-height: 1.5; }
.detail-transcript { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--ground); box-shadow: var(--press); font-family: inherit; font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-note { margin: 0; color: var(--ink-3); }
.detail-note.error { color: var(--warn); font-weight: 600; }
.detail-note-text { margin: 0 0 10px; font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-note-text.empty { color: var(--ink-3); }
@media (max-width: 767px) {
  .detail { width: 100%; border-radius: 0; }
  .detail-head { padding: 12px 8px 12px 18px; }
  .detail-body { padding: 16px 18px 28px; }
}

/* 오늘 화면 일정 카드: 머리에 [오늘 | 이번 주 | 이번 달](설계 2026-10-10 §5) */
.t-head-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 6px; }
.t-head-row .t-head { margin: 0; }
.t-view-sum { margin: 0 0 4px; font-size: 13.5px; font-weight: 700; color: var(--ink-3); }
.t-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.t-nav-label { font-size: 16px; font-weight: 800; }
.t-day { padding: 10px 0; border-top: 1px solid var(--line); }
.t-day:first-child { border-top: 0; }
.t-day-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 15px; font-weight: 800; }
.t-day-pill { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: var(--accent-fill); color: var(--on-accent); font-size: 12.5px; font-weight: 800; }
.t-day-empty { margin: 0; font-size: 14px; color: var(--ink-3); }
.t-ev-open { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: baseline; width: 100%; padding: 8px 0; border: 0; background: none; font-family: inherit; color: inherit; text-align: left; cursor: pointer; }
.t-ev-open:hover .t-ev-main { text-decoration: underline; }
.t-ev-main { min-width: 0; font-size: 15.5px; font-weight: 600; }
.t-ev-main small { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-3); }
.t-ev.done .t-ev-main, .t-ev.done .t-time { color: var(--ink-3); }
/* 이번 달: 월요일 시작 달력. PC 는 칸에 제목 2개 + "+N", 767px 이하는 점 */
.t-cal-week, .t-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.t-cal-week span { padding: 4px 0; font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-align: center; }
.t-cal-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 76px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-family: inherit; color: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.t-cal-cell.out { background: var(--chip); color: var(--ink-3); }
.t-cal-cell[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.t-cal-num { align-self: flex-start; padding: 0 6px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.t-cal-cell.today .t-cal-num { background: var(--accent-fill); color: var(--on-accent); }
.t-cal-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.t-cal-titles span { overflow: hidden; font-size: 12px; line-height: 1.35; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; }
.t-cal-more { font-weight: 700; color: var(--ink-3); }
.t-cal-dots { display: none; gap: 3px; }
.t-cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.t-cal-day { margin-top: 10px; }
@media (max-width: 767px) {
  .t-cal-cell { min-height: 48px; padding: 4px; align-items: center; }
  .t-cal-num { align-self: center; }
  .t-cal-titles { display: none; }
  .t-cal-dots { display: flex; }
}

/* 처리 내용 창(설계 2026-10-10 처리 내용 §2): PC 는 가운데 작은 창, 767px 이하는 아래에서 올라오는 창 */
.note-dialog { width: min(440px, calc(100% - 32px)); max-width: none; padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--raise); }
.note-dialog::backdrop { background: rgba(231, 236, 242, 0.72); backdrop-filter: blur(3px); }
.note-form { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 18px; }
.note-title { margin: 0 0 4px; font-size: 20px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.note-label { font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
.input.note-input { width: 100%; height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; font-size: 16px; line-height: 1.5; }
.note-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
@media (max-width: 767px) {
  .note-dialog { width: 100%; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .note-form { padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); }
  .note-actions .btn { flex: 1 1 0; }
}
