/* 조합 캐처(hidden input) — 셀 선택 중 IME 조합을 받는 화면 밖 input. 보이지 않게. */
.grid-catcher {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  padding: 0;
  border: 0;
  margin: 0;
  pointer-events: none;
  z-index: -1;
}

:root {
  /* ===== 디자인 시스템 "2c Modern Vivid" (클로드 핸드오프 이식) ===== */
  /* 중립 */
  --bg: #F5F5F2;
  --surface: #FFFFFF;
  --surface-sub: #FAFAF7;
  --text: #22272E;
  --muted: #667080;
  --faint: #98A0AB;
  --line: #E4E3DC;
  --line-strong: #CBCAC1;

  /* 탭 테마 (+ 연한 -bg 짝) */
  --rose: #C63F5E;   --rose-bg: #FAE3E8;    /* 일지 */
  --teal: #128A8B;   --teal-bg: #DBEEEE;    /* 기타의뢰 */
  --indigo: #5757CE; --indigo-bg: #E6E6FA;  /* 프리랜서 */
  --amber: #D89020;  --amber-bg: #FAEDD1;   /* 근무·급여 */

  /* 의미 색 */
  --profit: #C92C33; --profit-bg: #FCECEC;  /* 순수익 = 선명한 빨강 (한국 관례 수익=빨강). --danger(#AC443A 벽돌톤)와 구분: 더 순수·선명한 레드 + "담긴" pill/밴드 형태로만 사용 */
  --warn: #A5620F;   --warn-bg: #F6EAD5;    /* 진행·초과 */
  --danger: #AC443A; --danger-bg: #F6E2DF;  /* 급행·빼기 */
  --progress: #E0891F;

  /* 사람 파스텔 (톤 보정) */
  --p-sewon: #CBE0F1; --p-hakran: #EDD2DE; --p-suyeon: #D9E9CF;
  --p-seonghui: #FBEDBE; --p-sieun: #DBD4EA; --p-bora: #D9CCEA; --p-ai: #E3E3E1;

  /* 타이포 스케일 */
  --fs-micro: 11px; --fs-sm: 13px; --fs-base: 15px;
  --fs-md: 17px; --fs-lg: 21px; --fs-xl: 26px;

  /* 여백 (4px 배수) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px;

  /* 모서리 · 그림자 */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow-card: 0 1px 2px rgba(30,30,20,.05);
  --shadow-pop: 0 10px 34px rgba(30,30,20,.16);

  /* ===== 하위호환 별칭 (기존 변수명 → 새 토큰 참조) ===== */
  --card: var(--surface);
  --accent: var(--teal);          /* 구 accent(세이지그린) → 틸 계열로 통합 */
  --accent-soft: var(--teal-bg);
  --brass: var(--amber);
  --ok: #1A7A45;                  /* 완료·입금·전송 "성공" 상태 = 초록 (순수익 빨강과 의미 분리) */
  --ok-bg: #E2F0E7;               /* 성공 틴트 배경 (구 profit-bg 초록) */
  --rose-dark: #A8354F;           /* 로즈 진한 짝 (경계·아웃라인) */
  --teal-dark: #0E6E6F;           /* 틸 진한 짝 */
  --bluegray: #5B6472;            /* 월 누적 카드 등 중립 강조 */
  --sage: var(--profit);          /* 구 sage(순수익 초록) → profit */
  --sec-calc-bg: var(--surface-sub);
  --sec-sum-bg: var(--surface-sub);
  --new-flash: var(--ok-bg);

  /* ===== 파생 셰이드 (토큰에 없지만 필요한 명도 단계·틴트) ===== */
  /* 일지 표 헤더 3파트 — --rose(#C63F5E) HSL 명도 -4%/-8% */
  --rose-h1: var(--rose);         /* p1 = #C63F5E */
  --rose-h2: #BA3755;             /* p2 */
  --rose-h3: #AA324E;             /* p3 */
  /* 기타의뢰 표 헤더 3파트 — --teal(#128A8B) HSL 명도 -4%/-8% */
  --teal-h1: var(--teal);         /* op1 = #128A8B */
  --teal-h2: #107879;             /* op2 */
  --teal-h3: var(--teal-dark);    /* op3 = #0E6E6F(≈-8%) */
  /* 테마색 진한 짝 (프리랜서·급여 아웃라인) */
  --indigo-strong: #4444B0;       /* --indigo(#5757CE) 진한 짝 */
  --amber-strong: #B0741A;        /* --amber(#D89020) 진한 짝 */
  --off-fill: #E7E7E2;            /* 휴무 셀 회색(중립) */
  /* 순수익 빨강 진한 짝 (틴트 경계·강조 텍스트) — --profit(#C92C33) 유도 */
  --profit-line: #F2C6C6;         /* profit-bg보다 진한 경계 (연빨강 보더) */
  --profit-strong: #A5232A;       /* 틴트 위 순수익 라벨·숫자용 진한 빨강 */
  /* 그 외 표 메인 색 — rgb(92,168,25) 그린, 시은 님 지정 (2026-07: 바이올렛→그린) */
  --violet: #5CA819;              /* 그 외 표 헤더·강조 (토큰명은 역사적 이유로 유지) */
  --violet-deep: #447D0F;         /* 그 외 표 헤더 밑선·선택셀 진한 그린 (라이트/다크 동일 — 시안 v4 green-deep) */
  --sieun-line: #EFF7E5;          /* 그 외 표 월경계 배경 (그린 옅은 틴트) */
  --sieun-strong: #478510;        /* 그 외 표 강조 텍스트·아웃라인 (진한 짝) */
  --sieun-ring: var(--violet);    /* 그 외 표 편집 링 */
  /* 틸 틴트 단계 (기타의뢰 카드·hover·구분선) */
  --teal-tint: #EAF3F1;           /* 요약 카드 배경 (연틸) */
  --teal-tint-line: #C9E0DB;      /* 위 카드 경계 */
  --teal-tint2: #E8F0F0;          /* 월경계·hover 배경 */
  --teal-tint3: #DCEAE8;          /* 버튼 hover 배경 */
  --teal-faint: #A9BEB9;          /* 비활성 아이콘(회틸) */
  /* 로즈 틴트 단계 */
  --rose-tint: #FBF8F9;           /* 입력 카드 배경 (연로즈) */
  --rose-tint2: #F6E3E9;          /* 알약 배경 */
  --rose-tint-line: #E9D3CC;      /* 통계 카드 경계 */
  --rose-flash: #FBEEF1;          /* 신규 행 플래시 */
  --kind-hover: #F3EDE3;          /* 구분 셀 hover (연앰버) */
  --day-band: #F8EDE4;            /* 하루 마감 밴드 배경 (연로즈) */
  /* 중립 잔재 */
  --phantom-bg: #FCFCF9;          /* 팬텀 행 배경 */
  --phantom-fg: #C6CAC2;          /* 팬텀 행 글자 */
  --line-soft: #E0DAD1;           /* 얇은 세로 구분선 */
  --track: #F0F0EC;               /* 랭크 트랙·off hover 배경 */
  --track-line: #EFEFEA;          /* 통계 그리드선 */
  --disabled-bg: #F4F4F1;         /* 비활성 입력 배경 */
  --chip-bg: #EEEEEA;             /* 진행 칩 배경 */
  /* 통계 통계 잔재 */
  --bluegray-bg: #EDF2F7;         /* sum-expand hover 배경 (bluegray 연틴트) */
  --st-ai-fg: #4A5058;            /* 통계 AI 카드 큰숫자 (중립 진회색) */
  --wd-weekend: #C9A0AA;          /* 통계 주말 막대 (연로즈) */
  --wd-weekend-fg: #B06A78;       /* 통계 주말 라벨 (로즈) */
  --k-solo: #C9DCE0;              /* 통계 스택 1인 구간 (연틸) */
  --line-cool: #DCE6E4;           /* 진행률 링 트랙 (연틸그레이) */
  --tip-bg: #232B33;              /* SVG 툴팁 배경(항상 어둡게, 흰 글자 고정) */

  /* 기타의뢰 카테고리 칩 (JS O_CAT_COLOR 에서 var()로 참조) — 6종 파스텔 */
  --cat-sub-bg: var(--teal-tint3);    --cat-sub-fg: #2C6E64;   /* 자막(틸) */
  --cat-live-bg: #C8E0B0;             --cat-live-fg: #35610F;  /* 실시간(현장·그린 진하게) */
  --cat-show-bg: #D6E8C4;             --cat-show-fg: #3C6B1C;  /* 공연(현장·그린) */
  --cat-minutes-bg: #E1EFD2;          --cat-minutes-fg: #43701F; /* 회의록(현장·그린 연하게) */
  --cat-rec-bg: #E6E6E0;              --cat-rec-fg: #5C5C54;   /* 녹취(중립 회색) */
  --cat-etc-bg: #E6E6E0;              --cat-etc-fg: #5C5C54;   /* 기타(중립 회색) */
  --o-onsite-bg: #EDF6E1;             /* 현장 3종 작업 구역 연두 배경(연한 틴트) */
  /* 통계 SVG 차트 */
  --chart-line: #6B7178;          /* 추이 선(중립) */
  --chart-dot: var(--st-ai-fg);   /* 마지막 점 강조 */
  --chart-dot-dim: #8A9098;       /* 일반 점 */

  /* 거래처 탭 테마 = 바이올렛 (--violet은 '그 외' 그린이 점유 중이라 별도 토큰) */
  --hub: #7C3AED;                 /* 밴드·헤더·활성 탭 */
  --hub-deep: #5B21B6;            /* 진한 짝 (칩 글자·아웃라인) */
  --hub-tint: #F3EEFD;            /* 선택 행·연한 배경 */
}

/* ===== 다크 모드 토큰 세트 (핸드오프 [data-theme="dark"] 이식) ===== */
[data-theme="dark"] {
  --bg: #1A1C1E; --surface: #232629; --surface-sub: #1E2123;
  --text: #E8E7E2; --muted: #9CA3AD; --faint: #6B727B;
  --line: #33373B; --line-strong: #474C52;

  --rose: #E86B84;   --rose-bg: #3A2228;
  --teal: #3BB5B6;   --teal-bg: #123033;
  --indigo: #8A8BEB; --indigo-bg: #26274F;
  --amber: #E8A84A;  --amber-bg: #3A2E14;

  --profit: #F2787F; --profit-bg: #3A1D20;   /* 순수익 빨강 다크 (--danger #EE7264 코랄보다 핑크쪽으로 구분) */
  --ok: #54C084; --ok-bg: #173525;           /* 성공 초록 다크 (구 profit 초록 값 유지) */
  --warn: #DDA24A;   --warn-bg: #3A2E14;
  --danger: #EE7264; --danger-bg: #3A211D;
  --progress: #EB9A3A;

  /* 사람 파스텔 — 딥 톤 (밝은 글자) */
  --p-sewon: #2B4A66; --p-hakran: #5B3A48; --p-suyeon: #33502F;
  --p-seonghui: #5A4A1E; --p-sieun: #413A5E; --p-bora: #463A64; --p-ai: #3A3E42;

  /* 다크에서 진한 짝은 밝게(글자 대비) */
  --rose-dark: #E86B84;
  --teal-dark: #3BB5B6;
  --bluegray: #9CA3AD;
  --new-flash: var(--ok-bg);

  /* ===== 파생 셰이드 다크 대응 ===== */
  /* 일지 헤더 3파트 — 다크 --rose(#E86B84) HSL -4%/-8% */
  --rose-h1: var(--rose);         /* #E86B84 */
  --rose-h2: #E55975;
  --rose-h3: #E34867;
  --indigo-strong: var(--indigo); /* 다크는 밝은 인디고 그대로 */
  --amber-strong: var(--amber);   /* 다크는 밝은 앰버 그대로 */
  --off-fill: #2C2F33;
  /* 기타의뢰 헤더 3파트 — 다크 --teal(#3BB5B6) HSL -4%/-8% */
  --teal-h1: var(--teal);         /* #3BB5B6 */
  --teal-h2: #36A6A7;
  --teal-h3: #319697;
  /* 순수익 빨강 다크 */
  --profit-line: #5E2E31;
  --profit-strong: var(--profit);
  /* 그 외 표 다크 — 라이트와 같은 rgb(92,168,25) 계열 */
  --violet: #5CA819;              /* 다크: 헤더 (시은 님 지정색 유지) */
  --violet-deep: #447D0F;         /* 다크도 같은 딥그린 밑선 (시은 님 지정색 유지) */
  --sieun-line: #26370F;          /* 그 외 표 월경계 = 그린 딥 틴트 */
  --sieun-strong: var(--violet);  /* 강조 텍스트는 밝은 바이올렛 */
  --sieun-ring: var(--violet);
  /* 틸 틴트 다크 (teal-bg 계열로 수렴) */
  --teal-tint: var(--teal-bg);
  --teal-tint-line: var(--line-strong);
  --teal-tint2: var(--teal-bg);
  --teal-tint3: var(--teal-bg);
  --teal-faint: var(--faint);
  /* 로즈 틴트 다크 (rose-bg 계열) */
  --rose-tint: var(--rose-bg);
  --rose-tint2: var(--rose-bg);
  --rose-tint-line: var(--line-strong);
  --rose-flash: var(--rose-bg);
  --kind-hover: var(--surface-sub);
  --day-band: var(--rose-bg);
  /* 중립 잔재 다크 */
  --phantom-bg: var(--surface-sub);
  --phantom-fg: var(--faint);
  --line-soft: var(--line);
  --track: var(--surface-sub);
  --track-line: var(--line);
  --disabled-bg: var(--surface-sub);
  --chip-bg: var(--surface-sub);
  --bluegray-bg: var(--surface-sub);
  --st-ai-fg: var(--muted);
  --wd-weekend: #5B3A48;          /* p-hakran 다크 톤 (로즈 계열 주말) */
  --wd-weekend-fg: var(--rose);
  --k-solo: var(--teal-bg);
  --line-cool: var(--line);
  --tip-bg: #0F1113;              /* 다크에선 더 어둡게 */

  /* 카테고리 칩 다크 (딥 톤 배경 + 밝은 글자) */
  --cat-sub-bg: var(--teal-bg);       --cat-sub-fg: var(--teal);
  --cat-live-bg: #33481F;             --cat-live-fg: #A8CE86;   /* 실시간(현장·그린) */
  --cat-show-bg: #2F4322;             --cat-show-fg: #9CC078;   /* 공연(현장·그린) */
  --cat-minutes-bg: #293A1C;          --cat-minutes-fg: #90B86E; /* 회의록(현장·그린) */
  --cat-rec-bg: #38382F;              --cat-rec-fg: #B0B0A6;    /* 녹취(중립 회색) */
  --cat-etc-bg: #38382F;              --cat-etc-fg: #B0B0A6;    /* 기타(중립 회색) */
  --o-onsite-bg: #26311B;             /* 현장 3종 작업 구역 연두 배경(다크) */
  --chart-line: var(--faint);
  --chart-dot: var(--muted);
  --chart-dot-dim: var(--faint);

  /* 거래처 탭 바이올렛 다크 */
  --hub: #9D6BFF;
  --hub-deep: #B794FF;
  --hub-tint: #2A2244;
}

* { box-sizing: border-box; }

/* Pretendard 내장 (앱 서버에서 서빙 — 외부 CDN 요청 없음).
   시스템에 미설치여도 전 팀원 동일 렌더링. 시안(클로드 디자인)과 글꼴 일치가 목적. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }

/* ===== Topbar (시안: nav padding 16px 24px) =====
   높이는 sticky 요약 카드 오프셋(--topbar-h)의 기준이라 고정값으로 둔다.
   시안의 16px 세로 패딩 감각을 담되 fs-md 브랜드가 들어가는 58px로 확정. */
:root { --topbar-h: 58px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 0 24px; height: var(--topbar-h); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: baseline; gap: 10px; flex: 0 0 auto; }
.logo { font-weight: 700; font-size: var(--fs-md); color: var(--rose); white-space: nowrap; }
.sub { color: var(--faint); font-size: var(--fs-sm); white-space: nowrap; }
.tabs { display: flex; gap: 4px; flex-wrap: nowrap; }
.tab {
  background: transparent; border: none; padding: 7px 12px; cursor: pointer;
  color: var(--muted); font-size: var(--fs-base); border-radius: var(--r-sm); font-family: inherit;
  white-space: nowrap;
}
.tab:hover { background: var(--surface-sub); }
/* 활성 탭: 색 탭(일지·기타·프리·근무급여) = 테마 tint 배경 + 테마색 글자 700, padding 7px 14px.
   중립 탭(월정산·통계·설정) = 잉크 솔리드(--text 배경 + 흰 글자) — 시안 확인. */
.tab.active { background: var(--rose-bg); color: var(--rose-dark); font-weight: 700; padding: 7px 14px; }
.tab.active[data-tab="other"]      { background: var(--teal-bg);   color: var(--teal-dark); }
.tab.active[data-tab="freelancer"] { background: var(--indigo-bg); color: var(--indigo-strong); }
.tab.active[data-tab="payroll"]    { background: var(--amber-bg);  color: var(--amber-strong); }
.tab.active[data-tab="hub"]        { background: var(--hub-tint);  color: var(--hub-deep); }
.tab.active[data-tab="settle"],
.tab.active[data-tab="stats"],
.tab.active[data-tab="settings"]   { background: var(--text); color: var(--bg); }
/* 꾹 눌러 드래그 재배치: 들린 탭은 은은하게 반투명+그림자, 드롭 위치는 얇은 세로선으로 표시 */
.tabs .tab { touch-action: none; }
.tab.tab-dragging { opacity: .6; box-shadow: var(--shadow-pop); position: relative; z-index: 3; }

/* ===== 헤더 반응형 축소 (창을 줄여도 탭 10개가 늘 한 줄에) =====
   헤더 글자·패딩을 "가용 폭(--hdr-avail)"에 비례해 무단계(clamp)로 줄인다.
   white-space:nowrap로 "어\n썸" 꺾임 방지는 기본 규칙에서 처리.
   데스크톱 앱(Electron)은 우측 OS 캡션 버튼이 ~136px를 먹으므로, .sori-desktop일 때
   그만큼 가용 폭을 빼(--hdr-reserve) 같은 공식이 자동으로 더 일찍 축소되게 한다.
   → 미디어쿼리 단계(밴드)가 없어 특정 폭에서 캡션 버튼과 겹치는 구간이 생기지 않는다.
   일반 브라우저는 --hdr-reserve:0 이라 그대로, 좁아질수록만 줄어든다(768px↓는 m.html).
   패딩을 em으로 잡아 글자 크기에 따라 함께 줄어들게 했다. */
:root { --hdr-reserve: 0px; }
html.sori-desktop { --hdr-reserve: 152px; } /* 캡션 버튼 ~136px + 안전 여유 */
.topbar {
  --hdr-avail: calc(100vw - var(--hdr-reserve));
  /* 탭 글자: 가용 폭 ~750px에서 10.25px, ~1300px 이상에서 15px, 그 사이 선형 */
  --hdr-fs: clamp(10.25px, calc((var(--hdr-avail) - 750px) / 116 + 10.25px), 15px);
}
/* 부제(작업 관리·정산)는 장식이라 폭이 빠듯해지면 숨겨 탭 자리를 확보한다(워드마크는 유지).
   데스크톱 앱은 캡션 버튼이 ~152px를 먹으므로 그만큼 더 이른 폭에서 숨긴다. */
@media (max-width: 1050px) { .sub { display: none; } }
@media (max-width: 1210px) { html.sori-desktop .sub { display: none; } }
/* 더 좁아지면 역할 칩(관리자/직원/…)도 숨긴다 — 이름으로 이미 식별되므로 중복. */
@media (max-width: 960px) { .user-role { display: none; } }
@media (max-width: 1120px) { html.sori-desktop .user-role { display: none; } }
.tabs { gap: clamp(2px, calc((var(--hdr-avail) - 760px) / 300), 4px); }
.tab { font-size: var(--hdr-fs); padding: 0.42em 0.6em; }
.tab.active { padding: 0.42em 0.66em; }
.logo { font-size: calc(var(--hdr-fs) + 2px); }
.sub { font-size: calc(var(--hdr-fs) - 2px); }
.compact-toggle {
  font-size: calc(var(--hdr-fs) - 2.5px); padding: 0.4em 0.7em;
  margin-left: clamp(6px, 1vw, 12px);
}
.user-box { margin-left: clamp(6px, 1vw, 12px); gap: clamp(4px, 0.6vw, 8px); }
.user-name { font-size: calc(var(--hdr-fs) - 2.5px); }
.user-role { font-size: calc(var(--hdr-fs) - 3.5px); }
.user-logout { font-size: calc(var(--hdr-fs) - 2.5px); padding: 0.35em 0.6em; }

/* ===== 데스크톱 앱(Electron): 헤더를 타이틀바로 통합 =====
   preload가 <html>에 .sori-desktop을 붙였을 때만 적용된다(일반 브라우저 무영향).
   헤더 전체를 창 드래그 영역으로 삼고, 그 안의 인터랙티브 요소는 no-drag로 되돌린다.
   우측 캡션 버튼(최소화·최대화·닫기)과 겹치지 않게 env(titlebar-area-width)로 여백 확보.
   더블클릭 최대화는 드래그 영역이면 OS가 처리한다. */
html.sori-desktop .topbar {
  -webkit-app-region: drag;
  /* 캡션 버튼 폭만큼 우측 여백. env 미지원 시 138px(3버튼×46) 폴백 + 8px 간격. */
  padding-right: calc(100vw - env(titlebar-area-width, calc(100vw - 138px)) + 8px);
}
html.sori-desktop .topbar button,
html.sori-desktop .topbar a,
html.sori-desktop .topbar input,
html.sori-desktop .topbar label,
html.sori-desktop .topbar select,
html.sori-desktop .topbar .tab,
html.sori-desktop .topbar .tabs,
html.sori-desktop .topbar .compact-toggle,
html.sori-desktop .topbar .user-box {
  -webkit-app-region: no-drag;
}

main { padding: 20px; margin: 0 auto; }
.tabpanel { display: none; }
.tabpanel.active { display: block; }
/* 일지 탭: 상단 요약 카드로 이동했으므로 하단 여백 불필요 */

/* ===== Toolbar (시안: padding 14px 24px, 배경 surface-sub, 하단 1px line) =====
   main(padding:20px) 안에서 음수 마진으로 full-bleed 스트립을 만들어 시안의 넓은 툴바 감각을 낸다. */
.toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: -20px -20px 0; padding: 14px 24px;
  background: var(--surface-sub); border-bottom: 1px solid var(--line);
}
/* 툴바 바로 뒤에 sticky 요약 카드가 오는 탭(일지·기타·프리)은 카드가 간격을 담당 →
   그 외 탭(근무·급여·월정산·통계)은 툴바 아래 여백을 직접 확보 */
#tab-payroll .toolbar, #tab-settle .toolbar, #tab-stats .toolbar {
  margin-bottom: 20px;
}
.spacer { flex: 1; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-label { font-weight: 700; font-size: var(--fs-md); min-width: 88px; text-align: center; font-variant-numeric: tabular-nums; }
/* 월 이동 화살표 = 30×30 테두리 박스 버튼 (시안) */
.icon-btn {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  width: 30px; height: 30px; cursor: pointer; color: var(--muted); font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg); }
.toggle { display: flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); font-size: var(--fs-sm); }
.hint-inline { color: var(--muted); font-size: 12px; }

/* ===== 월 누적 라인 ===== */
.cum-line {
  font-size: 15px; color: var(--text); margin: 4px 2px 12px;
  font-variant-numeric: tabular-nums;
}
.cum-line .profit { font-weight: 700; font-size: 17px; color: var(--sage); }

/* ===== Chips ===== */
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px;
  font-weight: 600; line-height: 1.4;
}
.chip-rush { background: var(--danger-bg); color: var(--danger); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
/* 일지 툴바 "진행 중 N건" 앰버 칩 (시안: padding 4px 10px, warn-bg/warn, fs-sm 600, r-sm) */
#j-progress-badge {
  padding: 4px 10px; border-radius: var(--r-sm);
  background: var(--warn-bg); color: var(--warn);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.3;
}

/* 빠른 배정 순환 로스터 칩 */
.qa-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 34px; }
.qa-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 12px; border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12); font-size: 15px; font-weight: 600;
  color: var(--text);
}
.qa-chip .qa-ord { font-size: 12px; color: var(--muted); font-weight: 700; }
.qa-chip .qa-move, .qa-chip .qa-del {
  border: none; background: rgba(0,0,0,0.06); cursor: pointer;
  width: 22px; height: 22px; border-radius: 999px; line-height: 1;
  font-size: 13px; color: var(--text); display: inline-flex;
  align-items: center; justify-content: center; padding: 0;
}
.qa-chip .qa-move:hover, .qa-chip .qa-del:hover { background: rgba(0,0,0,0.14); }
.qa-chip .qa-move:disabled { opacity: 0.3; cursor: default; }
.qa-chip .qa-del:hover { background: var(--danger-bg); color: var(--danger); }
.qa-empty { color: var(--muted); font-size: 14px; }
.qa-roster-title { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--text); }

/* ===== 공통 테이블 (정산/설정) ===== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
/* 시트 표(일지·기타·프리)의 wrap은 overflow를 풀어 컬럼 헤더 sticky가 페이지 스크롤 기준으로 동작하게 한다.
   (overflow-x:auto는 overflow-y도 auto로 만들어 sticky를 깨뜨림). 가로가 넘치면 페이지 레벨에서 스크롤. */
.table-wrap:has(> table.sheet) { overflow: visible; }
/* 시안: 표 fs-sm, th padding 9px 12px + 2px line-strong 밑줄, td padding 9px 12px */
table.grid { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.grid th {
  background: var(--surface-sub); color: var(--muted); font-weight: 600; text-align: left;
  padding: 9px 12px; border-bottom: 2px solid var(--line-strong); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.grid th.num { text-align: right; }
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid tbody tr:hover { background: var(--surface-sub); }

/* ===== 월 정산 · 프리랜서별 정산 표 (시안 1505~1514) =====
   헤더: 배경 없음, muted 600, 우측 정렬(이름·계좌만 좌), 2px line-strong 밑줄.
   행: 1px line 하단선. 이름 굵게. 3.3%=danger 붉은, 실지급액=profit 초록 700. */
table.settle-table th {
  background: transparent; color: var(--muted); font-weight: 600;
  padding: 9px 12px; text-align: right; border-bottom: 2px solid var(--line-strong);
  position: static;
}
table.settle-table th:first-child, table.settle-table th.th-left { text-align: left; }
/* 본문 글씨 크게 (15px) — 자잘해서 안 보인다는 피드백. 실지급액은 17px로 한 단계 더 */
table.settle-table td { padding: 12px; border-bottom: 1px solid var(--line); font-size: var(--fs-base); }
table.settle-table tbody tr:last-child td { border-bottom: none; }
table.settle-table td.s-name { font-weight: 600; }
table.settle-table td.s-sum { font-weight: 600; }
table.settle-table td.s-zero { color: var(--faint); }
table.settle-table td.s-tax { color: var(--danger); }
table.settle-table td.s-payout { font-weight: 700; color: var(--profit); font-size: var(--fs-md); }
/* 정산표는 카드 안에 있어 wrap 테두리 제거 (시안: 표만) */
.settle-wrap { border: none; border-radius: 0; }

/* ===== 일지 시트 (시안: fs-sm, th padding 11px 10~14px, td padding 9px 10px) ===== */
table.sheet {
  font-size: var(--fs-sm);
  table-layout: fixed;      /* colgroup 너비 고정 — 편집/리사이즈 시 출렁임 없음 */
  /* 전체 너비는 JS(initColumns)가 col 합으로 px 지정 */
}
table.sheet th {
  background: var(--rose); color: #fff; font-weight: 600; font-size: var(--fs-sm);
  padding: 11px 10px;
  /* 스크롤해도 컬럼 헤더 고정 — 요약카드(sticky) 바로 아래. 오프셋은 JS(updateSheetHeadTop)가 탭별로 설정 */
  position: sticky; top: var(--sheet-head-top, 184px); z-index: 2;
  border-right: 1px solid rgba(255,255,255,0.18); border-bottom: none;
  overflow: hidden; text-overflow: ellipsis;
}
table.sheet th.th-fname { padding: 11px 14px; }
table.sheet th.h-blue { background: var(--bluegray); }
table.sheet th.h-green { background: var(--sage); }
table.sheet th:last-child { border-right: none; }
/* 파트별 헤더 톤 (미세 차이) */
table.sheet th.p1 { background: var(--rose-h1); }
table.sheet th.p2 { background: var(--rose-h2); }
table.sheet th.p3 { background: var(--rose-h3); }
table.sheet td {
  padding: 9px 10px; font-size: var(--fs-sm);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis;
}
table.sheet td:last-child { border-right: none; }
/* 파일명 셀 9px 14px, 금액류 9px 12px (시안) */
table.sheet td.fname { padding-top: 9px; padding-bottom: 9px; }
table.sheet td.num { padding: 9px 12px; }

/* 시트 셀 = "칸 선택" 모드가 기본. 네이티브 텍스트 선택/캐럿 커서 금지 (드래그 = 범위 선택만)
   :where()로 감싸 특이도를 0으로 만들어서, td.kind-cell 등 기존 cursor:pointer 규칙이 그대로 이김 */
:where(table.sheet, table.othersheet) td,
:where(table.sheet, table.othersheet) td * {
  user-select: none; -webkit-user-select: none; -moz-user-select: none;
  cursor: default;
}
/* 편집 모드 진입(td.editing 안 input)에서는 텍스트 선택·캐럿 커서 정상 동작 */
:where(table.sheet, table.othersheet) td.editing,
:where(table.sheet, table.othersheet) td.editing * {
  user-select: text; -webkit-user-select: text; -moz-user-select: text;
}
:where(table.sheet, table.othersheet) td.editing input,
:where(table.sheet, table.othersheet) td.editing textarea {
  cursor: text;
}

/* 정렬: 파일명만 왼쪽, 나머지 전부 가운데 */
table.sheet th, table.sheet td { text-align: center; }
table.sheet td.fname, table.sheet th.th-fname { text-align: left; }
table.sheet td { font-variant-numeric: tabular-nums; }
/* 의뢰·전달 시각 셀은 muted (시안: 보조 정보) */
table.sheet td[data-field="requested_at"],
table.sheet td[data-field="delivered_at"] { color: var(--muted); }

/* ── 기타의뢰 시트: 솔리드 청록(틸) 헤더 (기타의뢰 = 딥틸, 시은 님 지정 복귀) ── */
table.othersheet th { background: var(--teal); border-bottom: 2px solid var(--teal-dark); }
table.othersheet th.op1 { background: var(--teal); }
/* 분·금액·상태 헤더도 나머지와 같은 메인 틸로 (단일 솔리드 헤더) */
table.othersheet th.op2 { background: var(--teal); }
table.othersheet th.op3 { background: var(--teal); }
table.othersheet td.sec-calc { background: transparent; } /* 금액 셀 틴트 제거 — 다른 열과 동일하게 */
table.othersheet th.th-left { text-align: left; }
/* 왼쪽 정렬 열 (의뢰인·파일명·진행상황·프리·비고) */
table.othersheet td.al { text-align: left; }
table.othersheet th.op1 { text-align: left; } /* 마감 헤더도 왼쪽 정렬 (열 통일) */
table.othersheet td.editing { box-shadow: inset 0 0 0 2px var(--teal); }
table.othersheet td.sel-cell { outline-color: var(--teal-dark); }
/* 비고: 길면 말줄임(행 높이 고정). 전체 내용은 셀 단일 클릭 시 팝오버로 표시 */
table.othersheet td.note-cell {
  max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 완료·입금 토글 셀 */
table.othersheet td.toggle-cell { cursor: pointer; font-weight: 700; user-select: none; }
table.othersheet td.toggle-cell.on { background: var(--ok-bg); color: var(--ok); }
table.othersheet td.deposit-cell.on { background: var(--ok-bg); color: var(--ok); }
/* 기타의뢰 계산 열: 프리(연한 muted) · 순수익(--profit 빨강 굵게) — 읽기 전용 */
table.othersheet td.o-free {
  background: transparent; color: var(--muted); font-variant-numeric: tabular-nums;
}
table.othersheet td.o-profit {
  background: transparent; font-weight: 700; color: var(--profit); font-variant-numeric: tabular-nums;
}
/* 크몽 수수료가 반영된 금액(실수령): 원금액과 다름을 알리는 아주 작은 점선 밑줄 표식(툴팁에 원금액·수수료) */
table.othersheet td.o-amt-fee {
  text-decoration: underline dotted var(--muted); text-underline-offset: 3px;
}
table.othersheet td.o-amt-fee.editing { text-decoration: none; }
/* 현장 3종(실시간·회의록·공연): 두 칸막이 사이의 작업 구역(파일명·마감·작업자·분·금액·프리)만 연두.
   글자는 기존 본문 잉크 그대로(틴트 온 틴트 금지). 담당자 완료색(인라인)·마감 임박·선택색이 이 위에 우선한다. */
table.othersheet tr.o-onsite td.o-onsite-zone { background: var(--o-onsite-bg); }
/* 금액 없는 행: 회색 대신 붉은 계열로 — 가격 누락을 알아채도록(은은한 로즈 배경 + 로즈 글씨). */
table.othersheet tr.o-memo td { color: var(--rose); background: var(--rose-flash); }
/* 현장 행이 메모(분량 없음)여도 가운데 작업 구역의 연두는 유지한다.
   나머지 셀은 기존 메모 신호(로즈 배경·글자)를 보존한다. */
table.othersheet tr.o-memo.o-onsite td.o-onsite-zone { background: var(--o-onsite-bg); }

/* ── v5: 월 병합 셀 + 월 경계선 + 작업자 칩 + 이벤트 스트립 + VAT ── */
/* 월 병합 셀: 어썸 날짜 그룹 셀(buildDateCell)과 같은 시각 문법(배경 surface-sub·오른쪽 line-strong 선·
   가운데 정렬·세로 중앙). 그린 틴트 폐지. 색만 틸 — 경계선(아래)에서 틸을 쓴다. 「N월」 + 건수·순수익. */
table.othersheet td.o-mon {
  vertical-align: middle; text-align: center; font-weight: 600; white-space: nowrap;
  background: var(--surface-sub); color: var(--text);
  border-right: 2px solid var(--line-strong);
}
/* 「N월」 = 이 셀의 주인공 → 크게(21px). 건수는 muted, 순수익은 빨강(--profit). */
table.othersheet td.o-mon strong { display: block; font-size: var(--fs-lg); font-weight: 800; line-height: 1.1; }
table.othersheet td.o-mon .o-mon-sub { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
table.othersheet td.o-mon .o-mon-profit { color: var(--profit); font-weight: 700; }
/* [요약] 버튼 — 월 셀 안, 틸 아웃라인. 행 선택과 무관(이벤트 격리). */
table.othersheet td.o-mon .o-mon-sum-btn {
  margin-top: 6px; border: 1px solid var(--teal); background: var(--card); color: var(--teal-dark);
  border-radius: 5px; padding: 2px 9px; font: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer; line-height: 1.3;
}
table.othersheet td.o-mon .o-mon-sum-btn:hover { background: var(--teal); color: #fff; }
table.othersheet td.o-mon.o-mon-empty { background: var(--surface-sub); }
table.othersheet td.o-mon-ph { background: var(--surface-sub); border-right: 2px solid var(--line-strong); }
/* 월 경계(그 달 마지막 행): 어썸 마감선(3px)과 같은 형태, 색만 틸 — 일 경계(2px)보다 우선 */
table.othersheet tr.o-month-end td { border-bottom: 3px solid var(--teal); }
/* rowspan 월 셀도 자기 바닥에 같은 선을 그어 월 구분선이 표 전체 폭을 가로지른다. */
table.othersheet td.o-mon.o-mon-month-end { border-bottom: 3px solid var(--teal); }

/* 작업자 열: 이름O 칩 1~n명. done이면 담당자 고유색(인라인), 아니면 옅은 칩. 왼쪽 정렬. */
table.othersheet td.o-workers { white-space: nowrap; text-align: left; }
.o-wk {
  display: inline-block; border-radius: 3px; padding: 0 6px; margin-right: 3px;
  font-size: 12px; font-weight: 700; background: var(--chip-bg); color: var(--text);
  cursor: pointer; user-select: none;
}
.o-wk:last-child { margin-right: 0; }
.o-wk.done { color: var(--text); }
.o-wk:hover { filter: brightness(0.96); }

/* 파일명·내용 셀(자막·이벤트 제목 공통): 볼드 (시안 v5). */
table.othersheet td.fname { font-weight: 700; }

/* 이벤트 스트립(v5): 비자막 행 몸통에서 [분+금액+프리 요약]만 병합. 우측 요약 텍스트.
   요약 글자는 본문 잉크(var(--text))로 — 연두 현장 배경 위에서도 대비 확보(틴트 온 틴트 금지). */
table.othersheet td.o-strip { background: var(--surface-sub); cursor: pointer; }
table.othersheet td.o-strip-right { text-align: right; color: var(--text); font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
/* 현장 이벤트 스트립은 두 칸막이 안쪽이므로 o-onsite-zone의 연두가 우선한다. */

/* VAT 열: 어썸 다인처럼 O 한 글자(가운데). 클릭 토글. 틸 진한 짝(그린 잔재 제거). */
table.othersheet td.o-vat-cell { text-align: center; font-weight: 800; cursor: pointer; user-select: none; color: var(--teal-dark); }
table.othersheet td.o-vat-cell.on { color: var(--teal-dark); }

/* 마감 노랑 강조(시안 v4): 「마감이 24시간 이내(과거 포함) AND 진행 중」일 때만. 완료·입금 대기 행은 절대 노랑 금지(조건은 JS에서). */
table.othersheet td.o-due-soon { background: var(--warn-bg); color: var(--warn); font-weight: 700; }
table.othersheet tr.o-onsite td.o-onsite-zone.o-due-soon { background: var(--warn-bg); }

/* ── 기타의뢰 안 B: 자막 일감(청록) + 그 외(회보라) 두 섹션 ── */
/* 시안: 섹션 제목 = fs-base 700 기본 텍스트색, 서브는 fs-sm faint */
.o-sec-title { margin: 14px 2px 10px; font-size: var(--fs-base); font-weight: 700; color: var(--text); }
.o-sec-title.oe-title { color: var(--text); }
.o-sec-sub { font-weight: 500; font-size: var(--fs-sm); color: var(--faint); margin-left: 8px; }

/* (구 '그 외' 표 etcsheet 그린 헤더 스타일 제거 — 통일 표로 othersheet 하나만 사용) */

/* 날짜 미정 섹션 (접이식, 기본 접힘) */
.o-undated { margin: 18px 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.o-undated summary {
  cursor: pointer; list-style: none; padding: 10px 14px; font-size: 14px; font-weight: 700;
  color: var(--muted); user-select: none;
}
.o-undated summary::-webkit-details-marker { display: none; }
.o-undated summary::before { content: '▸ '; }
.o-undated[open] summary::before { content: '▾ '; }
.o-undated.has-items summary { color: var(--text); }
.o-undated.has-items summary #o-undated-count { color: var(--danger); font-weight: 800; }
.o-undated-body { padding: 0 14px 14px; }
.o-undated-body .o-sec-title { margin-top: 10px; }
.o-undated-subtotal {
  font-size: 13px; color: var(--muted); padding: 8px 2px 0; font-variant-numeric: tabular-nums;
}
.o-undated-subtotal b { color: var(--profit-strong); font-weight: 700; }

/* 월/년 보기 토글 (세그먼트) */
.seg-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg-btn {
  border: none; background: var(--card); color: var(--muted); cursor: pointer;
  padding: 6px 14px; font-size: 13px; font-weight: 600; font-family: inherit;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { background: var(--bg); }
.seg-btn.on { background: var(--teal); color: #fff; }

/* 상단 스트립 칩 (클릭 = 필터) */
.strip-chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 5px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  color: var(--text); font-variant-numeric: tabular-nums;
}
/* 시안: "못 받은 돈" = warn-bg/warn 틴트 칩 (경계선 없음) */
.strip-chip.unpaid { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn); }
.strip-chip:hover { background: var(--bg); }
.strip-chip.unpaid:hover { background: var(--warn-bg); filter: brightness(0.97); }
.strip-chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.strip-chip.unpaid.on { background: var(--warn); border-color: var(--warn); color: #fff; }

/* 구분(category) 필터 칩 — 툴바용. 구분 1종 이하면 비워져 숨는다. */
.o-cat-filter { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.o-cat-filter:empty { display: none; }
.o-cat-chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  color: var(--muted);
}
.o-cat-chip:hover { border-color: var(--teal); }
.o-cat-chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
/* 간략 스트립 안에서는 더 작게 */
.compact-strip .cs-cat .o-cat-chip { font-size: 11px; padding: 2px 8px; border-radius: var(--r-sm); }

/* 활성 거래처 필터 제거칩 — "거래처: 배영주 ✕". 걸린 상태를 한눈에. 클릭 = 해제. */
.o-client-filter { display: inline-flex; align-items: center; }
.o-client-filter:empty { display: none; }
.o-client-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--teal); background: var(--teal); color: #fff;
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.o-client-chip:hover { filter: brightness(1.06); }
.o-client-chip .ocf-x { font-size: 11px; opacity: 0.85; }
.compact-strip .o-client-filter .o-client-chip { font-size: 11px; padding: 2px 8px; }

/* 상태 칩 (진행 중 → 완료 → 입금 대기 순환) — 기타의뢰 전용(stateCell만 사용) */
td.state-cell { cursor: pointer; user-select: none; }
/* 고정 폭 + 가운데 정렬: '진행 중'·'완료'·'입금 대기' 3종이 모두 같은 크기로 보이게(시안 v4). */
.state-chip {
  display: inline-block; box-sizing: border-box; width: 68px; text-align: center;
  padding: 2px 0; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.5;
}
/* 진행 중: 회색 칩 — 배경 위 글자를 아주 진한 잉크(var(--text))로 (틴트 온 틴트 금지, 시안 v5). */
.state-chip.progress { background: var(--chip-bg); color: var(--text); font-weight: 800; }
.state-chip.wait { background: var(--warn-bg); color: var(--warn); }
.state-chip.paid { background: var(--ok-bg); color: var(--ok); }
/* 미수 파생 칩(완료+미입금+기한 경과): 라벨 '입금 대기' 빨강. 진한 빨강(profit-strong)으로 대비 확보.
   폭은 다른 상태 칩과 동일(68px 고정) — 같은 텍스트라 가변폭 불필요. */
.state-chip.unpaid { background: var(--profit-bg); color: var(--profit-strong); font-weight: 800; }

/* 거래처 셀: 색 배지 폐지(한 열 한 규칙, 시안 v4) → 일반 텍스트 굵게. 경로 셀도 muted 일반 텍스트. */
table.othersheet td.client-cell { font-weight: 600; }
table.othersheet td.channel-cell { color: var(--muted); font-weight: 400; }

/* 거래처 카드 팝오버 (모달 아님 — 마우스 오버 시 뜨는 작은 카드) */
.client-pop {
  position: fixed; z-index: 100; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 12px 14px;
  font-size: 13px; max-width: 320px; pointer-events: none;
}
.client-pop .cp-name { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.client-pop .cp-row { display: flex; justify-content: space-between; gap: 16px; padding: 1px 0; }
.client-pop .cp-row span:first-child { color: var(--muted); }
.client-pop .cp-rules { margin-top: 6px; color: var(--muted); white-space: pre-wrap; border-top: 1px solid var(--line); padding-top: 6px; }

/* 비고 전체보기 팝오버 (모달 아님 — 비고 셀 단일 클릭 시 전체 내용, 바깥클릭·Esc·재클릭 닫힘) */
.note-pop {
  position: fixed; z-index: 130; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.16); padding: 10px 12px;
  font-size: 13px; line-height: 1.5; color: var(--text);
  max-width: 380px; white-space: pre-wrap; word-break: break-word;
}

/* 비고 플로팅 에디터 — 셀 위에 뜨는 넉넉한 편집기(모달 아님). 표 레이아웃 불변, body에 fixed 배치 */
.note-float {
  position: fixed; z-index: 140; box-sizing: border-box;
  background: var(--card); border: 1px solid var(--teal); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.20); padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.note-float-ta {
  width: 100%; min-height: 128px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font: inherit; font-size: var(--fs-base); line-height: 1.5;
  color: var(--text); background: var(--surface);
  resize: none; overflow: hidden; white-space: pre-wrap; word-break: break-word;
}
.note-float-ta:focus { outline: none; border-color: var(--teal); }
.note-float-hint { font-size: 11px; color: var(--faint); text-align: right; user-select: none; }

/* (구 .kmong-chip 경로 배지 폐지 — 시안 v4: 경로는 다른 값과 동일한 muted 일반 텍스트) */
/* 크몽만 보기 필터 칩 */
.o-kmong-filter { display: inline-flex; align-items: center; }
.o-kmong-filter:empty { display: none; }
.o-kmong-chip {
  border: 1px solid var(--amber); background: var(--card); color: var(--amber);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.o-kmong-chip:hover { background: var(--amber-bg); }
.o-kmong-chip.on { background: var(--amber); color: #fff; }
.compact-strip .o-kmong-filter .o-kmong-chip { font-size: 11px; padding: 2px 8px; }

/* 마감된 날 하루 요약 팝오버 (non-modal 카드). 라벨 작게 / 숫자 굵게. */
.day-pop {
  position: fixed; z-index: 120; width: 340px;
  background: var(--rose-tint); border: 1px solid var(--rose); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.16); padding: 12px 13px;
  font-size: 13px; color: var(--text);
}
/* 헤더 한 줄 유지: 날짜+제목 · 건수·분량 뱃지 · 우측 아이콘 버튼들 */
.day-pop .dp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: nowrap; }
.day-pop .dp-title { font-weight: 800; font-size: 14px; white-space: nowrap; flex: 0 0 auto; }
.day-pop .dp-count {
  font-size: 11px; font-weight: 700; color: var(--rose-dark);
  background: var(--rose-tint2); border-radius: 10px; padding: 1px 8px; white-space: nowrap; flex: 0 0 auto;
}
/* 헤더 아이콘 버튼 (⛶ 펼치기 / ✕ 닫기) — 정사각 동일 스타일 */
.day-pop .dp-iconbtn {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  color: var(--muted); width: 24px; height: 24px; padding: 0;
  border-radius: 6px; line-height: 1; font-size: 13px; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.day-pop .dp-iconbtn:hover { color: var(--rose); border-color: var(--rose); background: var(--rose-bg); }
.day-pop .dp-money {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; margin-bottom: 9px;
}
.day-pop .dp-mrow { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 0; }
.day-pop .dp-mlabel { font-size: 11px; color: var(--muted); }
.day-pop .dp-mval { font-weight: 800; font-variant-numeric: tabular-nums; }
.day-pop .dp-profit { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 5px; }
.day-pop .dp-profit .dp-mlabel { color: var(--profit-strong); font-weight: 800; }
.day-pop .dp-profit .dp-mval { color: var(--profit-strong); font-size: 15px; }
.day-pop .dp-sec { margin-top: 9px; }
.day-pop .dp-sec-title {
  font-size: 10.5px; font-weight: 800; color: var(--muted);
  text-transform: none; letter-spacing: 0.02em; margin-bottom: 4px;
}
.day-pop .dp-frow, .day-pop .dp-trow {
  display: flex; justify-content: space-between; align-items: center; padding: 2px 0;
}
.day-pop .dp-fval, .day-pop .dp-trow span:last-child {
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.day-pop .dp-badge {
  font-size: 11.5px; font-weight: 700; color: var(--text);
  border-radius: 10px; padding: 1px 9px;
}
.day-pop .dp-ftotal {
  border-top: 1px solid var(--line); margin-top: 3px; padding-top: 4px;
  font-size: 12px; color: var(--muted);
}
.day-pop .dp-ftotal span:last-child { font-weight: 800; color: var(--text); }
.day-pop .dp-none { color: var(--muted); font-size: 12px; }
.day-pop .dp-ai .dp-ai-line {
  background: var(--profit-bg); border-radius: 7px; padding: 5px 9px;
  font-weight: 700; color: var(--profit-strong); font-variant-numeric: tabular-nums;
}
.day-pop .dp-trow span:first-child { color: var(--muted); }
.day-pop .dp-count { white-space: nowrap; }
/* 우측 정렬: 건수 뱃지 뒤에 오는 첫 아이콘 버튼을 오른쪽 끝으로 민다.
   뒤따르는 아이콘 버튼(✕)은 바로 옆에 6px 간격으로 붙는다. */
.day-pop .dp-count ~ .dp-iconbtn { margin-left: 6px; }
.day-pop .dp-count + .dp-iconbtn { margin-left: auto; }

/* 옅은 어둡기 backdrop — 중앙 모드에서만. 클릭 시 즉시 닫힘(JS). */
.day-backdrop {
  position: fixed; inset: 0; z-index: 119;
  background: rgba(0,0,0,0.2); display: none;
  animation: dpFade 0.12s ease-out;
}
@keyframes dpFade { from { opacity: 0; } to { opacity: 1; } }

/* ── 중앙 모드: 화면 중앙 고정, 폭 넓게, 여백·글자 크게, 2열 그리드 ── */
.day-pop.mode-center {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(600px, calc(100vw - 40px)); max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 22px 26px; font-size: 15px; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
  animation: dpFade 0.12s ease-out;
}
.day-pop.mode-center .dp-head { margin-bottom: 16px; gap: 12px; }
.day-pop.mode-center .dp-title { font-size: 20px; }
.day-pop.mode-center .dp-count { font-size: 14px; padding: 3px 12px; }
.day-pop.mode-center .dp-iconbtn { width: 30px; height: 30px; font-size: 16px; }
/* 기본 수치(금액 4종) — 2열 그리드, 숫자 크게 */
.day-pop.mode-center .dp-money {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px;
  padding: 16px 20px; margin-bottom: 18px;
}
.day-pop.mode-center .dp-mrow { padding: 4px 0; }
.day-pop.mode-center .dp-mlabel { font-size: 13px; }
.day-pop.mode-center .dp-mval { font-size: 19px; }
/* 순수익: 한 행 전체 폭, 24px 초록 */
.day-pop.mode-center .dp-profit {
  grid-column: 1 / -1; border-top: 1px solid var(--line);
  margin-top: 6px; padding-top: 10px;
}
.day-pop.mode-center .dp-profit .dp-mval { font-size: 25px; }
/* 섹션(프리 지급 / AI 절감 / 유형 분포) 2열 그리드로 시원하게 */
.day-pop.mode-center .dp-sec { margin-top: 20px; }
.day-pop.mode-center .dp-sec-title { font-size: 12.5px; margin-bottom: 8px; }
.day-pop.mode-center .dp-frow, .day-pop.mode-center .dp-trow { padding: 5px 0; }
.day-pop.mode-center .dp-fval,
.day-pop.mode-center .dp-trow span:last-child { font-size: 17px; }
.day-pop.mode-center .dp-badge { font-size: 13.5px; padding: 2px 12px; }
.day-pop.mode-center .dp-ai .dp-ai-line { padding: 10px 14px; font-size: 16px; }

/* 기타의뢰 월 요약 팝오버(.o-msum): day-pop 구조 재사용 + 기타의뢰 = 틸 정체성으로 강조색만 교체.
   day-pop 의 로즈 기본 규칙(.day-pop .dp-count 등)을 이기도록 .day-pop.o-msum 로 특정도를 올린다. */
.day-pop.o-msum { border-color: var(--teal); }
.day-pop.o-msum .dp-count { background: var(--teal-bg); color: var(--teal-dark); }
.day-pop.o-msum .dp-iconbtn:hover { color: var(--teal); border-color: var(--teal); background: var(--teal-tint3); }
/* 미수 밴드 — 문제 신호 빨강(담긴 밴드 형태로만) */
.day-pop.o-msum .o-msum-unpaid {
  background: var(--profit-bg); color: var(--profit-strong); border-radius: 7px;
  padding: 8px 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}
/* VAT 발행 — 마무리 한 줄, 은은하게 */
.day-pop.o-msum .o-msum-foot { margin-top: 16px; font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .day-pop.o-msum { border-color: var(--teal); }
[data-theme="dark"] .day-pop.o-msum .dp-count { background: var(--teal-bg); color: var(--teal); }
[data-theme="dark"] .day-pop.o-msum .o-msum-unpaid { background: var(--profit-bg); color: var(--profit); }

/* 기타의뢰 하단 요약 바(#o-bottombar)는 정보 중복으로 제거됨(2026-07). 상단 요약 카드(#o-sum-card)가 대체.
   하단 고정 바가 없으므로 표 아래 과도한 여백 불필요 — 표 하단 숨쉴 공간만 남긴다. */
#tab-other { padding-bottom: 24px; }

/* 3파트 구분 열 (얇은 칸막이) — 페이지 배경 톤, 좌우 얇은 경계선으로만 "살짝 구분".
   채워진 회색 셀처럼 보이면 안 됨(AI 셀 #E0E0E0과 혼동 방지). 너비는 JS가 고정(스케일 제외). */
table.sheet th.divider, table.sheet td.divider {
  background: var(--bg) !important;
  padding: 0;
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
}

/* 열 너비 드래그 핸들 */
.col-resizer {
  position: absolute; top: 0; right: -4px; width: 8px; height: 100%;
  cursor: col-resize; z-index: 3;
}
.col-resizer:hover { background: rgba(255,255,255,0.35); }

/* 구역 배경 톤 */
td.sec-calc { background: var(--sec-calc-bg); }
/* 마감 초과(미전달): 빨간 글씨(인라인) + 노란 셀 배경. 노랑은 테마 대응 토큰(p-seonghui) 재사용 */
td.due-overdue { background: var(--p-seonghui); }
td.sec-sum { background: var(--sec-sum-bg); }

/* 날짜 그룹 경계 (시안: border-top 2px line-strong) */
table.sheet tr.day-first td { border-top: 2px solid var(--line-strong); }

/* 행 hover: 배경색 교체가 아니라 반투명 어두운 오버레이(셀로판지)를 얹어
   색 있는 셀(담당 완료색 등)도 자기 색 위에서 균일하게 살짝 어두워짐 → 얼룩덜룩함 없음.
   background-image는 background-color 위에 겹치므로 인라인 배경/구역 배경을 건드리지 않음.
   날짜 셀(rowspan 병합)·칸막이·프리랜서 하루 계산 셀은 제외 (hover에 완전 불변). */
table.sheet tbody tr:hover td:not(.divider):not(.date-cell):not(.fr-date):not(.fr-day-calc) {
  /* !important: 담당 완료 셀은 인라인 style.background(=background-image:none 포함)로
     칠해져 있어, important가 없으면 오버레이가 인라인에 밀려 안 얹힘 → 얼룩덜룩해짐. */
  background-image: linear-gradient(rgba(35, 43, 51, 0.05), rgba(35, 43, 51, 0.05)) !important;
}

/* 날짜 셀: rowspan 병합, 세로 가운데 + [마감] 버튼.
   불투명 카드색 배경을 명시 — 어떤 hover 규칙에도 색이 절대 변하지 않도록. */
/* 날짜 셀: 세로 스택 + 가운데 정렬. 버튼들은 동일 너비로 세로 정렬. */
td.date-cell {
  font-weight: 600; white-space: nowrap; vertical-align: middle;
  background: var(--surface-sub);                     /* 시안: surface-sub 배경 */
  border-right: 2px solid var(--line-strong);          /* 오른쪽 2px line-strong */
  text-align: center;
}
td.date-cell > * { display: block; margin-left: auto; margin-right: auto; }
/* 세로 스택 gap 6px으로 [마감]/[요약] 칩 배치 */
.close-day-btn, .day-summary-btn {
  width: 52px; box-sizing: border-box; text-align: center;
  margin-top: 6px; font-size: var(--fs-micro); font-weight: 600; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted); cursor: pointer; font-family: inherit;
}
/* [마감]/[해제] 칩 = 로즈 솔리드 흰 글자 (시안) */
.close-day-btn { background: var(--rose); border-color: var(--rose); color: #fff; }
.close-day-btn:hover { background: var(--rose-dark); border-color: var(--rose-dark); }
.close-day-btn.closed { background: var(--rose); border-color: var(--rose); color: #fff; }
/* 날짜 fs-base 700 / 요일 fs-sm muted (시안) */
.date-cell .date-num { cursor: pointer; border-radius: 4px; line-height: 1.2; }
.date-cell .date-num .date-md { display: block; font-size: var(--fs-base); font-weight: 700; }
.date-cell .date-num .date-wd { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.date-cell .date-num:hover .date-md { color: var(--rose-dark); }
/* 마감된 날 [요약] 칩 — 1px line 아웃라인 muted */
.day-summary-btn:hover { background: var(--surface-sub); color: var(--bluegray); border-color: var(--bluegray); }
/* AI 배정 셀: 완료 개념 없음 — 항상 회색 채움(배경은 인라인), 커서는 기본(토글 없음) */
td.person-cell.ai-cell { cursor: default; }

/* 마감선: 마감된 날 블록 맨 아래 굵은 로즈 선 (정본 규칙 8: 3px solid var(--rose)) */
tr.day-close-line td, td.cell-close-line { border-bottom: 3px solid var(--rose) !important; }

.dim { color: var(--muted); }
.fname { overflow: hidden; text-overflow: ellipsis; }

/* 담당자: 진행/완료 모두 보통 굵기 — 구분은 O 표기와 배경색(완료, JS 인라인)만 */
td.person-cell { cursor: pointer; }
td.deliver-empty { cursor: pointer; }
/* 명시 생략("-") 셀: 옅은 회색 대시 — 미배정(빈 셀)과 구별. 토글 없음(더블클릭 편집). */
td.person-cell.person-omit { color: var(--line-strong); font-weight: 700; cursor: default; text-align: center; }

/* 시트식 셀 선택 (엑셀처럼 항상 하나) */
td.sel-cell { outline: 2px solid var(--rose-dark); outline-offset: -2px; }

/* 사각 범위 선택 — sel-cell과 구분되는 옅은 채움 + 얇은 바깥 테두리 */
td.range-cell {
  background: rgba(166, 79, 97, 0.13) !important;
  box-shadow: inset 0 0 0 1px rgba(166, 79, 97, 0.35);
}
td.range-cell.sel-cell { background: rgba(166, 79, 97, 0.13) !important; }
tr.job-row:hover td.range-cell,
tr.phantom-row td.range-cell { background: rgba(166, 79, 97, 0.16) !important; }

/* 선택 통계 칩 — 구글시트식 합계/평균/개수. 우하단 고정, 하단 바 위, non-modal. */
.sel-stats {
  position: fixed; right: 18px; bottom: 66px; z-index: 45;
  display: flex; gap: 16px; align-items: baseline;
  padding: 7px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums;
  pointer-events: none; /* 그리드 클릭을 가리지 않게 */
}
.sel-stats[hidden] { display: none; }
.sel-stats .ss-item { display: inline-flex; gap: 5px; align-items: baseline; }
.sel-stats .ss-lab { color: var(--muted); font-size: 11px; font-weight: 600; }
.sel-stats .ss-val { font-weight: 700; }
.sel-stats .ss-strong .ss-val { color: var(--rose-dark); font-size: 15px; }

/* 행 드래그 재정렬: 일지는 파일명 셀, 기타의뢰는 날짜 셀 왼쪽에 그립을 둔다. */
td.fname { position: relative; padding-left: 14px !important; }
/* 기타의뢰 행 그립은 날짜 칸에 둔다. 왼쪽 여백으로 날짜 텍스트와 겹치지 않게 한다. */
table.othersheet td.o-row-grip-cell { position: relative; padding-left: 18px !important; }
.row-grip {
  position: absolute; left: 1px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 20px; cursor: grab; opacity: 0; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; letter-spacing: -1px; color: var(--muted);
  user-select: none; z-index: 2;
}
/* ⠿ 글리프는 ::before(CSS content)로만 — grip 요소엔 텍스트 노드가 없어 셀 textContent·편집 시작값에 절대 안 섞인다. */
.row-grip::before { content: "⠿"; }
td.fname:hover .row-grip { opacity: 0.75; }
table.othersheet td.o-row-grip-cell:hover .row-grip { opacity: 0.75; }
.row-grip:hover { opacity: 1 !important; background: rgba(0,0,0,0.08); }
.row-grip:active { cursor: grabbing; }

/* 드래그 중 놓일 위치 인디케이터 — 굵고 뚜렷하게 (로즈 계열) */
.drop-indicator {
  position: absolute; left: 0; right: 0; height: 3px; background: var(--rose-dark);
  box-shadow: 0 0 0 1px rgba(166, 79, 97, 0.35), 0 1px 4px rgba(166, 79, 97, 0.5);
  pointer-events: none; z-index: 40; display: none; border-radius: 2px;
}
.drop-indicator.show { display: block; }
/* 기타의뢰 드롭 인디케이터: body 기준 절대 위치(틸 계열) — left/top/width는 JS가 지정 */
.o-drop-indicator {
  position: absolute; right: auto; z-index: 45; height: 3px; background: var(--teal-dark);
  box-shadow: 0 0 0 1px rgba(38, 106, 110, 0.35), 0 1px 4px rgba(38, 106, 110, 0.5);
}

/* 드래그 중인 행: "들린" 느낌 — 반투명 + 옅은 그림자 + 강조 배경 */
tr.row-dragging td {
  opacity: 0.5;
  background: var(--rose-flash) !important;
  box-shadow: 0 4px 10px rgba(166, 79, 97, 0.28);
}
/* 드래그 중엔 커서를 grabbing으로 (grip 자체 포함 문서 전체) */
body.row-drag-active, body.row-drag-active * { cursor: grabbing !important; }

/* 여러 행 선택(범위가 걸친 행) 표시 — 날짜 셀은 선택 하이라이트에서 제외 */

/* 우클릭 컨텍스트 메뉴 */
.ctx-menu {
  position: fixed; z-index: 100; min-width: 168px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); padding: 4px; font-size: 13.5px;
}
.ctx-menu button {
  display: block; width: 100%; text-align: left; padding: 7px 10px;
  border: none; background: none; border-radius: 5px; cursor: pointer;
  font: inherit; color: var(--text);
}
.ctx-menu button:hover { background: var(--rose-bg); color: var(--rose-dark); }
.ctx-menu button.danger:hover { background: var(--danger-bg); color: var(--danger); }
.ctx-menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 2px; }

/* 팬텀 빈 행 — 옅게, 아무 칸이나 입력하면 그 날짜에 새 행 생성 */
tr.phantom-row td { background: var(--phantom-bg); color: var(--phantom-fg); }
tr.phantom-row td.divider { background: var(--bg) !important; }

/* 구분 셀: 빈칸 / O / 급행 */
td.kind-cell { text-align: center; cursor: pointer; font-weight: 600; user-select: none; min-width: 44px; }
td.kind-cell.kind-rush { color: var(--danger); font-weight: 700; }
td.kind-cell:hover { background: var(--kind-hover); }

/* ===== 하단 고정 바 (기타의뢰 전용) — 왼쪽 돈 풀이, 오른쪽 연 합계 ===== */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--day-band); border-top: 3px solid var(--rose-dark);
  padding: 9px 24px; font-size: 15px; font-variant-numeric: tabular-nums;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.07);
}
.bottom-bar .bb-label { font-weight: 800; color: var(--rose-dark); font-size: 16px; margin-right: 4px; }

/* ===== 상단 요약 카드 2장 (일지) — 툴바 아래·표 위, 스크롤해도 상단 고정 =====
   카드1 = 선택한 날, 카드2 = 월 누적. 순수익은 초록 pill로 시선 종착점. */
/* 시안: 컨테이너 grid 1fr 1fr, gap 16px, padding 20px 24px, 배경 surface-sub, 하단 1px line.
   툴바와 이어지는 full-bleed 밴드(main padding 상쇄). sticky 유지. */
.sum-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 12px;
  position: sticky; top: var(--topbar-h); z-index: 6; /* 앱 헤더 아래에 고정, 표 헤더(z1) 위 */
  background: var(--surface-sub); border-bottom: 1px solid var(--line);
  margin-left: -20px; margin-right: -20px; padding: 20px 24px;
  font-variant-numeric: tabular-nums;
}
/* 카드가 하나뿐인 탭(기타·프리)은 1열 */
.o-sum-cards, .fr-sum-cards { grid-template-columns: 1fr; }
/* 프리랜서 탭: 툴바+요약카드를 한 래퍼로 묶어 함께 상단 고정 (표 스크롤에 툴바가 밀려 사라지던 문제).
   래퍼 자체 패딩·보더 없음 — 간략 모드에서 두 자식이 display:none 이면 높이 0이 되게. */
#tab-freelancer .fr-sticky-top { position: sticky; top: var(--topbar-h); z-index: 7; background: var(--bg); }
/* 래퍼 안에서 요약카드 자체 sticky 는 무효화(정적) — 이중 sticky 방지, 래퍼가 대신 고정한다. */
#tab-freelancer .fr-sticky-top .fr-sum-cards { position: static; top: auto; z-index: auto; }
.sum-card {
  min-width: 0; display: flex; align-items: center; gap: 4px;
  min-height: 68px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);       /* 왼쪽 4px 액센트 보더 */
  border-radius: var(--r-md); box-shadow: var(--shadow-card);
}
.sum-day { border-left-color: var(--rose); }        /* 오늘 카드 = 로즈 액센트 */
.sum-month { border-left-color: var(--line-strong); }
/* 라벨 칩: 오늘 = rose-bg/rose, N월 누적 = surface-sub + 1px 테두리/muted (시안) */
.sum-chip {
  border-radius: var(--r-sm); padding: 5px 12px;
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; flex: 0 0 auto;
  margin-right: 6px;
}
.sum-day .sum-chip { background: var(--rose-bg); color: var(--rose-dark); }
.sum-month .sum-chip { background: var(--surface-sub); border: 1px solid var(--line); color: var(--muted); }
/* 월 누적 카드 ⛶ — 하루 요약 dp-iconbtn과 같은 스타일(작은 네모 버튼) */
.sum-expand {
  flex: 0 0 auto; width: 24px; height: 24px; margin-right: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 6px;
  color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.sum-expand:hover { color: var(--bluegray); border-color: var(--bluegray); background: var(--bluegray-bg); }
/* 내부 스탯 gap 22px (시안) */
.sum-stats { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.sum-stat {
  display: inline-flex; flex-direction: column; align-items: flex-end;
  padding: 0 11px; border-left: 1px solid var(--line); line-height: 1.3;
}
.sum-stat:first-child { border-left: none; padding-left: 0; }
/* 스탯: 라벨 fs-micro faint 600 위 / 값 fs-md 700 tabular 아래 (시안) */
.sum-stat-label { font-size: var(--fs-micro); font-weight: 600; color: var(--faint); white-space: nowrap; }
.sum-stat-val {
  font-size: var(--fs-md); font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sum-stat.sum-dim .sum-stat-val { font-weight: 600; color: var(--muted); }
/* 3.3% 등 빼기 스탯 — danger 붉은색 (시안: 프리랜서·기타의뢰 요약 카드) */
.sum-stat.sum-neg .sum-stat-val { color: var(--danger); }
/* 프리 지급 스탯 — ok 초록 (마이너스 없이 지급액을 초록으로 표시). --ok는 라이트/다크 모두 정의됨 */
.sum-stat.sum-free .sum-stat-val { color: var(--ok); }
/* 순수익 알약: profit-bg 박스, padding 8px 16px, radius r-md, 값 fs-lg 700 profit (시안) */
.sum-profit {
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex; flex-direction: column; align-items: flex-end;
  background: var(--profit-bg); border-radius: var(--r-md);
  padding: 8px 16px; line-height: 1.2;
}
.sum-profit-label { font-size: var(--fs-micro); font-weight: 600; color: var(--profit); white-space: nowrap; }
.sum-profit-val {
  font-size: var(--fs-lg); font-weight: 700; color: var(--profit);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* 일지 표 헤더는 position:relative(스크롤과 함께 사라짐)라 카드와 겹치지 않는다.
   카드는 z-index 6 불투명이라 스크롤 시 표 위를 덮는다. */

/* ===== 기타의뢰 상단 요약 카드 (이달/올해) — 일지 sum-card 문법 재사용 ===== */
.o-sum-cards { top: var(--topbar-h); }   /* 앱 헤더 아래 sticky (sum-cards가 sticky 지정) */
.sum-other { border-left-color: var(--teal); }  /* 기타의뢰 = 틸 액센트 */
.sum-other .sum-chip { background: var(--teal-bg); color: var(--teal-dark); border: none; }
/* 구분별 건수 미니 칩 — 카드 오른쪽, 순수익 알약 앞. 값 0 구분은 JS에서 생략. */
.o-sum-cats { display: flex; align-items: center; gap: 6px; margin-left: 14px; flex-wrap: wrap; }
.o-sum-cat-chip {
  font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
/* 미수 배지(시안 v4): 파생 미수 건이 있을 때만 표시(0건이면 JS에서 미출력 — 강조 희소성).
   빨강 알약, 순수익 알약 왼쪽에 우측 정렬로 붙는다. */
.o-sum-alert {
  margin-left: auto; margin-right: 10px; flex: 0 0 auto; white-space: nowrap;
  background: var(--profit-bg); color: var(--profit); border-radius: 999px;
  padding: 5px 13px; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* ===== "오늘 남은 분량" 칩 (일지·프리랜서 요약 영역 오른쪽) =====
   미완료 잔여 작업 분량을 큼직한 tabular 숫자로. 일지=진한 민트(순수익 빨강과 구분,
   사용자 지정 2026-07), 프리=인디고. 남은 게 0이면 JS가 display:none 처리. */
.remain-chip {
  flex: 0 0 auto; margin-left: auto; white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: 7px;
  border-radius: var(--r-md); padding: 6px 14px;
}
/* 창이 좁으면 칩이 순수익 알약과 겹치지 않게 카드 안 윗줄로 올라간다
   (wrap-reverse: 넘친 뒷줄이 아래가 아니라 위에 쌓임). 넓으면 기존 한 줄 오른쪽 끝. */
.sum-month { flex-wrap: wrap-reverse; row-gap: 6px; }
.remain-chip .rc-lb { font-size: var(--fs-micro); font-weight: 700; }
.remain-chip .rc-val { font-size: var(--fs-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
/* 간략 스트립 판(작게) — 오른쪽 끝으로 밀어붙임 */
.compact-strip .cs-remain {
  margin-left: auto; flex: 0 0 auto; white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: 5px;
  border-radius: var(--r-sm); padding: 2px 10px;
}
.compact-strip .cs-remain .rc-lb { font-size: 10.5px; font-weight: 700; }
.compact-strip .cs-remain .rc-val { font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* 색: 진한 민트(일지 — 순수익 빨강과 헷갈리지 않게) / 인디고(프리). 변수 기반, 다크 자동 대응. */
.remain-mint { background: var(--teal-bg); color: var(--teal-dark); }
.remain-indigo { background: var(--indigo-bg); color: var(--indigo-strong); }

/* ===== 프리랜서 탭 (인디고 — 브리프 재배정: 프리=인디고) ===== */
/* 프리랜서 테마 전용 별칭. 기존 fr-계열·freesheet 규칙이 참조하던 --amber/--amber-dark 를
   전역 앰버 토큰과 충돌 없이 인디고로 매핑. (근무·급여의 진짜 앰버는 --amber 원본 유지)
   주의: 주석 안에 별표+슬래시 시퀀스를 쓰면 주석이 조기 종료돼 아래 :root 블록이 파싱에서 날아간다. */
:root {
  --fr: var(--indigo);
  --fr-dark: var(--indigo-strong);   /* --indigo(#5757CE) 진한 짝 */
}
[data-theme="dark"] {
  --fr-dark: var(--indigo);          /* 다크는 밝은 인디고 토큰 그대로 */
}
/* 사람 선택 칩들 (툴바 왼쪽) — 시안: r-sm 사각, padding 6px 14px, fs-sm.
   비활성 = 사람 파스텔 배경(인라인) / 활성 = 흰 surface + inset 2px 인디고 링 + 인디고 글자 700. */
.fr-people { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fr-person-chip {
  border: none; border-radius: var(--r-sm);
  padding: 6px 14px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  color: var(--text); background: var(--surface); line-height: 1.3;
  transition: box-shadow 0.12s;
}
.fr-person-chip:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.14); }
.fr-person-chip.on {
  background: var(--surface) !important;
  box-shadow: inset 0 0 0 2px var(--indigo);
  color: var(--indigo); font-weight: 700;
}
/* 출처 필터 (전체/어썸/기타) — 시안: surface 컨테이너(1px line, r-sm, padding 3px, gap 2px),
   버튼 padding 5px 12px r5, 활성 = 잉크 솔리드(--text 배경 흰 글자). */
.fr-source {
  display: inline-flex; gap: 2px; margin-left: 14px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.fr-src-filter {
  border: none; background: transparent; color: var(--muted);
  padding: 5px 12px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  border-radius: 5px; line-height: 1.3; font-family: inherit;
}
.fr-src-filter:hover { background: var(--surface-sub); }
.fr-src-filter.on { background: var(--text); color: var(--bg); font-weight: 700; }

/* 프리랜서 요약 카드 (인디고 액센트) */
.sum-free { border-left-color: var(--indigo); }
.sum-free .sum-chip { background: var(--indigo-bg); color: var(--indigo); border: none; }

/* 프리랜서 시트 헤더 = 인디고 */
table.freesheet th { background: var(--fr); border-bottom: 2px solid var(--fr-dark); }
table.freesheet td { font-variant-numeric: tabular-nums; }
table.freesheet th.th-left, table.freesheet td.fr-fname { text-align: left; }
/* 헤더는 파일명(th-left)만 빼고 전부 가운데(시트 기본). 본문 숫자열만 우측 정렬 */
table.freesheet td.num { text-align: right; }
/* 날짜 셀: 일지 date-cell 문법 — 날짜 위/요일 아래(연하게), 중앙 배치, 세로 가운데 */
table.freesheet td.fr-date {
  font-weight: 700; color: var(--text); background: var(--surface-sub);
  text-align: center; vertical-align: middle;
  font-size: var(--fs-sm);
  border-right: 2px solid var(--line-strong);
}
table.freesheet td.fr-date .date-md { display: block; font-size: var(--fs-base); font-weight: 700; }
table.freesheet td.fr-date .date-wd { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
/* 오른쪽 하루 계산 2열 (rowspan 세로 가운데) — 하루 요약 숫자: fs-md 크게, 가운데 정렬 */
table.freesheet td.fr-day-calc {
  vertical-align: middle; font-weight: 700; text-align: center;
  background: var(--surface-sub); color: var(--text);
  font-size: var(--fs-md); font-variant-numeric: tabular-nums;
}
/* 날짜 그룹 경계: 일지처럼 진한 상단 경계선(2px). 첫 그룹 제외는 tbody 첫 행 규칙으로 상쇄 */
table.freesheet tbody tr.fr-day-start > td { border-top: 2px solid var(--fr-dark); }
table.freesheet tbody tr.fr-day-start:first-child > td { border-top: none; }
/* (구 하루 소계 행 스타일 — 현재 미사용, 유지) */
tr.fr-subtotal td {
  background: var(--indigo-bg); font-weight: 700; color: var(--fr-dark);
  border-bottom: 2px solid var(--line-strong);
}
/* 출처 미니칩 (어썸=로즈, 기타=틸) */
.fr-src-chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.fr-src-awesome { background: var(--rose-bg); color: var(--rose-dark); }
.fr-src-other { background: var(--teal-bg); color: var(--teal-dark); }
.fr-src-client { color: var(--teal-dark); font-weight: 700; margin-left: 5px; font-size: 11.5px; }
/* 역할 배지 (텍/우나) */
.fr-role { font-weight: 700; color: var(--muted); }
/* 완료 셀 (클릭 토글) */
td.fr-done-cell {
  text-align: center; cursor: pointer; user-select: none; font-weight: 600;
  color: var(--text);
}
td.fr-done-cell:hover { box-shadow: inset 0 0 0 2px var(--fr); }

/* 작업 순위 배지 (.q-rank): 일지 담당 셀 이름 옆 + 프리랜서 파일명 앞. 작지만 잘 보이게(진한 인디고 알약). */
.q-rank {
  display: inline-block; min-width: 15px; padding: 0 4px; margin-left: 5px;
  border-radius: 999px; background: var(--indigo); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
  vertical-align: middle; font-variant-numeric: tabular-nums;
}
td.fr-fname .q-rank { margin-left: 0; margin-right: 6px; }
.q-rank.q-top { background: var(--danger); } /* 1순위만 빨강 (사용자 지정 2026-07) */

/* 작업 순서 정하기 모드 */
.fr-order-wrap { margin-top: 8px; }
.fr-order-hint { color: var(--muted); font-size: 13px; margin: 4px 2px 10px; }
.fr-order-list { display: flex; flex-direction: column; gap: 6px; }
.fr-order-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.fr-order-row.fr-order-dragging { opacity: 0.5; }
.fr-order-rank {
  min-width: 26px; text-align: center; font-weight: 800; font-size: 15px;
  color: var(--fr-dark); font-variant-numeric: tabular-nums;
}
.fr-order-rank.q-top { color: var(--danger); } /* 순서 모드 리스트도 1순위 번호는 빨강 */
.fr-order-handle { cursor: grab; color: var(--muted); font-size: 18px; user-select: none; }
.fr-order-date { color: var(--muted); font-size: 12.5px; white-space: nowrap; min-width: 74px; }
.fr-order-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-order-role { color: var(--muted); font-weight: 700; min-width: 34px; text-align: center; }
.fr-order-arrow {
  width: 28px; height: 26px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 12px;
}
.fr-order-arrow:disabled { opacity: 0.35; cursor: default; }
.fr-order-arrow:hover:not(:disabled) { border-color: var(--fr); }
.fr-order-done {
  padding: 5px 12px; border: 1px solid var(--ok); border-radius: 6px;
  background: transparent; color: var(--ok); font-weight: 700; cursor: pointer;
}
.fr-order-done:hover { background: var(--ok-bg); }
#fr-order-btn.on, #frcs-order.on { background: var(--fr); color: #fff; border-color: var(--fr); }
/* 순위 표시 토글: .on = 표시 중(기본). 순위 배지와 같은 인디고 계열로 켜짐 상태 표시.
   툴바 버튼(일지·프리랜서)과 간략 스트립 칩(일지 cs-rank·프리랜서 frcs-rank) 모두 동일 톤. */
#fr-rank-btn.on, #j-rank-btn.on { background: var(--fr); color: #fff; border-color: var(--fr); }
.compact-strip #cs-rank.on, .compact-strip #frcs-rank.on { background: var(--fr); color: #fff; border-color: var(--fr); }

.fr-empty {
  text-align: center; color: var(--muted); padding: 40px 0; font-size: 15px;
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 8px 8px;
  background: var(--card);
}

/* ===== 프리랜서 정산표 팝오버 (중앙 모드) ===== */
/* 폭 넓게(980px): 긴 파일명도 한 줄로 여유 있게. */
#fr-settle-pop.mode-center { width: min(980px, calc(100vw - 48px)); }
.fst-sub { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }
/* hidden: 글자 크기 배율(zoom)에서 소수점 잔여로 생기는 가짜 가로 스크롤바 방지.
   열 폭은 fixed 레이아웃+말줄임이라 실제로 넘칠 일 없음. */
.fst-wrap { overflow-x: hidden; }
.fst-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.fst-table th, .fst-table td {
  border-bottom: 1px solid var(--line); padding: 8px 12px; text-align: center; white-space: nowrap;
}
.fst-table th { background: var(--fr); color: #fff; font-weight: 800; border-bottom: 2px solid var(--fr-dark); }
.fst-table th.l, .fst-table td.l { text-align: left; }
.fst-table th.n, .fst-table td.n { text-align: right; }
/* 고정 열들은 콘텐츠 최대치(7자리 금액·"월 합산" 등)를 담을 폭으로 확정하고,
   내용 열만 auto 로 나머지 폭을 흡수 → 고정 열 합이 컨테이너를 넘지 않아 가로 스크롤 0. */
.fst-table col.fst-c-date { width: 64px; }
.fst-table col.fst-c-title { width: auto; }
.fst-table col.fst-c-min { width: 52px; }
.fst-table col.fst-c-unit { width: 62px; }
.fst-table col.fst-c-amt { width: 128px; } /* 7자리 금액(3,746,641원)도 16px 굵은 글씨로 여유 */
/* 내용 셀: 남는 폭 안에서 한 줄로 말줄임(auto 열이라 표를 넓히지 않음 → 스크롤 방지). */
.fst-table td.l {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 13px; padding-left: 10px; padding-right: 8px; max-width: 0;
}
.fst-table tr.fst-awesome td { background: var(--indigo-bg); font-weight: 700; }
.fst-table tfoot tr.fst-sumrow td { background: var(--surface-sub); font-weight: 700; }
.fst-table tfoot tr.fst-sumrow td.n { font-weight: 800; }
.fst-table tfoot tr.fst-payrow td {
  background: var(--profit-bg); color: var(--profit-strong); font-weight: 800; font-size: 16px;
  border-top: 2px solid var(--profit-line); border-bottom: none;
}
.fst-btns { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }

/* ===== 기타의뢰 상세 ▸ 아이콘 (파일명 셀 안, 텍스트 왼쪽 디스클로저) ===== */
/* 상세 열 폐지(시안 v5) → ▸ 아이콘을 파일명 셀 안으로. ▸ 글리프는 ::before로만 그려 셀 텍스트 오염 차단.
   항상 은은하게 보이는 상시 어포던스(hover 시 진해짐). 파일명 앞 좌측 정렬. */
table.othersheet td.fname { padding-left: 8px !important; }
.o-detail-btn {
  border: none; background: none; color: var(--teal-faint); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 8px 0 0; margin: 0; vertical-align: baseline;
  transition: color 0.12s;
}
.o-detail-btn::before { content: "▸"; }
.o-detail-btn:hover { color: var(--teal-dark); }
td.fname .o-detail-btn { flex: 0 0 auto; }
/* 견적서 보기 아이콘: 파일명/내용 셀 우측, 어썸 일지 드라이브 아이콘(.drive-ic)과 같은 자리·스트로크·색.
   인라인 SVG 라인 글리프. 평시 숨김(opacity 0) → 행 호버·셀 선택 시에만(시안 v4 아이콘 다이어트). */
.o-quote-icons {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center;
  opacity: 0; transition: opacity 0.12s;
}
#tab-other tr[data-oj]:hover .o-quote-icons,
#tab-other tr:has(td.sel-cell) .o-quote-icons,
td.fname:hover .o-quote-icons { opacity: 1; }
.o-quote-ic {
  width: 22px; height: 20px; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 4px;
  color: var(--teal-dark); line-height: 0;
  transition: background 0.12s, color 0.12s;
}
.o-quote-ic:hover { background: var(--teal-tint2); color: var(--teal); }
.o-quote-ic svg { display: block; }
[data-theme="dark"] .o-quote-ic:hover { background: var(--teal-bg); }
/* 편집 중엔 아이콘 숨김 (input 이 셀을 채움) */
td.fname.editing .o-quote-icons { display: none; }

/* ===== 마감(due) 셀 달력·시계 아이콘 + 피커 팝오버 ===== */
td.editable[data-field="due"] { position: relative; }
.o-due-icons {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; opacity: 0; transition: opacity 0.12s;
}
/* 평시 숨김 → 행 호버·셀 선택·마감 셀 호버 시에만(시안 v4 아이콘 다이어트) */
#tab-other tr[data-oj]:hover .o-due-icons,
#tab-other tr:has(td.sel-cell) .o-due-icons,
td.editable[data-field="due"]:hover .o-due-icons { opacity: 1; }
.o-due-ic {
  width: 20px; height: 18px; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 4px;
  color: var(--teal-dark); line-height: 0; transition: background 0.12s, color 0.12s;
}
.o-due-ic:hover { background: var(--teal-tint2); color: var(--teal); }
.o-due-ic svg { display: block; }
[data-theme="dark"] .o-due-ic:hover { background: var(--teal-bg); }
td.editable[data-field="due"].editing .o-due-icons { display: none; }
/* 상세 패널 마감 입력 옆 아이콘 */
.op-due-btn { font-size: 13px; }

.o-due-pop {
  position: fixed; z-index: 130; width: 268px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18); padding: 10px; color: var(--text);
}
.o-due-pop .dp-textrow { margin-bottom: 9px; }
.o-due-pop .dp-text {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px;
  padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--text);
}
.o-due-pop .dp-text:focus { outline: none; border-color: var(--teal); }

.o-due-pop .dp-cal-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px;
}
.o-due-pop .dp-cal-title { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.o-due-pop .dp-nav {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; font-family: inherit; padding: 0;
}
.o-due-pop .dp-nav:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-tint2); }

.o-due-pop .dp-week, .o-due-pop .dp-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.o-due-pop .dp-wd { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.o-due-pop .dp-sun { color: var(--danger); }
.o-due-pop .dp-sat { color: var(--indigo); }
.o-due-pop .dp-day {
  aspect-ratio: 1 / 1; border: 1px solid transparent; background: transparent; color: var(--text);
  border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 12px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.o-due-pop .dp-day.dp-empty { visibility: hidden; cursor: default; }
.o-due-pop button.dp-day:hover { background: var(--teal-tint2); }
.o-due-pop .dp-day.dp-today { border-color: var(--line-strong); font-weight: 700; }
.o-due-pop .dp-day.dp-sel,
.o-due-pop .dp-day.dp-sel:hover { background: var(--teal); color: #fff; font-weight: 800; border-color: var(--teal); }

.o-due-pop .dp-time { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 9px; }
.o-due-pop .dp-timehead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.o-due-pop .dp-readout { display: flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.o-due-pop .dp-seg {
  font-family: inherit; font-size: 20px; font-weight: 800; line-height: 1; color: var(--text);
  padding: 3px 7px; border-radius: 7px; border: 1px solid transparent; background: transparent;
  cursor: pointer; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums;
}
.o-due-pop .dp-seg:hover { background: var(--teal-tint2); }
.o-due-pop .dp-seg.on { background: var(--teal); color: #fff; }
.o-due-pop .dp-colon { font-size: 20px; font-weight: 800; color: var(--muted); }
.o-due-pop .dp-ampm { display: flex; flex-direction: column; gap: 3px; }
.o-due-pop .dp-ap {
  font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer;
  padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.o-due-pop .dp-ap:hover { border-color: var(--teal); color: var(--teal); }
.o-due-pop .dp-ap.on { background: var(--teal); color: #fff; border-color: var(--teal); }

.o-due-pop .dp-clockwrap { display: flex; justify-content: center; padding: 4px 0 2px; }
.o-due-pop .dp-clock { width: 174px; height: 174px; touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.o-due-pop .dp-face { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.o-due-pop .dp-tick { stroke: var(--line-strong); stroke-width: 1; }
.o-due-pop .dp-tick-maj { stroke: var(--muted); stroke-width: 2; }
.o-due-pop .dp-num { fill: var(--text); font-family: inherit; font-size: 15px; font-weight: 700; pointer-events: none; }
.o-due-pop .dp-hhand { stroke: var(--teal-dark); stroke-width: 5; stroke-linecap: round; }
.o-due-pop .dp-mhand { stroke: var(--teal); stroke-width: 3; stroke-linecap: round; }
.o-due-pop .dp-hub { fill: var(--teal-dark); stroke: var(--card); stroke-width: 1.5; }
.o-due-pop .dp-clock.dp-noset .dp-hhand,
.o-due-pop .dp-clock.dp-noset .dp-mhand,
.o-due-pop .dp-clock.dp-noset .dp-hub { opacity: 0.28; }

.o-due-pop .dp-manrow { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.o-due-pop .dp-tinput {
  width: 72px; box-sizing: border-box; font-family: inherit; font-size: 14px; font-weight: 700; text-align: center;
  padding: 5px 6px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.o-due-pop .dp-tinput:focus { outline: none; border-color: var(--teal); }
.o-due-pop .dp-tinput.bad { border-color: var(--danger); }
.o-due-pop .dp-tclear {
  font-family: inherit; font-size: 11px; font-weight: 700; color: var(--muted); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px;
}
.o-due-pop .dp-tclear:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

.o-due-pop .dp-btns { display: flex; gap: 6px; margin-top: 10px; }
.o-due-pop .dp-btn {
  flex: 1; padding: 7px 0; border-radius: 7px; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 700; border: 1px solid var(--line);
}
.o-due-pop .dp-clear { background: var(--surface); color: var(--muted); }
.o-due-pop .dp-clear:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.o-due-pop .dp-apply { background: var(--teal); color: #fff; border-color: var(--teal); }
.o-due-pop .dp-apply:hover { background: var(--teal-dark); }

/* ===== 그 외 표 구분 칩 셀 (카테고리별 파스텔 칩, 클릭 순환·타이핑) ===== */
td.o-cat-cell { text-align: center; cursor: pointer; user-select: none; padding: 3px 4px; }
.o-cat-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
/* 표 안 구분 칩(시안 v5): 각진 태그(radius 3px) + 상태 칩처럼 고정 폭·가운데 정렬(글자 수 무관).
   '#' 접두 폐지. (툴바 필터 칩에는 적용 안 함 — 셀에 한정) */
td.o-cat-cell .o-cat-chip {
  border: 1px solid rgba(0,0,0,0.14); border-radius: 3px;
  box-sizing: border-box; width: 52px; padding: 2px 4px; text-align: center;
}
[data-theme="dark"] td.o-cat-cell .o-cat-chip { border-color: rgba(255,255,255,0.2); }
table.othersheet td.o-cat-cell.editing { box-shadow: inset 0 0 0 2px var(--teal); }

/* 잘라낸 행 (Ctrl+X) — 점선 + 옅게, Ctrl+V 로 선택 위치에 이동 */
tr.row-cut td {
  opacity: 0.5;
  border-top: 2px dashed var(--rose) !important;
  border-bottom: 2px dashed var(--rose) !important;
}

/* 진행 중 스트라이프 (파일명 셀 왼쪽 — 날짜 병합과 무관하게 항상 같은 위치) */
tr.in-progress td[data-field="filename"] { box-shadow: inset 3px 0 0 var(--progress); }

/* 견적→기타 이동으로 지목된 행 — 다른 행 선택 전까지 지속되는 또렷한 강조 (좌측 바 + 옅은 청록 배경) */
tr.row-picked td { background: var(--teal-bg); }
table.othersheet tr.row-picked td.o-onsite-zone { background: var(--teal-bg); }
tr.row-picked td:first-child { box-shadow: inset 4px 0 0 var(--teal); }

/* 새로 추가된 행 하이라이트 */
tr.row-new td { animation: rowNew 3.2s ease-out; }
@keyframes rowNew {
  0% { background-color: var(--new-flash); }
  65% { background-color: var(--new-flash); }
  100% { background-color: transparent; }
}

/* 셀 편집 — input이 셀 내부를 그대로 채워서 크기 변화(리플로우) 없음 */
/* (평상시 커서는 위 table.sheet/othersheet 규칙의 default를 따름 — 편집 중(td.editing)에만 text) */
.cell-input {
  display: block; width: 100%; height: auto;
  box-sizing: border-box; border: none; outline: none; border-radius: 0;
  padding: 0; margin: 0;
  font: inherit; line-height: inherit; font-size: var(--fs-sm);
  background: transparent; color: inherit; text-align: inherit;
}
td.editing {
  box-shadow: inset 0 0 0 2px var(--rose);
  background: var(--surface) !important;
}
.cell-error { outline: 2px solid var(--danger); outline-offset: -2px; }

/* 날짜 셀 편집: 텍스트 입력 + 달력 팝업 버튼 */
.date-edit-wrap { display: flex; align-items: center; width: 100%; height: 100%; gap: 2px; }
.date-edit-wrap .cell-input { flex: 1 1 auto; min-width: 0; width: auto; }
.date-pick-native {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
  border: none; padding: 0; margin: 0;
}
.date-pick-btn {
  flex: 0 0 auto; border: none; background: transparent; cursor: pointer;
  font-size: 12px; padding: 0 2px; line-height: 1; opacity: 0.7; border-radius: 3px;
}
.date-pick-btn:hover { opacity: 1; background: rgba(0,0,0,0.06); }

/* 행 삭제 버튼 */
.del-cell { width: 30px; text-align: center; }
.del-btn {
  visibility: hidden; border: none; background: none; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 4px;
}
tr:hover .del-btn { visibility: visible; }
.del-btn:hover { background: var(--danger-bg); color: var(--danger); }

/* ===== Cards ===== */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px; margin-bottom: 18px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; }
.hint { color: var(--muted); margin: 0 0 10px; font-size: 12px; }

.row { display: flex; align-items: flex-end; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field.checkbox { flex-direction: row; align-items: center; }
.field input, .field select, .add-inline input, .add-inline select {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 13px;
  font-family: inherit; background: var(--card); color: var(--text);
}
.add-inline { align-items: center; }
.client-rates { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }

/* ===== 설정 서브내비 ===== */
.set-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
/* 시안: 칩 padding 6px 16px, radius r-sm, 비활성 surface/muted, 활성 teal 솔리드 흰 글자 */
.set-navchip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 6px 16px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-sm);
  font-family: inherit; font-weight: 600;
}
.set-navchip:hover { background: var(--bg); }
.set-navchip.on { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 700; }
/* 시안: 설정의 "추가" 버튼 = teal 솔리드. add 액션 버튼에 .btn-add 부여(app.js가 렌더 시). */
#tab-settings .btn-add {
  background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 700;
}
#tab-settings .btn-add:hover { filter: brightness(1.05); background: var(--teal); }
.set-section[hidden] { display: none; }
.set-inactive summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.set-inactive[open] summary { margin-bottom: 4px; }
/* 주민번호 마스킹 셀 */
.resident-cell { cursor: pointer; font-variant-numeric: tabular-nums; }

/* ===== Buttons ===== */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 7px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); background: var(--accent); }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-bg); color: var(--danger); }

/* ===== KPI (월 정산 카드 4장) — 시안: grid 4열 gap 16px =====
   카드: surface, 1px line, r-md, padding 16px 18px, shadow-card.
   라벨 fs-micro faint 600 / 숫자 fs-xl 700 tabular / 서브 fs-micro muted. */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; box-shadow: var(--shadow-card);
}
.kpi .label { color: var(--faint); font-size: var(--fs-micro); font-weight: 600; margin-bottom: 6px; }
.kpi .big { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .small { color: var(--muted); font-size: var(--fs-micro); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi.accent .big, .kpi.teal .big { color: var(--teal); }
.kpi.brass .big { color: var(--brass); }
/* 회사 전체 순수익 = 민트 배경 + 초록 숫자·라벨 (시안) */
.kpi.profit { background: var(--profit-bg); border-color: var(--profit-line); box-shadow: none; }
.kpi.profit .big { color: var(--profit); }
.kpi.profit .label { color: var(--profit); }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.toast.err { background: var(--danger); }

/* ===== 근무·급여 탭 ===== */
/* 급여 팔레트: 앰버 (브리프 재배정: 근무·급여=앰버). --pay* 는 앰버 토큰으로 매핑. */
:root {
  --pay: var(--amber);
  --pay-dark: var(--amber-strong);
  --pay-soft: var(--amber-bg);
  --leave: var(--p-suyeon);   /* 연차·반차 = 수연 파스텔(초록) — 시안 */
  --leave-line: var(--line);
  --trip: var(--amber-bg);    /* 출장 = 앰버 연한 배경 — 시안 (인라인 스타일 준수) */
  --trip-line: var(--line);
  --off: var(--off-fill);        /* 휴무 회색 */
  --ot: var(--progress);         /* 초과 = progress 오렌지 */
}
[data-theme="dark"] {
  --pay-dark: var(--amber-strong);
  --pay-soft: var(--amber-bg);
  --leave: var(--p-suyeon);
  --leave-line: var(--line);
  --trip: var(--amber-bg);
  --trip-line: var(--line);
  --off: var(--off-fill);
}
/* 시안: 담당자 칩 = 사람 파스텔 배경, padding 6px 12px, r-sm, fs-sm 600 */
.pr-who { display: inline-block; padding: 6px 12px; border-radius: var(--r-sm); background: var(--p-hakran); color: var(--text); font-weight: 600; font-size: var(--fs-sm); }
.pr-who:empty { display: none; }

/* 오늘 출퇴근 카드 (달력 위). 학란이 매일 누르는 용도. 급여 카드 문법과 통일된 카드. */
/* 시안: 좌측 4px 앰버 액센트, r-md, shadow-card, padding 14px 18px */
.pr-clock-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: var(--r-md); box-shadow: var(--shadow-card);
  padding: 14px 18px; margin-bottom: 16px;
}
.pr-clock-date { font-weight: 700; font-size: var(--fs-md); color: var(--text); white-space: nowrap; }
.pr-clock-btns { display: flex; gap: 10px; margin-left: auto; }
.pr-clock-btn {
  min-height: 44px; min-width: 108px; padding: 0 20px;
  font: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
/* 시안: 출근 = 앰버 솔리드(흰 글자, ✓) / 퇴근 = 중립 line-strong 아웃라인 */
.pr-clock-in { background: var(--pay); border: 1px solid var(--pay-dark); color: #fff; }
.pr-clock-in:hover { background: var(--pay-dark); }
.pr-clock-out { background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); }
.pr-clock-out:hover { background: var(--surface-sub); }
/* 기록되면 상태 표시. 시안: 출근(체크) = 앰버 솔리드 유지, 퇴근 = 앰버 연한 배경. */
.pr-clock-out.done {
  background: var(--pay-soft); border-color: var(--pay); color: var(--pay-dark);
}
.pr-clock-in.done { background: var(--pay); border-color: var(--pay-dark); color: #fff; }
.pr-clock-in.done:hover { background: var(--pay-dark); }
/* 오늘 기록 수정 링크 (팝오버 열기) */
.pr-clock-edit {
  margin-left: 4px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted); background: transparent; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; min-height: 44px;
}
.pr-clock-edit:hover { background: var(--pay-soft); border-color: var(--pay); }

/* ===== 근태 미니 편집 팝오버 (모달 아님, 화면 안 막음) ===== */
.att-pop {
  position: fixed; z-index: 130; width: 236px;
  background: var(--surface); border: 1px solid var(--pay); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2); padding: 12px; font-size: 13px;
}
.att-pop-head { font-weight: 800; font-size: 14px; color: var(--pay-dark); margin-bottom: 10px; }
.att-time-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.att-time-row.att-time-off { opacity: 0.4; }
.att-time-in {
  flex: 1 1 0; min-width: 0; text-align: center; padding: 7px 6px;
  font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 6px;
  outline: none; background: var(--surface); font-variant-numeric: tabular-nums;
}
.att-time-in:focus { border-color: var(--pay); }
.att-time-in:disabled { background: var(--disabled-bg); }
.att-dash { color: var(--muted); font-weight: 700; }
.att-chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.att-chip {
  padding: 5px 10px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted);
}
.att-chip:hover { border-color: var(--pay); color: var(--pay-dark); }
.att-chip.on { background: var(--pay); border-color: var(--pay-dark); color: #fff; }
.att-btn-row { display: flex; gap: 8px; justify-content: flex-end; }

.pr-layout { display: flex; gap: 20px; align-items: flex-start; }
.pr-cal-wrap { flex: 1 1 auto; min-width: 0; }
/* 시안: 급여 카드 width 320px, r-md, shadow-card, padding 20px */
.pr-card {
  flex: 0 0 320px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 20px; box-shadow: var(--shadow-card);
}

/* 달력 — 시안: 붙어 있는 격자(테이블 느낌). 헤더 fs-sm 600 muted, 토=teal·일=rose.
   셀: 70px, border 1px line(공유), 라운드·간격 없음, vertical-align:top, padding 6px 8px. */
.pr-cal-head {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; margin-bottom: 0;
}
.pr-cal-head span { text-align: center; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); padding: 8px 0; }
.pr-cal-head .sat { color: var(--teal); }
.pr-cal-head .sun { color: var(--rose); }
/* 공유 테두리: 컨테이너 위·왼쪽 1px, 각 셀 아래·오른쪽 1px → 이중선 없이 격자 */
.pr-cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}

.pr-day {
  position: relative; min-height: 70px; background: var(--surface);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 6px 8px; cursor: pointer; overflow: hidden; vertical-align: top;
}
.pr-day.empty { background: var(--surface-sub); cursor: default; }
.pr-day.weekend { background: var(--surface-sub); }
.pr-day.d-off { background: var(--off); }
.pr-day.d-leave { background: var(--leave); }
.pr-day.d-trip { background: var(--trip); }
.pr-day.d-holiday { background: var(--rose-bg); }
.pr-day.sel { box-shadow: inset 0 0 0 2px var(--pay); }
.pr-day .dnum { font-weight: 700; font-size: var(--fs-sm); color: var(--text); }
.pr-day.sun .dnum { color: var(--rose); }
.pr-day.sat .dnum { color: var(--teal); }
/* 자동 공휴일: 날짜 숫자 로즈(일요일과 동일 계열) + 작은 이름 라벨. 배경은 채우지 않아 수동 지정(d-holiday 풀필)과 구분 */
.pr-day.holiday .dnum { color: var(--rose); }
.pr-day .dholiday {
  font-size: var(--fs-micro); color: var(--rose); font-weight: 700; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pr-day .dholiday.sub { font-weight: 500; color: var(--muted); }
.pr-day.d-trip .dstatus { color: var(--amber); }
.pr-day .dtime { font-size: var(--fs-micro); color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pr-day.sel .dtime { color: var(--warn); }
.pr-day .dstatus { font-size: var(--fs-micro); color: var(--muted); font-weight: 500; margin-top: 2px; }
/* +N 초과근무 뱃지 = 앰버(progress) 솔리드, top/right 6px (시안) */
.pr-day .ot-badge {
  position: absolute; top: 6px; right: 6px; background: var(--progress); color: #fff;
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: var(--r-sm);
}
/* 셀 인라인 입력 — 셀 크기 그대로, 출렁임 없음 */
.pr-day .pr-cell-input {
  width: 100%; border: 1px solid var(--pay); border-radius: 5px;
  padding: 2px 4px; font: inherit; font-size: 13px; margin-top: 4px;
  outline: none; background: var(--surface); box-sizing: border-box;
}

/* 범례 — 시안: gap 18px, fs-sm muted. 스와치 15×15 r4.
   재택=흰+line-strong 테두리 / 연차반차=p-suyeon / 휴무=surface-sub+line / 출장=amber-bg / 초과=progress 솔리드 */
.pr-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; color: var(--muted); font-size: var(--fs-sm); }
.pr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pr-legend .lg { width: 15px; height: 15px; border-radius: 4px; display: inline-block; }
.pr-legend .lg-work { background: var(--surface); border: 1px solid var(--line-strong); }
.pr-legend .lg-leave { background: var(--p-suyeon); }
.pr-legend .lg-off { background: var(--surface-sub); border: 1px solid var(--line); }
.pr-legend .lg-trip { background: var(--amber-bg); }
.pr-legend .lg-ot { background: var(--progress); }

/* 급여 카드 (읽기 전용 요약) — 시안: 라벨 fs-sm muted 600 → 합계 26px 앰버.
   내역 줄: padding 12px 0, border-top 1px line, 라벨 fs-sm muted, 값 fs-base 700. */
.pr-card-title { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; margin-bottom: 4px; }
.pr-card-title b { color: var(--muted); font-weight: 600; }
.pr-total {
  font-size: 26px; font-weight: 700; color: var(--amber);
  font-variant-numeric: tabular-nums; margin: 0 0 18px;
}
.pr-pay { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.pr-pay td { padding: 12px 0; border-top: 1px solid var(--line); vertical-align: baseline; }
.pr-pay td.pr-label { color: var(--muted); font-size: var(--fs-sm); }
.pr-pay td.pr-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; font-size: var(--fs-base); color: var(--text); }
.pr-pay td.pr-val.neg { color: var(--danger); }
.pr-pay .pr-auto { color: var(--faint); font-size: var(--fs-micro); margin-top: 2px; }
/* 매달 자동 적용되는 고정 항목 뱃지 */
.pr-badge-monthly {
  display: inline-block; background: var(--pay-soft); color: var(--pay-dark);
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  margin-left: 6px; vertical-align: 1px;
}

/* 연차 배너 (급여 카드 아래) — 시안: amber-bg/amber, fs-sm 600, padding 11px, r-sm, 가운데 */
.pr-leave-line {
  margin-top: 14px; padding: 11px; background: var(--amber-bg); border-radius: var(--r-sm);
  color: var(--amber); font-size: var(--fs-sm); font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums;
}

.mini-select {
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px;
  font-size: 13px; background: var(--card); font-family: inherit; max-width: 100%;
}
.inline-input { border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; font-size: 12px; width: 70px; font-family: inherit; text-align: right; }

/* ===== 기타의뢰 상세/추가 — 화면 중앙 팝오버 (일지 하루요약 중앙 모드와 같은 문법) ===== */
/* backdrop: 옅은 어둡기 + 클릭 시 닫힘(JS). 화면 중앙 고정. */
.o-panel-backdrop {
  position: fixed; inset: 0; z-index: 119;
  background: rgba(0,0,0,0.2); animation: dpFade 0.12s ease-out;
}
/* 패널 + 사이드 카드를 한 틀로 묶는 래퍼: 화면 중앙 정렬, 같은 높이(stretch). */
.o-panel-wrap {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 120;
  display: flex; align-items: stretch; gap: 14px;
  max-height: calc(100vh - 48px); max-width: calc(100vw - 40px);
  animation: dpFade 0.12s ease-out;
}
.o-panel {
  flex: 0 0 auto;
  width: min(700px, calc(100vw - 40px)); max-height: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
  display: flex; flex-direction: column; overflow: hidden;
}

/* ── 거래처 정보 사이드 카드: 고정 폭(300px), 패널과 같은 높이(래퍼 stretch). 내용만 교체돼 틀 불변. ── */
.o-side-card {
  flex: 0 0 300px; width: 300px; max-height: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
  display: flex; flex-direction: column; overflow: hidden;
}
.o-side-card.collapsed { flex-basis: 34px; width: 34px; }
/* 접힘 상태: 얇은 세로 탭만 (클릭하면 펴짐) */
.o-side-tab {
  display: none; width: 100%; flex: 1 1 auto; border: none; cursor: pointer;
  background: var(--hub); color: #fff; font-family: inherit; font-weight: 800; font-size: 13px;
  writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: 0.06em;
  align-items: center; justify-content: center; padding: 12px 0;
}
.o-side-tab:hover { background: var(--hub-deep); }
.o-side-card.collapsed .o-side-tab { display: flex; }
.o-side-card.collapsed .o-side-inner { display: none; }
.o-side-inner { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.o-side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--hub); color: #fff; flex: 0 0 auto;
}
.o-side-title { font-weight: 800; font-size: 14px; }
.o-side-collapse {
  border: none; background: rgba(255,255,255,0.18); color: #fff; width: 26px; height: 26px;
  border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1;
}
.o-side-collapse:hover { background: rgba(255,255,255,0.32); }
.o-side-body { overflow-y: auto; flex: 1 1 auto; padding: 12px 14px 14px; min-height: 0; }

/* 사이드 카드 내부 조각 */
.osc-empty { color: var(--faint); font-size: 13px; text-align: center; padding: 40px 8px; line-height: 1.7; }
.osc-name-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.osc-name { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.osc-badge {
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  background: var(--hub-tint); color: var(--hub-deep);
}
.osc-badge.awesome { background: var(--rose-tint, var(--hub-tint)); color: var(--rose, var(--hub-deep)); }
.osc-tiles { display: flex; gap: 6px; margin: 10px 0; }
.osc-tile { flex: 1; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); padding: 7px 6px; text-align: center; background: var(--surface); }
.osc-tile .tk { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.osc-tile .tv { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.osc-tile.sales .tv { color: var(--profit); }
.osc-band {
  background: var(--hub); color: #fff; font-weight: 800; font-size: 11px;
  padding: 4px 10px; border-radius: var(--r-sm); margin: 12px 0 6px; letter-spacing: 0.03em;
}
.osc-kv { display: flex; gap: 8px; padding: 3px 2px; font-size: 12.5px; border-bottom: 1px dotted var(--line); }
.osc-kv:last-child { border-bottom: none; }
.osc-k { flex: 0 0 62px; color: var(--muted); text-align: right; }
.osc-v { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.osc-v.empty { color: var(--faint); font-weight: 400; }
.osc-notes { font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; padding: 2px 2px; }
/* 최근 작업 목록 (양식 가져오기) */
.osc-recent { margin-top: 4px; }
.osc-rlist { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.osc-rrow { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
.osc-rrow:last-child { border-bottom: none; }
.osc-rrow:hover { background: var(--surface-sub); }
.osc-rdate { flex: 0 0 40px; color: var(--muted); font-variant-numeric: tabular-nums; }
.osc-rtitle { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.osc-ramt { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.osc-rget {
  flex: 0 0 auto; border: 1px solid var(--hub); background: var(--surface); color: var(--hub-deep);
  font-family: inherit; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; cursor: pointer;
}
.osc-rget:hover { background: var(--hub); color: #fff; }
.osc-rget:disabled { opacity: 0.4; cursor: default; }
.osc-rlist-scroll { max-height: 220px; overflow-y: auto; }
.osc-hint { font-size: 11px; color: var(--faint); margin: 6px 2px 0; line-height: 1.5; }
.o-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--teal); color: #fff; flex: 0 0 auto;
}
.o-panel-title { font-weight: 800; font-size: 16px; }
.o-panel-close {
  border: none; background: rgba(255,255,255,0.18); color: #fff; width: 28px; height: 28px;
  border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1;
}
.o-panel-close:hover { background: rgba(255,255,255,0.32); }
/* 패널 본문: 위쪽 스크롤 영역 + 아래 고정 버튼 밴드.
   타이포는 3단계로만 고정:
   ① 구역 라벨 13px 굵은 회색  ② 본문/입력/금액 16px  ③ 순수익 30px  (+ 참고 줄 13px 회색) */
.o-panel-body { padding: 0; overflow-y: auto; flex: 1 1 auto; display: flex; flex-direction: column; }
.op-scroll { flex: 1 0 auto; padding: 22px 24px 16px; display: flex; flex-direction: column; gap: 24px; }

/* 숨김 호환 필드 (op-done 체크박스·op-deposit 텍스트 — 칩이 구동) */
.op-hidden-field { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── 큼직한 구역 (① 기본정보 ② 돈 ③ 지급 ④ 비고) ── */
.op-sec { display: flex; flex-direction: column; gap: 12px; }
.op-sec + .op-sec { border-top: 1px solid var(--line); padding-top: 20px; }
/* 구역 라벨 = 타이포 1단계 (작고 굵은 회색) */
.op-sec-lab { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: 0.04em; padding: 0 2px; }

/* ── 상태 토글 칩: 켜짐=채운 배지 / 꺼짐=회색 아웃라인 ── */
.op-status-chips { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.op-toggle-chip {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.op-toggle-chip:hover { border-color: var(--line-strong); }
/* 완료·입금 켜짐 = 성공 초록 */
.op-done-chip.on, .op-deposit-chip.on { background: var(--ok); border-color: var(--ok); color: #fff; }
/* 세금계산서 켜짐 = 중립 채움 (선택 세그 문법: text 배경 + bg 글자) */
.op-vat-chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.op-deposit-date {
  font-size: 13px; color: var(--ok); font-weight: 700; cursor: pointer;
  border-bottom: 1px dashed var(--ok); font-variant-numeric: tabular-nums;
}

/* ================= 정의표: [라벨 | 입력] 2열 =================
   입력은 '채우는 곳'이 배경과 구분되도록 옅은 배경 + 1px 테두리(어포던스). */
.op-dl { display: flex; flex-direction: column; gap: 10px; }
.op-row { display: flex; align-items: center; gap: 12px; min-height: 42px; }
/* 라벨 열: 고정폭·오른쪽 정렬·muted */
.op-lab { flex: 0 0 66px; text-align: right; font-size: 14px; font-weight: 700; color: var(--muted); line-height: 1.2; }
/* 값 열: 나머지 폭 채움 */
.op-val { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.op-val-col { flex-direction: column; align-items: stretch; gap: 3px; }

/* 입력 어포던스: 옅은 배경 + 테두리 = '여기 쓰는 곳'. 포커스 시 테두리 강조. */
.op-in {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font-size: 16px; font-family: inherit;
  background: var(--surface-sub); color: var(--text); box-sizing: border-box;
}
.op-in:hover { border-color: var(--line-strong); }
.op-in:focus {
  outline: none; background: var(--card);
  border-color: var(--teal); box-shadow: 0 0 0 3px var(--accent-soft);
}
.op-in-strong { font-weight: 700; }
/* 필수 미입력 = 빨간 테두리 + 아주 옅은 빨강 배경 (입력 시 즉시 해제) */
.op-req-empty { border-color: var(--danger); background: var(--danger-bg); }
.op-req-empty:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.op-in-num { text-align: right; font-variant-numeric: tabular-nums; }
.op-in-fixed { width: auto; flex: 0 0 auto; }
.op-in-cat { min-width: 130px; }
.op-date-wrap { position: relative; }
.op-date-native {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: none; padding: 0;
}
.date-pick-btn {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  border-radius: 7px; width: 34px; height: 38px; font-size: 15px; padding: 0;
}
.date-pick-btn:hover { border-color: var(--line-strong); background: var(--surface-sub); }
.op-due-inline { gap: 5px; }
.op-due-in { width: 120px; }
/* 마감 ±1일 버튼 */
.op-due-step { width: 32px; font-weight: 700; font-size: 18px; line-height: 1; }

/* 비고: 여러 줄 여유 */
.op-note-area {
  width: 100%; resize: vertical; font: inherit; font-size: 16px; min-height: 84px;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px;
  background: var(--surface-sub); color: var(--text); box-sizing: border-box;
}
.op-note-area:focus {
  outline: none; background: var(--card);
  border-color: var(--teal); box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ===================================================================
   ② 돈 (영수증) — 위→아래로 읽으면 계산이 곧 이야기.
   각 줄 = [topic 왼쪽 | mid 입력·설명 | amt 오른쪽 축(tabular-nums)].
   =================================================================== */
.op-receipt {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; background: var(--surface-sub);
}
.op-r-group { display: flex; flex-direction: column; }
.op-r-line { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 4px 0; }
/* topic(금액/크몽 수수료/실수령/지급/순수익) = 본문 크기, story 라벨 */
.op-r-topic { flex: 0 0 auto; min-width: 72px; white-space: nowrap; font-size: 16px; font-weight: 700; color: var(--text); }
/* mid: 인라인 입력·설명 */
.op-r-mid { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.op-r-word { font-size: 13px; color: var(--muted); font-weight: 700; }
.op-r-op { font-size: 15px; color: var(--muted); font-weight: 700; }
.op-r-muted { font-size: 13px; color: var(--muted); }
/* 숫자 축: 오른쪽 정렬(tabular-nums). 마이너스는 값 바로 앞에 붙여 즉각 읽히게. */
.op-r-amt {
  flex: 0 0 auto; min-width: 124px; text-align: right; font-size: 17px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.op-r-amt-lg { font-size: 19px; font-weight: 800; }
.op-r-amt-net { font-weight: 800; }
/* 빼기(수수료·지급) = 회색 아웃플로 (순수익 빨강과 의미 분리; − 부호가 읽힘) */
.op-r-amt-minus { color: var(--muted); font-weight: 700; }

/* 인라인 입력(분·단가·고정금액): 옅은 배경 + 테두리 어포던스 */
.op-r-in {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
  font-size: 16px; font-family: inherit; background: var(--card); color: var(--text);
  box-sizing: border-box; text-align: right; font-variant-numeric: tabular-nums;
}
.op-r-in:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--accent-soft); }
.op-r-in-min { width: 72px; text-align: center; }
.op-r-in-price { width: 92px; }
.op-r-in-override { width: 160px; }

/* 금액 결과: 클릭해 고정값 수정 */
/* padding-right 6px 가 숫자를 축 안쪽으로 밀어 다른 줄과 어긋나므로 margin-right 로 상쇄(hover 배경은 유지) */
#op-amount-result { cursor: pointer; padding: 2px 6px; margin-right: -6px; border-radius: 6px; }
#op-amount-result:hover { background: var(--card); }
#op-amount-result.op-override-on { color: var(--teal-dark); }

/* 고정 금액 줄: 값이 있거나(op-override-active) 편집 진입(editing) 시만 노출 */
.op-r-override-line { display: none; min-height: 38px; }
.op-r-override-line.op-override-active, .op-r-override-line.editing { display: flex; }
#op-calc-line.op-calc-dimmed .op-r-calc-expr { opacity: .4; }
#op-calc-line.op-calc-dimmed .op-r-calc-expr .op-r-in { text-decoration: line-through; }
.op-r-override-line.op-override-active .op-r-override-word { color: var(--teal-dark); font-weight: 800; }
.op-r-override-line.op-override-active .op-r-in-override {
  border-color: var(--teal); background: var(--teal-tint3); font-weight: 700; color: var(--teal-dark);
}
.op-r-hint { font-size: 13px; color: var(--muted); }

/* 실수령: 값 한 번만 표시. 버튼이 상태 전환 — 자동='✎ 직접 입력'(편집 진입) / 수동='자동 계산'(자동 복귀) */
.op-net-edit {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 7px; padding: 5px 11px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.op-net-edit:hover { border-color: var(--teal); color: var(--teal-dark); }
.op-net-input {
  display: none; width: 124px; text-align: right; font-variant-numeric: tabular-nums;
  border: 1px solid var(--teal); border-radius: 7px; padding: 7px 9px; font-size: 17px; font-weight: 700;
  font-family: inherit; background: var(--card); color: var(--text); box-sizing: border-box;
}
.op-net-input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.op-r-net-line.editing #op-net-amt, .op-r-net-line.editing .op-net-edit { display: none; }
.op-r-net-line.editing .op-net-input { display: inline-block; }

/* 순수익 줄: 굵은 구분선으로 '결론' 강조. 타이포 3단계 = 30px 빨강. */
.op-r-profit-line { border-top: 2px solid var(--line-strong); margin-top: 4px; padding-top: 10px; }
.op-r-topic-profit { font-weight: 800; color: var(--profit-strong); }
.op-r-amt-profit { font-size: 30px; font-weight: 800; color: var(--profit); }

/* 세금: 영수증 밖 참고 줄 (계산 흐름의 결론처럼 보이지 않게 — 회색 작게) */
.op-taxnote {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 16px; font-size: 13px; color: var(--muted);
}
.op-taxnote-amt { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ================= ③ 지급 (조작 공간) =================
   행당 그룹: [누구·역할] | [기준 세그 + 단가/총액] | [계산액 −] | [완료·삭제] */
.op-pays-list { display: flex; flex-direction: column; gap: 8px; }
.op-pays-add-wrap { display: flex; }
.op-pay-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-sub); padding: 9px 11px; min-height: 50px;
}
.op-pay-who { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.op-pay-basis { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.op-pay-person, .op-pay-role {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 8px;
  font-size: 15px; font-family: inherit; background: var(--card); color: var(--text);
}
.op-pay-person { flex: 0 0 auto; min-width: 74px; font-weight: 700; }
.op-pay-role { flex: 0 0 auto; min-width: 62px; }
/* 분당|총액 세그 */
.op-seg { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.op-seg-btn {
  border: none; background: var(--card); color: var(--muted);
  font-size: 13px; font-weight: 700; padding: 7px 9px; cursor: pointer; font-family: inherit; line-height: 1.1;
}
.op-seg-btn + .op-seg-btn { border-left: 1px solid var(--line); }
/* 선택 세그 = 중립 잉크(틴트온틴트 금지) */
.op-seg-btn.on { background: var(--text); color: var(--bg); }
.op-pay-price {
  flex: 0 0 auto; width: 96px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
  font-size: 16px; font-family: inherit; text-align: right; font-variant-numeric: tabular-nums;
  background: var(--card); color: var(--text); box-sizing: border-box;
}
.op-pay-price:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--accent-soft); }
/* 계산된 지급액: 오른쪽 축으로 밀어냄 (읽기 전용) */
.op-pay-amt {
  margin-left: auto; flex: 0 0 auto; text-align: right; font-size: 16px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.op-pay-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
/* 완료 체크: 켜지면 담당자 고유색(시트 세원O 문법), 미완료는 흐린 '진행중' */
.op-pay-done {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 7px;
  padding: 6px 10px; font-size: 13px; font-weight: 800; cursor: pointer; color: var(--muted);
  font-family: inherit; line-height: 1.1;
}
.op-pay-done.on { border-color: rgba(0,0,0,0.12); color: var(--text); }
.op-pay-del { flex: 0 0 auto; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 5px; }
.op-pay-del:hover { color: var(--danger); }
.op-add-btn {
  border: 1px solid var(--teal); background: var(--surface); color: var(--teal-dark);
  border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.op-add-btn:hover { background: var(--teal); color: #fff; }

/* ================= 하단 고정 (버튼만 — 분홍 순수익 밴드 제거) ================= */
.op-sticky-bottom {
  position: sticky; bottom: 0; z-index: 2;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 24px 16px; display: flex; flex-direction: column; gap: 10px;
}
.op-footer { display: flex; align-items: center; gap: 8px; }
.op-save-status { flex: 1 1 auto; font-size: 13px; color: var(--ok); min-height: 16px; }
.op-save-status.err { color: var(--danger); }
/* 상세 패널 견적서 버튼: 연결 견적 있으면 "견적서 보기", 없으면 "견적서 생성하기" */
.op-quote-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--teal-bg); border-color: var(--teal); color: var(--teal-dark);
  font-weight: 700;
}
.op-quote-btn:hover { background: var(--teal-tint3); }

/* ===================================================================
   통계 탭 — 읽기 전용. 큰 숫자·명확한 위계·손수 SVG 차트.
   팔레트: 어썸=로즈 / 기타=틸 / 순수익=초록 var(--profit-strong) / 프리=앰버 / AI=회색
   =================================================================== */
.stat-chips { display: inline-flex; gap: 8px; }
.stat-chip {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 14px;
  font-family: inherit; font-weight: 700; line-height: 1.3;
}
.stat-chip:hover { background: var(--bg); }
/* 기간 세그먼트 활성 = 잉크 솔리드(--text 배경 + 흰 글자) — 시안 */
.stat-chip.on {
  background: var(--text); border-color: var(--text); color: #fff;
  box-shadow: none;
}
.stat-period { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* 인사이트 카드 4장 — .sum-card 문법(테두리·radius·그림자) + 큰 숫자 */
.st-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.st-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.st-card .st-c-label { color: var(--muted); font-size: var(--fs-micro); font-weight: 600; }
/* KPI 숫자 = fs-xl(26px) 700 (시안) */
.st-card .st-c-big {
  font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.st-card .st-c-sub { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.st-card.st-profit { background: var(--profit-bg); border-color: var(--profit-line); }
.st-card.st-profit .st-c-big { color: var(--profit); }
.st-card.st-profit .st-c-label { color: var(--profit); }
.st-card.st-ai { background: var(--surface-sub); border-color: var(--line); }
.st-card.st-ai .st-c-big { color: var(--st-ai-fg); }
.st-card.st-chan { background: var(--rose-bg); border-color: var(--rose-tint-line); }
.st-card.st-chan .st-c-big { color: var(--rose-dark); font-size: 22px; }
.st-delta { font-size: 13px; font-weight: 800; }
.st-delta.up { color: var(--profit-strong); }
.st-delta.down { color: var(--danger); }
.st-delta.flat { color: var(--muted); }

/* 차트/순위/패턴 카드 공통 */
.st-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px 18px; margin-bottom: 16px;
}
.st-block h3 { margin: 0 0 12px; font-size: 15px; font-weight: 800; color: var(--text); }
.st-block .st-sub-note { color: var(--muted); font-size: 12px; font-weight: 600; margin-left: 6px; }
.st-chart-wrap { width: 100%; overflow: hidden; }
.st-chart-wrap svg { display: block; width: 100%; height: auto; }

/* 차트 요소 */
.st-bar-rose { fill: var(--rose); }
.st-bar-teal { fill: var(--teal); }
/* [월] 모드 추이 차트: 선택 달 강조 / 나머지 흐리게 */
/* 시안: 막대는 전부 솔리드 (흐림 없음). 선택 기간은 프레임 + 로즈 x라벨로 강조 */
.st-bar-dim { opacity: 1; }
.st-bar-sel { opacity: 1; }
.st-axis-label-sel { fill: var(--rose); font-weight: 800; }
.st-bar-frame { fill: none; stroke: var(--text); stroke-width: 1.6; rx: 2; }
.st-line-profit { fill: none; stroke: var(--profit); stroke-width: 2.5; }
.st-dot-profit { fill: var(--profit); }
.st-axis { stroke: var(--line); stroke-width: 1; }
.st-gridline { stroke: var(--track-line); stroke-width: 1; }
.st-axis-label { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.st-val-label { fill: var(--profit); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.st-legend { display: flex; gap: 16px; margin-bottom: 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
.st-legend .st-lg { display: inline-flex; align-items: center; gap: 6px; }
.st-legend .st-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.st-sw-rose { background: var(--rose); }
.st-sw-teal { background: var(--teal); }
.st-sw-green { background: var(--profit); }

/* SVG 호버 툴팁 */
.st-tip {
  position: fixed; z-index: 60; pointer-events: none; display: none;
  background: var(--tip-bg); color: #fff; border-radius: 6px; padding: 7px 10px;
  font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 10px rgba(0,0,0,0.28); white-space: nowrap;
}
.st-tip b { font-weight: 800; }
.st-hover-col { fill: transparent; cursor: default; }
.st-hover-col:hover { fill: rgba(0,0,0,0.04); }

/* 2열 (TOP 순위) */
.st-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* 가로 바 순위 */
.st-rank { display: flex; flex-direction: column; gap: 9px; }
.st-rank-row { display: grid; grid-template-columns: 1fr; gap: 3px; }
.st-rank-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.st-rank-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-rank-val { font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; flex: 0 0 auto; }
.st-rank-val b { color: var(--text); }
.st-rank-track { height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; }
.st-rank-fill { height: 100%; border-radius: 5px; }
.st-rank-fill.rose { background: var(--rose); }
.st-rank-fill.teal { background: var(--teal); }
.st-rank-share { color: var(--muted); font-weight: 600; }

/* 패턴 3열 */
.st-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }

/* 요일 세로 바 */
.st-wd { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding: 4px 2px 0; }
.st-wd-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.st-wd-bar { width: 100%; max-width: 30px; border-radius: 4px 4px 0 0; background: var(--rose); min-height: 2px; }
.st-wd-bar.weekend { background: var(--wd-weekend); }
.st-wd-num { font-size: 12px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.st-wd-lab { font-size: 12px; color: var(--muted); font-weight: 700; }
.st-wd-lab.weekend { color: var(--wd-weekend-fg); }

/* 유형 스택바 한 줄 */
.st-stack { height: 26px; border-radius: 6px; overflow: hidden; display: flex; margin: 6px 0 12px; }
.st-stack span { display: block; height: 100%; }
.st-stack .k-solo { background: var(--k-solo); }
.st-stack .k-multi { background: var(--teal); }
.st-stack .k-rush { background: var(--danger); }
.st-kind-legend { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.st-kind-legend .kl { display: flex; align-items: center; gap: 8px; }
.st-kind-legend .kl .sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.st-kind-legend .kl .kl-name { font-weight: 700; color: var(--text); }
.st-kind-legend .kl .kl-val { margin-left: auto; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 자동 인사이트 문장 */
.st-insight { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.st-insight li {
  font-size: 14px; color: var(--text); padding-left: 16px; position: relative;
  font-variant-numeric: tabular-nums; line-height: 1.5;
}
.st-insight li::before { content: '·'; position: absolute; left: 4px; color: var(--rose); font-weight: 800; }
.st-insight li b { font-weight: 800; }
.st-empty { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

/* AI 인사이트 카드 (수동 브릿지) */
.ai-copybar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ai-guide { color: var(--muted); font-size: 13px; }
.ai-area { }
.ai-textarea {
  width: 100%; min-height: 140px; box-sizing: border-box; resize: vertical;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-family: inherit; font-size: 14px; line-height: 1.55; color: var(--text); background: var(--surface);
}
.ai-textarea:focus { outline: none; border-color: var(--accent); }
.ai-btnrow { display: flex; gap: 8px; margin-top: 10px; }
.btn.btn-sm { padding: 5px 12px; font-size: 13px; }
.ai-md { font-size: 14px; line-height: 1.6; color: var(--text); }
.ai-md .ai-md-p { margin: 2px 0; }
.ai-md .ai-md-p:empty { min-height: 0; }
.ai-md .ai-md-ul { margin: 4px 0; padding-left: 20px; }
.ai-md .ai-md-ul li { margin: 3px 0; }
.ai-md b { font-weight: 800; }
.ai-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.ai-foot { margin-top: 12px; color: var(--muted); font-size: 11.5px; opacity: 0.75; }

@media (max-width: 900px) {
  .st-cards { grid-template-columns: repeat(2, 1fr); }
  .st-two, .st-three { grid-template-columns: 1fr; }
}

/* ===== 화면: 글자 크기 스케일 (zoom으로 전체 요소를 자연스럽게 확대) ===== */
:root { --font-scale: 1; }
body { zoom: var(--font-scale); }

.fs-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fs-chip {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 9px 20px; border-radius: 999px; cursor: pointer; font-size: 14px;
  font-family: inherit; font-weight: 600;
}
.fs-chip:hover { background: var(--bg); }
.fs-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 효과음 크기 슬라이더 — accent 톤, 토글 꺼짐 시 비활성 */
.sound-vol input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 130px; height: 6px;
  border-radius: 999px; background: var(--line-strong); cursor: pointer; outline: none;
}
.sound-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--card); cursor: pointer;
}
.sound-vol input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--card); cursor: pointer;
}
.sound-vol input[type="range"].disabled,
.sound-vol input[type="range"]:disabled { opacity: .4; cursor: not-allowed; }
.sound-vol #sound-volume-val.disabled { opacity: .4; }

/* 저장 성공 피드백 (버튼 체크 잠깐) */
.btn.flash-ok, .btn-primary.flash-ok {
  background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important;
}

/* ===== 근무·급여: 오늘 날짜 하이라이트 (B4) ===== */
.pr-day.today { box-shadow: inset 0 0 0 2px var(--ot); }
.pr-day.today.sel { box-shadow: inset 0 0 0 2px var(--pay), 0 0 0 2px var(--ot); }
.pr-day.today .dnum { color: var(--ot); }

/* ===== 급여 대장 (관리자 전용) — 시안: surface-sub 스트립, border-top 1px line ===== */
.pr-ledger { margin: 22px -20px 0; border-top: 1px solid var(--line); background: var(--surface-sub); }
.pr-ledger-summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 14px 24px; font-size: var(--fs-base); font-weight: 600; color: var(--text);
}
.pr-ledger[open] .pr-ledger-summary { border-bottom: 1px solid var(--line); }
.pr-ledger-summary::-webkit-details-marker { display: none; }
.pr-ledger-caret { color: var(--muted); font-size: 12px; }
/* 시안: 🔒 관리자 = amber-bg/amber, fs-micro 700, padding 3px 9px, r-sm */
.pr-ledger-admin {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--amber-bg); color: var(--amber-strong); font-size: var(--fs-micro); font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-sm);
}
.pr-ledger-hint { color: var(--faint); font-size: var(--fs-sm); font-weight: 500; }
.pr-ledger-body { padding: 14px 24px 18px; }

.pr-ledger-years { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pr-year-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 4px 14px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; font-variant-numeric: tabular-nums;
}
.pr-year-chip:hover { border-color: var(--pay); color: var(--pay-dark); }
.pr-year-chip.on { background: var(--pay); border-color: var(--pay); color: #fff; }

.pr-ledger-table { width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.pr-ledger-table th {
  color: var(--muted); font-weight: 600; font-size: 11.5px; text-align: right;
  padding: 4px 8px; border-bottom: 1px solid var(--line);
}
.pr-ledger-table th:first-child { text-align: left; }
.pr-ledger-table th.pr-led-note-h { text-align: left; }
.pr-ledger-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.pr-ledger-table td.num { text-align: right; white-space: nowrap; }
.pr-led-total-h { color: var(--pay-dark) !important; }
.pr-led-total { font-weight: 800; color: var(--pay-dark); }
.pr-led-neg { color: var(--danger); }
.pr-led-computed td:first-child { color: var(--pay); font-weight: 700; }
.pr-ledger-table tr:hover td { background: var(--pay-soft); }

/* 비고 셀: 말줄임, 클릭 시 편집 */
.pr-led-note {
  max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); cursor: text;
}
.pr-led-note:empty::before { content: '＋'; color: var(--muted); opacity: 0.5; }
.pr-led-note:hover { background: var(--pay-soft); }
.pr-ledger-table tfoot .pr-led-sum td {
  border-top: 2px solid var(--pay-dark); border-bottom: none;
  font-weight: 800; padding-top: 8px; color: var(--pay-dark);
}
.pr-ledger-table tfoot .pr-led-sum td:first-child { text-align: right; }

/* ===== 급여 이체 체크리스트 (급여 대장 위, 관리자 전용) ===== */
/* 관리자 영역 2단: 체크리스트(왼쪽 고정폭 340) + 급여 대장(오른쪽 남은폭). 좁은 창(≤1000px)엔 세로 스택. */
/* 대장 왼쪽 · 체크리스트 오른쪽. DOM은 [체크리스트, 대장] 순이라 row-reverse로 체크리스트를 우측에 둔다.
   폭은 헤더 한 줄(제목·관리자·월·＋항목)이 줄바꿈 없이 들어가게 넉넉히. */
.pr-admin-row {
  display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 16px; margin-top: 22px;
}
.pr-admin-row .payday-check { flex: 0 0 372px; margin-top: 0; }
.pr-admin-row .pr-ledger {
  flex: 1 1 auto; min-width: 0; margin: 0;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
@media (max-width: 1000px) {
  /* 좁으면 세로 스택. column 이면 DOM 순서대로(체크리스트 위) — 기존 스택 순서 유지. */
  .pr-admin-row { flex-direction: column; align-items: stretch; }
  .pr-admin-row .payday-check { flex: 0 0 auto; }
}
.payday-check {
  margin: 22px 0 0; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card); overflow: hidden;
}
.payday-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-sub);
}
.payday-head .spacer { flex: 1 1 auto; }
/* 헤더 텍스트는 줄바꿈 금지 (좁은 폭에서 "체크리\n스트"·"관리\n자"로 쪼개지지 않게) */
.payday-title { font-size: var(--fs-base); font-weight: 700; color: var(--text); white-space: nowrap; }
.payday-admin {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: 0 0 auto;
  background: var(--amber-bg); color: var(--amber-strong); font-size: var(--fs-micro); font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-sm);
}
.payday-month { color: var(--pay-dark); font-weight: 700; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); white-space: nowrap; }
.payday-add {
  border: 1px solid var(--pay); background: var(--pay-soft); color: var(--pay-dark);
  padding: 5px 12px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700;
  white-space: nowrap; flex: 0 0 auto;
}
.payday-add:hover { background: var(--pay); color: #fff; }
.payday-rows { padding: 6px 0; }
.payday-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-bottom: 1px solid var(--line-soft);
}
.payday-row:last-child { border-bottom: none; }
.payday-label {
  flex: 1 1 auto; font-size: var(--fs-base); color: var(--text); cursor: default;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.payday-row.done .payday-label { color: var(--muted); text-decoration: line-through; }
.payday-o {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 6px;
  border: 1.5px solid var(--line-strong); background: var(--card);
  color: var(--ok); font-weight: 900; font-size: 16px; cursor: pointer; line-height: 1;
}
.payday-o:hover { border-color: var(--ok); }
.payday-row.done .payday-o { background: var(--ok-bg); border-color: var(--ok); }
.payday-del {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 13px; line-height: 1;
}
.payday-del:hover { background: var(--danger-bg); color: var(--danger); }
.payday-edit {
  flex: 1 1 auto; font: inherit; font-size: var(--fs-base); color: var(--text);
  border: 1px solid var(--pay); border-radius: 5px; padding: 5px 8px; box-sizing: border-box;
}
.payday-edit:focus { outline: none; box-shadow: 0 0 0 2px var(--pay-soft); }

/* 실행 취소 토스트 버튼 */
.toast-undo {
  margin-left: 10px; border: 1px solid rgba(255,255,255,0.5); background: transparent;
  color: #fff; font: inherit; font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 5px; cursor: pointer;
}
.toast-undo:hover { background: rgba(255,255,255,0.18); }

/* ===== 구글 드라이브 ===== */
/* 파일명 셀 안 우측 정렬 아이콘 [받(⤓)][보(✈)] — 인라인 SVG 16px */
/* 파일명 텍스트가 아이콘 아래로 파묻히지 않게 우측 여백 확보 */
td.fname { padding-right: 52px !important; }
.drive-icons {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: inline-flex; gap: 3px; align-items: center;
  opacity: 0.55; transition: opacity 0.12s;
}
td.fname:hover .drive-icons { opacity: 1; }
.drive-ic {
  width: 22px; height: 20px; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 4px;
  color: var(--teal-dark); line-height: 0;
}
.drive-ic:hover { background: var(--teal-tint2); color: var(--teal); }
.drive-ic svg { display: block; }
/* 링크 없는 행: 연회색 (클릭 시 안내 토스트) */
.drive-ic.drive-ic-off { color: var(--line-strong); }
.drive-ic.drive-ic-off:hover { background: var(--track); color: var(--muted); }
.drive-ic:disabled { cursor: default; }
.drive-ic.drive-ic-busy { background: transparent; }
/* 편집 중엔 아이콘 숨김 (input 이 셀을 채움) */
td.fname.editing .drive-icons { display: none; }

/* 진행률 링 */
.drive-ring-svg .ring-track { stroke: var(--line-cool); }
.drive-ring-svg .ring-arc { stroke: var(--teal); transition: stroke-dashoffset 0.25s linear; }
.drive-ring-svg.ring-error .ring-arc { stroke: var(--danger); }
.drive-ring-svg.ring-spin { animation: drive-ring-spin 0.9s linear infinite; transform-origin: 50% 50%; }
@keyframes drive-ring-spin { to { transform: rotate(360deg); } }

/* 파일 선택 팝오버 / 드라이브 링크 입력 팝오버 */
.drive-picker {
  position: fixed; z-index: 120; min-width: 220px; max-width: 440px; max-height: 320px;
  overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); padding: 6px; font-size: 13px;
}
.drive-picker-head { font-weight: 700; color: var(--rose-dark); padding: 4px 6px 6px; font-size: 12.5px; }
.drive-picker-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  width: 100%; text-align: left; padding: 7px 8px; border: none; background: none;
  border-radius: 5px; cursor: pointer; font: inherit; color: var(--text);
}
.drive-picker-item:hover { background: var(--rose-bg); color: var(--rose-dark); }
.drive-picker-item .dp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-picker-item .dp-size { color: var(--muted); font-size: 11.5px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.drive-confirm-actions { display: flex; gap: 6px; padding: 2px; }
.drive-confirm-actions .drive-picker-item { justify-content: center; flex: 1; font-weight: 600; }
.drive-confirm-actions .dp-ok { background: var(--rose-bg); color: var(--rose-dark); }
.drive-confirm-actions .dp-ok:hover { background: var(--rose-dark); color: #fff; }
.drive-link-pop { padding: 10px; }
.drive-link-pop .inline-input { display: block; margin: 4px 0 8px; }
.drive-link-row { display: flex; gap: 6px; justify-content: flex-end; }

/* 연결 상태 배지 */
.drive-status { font-weight: 600; color: var(--muted); margin-right: 8px; }
.drive-status.ok { color: var(--ok); }

/* =====================================================================
   다크 모드 오버라이드 — 토큰으로 안 잡히는 하드코딩 밝은 틴트/배경 보정.
   (라이트에서는 원본 그대로, [data-theme="dark"]에서만 적용)
   ===================================================================== */
[data-theme="dark"] {
  /* 공통 표/시트 hover·경계 */
}
[data-theme="dark"] table.grid tbody tr:hover { background: var(--surface-sub); }
[data-theme="dark"] table.sheet td { border-bottom-color: var(--line); border-right-color: var(--line); }
[data-theme="dark"] table.sheet tr.day-first td { border-top-color: var(--line-strong); }

/* 시트 헤더 파트별 톤은 --rose-h1~3·--teal-h1~3 파생 변수가 다크에서 자동 전환됨(중복 오버라이드 제거) */

/* "잉크 솔리드" 활성 상태(중립 탭·세그먼트·통계 칩)는 라이트에서 --text 배경+흰 글자.
   다크에서는 --text 가 밝아 흰 글자와 겹치므로, 밝은 칩 위에 어두운 글자(--bg)로 반전. */
[data-theme="dark"] .tab.active[data-tab="settle"],
[data-theme="dark"] .tab.active[data-tab="stats"],
[data-theme="dark"] .tab.active[data-tab="settings"],
[data-theme="dark"] .fr-src-filter.on,
[data-theme="dark"] .stat-chip.on { color: var(--bg); }

/* 메모 행 — othersheet 파생 변수가 다크에서 자동 전환 */
[data-theme="dark"] table.othersheet tr.o-memo td { background: var(--rose-bg); color: var(--rose); }
/* 현장+메모의 작업 구역은 더 구체적인 공통 규칙과 테마 토큰으로 연두를 유지한다. */

/* 요약 카드: 라이트와 동일하게 surface 배경 + 색 액센트 보더 유지 (토큰이 자동 전환) */
[data-theme="dark"] .sum-card { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .sum-day { border-left-color: var(--rose); }
[data-theme="dark"] .sum-month { border-left-color: var(--line-strong); }
[data-theme="dark"] .sum-other { border-left-color: var(--teal); }
[data-theme="dark"] .sum-free { border-left-color: var(--indigo); }
[data-theme="dark"] .sum-profit { background: var(--profit-bg); }
[data-theme="dark"] .sum-profit-label, [data-theme="dark"] .sum-profit-val { color: var(--profit); }
[data-theme="dark"] .sum-expand, [data-theme="dark"] .day-pop .dp-iconbtn { background: var(--surface); }

/* 팝오버들 */
[data-theme="dark"] .day-pop { background: var(--surface); border-color: var(--rose); }
[data-theme="dark"] .day-pop .dp-count { background: var(--rose-bg); color: var(--rose); }
[data-theme="dark"] .day-pop .dp-money { background: var(--surface-sub); border-color: var(--line); }
[data-theme="dark"] .day-pop .dp-profit .dp-mlabel,
[data-theme="dark"] .day-pop .dp-profit .dp-mval { color: var(--profit); }
[data-theme="dark"] .day-pop .dp-ai .dp-ai-line { background: var(--profit-bg); color: var(--profit); }
[data-theme="dark"] .ctx-menu, [data-theme="dark"] .drive-picker,
[data-theme="dark"] .client-pop, [data-theme="dark"] .att-pop { background: var(--surface); }
[data-theme="dark"] .ctx-menu button:hover,
[data-theme="dark"] .drive-picker-item:hover { background: var(--rose-bg); }

/* 하단 바(일지 요약 바) */
[data-theme="dark"] .bottom-bar { background: var(--surface-sub); }
[data-theme="dark"] .o-detail-btn:hover { background: var(--teal-bg); }

/* 상태·구분 칩, phantom, hover */
[data-theme="dark"] .state-chip.progress { background: var(--surface-sub); }
[data-theme="dark"] tr.phantom-row td { background: var(--surface-sub); color: var(--faint); }
[data-theme="dark"] td.kind-cell:hover { background: var(--surface-sub); }
[data-theme="dark"] .close-day-btn:hover { background: var(--rose-bg); }
[data-theme="dark"] tr.row-dragging td { background: var(--rose-bg) !important; }

/* 근무·급여 달력 */
[data-theme="dark"] .pr-day.weekend { background: var(--surface-sub); }
[data-theme="dark"] .pr-day.d-holiday { background: var(--rose-bg); }
[data-theme="dark"] .att-time-in:disabled { background: var(--surface-sub); }
[data-theme="dark"] .att-chip { background: var(--surface); }
[data-theme="dark"] .pr-legend .lg-work { background: var(--surface); }

/* 기타의뢰 상세 패널 — 입력/셀 색은 테마 토큰(--card/--surface-sub)이 처리.
   지급 행 배경이 surface-sub 이므로 셀렉트는 base 의 --card(밝은 톤)로 대비 유지 — 별도 override 불필요. */

/* 통계 카드 */
[data-theme="dark"] .st-card.st-ai { background: var(--surface-sub); border-color: var(--line); }
[data-theme="dark"] .st-card.st-chan { background: var(--rose-bg); border-color: var(--line-strong); }
[data-theme="dark"] .st-card.st-profit { background: var(--profit-bg); border-color: var(--profit-line); }
[data-theme="dark"] .st-rank-track { background: var(--surface-sub); }
[data-theme="dark"] .st-hover-col:hover { fill: rgba(255,255,255,0.05); }
[data-theme="dark"] .st-gridline { stroke: var(--line); }
[data-theme="dark"] .st-tip, [data-theme="dark"] .toast { background: #000; color: var(--text); }

/* 프리랜서 출처 미니칩 */
[data-theme="dark"] .fr-src-awesome { background: var(--rose-bg); color: var(--rose); }
[data-theme="dark"] .fr-src-other { background: var(--teal-bg); color: var(--teal); }

/* 드라이브 아이콘 hover */
[data-theme="dark"] .drive-ic:hover { background: var(--teal-bg); }
[data-theme="dark"] .drive-status.ok { color: var(--ok); }

/* 설정 서브내비 활성칩 = 중립 (틸) */
[data-theme="dark"] .set-navchip.on,
[data-theme="dark"] .btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }

/* 급행 스트라이프·마감선 등은 토큰이라 자동 전환됨 */

/* 다크: 행 hover 오버레이는 밝은 셀로판(어두운 배경 위에서 보이도록) — 방식(오버레이)은 동일 */
[data-theme="dark"] table.sheet tbody tr:hover td:not(.divider):not(.date-cell):not(.fr-date):not(.fr-day-calc) {
  background-image: linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06)) !important;
}

/* =====================================================================
   간략 보기(compact) — 보조 모니터 상시 감시용 (일지 탭만)
   시안: compact-mock3.html. 색은 전부 토큰 참조 → 다크 자동 대응.
   ===================================================================== */

/* ── 열 표시/숨김 (기본 vs 간략) ── */
/* 순수익(col-both)은 양쪽 표시. 15%·프리(col-compact-only)는 간략에만, 반올림·금액·텍프리·우나프리(col-base-only)는 기본에만.
   중요: table-layout:fixed에서 셀을 display:none 하면 <col>↔셀 정렬이 깨져 뒤쪽 열이 0폭이 된다.
   그래서 "숨김"은 display가 아니라 셀을 0폭으로 접는 방식(table-cell 유지). 폭은 colgroup(0px)이 결정. */
.col-hide-cell {
  width: 0 !important; padding: 0 !important; border-left: none !important; border-right: none !important;
  overflow: hidden !important; white-space: nowrap !important;
  max-width: 0 !important; font-size: 0 !important;
}
/* th에도 같은 접힘 적용 (본문 셀과 열 정렬 유지) */
th.col-hide-cell { border-left: none !important; border-right: none !important; }

/* ── 간략 토글 버튼 (탑바 우측) ── */
.compact-toggle {
  margin-left: 12px; flex: 0 0 auto;
  font-size: 12.5px; color: var(--muted); font-family: inherit; font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 5px 10px; background: var(--surface-sub); cursor: pointer; white-space: nowrap;
}
.compact-toggle:hover { border-color: var(--rose); color: var(--rose); }
body.compact .compact-toggle { background: var(--rose-bg); border-color: var(--rose); color: var(--rose); }

/* ── 헤더 사용자 표시 + 로그아웃 (작고 조용하게) ── */
.user-box { display: flex; align-items: center; gap: 8px; margin-left: 12px; flex: 0 0 auto; }
.user-box[hidden] { display: none; }
.user-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.user-role {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--surface-sub); color: var(--muted); white-space: nowrap;
}
.user-role[data-role="admin"]      { background: var(--rose-bg);   color: var(--rose-dark); }
.user-role[data-role="staff"]      { background: var(--amber-bg);  color: var(--amber-strong); }
.user-role[data-role="freelancer"] { background: var(--indigo-bg); color: var(--indigo-strong); }
.user-logout {
  font-size: 12px; color: var(--muted); font-family: inherit; font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 5px 9px; background: var(--surface-sub); cursor: pointer; white-space: nowrap;
}
.user-logout:hover { border-color: var(--rose); color: var(--rose); }

/* ── 헤더 아바타 + 마이페이지 진입 버튼(아바타+이름) ── */
.user-main {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: none; padding: 2px 6px; border-radius: 8px;
  cursor: pointer; font: inherit; color: inherit;
}
.user-main:hover { background: var(--surface-sub); }
/* 아바타 원: 이미지면 배경 사진, 없으면 이니셜(배경·글자색은 JS 인라인으로 사람 색 적용). */
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; line-height: 1;
  background-size: cover; background-position: center; overflow: hidden;
}

/* ── 접속자 칩(관리자 전용): 프로필 아바타 왼쪽. 접속자 없으면 hidden. ── */
/* 자리 차지 최소화: 고정폭(flex:0 0 auto)이라 헤더 반응형 무단계 축소에 영향 안 줌. */
.presence-strip { display: inline-flex; align-items: center; margin-right: 6px; flex: 0 0 auto; }
.presence-strip[hidden] { display: none; }
/* 겹침 스택 18px 원형. 배경·글자색은 paintAvatar 가 사람 색으로 인라인(다크 대응 포함) — 하드코딩 금지. */
.presence-chip {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 10px; line-height: 1;
  background-size: cover; background-position: center; overflow: hidden;
  margin-left: -5px; border: 1.5px solid var(--surface);
}
.presence-chip:first-child { margin-left: 0; }
/* +N 접힘 칩: paintAvatar 대상이 아니므로 변수 기반 색을 여기서 준다. */
.presence-more { background: var(--surface-sub); color: var(--muted); }

/* ── 마이페이지 우측 슬라이드 패널 (non-modal) ── */
.mp-backdrop { position: fixed; inset: 0; z-index: 199; background: rgba(0,0,0,0.18); animation: dpFade 0.12s ease-out; }
.mp-panel {
  /* 데스크톱 앱에선 상단이 타이틀바(창 버튼 오버레이) — 패널이 그 아래에서 시작해야
     최소화/닫기 버튼과 안 겹친다. 브라우저에선 env() 폴백 0px 라 기존과 동일. */
  position: fixed; top: env(titlebar-area-height, 0px); right: 0; z-index: 200;
  width: min(380px, 92vw); height: calc(100vh - env(titlebar-area-height, 0px));
  background: var(--card); border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(0,0,0,0.22);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.18s ease-out;
  pointer-events: none;
}
.mp-panel.open { transform: translateX(0); pointer-events: auto; }
.mp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: var(--rose, var(--accent)); color: #fff; flex: 0 0 auto;
}
.mp-title { font-weight: 800; font-size: 16px; }
.mp-close {
  border: none; background: rgba(255,255,255,0.18); color: #fff; width: 28px; height: 28px;
  border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1;
}
.mp-close:hover { background: rgba(255,255,255,0.32); }
.mp-body { flex: 1 1 auto; overflow-y: auto; padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 22px; }
.mp-sec { display: flex; flex-direction: column; gap: 12px; }
.mp-sec + .mp-sec { border-top: 1px solid var(--line); padding-top: 20px; }
.mp-sec-lab { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: 0.04em; }
.mp-hint { font-size: 12px; color: var(--faint); margin: 0; line-height: 1.5; }
/* ① 프로필 */
.mp-profile { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; }
.mp-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 30px; line-height: 1;
  background-size: cover; background-position: center; overflow: hidden;
}
.mp-idblock { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mp-name { font-size: 20px; font-weight: 800; color: var(--text); }
.mp-role { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-sub); color: var(--muted); }
.mp-role[data-role="admin"]      { background: var(--rose-bg);   color: var(--rose-dark); }
.mp-role[data-role="staff"]      { background: var(--amber-bg);  color: var(--amber-strong); }
.mp-role[data-role="freelancer"] { background: var(--indigo-bg); color: var(--indigo-strong); }
.mp-avatar-actions { display: flex; gap: 8px; flex: 1 1 100%; }
/* ② 화면 설정 */
.mp-field { display: flex; flex-direction: column; gap: 8px; }
.mp-field-lab { font-weight: 700; color: var(--text); font-size: 14px; }
.mp-vol { display: flex; align-items: center; gap: 10px; }
.mp-vol-lab { font-weight: 600; color: var(--text); font-size: 13px; }
#mp-sound-volume { flex: 1 1 auto; }
.sound-vol-val { font-variant-numeric: tabular-nums; min-width: 44px; font-weight: 700; color: var(--text); }
.sound-vol-slider.disabled, .sound-vol-val.disabled { opacity: 0.4; }
/* ③ 로그아웃 */
.mp-logout-sec { align-items: stretch; }
.mp-logout-btn { width: 100%; justify-content: center; text-align: center; }

/* ── 팀 계정: 아바타 썸네일 + 탭 지정 편집기 ── */
.acc-name { display: flex; align-items: center; }
.acc-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; margin-right: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; line-height: 1;
  background-size: cover; background-position: center; overflow: hidden;
}
.acc-tabs { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.acc-tabs-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.acc-tabs-ck { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.acc-tabs-note { font-size: 12px; color: var(--muted); margin: 0; }
.acc-tabs-actions { display: flex; align-items: center; gap: 8px; }

/* ── 팀 계정 카드 (설정 · 로그인 발급/회수) ── */
#set-accounts-card .acc-id { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; }
#set-accounts-card .acc-pw { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; color: var(--text); }
.acc-actions { white-space: nowrap; }
.acc-actions .btn { margin-left: 6px; }
.acc-actions .btn:first-child { margin-left: 0; }
.acc-revoke { color: var(--danger); border-color: var(--danger-bg); }
.acc-revoke:hover { border-color: var(--danger); background: var(--danger-bg); }
.acc-sub td { background: var(--surface-sub); }
.acc-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 2px; }
.acc-form .inline-input { width: 220px; text-align: left; }
.acc-err { color: var(--danger); font-size: 13px; font-weight: 700; }
.acc-revoke-msg { font-size: 14px; font-weight: 600; color: var(--text); }
.acc-close { margin-left: auto; }
.acc-temp { padding: 6px 2px; }
.acc-temp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.acc-temp-id {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 15px;
  font-weight: 700; color: var(--muted);
}
.acc-temp-pw {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 24px; font-weight: 800;
  letter-spacing: 1px; color: var(--rose-dark); background: var(--rose-bg);
  padding: 4px 12px; border-radius: var(--r-sm); user-select: all;
}
.acc-temp-note { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--danger); }

/* ── 간략 스트립 (기본 모드에선 숨김) ── */
.compact-strip { display: none; }
body.compact .compact-strip {
  display: flex; align-items: center; gap: 12px;
  height: 34px; padding: 0 10px;
  background: var(--surface-sub); border-bottom: 1px solid var(--line);
  font-size: 13px; position: sticky; top: var(--topbar-h); z-index: 6;
  margin: 0 -20px; padding: 0 24px;  /* 툴바 폭에 맞춰 좌우로 확장 */
  font-variant-numeric: tabular-nums;
}
/* 일지·프리랜서 스트립: 창이 좁아 글씨가 잘릴 참이면 '남은' 칩(마지막 항목)부터 윗줄로 올라간다
   — sum-month와 같은 wrap-reverse 수법. 높이는 줄 수만큼 늘어난다(한 줄일 땐 기존 34px 유지).
   기타의뢰 스트립(o-cs)은 남은 칩이 없고 "한 줄 클립" 설계라 제외. */
body.compact #j-compact-strip, body.compact #fr-compact-strip {
  flex-wrap: wrap-reverse; height: auto; min-height: 34px;
  align-content: center; row-gap: 2px; padding-top: 3px; padding-bottom: 3px;
}
.compact-strip .cs-mn { display: flex; align-items: center; gap: 5px; font-weight: 700; }
.compact-strip .cs-a {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  color: var(--muted); font-size: 11px; font-family: inherit; line-height: 1;
}
.compact-strip .cs-a:hover { color: var(--rose); }
.compact-strip .cs-month { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* 진행 칩: 기본 = warn 옅은 알약, 활성(필터 켜짐) = 채움 */
.compact-strip .cs-prog {
  background: var(--warn-bg); color: var(--warn); font-size: 11px; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 2px 7px;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.compact-strip .cs-prog:hover { border-color: var(--warn); }
.compact-strip .cs-prog.on { background: var(--warn); color: #fff; }
/* 오늘만 체크박스 (네이티브 감춤 + 커스텀 박스) */
.compact-strip .cs-ck {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.compact-strip .cs-ck input { position: absolute; opacity: 0; width: 0; height: 0; }
.compact-strip .cs-box {
  width: 12px; height: 12px; border: 1.5px solid var(--line-strong); border-radius: 3px;
  display: inline-block; background: var(--surface);
}
.compact-strip .cs-ck input:checked + .cs-box {
  background: var(--rose); border-color: var(--rose);
  box-shadow: inset 0 0 0 2px var(--surface);
}
/* 요약 알약(오늘/월): 라벨 faint + 숫자 700 + 순수익 초록 슬림 알약 */
.compact-strip .cs-sum { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.compact-strip .cs-lb { font-size: 10.5px; color: var(--faint); font-weight: 600; }
.compact-strip .cs-mid { font-size: 10.5px; color: var(--faint); font-weight: 600; }
.compact-strip .cs-profit {
  background: var(--profit-bg); color: var(--profit); font-weight: 700;
  border-radius: var(--r-sm); padding: 2px 8px; font-variant-numeric: tabular-nums;
}
.compact-strip .cs-sep { color: var(--line-strong); }

/* 간략 모드: 툴바·요약 카드 숨김 (스트립이 대체) */
body.compact #tab-journal.active .toolbar,
body.compact #tab-journal.active .sum-cards { display: none; }

/* ── 간략 표 (시안 그대로): 행 24px, 12.5px, th 11.5px ── */
body.compact #j-table td {
  padding: 1px 5px; font-size: 12.5px; height: 24px; line-height: 1.2;
}
body.compact #j-table td.fname { padding-left: 6px !important; }
body.compact #j-table th {
  padding: 4px 4px; font-size: 11.5px;
}
body.compact #j-table th.th-fname { padding: 4px 6px; }
/* 돈 셀: 15%·프리 = muted 우측정렬, 순수익 = profit 700 우측정렬 (숫자만, "원" 없음) */
body.compact #j-table td.money-dim-cell { text-align: right; color: var(--muted); font-weight: 400; }
body.compact #j-table td.profit-cell { text-align: right; color: var(--profit); font-weight: 700; }
/* 간략 모드 편집기: 행 높이 24px 유지 (font/line-height 축소) */
body.compact #j-table td.editing .cell-input { font-size: 12.5px; line-height: 1.25; }
/* 날짜 셀: 07/06(월) 한 줄(날짜 700 12px + 요일 muted) + 미니 버튼 */
body.compact #j-table td.date-cell { padding: 4px 2px; }
body.compact #j-table td.date-cell .date-num .date-md { font-size: 12px; }
body.compact #j-table td.date-cell .date-num .date-wd { font-size: 11px; }
/* 미니 마감/요약 버튼: 40px 폭, 10px */
body.compact #j-table .close-day-btn,
body.compact #j-table .day-summary-btn {
  width: 40px; font-size: 10px; padding: 1.5px 0; margin-top: 3px; line-height: 1.4;
}
/* 간략 모드에선 열 리사이저 숨김 (리사이즈 비활성) */
/* 간략 모드에서도 열 리사이즈 유지 (col-resizer 표시) — 조절값은 :c 전용 키에 저장 */
/* 간략 모드 팬텀 행도 24px */
body.compact #j-table tr.phantom-row td { height: 24px; }

/* =====================================================================
   간략 보기 확장 — 기타의뢰 · 프리랜서 탭 (일지와 같은 문법)
   ===================================================================== */

/* ── 간략 모드: 각 탭 툴바·요약카드·하단 바 숨김 (스트립이 대체) ── */
body.compact #tab-other.active .toolbar,
body.compact #tab-other.active .sum-cards,
body.compact #tab-freelancer.active .toolbar,
body.compact #tab-freelancer.active .sum-cards { display: none; }

/* ── 스트립 공통 추가 컨트롤 (일지 .compact-strip 기반 위에 확장) ── */
/* 세그먼트(월/년, 출처) — 작은 알약 세그 */
.compact-strip .cs-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; flex: 0 0 auto; }
.compact-strip .cs-seg-btn {
  background: var(--surface); border: none; cursor: pointer; font-family: inherit;
  font-size: 11px; font-weight: 600; color: var(--muted); padding: 3px 8px; line-height: 1.4;
}
.compact-strip .cs-seg-btn + .cs-seg-btn { border-left: 1px solid var(--line); }
.compact-strip .cs-seg-btn:hover { background: var(--surface-sub); }
.compact-strip .cs-seg-btn.on { background: var(--text); color: var(--bg); font-weight: 700; }
/* 못 받은 돈 칩 — 진행칩과 같은 알약, warn 팔레트 (기본 옅음, 활성 채움) */
.compact-strip .cs-unpaid { background: var(--warn-bg); color: var(--warn); }
.compact-strip .cs-unpaid.on { background: var(--warn); color: #fff; }
/* 작은 액션 버튼 ([+추가]·[정산표]) */
.compact-strip .cs-newbtn {
  flex: 0 0 auto; font-family: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 3px 9px; background: var(--surface); cursor: pointer; white-space: nowrap; line-height: 1.4;
}
.compact-strip .cs-newbtn:hover { border-color: var(--rose); color: var(--rose); }
/* 유연 여백 (오른쪽 정렬용) */
.compact-strip .cs-grow { flex: 1 1 auto; }
/* 스트립 요약 라벨/값 나열 (건수/매출/…): 라벨 faint + 값 700 */
.compact-strip .cs-sum b { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.compact-strip .cs-sum b.cs-neg { color: var(--danger); }
.compact-strip .cs-sum b.cs-free { color: var(--ok); }
/* 사람 칩 묶음 (프리랜서 스트립) */
.compact-strip .cs-people { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.compact-strip .cs-person {
  border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-family: inherit;
  font-size: 11.5px; font-weight: 600; color: var(--text); padding: 3px 9px; line-height: 1.4; white-space: nowrap;
}
.compact-strip .cs-person:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.compact-strip .cs-person.on { box-shadow: inset 0 0 0 2px var(--fr-dark); font-weight: 700; }
/* 기타의뢰 스트립: 세그·네비·칩·요약이 한 줄에 많으니 간격을 살짝 좁힘 */
body.compact .o-cs, body.compact .fr-cs { gap: 10px; }
body.compact .fr-cs .cs-sum { gap: 5px; }

/* ── 간략 표 밀도: 기타의뢰(os/oe/ous/oue) · 프리랜서(fr) 행 24px, 12.5px ── */
body.compact #os-table td, body.compact #oe-table td,
body.compact #ous-table td, body.compact #oue-table td,
body.compact #fr-table td {
  padding: 1px 5px; font-size: 12.5px; height: 24px; line-height: 1.2;
}
body.compact #os-table td.fname, body.compact #oe-table td.fname,
body.compact #ous-table td.fname, body.compact #oue-table td.fname,
body.compact #fr-table td.fname { padding-left: 6px !important; padding-right: 6px !important; }
body.compact #os-table td.num, body.compact #oe-table td.num,
body.compact #ous-table td.num, body.compact #oue-table td.num,
body.compact #fr-table td.num { padding: 1px 5px; }
body.compact #os-table th, body.compact #oe-table th,
body.compact #ous-table th, body.compact #oue-table th,
body.compact #fr-table th {
  padding: 4px 4px; font-size: 11.5px;
}
/* 편집 진입 시에도 행 높이 24px 유지 (font/line-height 축소) */
body.compact #os-table td.editing .cell-input, body.compact #oe-table td.editing .cell-input,
body.compact #ous-table td.editing .cell-input, body.compact #oue-table td.editing .cell-input,
body.compact #fr-table td.editing .cell-input { font-size: 12.5px; line-height: 1.25; }
/* 간략 모드에서도 열 리사이즈 유지 (리사이저 표시) — 조절값은 간략 전용 :c 키에 저장 */
/* 팬텀 행도 24px */
body.compact #os-table tr.phantom-row td, body.compact #oe-table tr.phantom-row td { height: 24px; }

/* ── 칩류 컴팩트 크기 (밀도에 맞춤, 인지 문법·색은 불변) ── */
body.compact #tab-other .o-cat-chip { font-size: 11px; line-height: 1.4; }
/* 컴팩트 구분 칩도 고정 폭 유지(3종 동일, 가운데) — 셀 안에서만 */
body.compact #tab-other td.o-cat-cell .o-cat-chip { width: 46px; padding: 1px 3px; }
/* 컴팩트 상태 칩: 폭도 함께 축소(고정 폭 유지, 3종 동일). 미수 칩도 같은 고정 폭. */
body.compact #tab-other .state-chip { font-size: 11px; width: 58px; padding: 1px 0; line-height: 1.4; }
body.compact #tab-other .state-chip.unpaid { width: 58px; min-width: 0; padding: 1px 0; }
body.compact #tab-other .o-detail-btn { font-size: 16px; padding-right: 6px; }
body.compact #tab-freelancer .fr-src-chip { font-size: 10.5px; padding: 1px 7px; line-height: 1.35; }
body.compact #tab-freelancer .fr-src-client { font-size: 10.5px; margin-left: 4px; }

/* ── 프리랜서 날짜 셀·하루 계산 컴팩트 ── */
body.compact #fr-table td.fr-date { font-size: 12px; }
body.compact #fr-table td.fr-date .date-md { font-size: 12px; }
body.compact #fr-table td.fr-date .date-wd { font-size: 11px; }
/* 하루 계산 숫자: 기본 fs-md는 컴팩트에 과함 → 13px/700 로 강조 유지 */
body.compact #fr-table td.fr-day-calc { font-size: 13px; font-weight: 700; }

/* ===================== 견적서 탭 ===================== */
/* 앱 크롬만. 종이 스타일은 quote-paper.css 로 격리. */
.q-toolbar .seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.q-toolbar .seg button { padding: 5px 12px; border: none; background: none; border-radius: 5px; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.q-toolbar .seg button.on { background: var(--text); color: var(--bg); font-weight: 700; }
.q-toolbar .btn.awesome { background: var(--rose-bg); border-color: var(--rose-bg); color: var(--rose); font-weight: 700; }
.q-toolbar .hint { margin-left: auto; font-size: var(--fs-sm); color: var(--faint); }

/* 1차 행동: "새 견적서" — 크고 또렷하게 (주 색·아이콘) */
.q-new-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 15px;
  font-family: inherit; cursor: pointer; box-shadow: 0 1px 4px rgba(18,138,139,.25);
  transition: filter .12s, box-shadow .12s;
}
.q-new-btn:hover { filter: brightness(1.06); box-shadow: 0 2px 7px rgba(18,138,139,.35); }

/* 발행사 선택: 미선택 = 흰(카드) 배경 + 회색 글씨(무채색, 필터 버튼 톤). 선택(.on) = 브랜드색 배경 + 흰 글씨. */
.q-issuer-seg { padding: 3px; gap: 4px; background: var(--card); }
.q-issuer-seg button { background: none; color: var(--muted); font-weight: 600; border: 2px solid transparent; opacity: 1; }
/* 선택(.on) = 브랜드색 배경 + 흰 글씨 — 소리(파랑)·봄날(연두) */
.q-issuer-seg button[data-issuer="sori"].on { background: #185EAB; color: #fff; font-weight: 700; border-color: transparent; }
.q-issuer-seg button[data-issuer="bomnal"].on { background: #8EB739; color: #fff; font-weight: 700; border-color: transparent; }

/* 뷰포트 높이에 맞춰 고정 — 목록(#q-list-items)과 종이(.q-paperwrap)가 각자 박스 안에서 스크롤되고
   페이지가 끝없이 늘어나지 않게 한다. 오프셋 150px ≈ 앱 헤더(58) + 견적 툴바 + 여백. */
.q-layout { display: flex; height: calc(100vh - 150px); min-height: 380px; }
/* min-width:0 필수 — 없으면 항목의 긴 텍스트(min-content)가 flex-basis를 밀어내 폭이 340↔364로 흔들린다 */
.q-list { flex: 0 0 340px; min-width: 0; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.q-list-head { padding: 12px 16px; font-size: var(--fs-micro); letter-spacing: .1em; color: var(--faint); font-weight: 700; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
/* 검색·상태필터: 목록 상단 고정, 항목만 스크롤 */
.q-list-tools { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
.q-search {
  width: 100%; box-sizing: border-box; padding: 8px 11px; font-size: var(--fs-sm);
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card);
  color: var(--text); font-family: inherit;
}
.q-search:focus { outline: none; border-color: var(--teal); }
.q-search::placeholder { color: var(--faint); }
/* 월/구분 필터: 연도 세그(#q-year-seg)와 같은 각진 세그먼트 문법.
   왼쪽에 라벨 캡션('월'/'구분')을 붙여 무엇의 필터인지 즉시 보이게. 두 바는 같은 폭(라벨 뒤 flex:1)으로 세로 정렬. */
.q-seg-row { display: flex; align-items: stretch; gap: 8px; }
.q-seg-row:empty { display: none; }               /* 구분 세그가 비면(연결 견적 없음) 숨김 */
.q-seg-label {
  flex: 0 0 30px; align-self: center; text-align: left;
  font-size: var(--fs-micro); font-weight: 700; color: var(--faint); letter-spacing: .02em;
}
.q-seg-bar {
  display: flex; flex: 1 1 auto; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--card);
}
.q-seg-bar button {
  flex: 1 1 0; min-width: 0; padding: 5px 2px; border: none; border-left: 1px solid var(--line);
  background: none; color: var(--muted); font-weight: 600; font-size: var(--fs-micro);
  font-family: inherit; font-variant-numeric: tabular-nums; text-align: center;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.q-seg-bar button:first-child { border-left: none; }
/* 호버 = 옅은 배경 틴트 + 글자는 진하게(--text) 유지. 저대비·깜빡임 금지 (transition 없음 → 즉시). */
.q-seg-bar button:hover:not(:disabled) { background: var(--surface); color: var(--text); }
/* 견적 없는 달: 흐림 + 클릭 무시(위치는 고정) — 매달 자리가 같아 예측 가능 */
.q-seg-bar button:disabled { color: var(--faint); opacity: .38; cursor: default; }
/* 선택(.on) 시각 = 연도 세그와 동일: 진한 텍스트색 배경 + 흰 글씨 */
.q-seg-bar button.on { background: var(--text); color: var(--bg); font-weight: 700; }
/* 선택된 세그 호버: 반전 대비 유지 (호버가 배경만 옅게 덮어 흰 글씨가 사라지던 버그 방지) */
.q-seg-bar button.on:hover:not(:disabled) { background: var(--text); color: var(--bg); }
/* '전체' 리셋 셀: 2글자라 살짝 여유 */
.q-seg-bar button.q-seg-all { flex: 0 0 auto; padding-left: 8px; padding-right: 8px; }
/* 어썸 세그: 로즈 텍스트 포인트만(과하지 않게). 선택 시엔 연도 세그와 동일한 on 스타일 유지 */
.q-seg-bar button.q-seg-awesome { color: var(--rose); font-weight: 700; }

/* 기타의뢰 구분 필터 — 견적 세그(q-seg) 형태 이식.
   툴바: 내용 폭 세그(버튼 넉넉한 좌우 패딩). 간략 스트립: 34px 한 줄 유지하며 남는 폭에서 축소(삐져나옴 방지). */
.o-cat-filter { gap: 8px; flex-wrap: nowrap; }
.o-cat-filter .q-seg-label { flex: 0 0 auto; }
.o-cat-filter .q-seg-bar.o-cat-seg { flex: 0 1 auto; min-width: 0; }
.o-cat-filter .q-seg-bar.o-cat-seg button { flex: 0 0 auto; padding: 5px 12px; font-size: var(--fs-sm); }
/* 간략 스트립: 라벨 생략(밀도), 세그는 남는 폭에서 축소하되 overflow:hidden 으로 클립(옆 칩과 겹침 방지).
   34px 한 줄 유지. 버튼은 내용 폭 고정 — 좁아지면 세그가 통째로 클립될 뿐 겹치거나 2줄로 넘치지 않는다. */
.compact-strip .cs-cat.o-cat-filter { flex: 0 1 auto; min-width: 0; overflow: hidden; gap: 0; }
.compact-strip .cs-cat .q-seg-label { display: none; }
.compact-strip .cs-cat .q-seg-bar.o-cat-seg { flex: 0 1 auto; min-width: 0; }
.compact-strip .cs-cat .q-seg-bar.o-cat-seg button { flex: 0 0 auto; padding: 3px 8px; font-size: 11px; }
/* 간략 스트립 요약(건수/매출/…)도 좁으면 함께 축소·클립 → 세그가 통째로 사라지거나 [+추가]가 밀리지 않게 부담 분담 */
.compact-strip .cs-sum { min-width: 0; overflow: hidden; }
.q-filter { display: inline-flex; gap: 2px; padding: 3px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); }
.q-filter button { flex: 1; padding: 5px 8px; border: none; background: none; border-radius: 5px; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.q-filter button.on { background: var(--text); color: var(--bg); font-weight: 700; }
#q-list-items { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.q-item { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.q-item:hover { background: var(--surface-sub); }
.q-item.on { background: var(--surface-sub); box-shadow: inset 3px 0 0 var(--text); }
.q-r1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.q-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.q-to { flex: 0 1 auto; min-width: 0; font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-badge { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.q-b-sent { background: var(--ok-bg); color: var(--ok); }
.q-b-draft { background: var(--surface-sub); color: var(--muted); border: 1px solid var(--line); }
.q-b-auto { background: var(--rose-bg); color: var(--rose-dark); }
.q-b-link { background: var(--teal-bg); color: var(--teal-dark); margin-left: 6px; }
.q-b-stmt { background: var(--indigo-bg); color: var(--indigo-strong); margin-left: 6px; }
.q-r2 { display: flex; align-items: center; margin-top: 4px; font-size: 12.5px; color: var(--muted); gap: 8px; min-width: 0; }
.q-tt { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-amt { margin-left: auto; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-empty-list { padding: 24px 16px; color: var(--faint); font-size: var(--fs-sm); }

.q-paperwrap { flex: 1; min-width: 0; padding: 26px 40px 40px; display: flex; flex-direction: column; align-items: center; background: var(--bg); overflow: auto; }
/* 좁은 폭에서 종이(794px)가 목록 밑으로 밀리지 않게: 컨텐츠가 넘치면 왼쪽부터 시작해 가로 스크롤 */
@media (max-width: 1240px) { .q-paperwrap { align-items: flex-start; } }
.q-actions { width: 794px; max-width: 100%; display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.q-actions-sp { flex: 1; }
/* 1차 액션(발행)은 또렷하게 강조 */
.q-actions .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.q-actions .btn.primary:hover { filter: brightness(1.05); background: var(--accent); }
/* '의뢰 보기' 버튼: 활성(패널 열림) 시 틸 채움으로 상태 표시 */
.q-view-other.on { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 700; }
.q-view-other.on:hover { filter: brightness(1.05); background: var(--teal); }
/* ===== 견적 옆 '의뢰 보기' 패널 — 연결 기타의뢰를 나란히 띄워 시트식으로 편집 (모달 아님) ===== */
.q-other-panel {
  flex: 0 0 360px; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.qo-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; background: var(--teal); color: #fff;
  font-weight: 700; font-size: var(--fs-base);
}
.qo-title { flex: 1; min-width: 0; }
.qo-close {
  border: 0; background: transparent; color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer;
  padding: 2px 6px; border-radius: 6px;
}
.qo-close:hover { background: rgba(255,255,255,.18); }
.qo-note {
  flex: 0 0 auto; padding: 8px 14px;
  background: var(--teal-tint); color: var(--teal-dark);
  border-bottom: 1px solid var(--teal-tint-line);
  font-size: var(--fs-sm);
}
.qo-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 0; }
.qo-loading { padding: 20px 14px; color: var(--faint); }
.qo-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); min-height: 44px; }
.qo-label {
  flex: 0 0 84px; display: flex; align-items: center;
  padding: 8px 12px; background: var(--surface-sub);
  color: var(--muted); font-size: var(--fs-sm); font-weight: 600;
  border-right: 1px solid var(--line);
}
.qo-val {
  flex: 1; min-width: 0; display: flex; align-items: center;
  padding: 8px 12px; font-size: var(--fs-base); color: var(--text);
  cursor: text; white-space: pre-wrap; word-break: break-word;
}
.qo-val.num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.qo-val.empty { color: var(--faint); }
.qo-val:hover { background: var(--teal-tint2); }
.qo-input {
  width: 100%; border: 1px solid var(--teal); border-radius: 4px;
  padding: 6px 8px; font: inherit; font-size: var(--fs-base);
  color: var(--text); background: var(--surface);
}
textarea.qo-input { min-height: 60px; resize: none; overflow: hidden; }
/* 삭제(파괴적 액션)는 더보기와 살짝 떨어뜨려 우측 끝에 배치 */
.q-del-btn { margin-left: 8px; }
.q-del-btn:hover { filter: brightness(1.05); }
/* 연결 칩: 클릭 가능한 버튼. hover 시 또렷해져 클릭 가능함을 알림. */
.q-linkchip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--teal); background: var(--teal-bg);
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 5px 11px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: border-color 0.12s, filter 0.12s;
}
.q-linkchip:hover { border-color: var(--teal); filter: brightness(0.98); }
/* ⋯ 더보기 오버플로 메뉴 */
.q-more-wrap { position: relative; }
.q-more-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop); z-index: 60; min-width: 190px; overflow: visible; padding: 4px;
}
.q-more-item {
  display: block; width: 100%; text-align: left; box-sizing: border-box;
  padding: 9px 12px; font-size: var(--fs-sm); cursor: pointer; color: var(--text);
  border: none; background: none; border-radius: 5px; font-family: inherit;
}
.q-more-item:hover { background: var(--surface-sub); }
.q-more-danger { color: var(--danger); }
.q-more-sep { height: 1px; background: var(--line); margin: 4px 0; }
.q-preset-wrap { position: relative; }
.q-preset-menu { position: absolute; top: 0; right: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-pop); z-index: 70; min-width: 140px; overflow: hidden; padding: 4px; }
.q-preset-item { padding: 8px 14px; font-size: var(--fs-sm); cursor: pointer; color: var(--text); border-radius: 5px; }
.q-preset-item:hover { background: var(--surface-sub); }
.q-empty { text-align: center; padding: 60px 20px; }
.q-empty-title { font-size: var(--fs-lg); font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.q-empty-sub { font-size: var(--fs-base); color: var(--faint); line-height: 1.6; }

/* ===== 거래처 탭 (시안 v3) =====
   좌: 목록 시트(바이올렛 밴드 th) / 우: 상세(정의표 인라인 편집).
   색 언어: 매출=--profit(빨강), 입금·미입금=--ok(초록), 밴드=--hub 단색+흰 글자. 틴트 온 틴트 금지. */
.hub-toolbar { gap: 12px; }
.hub-search {
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 7px 11px; font-size: var(--fs-sm); font-family: inherit;
  background: var(--surface); color: var(--text); min-width: 220px;
}
.hub-sort { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.hub-sort button {
  padding: 6px 12px; border: none; border-left: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: var(--fs-sm);
  cursor: pointer; font-family: inherit;
}
.hub-sort button:first-child { border-left: none; }
.hub-sort button.on { background: var(--text); color: var(--bg); font-weight: 700; }
.hub-new-btn { background: var(--hub); border-color: var(--hub); color: #fff; font-weight: 700; }
.hub-new-btn:hover { background: var(--hub-deep); border-color: var(--hub-deep); }

.hub-body {
  display: flex; align-items: flex-start; gap: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden; min-height: 560px;
}
.hub-list { flex: 1 1 52%; border-right: 1px solid var(--line-strong); overflow-x: auto; outline: none; align-self: stretch; }
.hub-detail { flex: 1 1 48%; display: flex; flex-direction: column; font-size: var(--fs-base); min-width: 0; }

/* 인라인 새 거래처 추가 바 (모달 금지 — 목록 위 인라인 행) */
.hub-add-bar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--hub-tint); }
.hub-add-bar input {
  flex: 1; border: 1px solid var(--hub); border-radius: var(--r-sm);
  padding: 7px 10px; font-size: var(--fs-sm); font-family: inherit; background: var(--surface); color: var(--text);
}
.hub-add-bar .btn { font-size: var(--fs-sm); }

/* 목록 시트 */
.hub-table { border-collapse: collapse; width: 100%; font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
.hub-table th {
  background: var(--hub); color: #fff; padding: 9px 10px; text-align: left;
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
  border-bottom: 2px solid var(--line-strong); position: sticky; top: 0; z-index: 1;
}
.hub-table th.n, .hub-table td.n { text-align: right; }
.hub-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.hub-table tbody tr { cursor: pointer; }
.hub-table tbody tr:hover { background: var(--surface-sub); }
.hub-table td.hub-cname { font-weight: 800; font-size: 16px; }
.hub-table tr.hub-picked td { background: var(--hub-tint); }
.hub-table tr.hub-picked:hover td { background: var(--hub-tint); }
.hub-src { color: var(--muted); font-size: 14px; }
.hub-empty-row td { color: var(--faint); font-weight: 400; text-align: center; padding: 18px 10px; }

/* 상세 */
.hub-d-head { padding: 14px 16px 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hub-d-title { font-size: 25px; font-weight: 800; }
.hub-d-src { color: var(--muted); font-size: 14px; }
.hub-detail-empty { padding: 60px 24px; text-align: center; color: var(--faint); font-size: 15px; }

.hub-tiles { display: flex; gap: 8px; padding: 0 14px 10px; }
.hub-tile { flex: 1; border: 2px solid var(--line-strong); border-radius: var(--r-sm); padding: 9px 10px; text-align: center; background: var(--surface); }
.hub-tile .hk { font-size: 13px; color: var(--muted); font-weight: 700; }
.hub-tile .hv { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.hub-tile.sales .hv { color: var(--profit); }
.hub-unpaid-line { padding: 0 16px 10px; font-size: 14px; color: var(--muted); }
.hub-unpaid-line b { color: var(--ok); font-weight: 700; }

/* 밴드 = 시트 헤더 문법 (바이올렛 단색 + 흰 글자) */
.hub-band {
  background: var(--hub); color: #fff; font-weight: 800; font-size: 13.5px;
  padding: 6px 16px; display: flex; align-items: center; gap: 8px;
}
.hub-band .hub-chips { margin-left: auto; display: flex; gap: 5px; }
.hub-bchip {
  background: #fff; color: var(--hub-deep); font-size: 12px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px; cursor: pointer; border: none; font-family: inherit;
}
.hub-bchip.off { background: transparent; color: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.45); }
.hub-bchip.nav { background: rgba(255,255,255,.9); }

.hub-rows { padding: 6px 16px 10px; }
.hub-row { display: flex; align-items: baseline; gap: 12px; padding: 5px 0; border-bottom: 1px dotted var(--line); }
.hub-row:last-child { border-bottom: none; }
.hub-lab { flex: 0 0 88px; text-align: right; color: var(--muted); font-size: 13.5px; }
.hub-vwrap { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; font-weight: 600; }
.hub-vwrap .dim { font-weight: 400; color: var(--faint); }
/* 값 = 클릭해 인라인 편집 (시트 감각) */
.hub-val { cursor: text; border-radius: 4px; padding: 1px 3px; margin: 0 -3px; }
.hub-val:hover { background: var(--hub-tint); }
.hub-val.empty { color: var(--faint); font-weight: 400; }
.hub-val.ro { cursor: default; }
.hub-val.ro:hover { background: transparent; }
.hub-edit-in {
  width: 100%; border: 1px solid var(--hub); border-radius: 4px; padding: 3px 6px;
  font-size: var(--fs-sm); font-family: inherit; background: var(--surface); color: var(--text);
}
textarea.hub-edit-in { resize: vertical; }
.hub-cert-link { margin-left: 6px; text-decoration: none; cursor: pointer; }

/* 최근 작업 미니 시트 */
.hub-minisheet { margin: 6px 14px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.hub-minisheet table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.hub-minisheet th { background: var(--hub); color: #fff; font-size: 12.5px; padding: 6px 9px; text-align: left; font-weight: 700; }
.hub-minisheet th.n, .hub-minisheet td.n { text-align: right; }
.hub-minisheet td { padding: 6px 9px; border-bottom: 1px solid var(--line); }
.hub-minisheet tr:last-child td { border-bottom: none; }
.hub-mini-empty { color: var(--faint); text-align: center; padding: 12px; }
.hub-paidok { color: var(--muted); }
.hub-unpaid { color: var(--ok); font-weight: 800; }

.hub-detail-foot { margin-top: auto; padding: 12px 16px; display: flex; justify-content: flex-end; }
.hub-del-btn { background: none; border: none; color: var(--faint); font-size: 13px; cursor: pointer; font-family: inherit; text-decoration: underline; }
.hub-del-btn:hover { color: var(--danger); }

/* 최근 작업 미니 시트: 전체 반환이라 고정 높이 + 내부 스크롤. 헤더는 sticky. */
.hub-minisheet { max-height: 340px; overflow: auto; }
.hub-minisheet th { position: sticky; top: 0; z-index: 1; }
/* 행 동작 아이콘 (상세 열기 · 견적 열기) */
.hub-minisheet td.hub-act { white-space: nowrap; text-align: center; padding: 3px 8px; }
.hub-act-btn {
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  color: var(--hub-deep); font-size: 14px; line-height: 1; padding: 3px 5px; border-radius: 5px;
}
.hub-act-btn:hover { background: var(--hub-tint); }
.hub-act-btn.q { color: var(--muted); }
.hub-act-btn.q:hover { background: var(--surface-sub); color: var(--hub-deep); }

/* 견적서 미리보기 오버레이 (hub 위) */
.hub-quote-ov { position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center; }
.hub-quote-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.32); animation: dpFade 0.12s ease-out; }
.hub-quote-card {
  position: relative; z-index: 1;
  width: auto; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.32); display: flex; flex-direction: column; overflow: hidden;
  animation: dpFade 0.12s ease-out;
  --qscale: 1;
}
.hub-quote-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--hub); color: #fff; flex: 0 0 auto; }
.hub-quote-title { font-weight: 800; font-size: 15px; margin-right: auto; }
.hub-quote-head .btn { background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.4); color: #fff; font-weight: 700; }
.hub-quote-head .btn:hover { background: rgba(255,255,255,0.28); }
.hub-quote-close { border: none; background: rgba(255,255,255,0.18); color: #fff; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1; }
.hub-quote-close:hover { background: rgba(255,255,255,0.32); }
/* A4 무대: 종이(794×1123px 고정)를 담고 --qscale 로 통째 축소 → A4 한 장 전체가 카드에 딱 맞게 보인다.
   (종이는 794px 고정폭이라 iframe 을 좁히면 잘리므로, 폭을 줄이지 않고 transform 으로 스케일한다.) */
.hub-quote-stage {
  flex: 0 0 auto; align-self: center; position: relative; overflow: hidden; background: #fff;
  width: calc(794px * var(--qscale));
  height: calc(1123px * var(--qscale));
}
.hub-quote-frame {
  position: absolute; top: 0; left: 0;
  width: 794px; height: 1123px; border: none; background: #fff;
  transform: scale(var(--qscale)); transform-origin: top left;
}

/* ================= 프리랜서 SRT 드래그&드롭 업로드 ================= */
/* 드래그 오버레이: 표/순서 모드 위를 덮는 점선 안내. 변수 기반·다크 대응. */
#tab-freelancer { position: relative; }
.fr-drop-overlay {
  position: absolute; inset: 0; z-index: 40;
  display: none; align-items: center; justify-content: center;
  pointer-events: none; /* 드래그 이벤트가 아래 표로 통과하게 */
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 3px dashed var(--accent);
  border-radius: 12px;
}
.fr-drop-overlay.on { display: flex; }
.fr-drop-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 28px 40px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-pop);
  border: 1px solid var(--line);
}
.fr-drop-icon { font-size: 44px; line-height: 1; }
.fr-drop-msg { font-size: 22px; font-weight: 800; color: var(--text); text-align: center; }
.fr-drop-overlay.busy { border-style: solid; }
.fr-drop-overlay.busy .fr-drop-msg { color: var(--accent); }

/* 업로드 완료 확인 팝업: 완료 알림용 짧은 카드(편집을 막는 모달이 아님). 배경 클릭·ESC·확인 닫기. */
.fr-upload-pop-back {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,20,15,0.5); padding: 20px;
}
.fr-upload-pop-card {
  background: var(--surface); color: var(--text);
  border-radius: 16px; box-shadow: var(--shadow-pop);
  border: 1px solid var(--line);
  padding: 26px 28px 22px; max-width: 560px; width: 100%;
  max-height: 82vh; overflow: auto; text-align: center;
}
.fr-up-check {
  width: 56px; height: 56px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 900; color: #fff;
  background: var(--ok); border-radius: 50%;
}
.fr-up-title { font-size: 24px; font-weight: 900; margin-bottom: 16px; }
.fr-up-list { text-align: left; display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.fr-up-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-sub); border: 1px solid var(--line);
  font-size: 16px;
}
.fr-up-name { font-weight: 800; word-break: break-all; }
.fr-up-arrow { color: var(--muted); }
.fr-up-stat { font-weight: 700; }
.fr-up-row.match { background: var(--ok-bg); border-color: var(--ok); }
.fr-up-row.match .fr-up-stat { color: var(--ok); }
.fr-up-row.fail { background: var(--danger-bg); border-color: var(--danger); }
.fr-up-row.fail .fr-up-stat { color: var(--danger); }
.fr-up-row.plain .fr-up-stat { color: var(--muted); }
.fr-up-ok {
  font-size: 18px; font-weight: 800; color: #fff;
  background: var(--accent); border: none; border-radius: 10px;
  padding: 11px 40px; cursor: pointer;
}
.fr-up-ok:hover { filter: brightness(1.06); }

/* ── 스크롤바: 얇고 미니멀 (앱·브라우저 전부 Chromium 계열이라 webkit 커스텀 사용) ──
   투명 트랙 + 둥근 썸. 색은 --text 기반 반투명이라 라이트/다크 모두 자동 대응. */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 20%, transparent);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text) 36%, transparent); }
::-webkit-scrollbar-corner { background: transparent; }
