/* ======================================================================
   app.css — 이 앱의 껍데기만. 그리드 키트(cgrid.css)와 섞지 않는다.
   사이드바 / 사이드바 메뉴 계층 / 대시보드 / 로그인
   ====================================================================== */
/* ---------- 사이드바 — colon-hub 와 같은 모양·움직임(0059, 사용자 2026-11-04 "colon-hub 처럼") ----------
   남색 그라데이션 · 묶음 머리 굵게/연하게 · 1뎁스 47px · 활성 = 왼쪽 흰 막대 + 밝은 바탕 ·
   묶음 여닫기 = 높이가 미끄러지듯(grid-template-rows 0fr↔1fr) · 꺽쇠 회전 · 컨트롤 바는 메뉴에 마우스를 올릴 때만 */
:root {
    --sb-w: 240px;
    --sb-bg: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    --sb-solid: #16213e;
    --sb-fg: rgba(255, 255, 255, .62);
    --sb-accent: #ffffff;
    --ease-out: cubic-bezier(.2, .8, .2, 1);
}
#adminSidebar {
    width: var(--sb-w); flex: 0 0 var(--sb-w); background: var(--sb-bg); color: var(--sb-fg);
    box-shadow: 2px 0 12px rgba(0, 0, 0, .15); position: relative; z-index: 5;
    transition: margin-left .18s ease;
}
body.sidebar-collapsed #adminSidebar { margin-left: calc(var(--sb-w) * -1); }
/* 로고 줄 — colon-hub .sb-logo 치수 */
.sb-logo { flex: 0 0 auto; display: flex; align-items: center; padding: 20px 24px; border-bottom: 1px solid rgba(255, 255, 255, .08); white-space: nowrap; }
.sb-logo .brand-logo { font-size: 18px; font-weight: 700; letter-spacing: .5px; color: #fff; text-decoration: none; }
.sb-logo .brand-logo span { color: rgba(255, 255, 255, .5); font-weight: 600; letter-spacing: 1.5px; font-size: 14px; }

/* ⑤ 접기 핸들 — 펼침 = 사이드바 경계에 붙은 흰 탭 / 접힘 = 화면 왼쪽 끝 (colon-hub .sb-handle) */
#sidebarHandle {
    position: fixed; top: 50%; left: var(--sb-w); transform: translate(-100%, -50%);
    width: 20px; height: 52px; padding: 0; z-index: 60;
    background: #fff; color: #555; border: 1px solid #e2e8f0; border-right: 0; border-radius: 8px 0 0 8px;
    box-shadow: 2px 0 6px rgba(0, 0, 0, .06); transition: left .18s ease;
}
#sidebarHandle:hover { background: #f4f4f4; color: #333; }
#sidebarHandle svg { display: block; width: 10px; height: 24px; }
body.sidebar-collapsed #sidebarHandle { left: 0; transform: translate(0, -50%); border: 1px solid #e2e8f0; border-left: 0; border-radius: 0 8px 8px 0; }
body.sidebar-collapsed #sidebarHandle svg { transform: scaleX(-1); }   /* 닫힘 = 오른쪽(›) 화살표 */
body.modal-open #sidebarHandle { z-index: 10; }

/* 사이드바 메뉴 스크롤바: 얇고 은은하게(다크 배경) */
#adminSidebar nav { padding: 4px 0 48px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }   /* §2.8⑦ 하단 여유 */
#adminSidebar nav::-webkit-scrollbar { width: 6px; }
#adminSidebar nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 3px; }
#adminSidebar nav::-webkit-scrollbar-track { background: transparent; }
/* 본문 스크롤바: 얇게 */
main { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .35) transparent; }
main::-webkit-scrollbar { width: 8px; }
main::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .3); border-radius: 4px; }
main::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .5); }
main::-webkit-scrollbar-track { background: transparent; }

/* ---------- 사이드바 메뉴 계층 (§2.8 ⑦: 0뎁스 그룹 / 1뎁스 리프) ---------- */
.nav-link, .nav-group-head {
    display: flex; align-items: center; gap: 8px; width: 100%; font-size: 14px; line-height: 1.2; text-align: left;
    color: rgba(255, 255, 255, .6); text-decoration: none; border: 0; border-left: 3px solid transparent; background: transparent;
    transition: background .2s ease, color .2s ease;
}
/* 0뎁스 묶음 머리 — 글씨 크기는 1뎁스와 같고 굵고 연하게. 꺽쇠는 행 오른쪽 끝 */
.nav-group-head { padding: 10px 24px; color: rgba(255, 255, 255, .5); font-weight: 700; cursor: pointer; }
.nav-group-head:hover { color: rgba(255, 255, 255, .82); }
.nav-top { padding: 10px 24px; font-weight: 700; }           /* 묶음 밖 리프(대시보드) = 묶음 머리와 같은 들여쓰기·굵기 */
.nav-leaf { padding: 10px 24px 10px 47px; font-weight: 500; } /* 1뎁스 리프 */
.nav-link:hover { background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .92); }
/* ⑧ 활성 = 왼쪽 흰 막대 + 굵게 + 밝은 바탕 */
.nav-link.is-active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; border-left-color: var(--sb-accent); }
.nav-link.is-active .nav-label { color: #fff; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* 말줄임 */
/* 꺽쇠 = 행 오른쪽 끝(ADMIN_PAGE_RULE §2.8⑦) — 닫힘 › / 열림 ⌄ 로 돈다 */
.nav-chevron { order: 9; margin-left: auto; width: 11px; height: 11px; flex: 0 0 11px; stroke-width: 3; color: currentColor; transition: transform .2s ease; }
.nav-group.is-open > .nav-group-head .nav-chevron { transform: rotate(90deg); }
/* 묶음 여닫기 — 높이가 미끄러지듯(내용은 .nav-group-inner 한 칸) */
.nav-group { margin-bottom: 2px; }
.nav-group-body { display: grid; grid-template-rows: 0fr; opacity: .2; transition: grid-template-rows .24s var(--ease-out), opacity .2s ease; }
.nav-group-inner { min-height: 0; overflow: hidden; }
.nav-group.is-open > .nav-group-body { grid-template-rows: 1fr; opacity: 1; }
/* 닫힌 묶음 안에 지금 화면이 있으면 머리 글씨를 활성 톤으로(§2.8 ⑦ 기본 전체 닫힘 — 자동 펼침 안 함, 0041) */
.nav-group:not(.is-open).has-cur > .nav-group-head { color: rgba(255, 255, 255, .92); }

/* 맨 윗줄 — 대시보드(왼쪽) + 컨트롤 바(오른쪽), nav 스크롤 안에서 sticky (0057).
   컨트롤 바는 메뉴 영역에 마우스를 올릴 때만 보인다(colon-hub 와 같게) — 터치 기기는 늘 보인다 */
.nav-ctl { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; background: #1a1a2e; margin-bottom: 2px; }
.nav-ctl > .nav-link { flex: 1 1 auto; min-width: 0; width: auto; }
.nav-ctl-btns {
    flex: none; display: flex; align-items: center; gap: 2px; height: 30px; margin-right: 12px; padding: 0 4px; border-radius: 8px;
    background: rgba(22, 33, 62, .92); opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
#adminSidebar nav:hover .nav-ctl-btns, .nav-ctl-btns:focus-within { opacity: 1; pointer-events: auto; }
@media (hover: none) { .nav-ctl-btns { opacity: 1; pointer-events: auto; } }
.nav-ctl-btns > span { width: 1px !important; height: 12px !important; margin: 0 3px !important; background: rgba(255, 255, 255, .15) !important; }
.nav-mini-btn { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 5px; background: transparent; color: rgba(255, 255, 255, .38); cursor: pointer; }
.nav-mini-btn:hover { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .9); }
.nav-mini-btn svg { width: 13px; height: 13px; stroke-width: 2.2; }
/* 사이드바 툴팁 — 메뉴 이름은 말줄임으로 잘렸을 때만, 그 줄 오른쪽 바깥에(colon-hub 0163). 컨트롤 단추는 늘 */
.nav-tooltip { position: fixed; z-index: 200; transform: translateY(-50%); background: #fff; color: #1a1a2e; border: 1px solid #1a1a2e; font-size: 12px; font-weight: 600;
    padding: 5px 10px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .07s; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.nav-tooltip.show { opacity: 1; }

/* 탭 줄 = 사이드바 아랫색의 연장(colon-hub .cs-bar) */
#shellHeader { background: var(--sb-solid); }
#shellHeader .ws-ctrl, #shellHeader .ws-user { border-color: rgba(255, 255, 255, .1); }
/* §2.5 그리드 셀 말줄임 커스텀 툴팁 (커서 추종, 긴 내용은 줄바꿈) */
.admin-celltip { position: fixed; z-index: 200; transform: translateY(-50%); background: #fff; color: var(--primary); border: 1px solid var(--primary); font-size: 12px;
    padding: 5px 9px; border-radius: 6px; max-width: 60vw; white-space: normal; word-break: break-word; line-height: 1.4;
    pointer-events: none; opacity: 0; transition: opacity .07s; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.admin-celltip.show { opacity: 1; }
/* .admin-tip 은 키트(cgrid.css)가 정한다 — 여기서 바깥 상자에 바탕·테두리를 다시 입히면 툴팁이 두 겹이 된다(2026-10-02 제거) */

/* ============================================================
   colon-work 추가분 — 공통 컴포넌트(§1.6 atom/molecule) 확장
   화면 JTE 에 인라인 <style> 을 두지 않기 위해 전부 여기에 둔다.
   ============================================================ */

/* ---------- 대시보드 ---------- */
/* 할 일 띠 — 기한이 지난 것은 **한 번에 눈에 들어와야** 한다. 평상시 카드와 같은 톤이면 그냥 지나친다 */
.todo-band { background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius); padding: 14px 16px 16px; }
.todo-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.todo-badge { font-size: 11px; font-weight: 800; color: #fff; background: var(--danger); border-radius: 999px; padding: 3px 10px; }
.todo-title { font-size: 14px; font-weight: 700; color: #b91c1c; }
.cert-band { padding-bottom: 14px; }
.cert-band .todo-head { margin-bottom: 0; flex-wrap: wrap; }
.cert-done { margin-left: auto; }
/* 메모 띠 — 기한 경과(빨강)와 구분되는 '잊지 말 것' 톤 */
.memo-band { background: #fffbeb; border-color: #fde68a; padding-bottom: 14px; display: grid; gap: 8px; }
.memo-band .todo-head { margin-bottom: 0; align-items: flex-start; }
.memo-band .todo-badge { background: #d97706; flex: none; }
.memo-band .todo-title { color: #92400e; font-weight: 600; }
/* 할 일 띠 — 종류별 한 줄(라벨 + 카드). 카드 폭은 줄마다 같게(auto-fill) — 한 장뿐인 줄이 꽉 늘어나지 않게 */
.todo-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; }
.todo-row + .todo-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #fecaca; }
.todo-row-label { font-size: 13px; font-weight: 800; color: #b91c1c; line-height: 1.35; }
.todo-row-label span { display: block; font-size: 11px; font-weight: 500; color: #ef4444; margin-top: 2px; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@media (max-width: 640px) { .todo-row { grid-template-columns: 1fr; } }
.stat-card.is-danger { border-color: #fca5a5; background: #fff; }
.stat-card.is-danger .stat-label { color: #b91c1c; font-weight: 700; }
.stat-card.is-danger .stat-value { color: #b91c1c; }
a.stat-card.is-danger:hover { background: var(--danger); border-color: var(--danger); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: block; transition: all .15s; }
a.stat-card:hover { background: var(--primary); border-color: var(--primary); }
a.stat-card:hover .stat-label, a.stat-card:hover .stat-value, a.stat-card:hover .stat-sub { color: #fff; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat-label::before { content: ""; width: 4px; height: 13px; border-radius: 2px; background: var(--primary); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.25; margin-top: 8px; }
.stat-value .unit { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-left: 3px; }
.stat-sub { font-size: 11px; color: var(--text-secondary); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* 설명은 한 줄 — 넘치면 … */
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-head { padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.panel-head::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--primary); }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { background: #f8fafc; font-size: 11px; font-weight: 600; color: var(--text-secondary); padding: 8px 14px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mini-table td { font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-primary); white-space: nowrap; }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table tbody tr:hover td { background: var(--primary-light); }
/* 숫자는 자릿수가 세로로 맞아야 대소가 눈에 들어온다(tabular-nums) + 본문보다 크고 진하게 */
.mini-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mini-table td.amt { font-size: 14.5px; font-weight: 700; color: var(--primary); letter-spacing: -.01em; }
.mini-table td.amt .cur { font-size: 10.5px; font-weight: 600; color: var(--text-secondary); margin-left: 2px; }
.mini-table td.cnt { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.mini-table td.cnt .unit { font-size: 10.5px; font-weight: 500; color: var(--text-secondary); margin-left: 1px; }
.mini-table td.ym { font-size: 12.5px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.mini-table td.amt.zero { color: var(--text-secondary); font-weight: 500; }   /* 0 은 눈에 덜 걸리게 */
.mini-empty { padding: 26px 14px; text-align: center; color: var(--text-secondary); font-size: 13px; }

/* 세무 일정 (0057) — 이번 달 체크리스트 + 다가오는 기한. 두 칸(좁으면 한 칸). 한 줄 = 그 화면으로 가는 링크 */
.dash-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .dash-cols { grid-template-columns: minmax(0, 1fr); } }
.panel-head-sub { font-size: 11.5px; font-weight: 500; color: var(--text-secondary); }
.panel-head-count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.panel-head { flex-wrap: wrap; row-gap: 2px; }
.due-list { display: flex; flex-direction: column; }
.due-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text-primary); text-decoration: none; transition: background .12s; }
.due-row:last-child { border-bottom: none; }
.due-row:hover { background: var(--primary-light); }
.due-day { flex: none; width: 64px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.due-mark { flex: none; width: 18px; height: 18px; display: inline-flex; color: #94a3b8; }
.due-mark svg { width: 18px; height: 18px; }
.due-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.due-title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.due-sub { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-state { flex: none; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: #f1f5f9; color: #475569; white-space: nowrap; }
.due-left { flex: none; min-width: 52px; text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.due-empty { padding: 26px 14px; text-align: center; color: var(--text-secondary); font-size: 13px; }
/* 완료 = 초록 체크 · 글자 옅게 */
.due-row[data-tone="done"] .due-mark { color: #10b981; }
.due-row[data-tone="done"] .due-title { color: var(--text-secondary); font-weight: 500; }
.due-row[data-tone="done"] .due-state { background: #ecfdf5; color: #047857; }
.due-row[data-tone="done"] .due-day { color: var(--text-secondary); font-weight: 500; }
/* 7일 이내(지난 것 포함) 미완료 = 빨강 */
.due-row[data-tone="urgent"] { background: #fef2f2; }
.due-row[data-tone="urgent"]:hover { background: #fee2e2; }
.due-row[data-tone="urgent"] .due-mark, .due-row[data-tone="urgent"] .due-title,
.due-row[data-tone="urgent"] .due-left, .due-row[data-tone="urgent"] .due-day { color: #b91c1c; }
.due-row[data-tone="urgent"] .due-state { background: var(--danger); color: #fff; }
/* 행 없음(미등록) — 아직 여유 있는 것 */
.due-row[data-tone="missing"] .due-state { background: #fffbeb; color: #b45309; }
.due-row[data-tone="todo"] .due-mark { color: var(--primary); }
@media (max-width: 640px) {
    .due-row { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
    .due-day { width: 100%; font-size: 12px; }
    .due-row .due-main { flex-basis: calc(100% - 26px - 8px - 120px); }
    .due-sub { white-space: normal; }
    .due-left { min-width: 0; }
}

/* ---------- 로그인 ---------- */
body:has(.login-wrap) { margin: 0; padding: 0; background: #0f172a; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #0f172a; position: relative; }
.login-card { width: 100%; max-width: 360px; background: #fff; border-radius: 16px; padding: 34px 30px 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.login-logo { font-size: 21px; font-weight: 800; color: #0f172a; letter-spacing: -.02em; text-align: center; }
.login-logo span { color: #64748b; font-weight: 700; }
/* 브랜드 마크(콜론 + 서류가방) — 사이드바·로그인 공통 */
.brand-logo, .login-logo { display: inline-flex; align-items: center; gap: 8px; }
.login-logo { display: flex; justify-content: center; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.login-logo .brand-mark { width: 30px; height: 30px; }
.brand-logo .brand-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }   /* 어두운 사이드바 위에서 윤곽이 보이게 */
.login-form { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.login-form .filter-input { height: 44px; font-size: 14px; }
.login-form .btn { height: 44px; justify-content: center; font-size: 14px; }
.login-error { font-size: 12.5px; color: var(--danger); font-weight: 600; text-align: center; }
/* Caps Lock 경고 — 오류 문구(빨강)와 **다른 색**을 쓴다. 이건 '틀렸다'가 아니라
   '이대로 치면 틀린다'는 예고라서, 같은 빨강이면 이미 실패한 것으로 읽힌다. */
.login-caps {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 0; padding: 7px 10px;
    font-size: 12.5px; font-weight: 600; color: #b45309;
    background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm);
}
/* ⚠️ footgun: `display:flex` 는 브라우저 기본 `[hidden]{display:none}` 을 **이긴다**
   (작성자 스타일이 UA 스타일보다 우선). 숨김을 명시하지 않으면 늘 켜진 것처럼 보인다. */
.login-caps[hidden] { display: none; }
.login-version { position: fixed; left: 16px; bottom: 12px; font-size: 11px; color: rgba(255, 255, 255, .45); }

/* 옛 오프캔버스 보조요소(admin.jte 단독 화면에만 남음 — 직접 접속은 셸로 바운스되므로 늘 숨김).
   모바일 셸(아래 탭 줄 · 탭 드롭다운 · ☰ · 오른쪽 서랍 · 밀기 · 안전 영역)은 키트 v4.16.0(cgrid-shell.js
   mobileShell + cgrid.css 모바일 셸 블록, §2.19)이 한다 — 여기서 사이드바·탭 줄 모바일 규칙을 다시 쓰지 않는다. */
#sidebarBackdrop { display: none; }
#sidebarFab { display: none !important; }

@media (max-width: 768px) {
    /* ----- 화면(iframe) 본문 여백 24 → 12px ----- */
    #adminMain { padding: 12px !important; }

    /* ----- 팝업 여백 — 바깥 8 · 머리 14/8 · 푸터 10/14 는 키트 v4.17.2 가 한다(0036, 여기 있던 바깥 6·머리 14/10 은 키트 선택자가 더 강해 이미 안 먹었고 푸터는 같은 값).
       몸통 사방 14px(키트는 아래만 16)·팝업 높이는 colon-work 값이라 남긴다 ----- */
    .cg-modal-overlay > div { max-height: calc(100dvh - 16px) !important; }   /* 바깥 8px 위아래 */
    .cg-modal-body { padding: 14px !important; }
    .cg-modal-footer [data-modal-footer], .cg-modal-footer > div { flex-wrap: wrap; }
    .cg-modal-footer .btn { white-space: nowrap; }

    /* ----- 대시보드 — 카드 2열, 숫자 작게, 표는 가로 스크롤 ----- */
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stat-card { padding: 12px 14px; }
    .stat-value { font-size: 21px; }

    /* ----- 검색영역 — 콤보 하나짜리 조건은 두 칸씩(세로로 끝없이 길어지지 않게).
       검색어(유형+값)·기간(시작~끝)처럼 줄에 둘 이상 든 조건은 한 줄 전체 ----- */
    .admin-search-card .filter-bar { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; }
    .admin-search-card .filter-group:has(.filter-row > :nth-child(2)) { grid-column: 1 / -1; }
    .admin-search-card .filter-row > :only-child, .admin-search-card .filter-row > .combobox:only-of-type:last-child { width: 100% !important; min-width: 0; }
    .admin-search-card .filter-group:not(:has(.filter-row > :nth-child(2))) .combobox { width: 100% !important; }
    .admin-search-card .filter-group:not(:has(.filter-row > :nth-child(2))) .combobox > input { width: 100% !important; }

    /* ----- 목록 툴바 — 화면 액션(+ 등록)과 도구(수정 등)를 한 줄에 가운데 맞춘다. 줄바꿈(flex-wrap)은 키트 v4.17.2 가 함(0036) ----- */
    .grid-toolbar > .gk-row { width: 100%; align-items: center !important; justify-content: space-between; gap: 8px; }
    .grid-toolbar .grid-actions { margin-bottom: 0; }
    .grid-toolbar .grid-actions .btn { white-space: nowrap; }
    .grid-toolbar > .gk-row > .grid-tools { margin-bottom: 0; margin-left: auto; }
    .grid-toolbar + * , .grid-toolbar { row-gap: 8px; }
    .grid-toolbar { margin-bottom: 10px; }

    .todo-badge { white-space: nowrap; }

    /* ----- 계약서 팝업 대표 서명 줄 ----- */
    .owner-pick .filter-input { flex: 1 1 140px; }
}


/* 모달 폼 — 여백은 모달 본문(p-6) 하나만. 폼 맨 앞의 hidden id 때문에 space-y-4 가 첫 섹션 위에 16px 을 더 얹던 것을 뺀다 */
.cg-modal-body form.space-y-4 > .form-grid { margin-top: 0; }
.cg-modal-body form.space-y-4 > .form-error + .form-grid { margin-top: 12px; }
/* 텍스트에어리어(비고·내용 상세) 칸은 언제나 한 줄 전체 — 템플릿에서 col-full 을 빠뜨려도 여기서 맞춘다 */
.form-grid .field:has(> textarea) { grid-column: 1 / -1; }
/* 섹션 띠 앞뒤 간격 축소 — 키트 기본(위 16px + 줄간격 14px = 30px)은 팝업에서 휑하다 → 위 18px · 아래 10px */
.form-grid .form-section { margin: 4px 0 -4px; }
.form-grid .form-section:first-child { margin-top: 0; }
/* 폼 라벨 앞 막대는 연하게 — 섹션 띠(진한 막대)와 위계를 가른다. 검색카드 라벨 막대는 그대로 */
.form-grid .field-label::before { background: #94a3b8; }

/* 히스토리(작업 진행내역) — 한 줄 = 작업일시 · 내용 · 삭제. 좁은 화면에선 세로로 쌓인다 */
.sublog { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sublog > [data-sublog-add] { align-self: flex-end; }   /* "+ 추가" 버튼은 오른쪽 끝 */
.sublog-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.sublog-row { display: grid; grid-template-columns: 190px 1fr auto; gap: 8px; align-items: start; width: 100%; }
.sublog-row .sublog-content { min-height: 64px; width: 100%; padding: 10px 12px; line-height: 1.55; }
.sublog-list:has([data-sublog-row]) + .sublog-empty { display: none; }
@media (max-width: 640px) {
    .sublog-row { grid-template-columns: 1fr auto; }
    .sublog-row .sublog-content { grid-column: 1 / -1; }
}

/* 첨부(작업 상세 · 히스토리 줄) — 이미지는 썸네일, 나머지는 📎 + 이름. 끌어다 놓는 중인 칸은 테두리 강조 */
.attach { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; border-radius: 8px; transition: box-shadow .12s; }
.attach.attach-hot { box-shadow: 0 0 0 2px #3b82f6; background: #eff6ff; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-list:empty { display: none; }
.attach-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attach-bar .field-hint { margin: 0; }
.attach-pick { cursor: pointer; }
.attach-item { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 4px;
    border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; font-size: 12px; color: #334155; }
.attach-thumb { display: block; width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: #e2e8f0; flex: none; }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-icon { display: inline-flex; align-items: center; color: #64748b; text-decoration: none; padding: 0 2px; }
.attach-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1e293b; text-decoration: none; }
.attach-name:hover { text-decoration: underline; }
.attach-size { color: #94a3b8; white-space: nowrap; }
.attach-del { display: inline-flex; align-items: center; border: 0; background: none; color: #94a3b8; cursor: pointer; padding: 2px 4px; line-height: 1; }
.attach-del:hover { color: #dc2626; }
.attach-wait { color: #64748b; padding: 8px 10px; }
.sublog-row .sublog-attach { grid-column: 2 / 3; margin-top: 0; }
@media (max-width: 640px) {
    .sublog-row .sublog-attach { grid-column: 1 / -1; }
}

/* 작업 목록 행 색 — app-grid.js 가 셀에 숨은 .row-tone 표식을 심는다(키트는 공용이라 손대지 않음)
   보류 = 옅은 회색(글자도 흐리게) · 대금 받기 전(대금지급완료·최종완료 아님) = 옅은 노랑. 마우스 올림·선택 표시는 키트 스타일이 이긴다. */
/* ⚠️ :not(:hover) — 마우스 올림은 키트의 반전(진한 바탕 + 흰 글씨)에 맡긴다. 안 빼면 이 바탕이 반전을 이겨
      노랑 위 흰 글씨(안 보임)·보류는 올려도 변화 없음이 된다(2026-10-01 제보). */
.data-table tbody tr:not(:hover):has(.row-tone[data-tone="hold"]) > td { background-color: #f1f5f9; color: #94a3b8; }
.data-table tbody tr:not(:hover):has(.row-tone[data-tone="todo"]) > td { background-color: #fefce8; }

/* 세금계산서 항목 한 줄 — 비고(이름) · 공급가액 · 세액(자동) · 삭제 (좁으면 두 줄) */
.inv-item-row { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1.2fr) minmax(0,1fr) auto; gap: 6px; width: 100%; }
.inv-item-row > input { min-width: 0; width: 100%; }
@media (max-width: 720px) { .inv-item-row { grid-template-columns: 1fr 1fr; } }

/* 팝업 입력 구분(2026-10-02 사용자 요청) — **입력하는 칸은 옅은 파랑**, 자동계산 칸은 회색 + 칸 안 오른쪽 계산기 아이콘.
   ⚠️ background 단축 속성 금지 — 콤보 화살표(background-image)가 지워진다. 색만 바꾼다. */
.cg-modal-body .filter-input:not([readonly]):not([disabled]):not([type="hidden"]),
.cg-modal-body textarea.filter-input:not([readonly]) { background-color: #e8f1ff; border-color: #93c5fd; }
.cg-modal-body .filter-input:not([readonly]):not([disabled]):hover { border-color: #60a5fa; }
.cg-modal-body .filter-input:not([readonly]):not([disabled]):focus { background-color: #fff; border-color: var(--primary, #111827); }
/* 읽기 전용(잠김 포함) = 회색, 커서 금지 */
.filter-input[readonly] { background-color: #f1f5f9 !important; color: #334155; cursor: not-allowed; border-color: #e2e8f0; }
.filter-input[readonly]:focus { box-shadow: none; outline: none; }
/* 자동계산 칸 = **음영 없는 흰 바탕 + 점선 테두리** + 칸 안 오른쪽 계산기 아이콘(ADR-028).
   입력칸(파란 바탕)·잠긴 칸(회색)과 바탕부터 다르게 해 한눈에 구분된다(2026-10-02 요청). 잠긴 칸엔 아이콘 없음 — calc-out 만 */
.filter-input.calc-out[readonly] {
    background-color: #fff !important; border-style: dashed; border-color: #cbd5e1;
    padding-right: 30px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Cpath d='M8 6h8M8 11h.01M12 11h.01M16 11h.01M8 15h.01M12 15h.01M16 15h.01M8 19h.01M12 19h.01M16 19h.01'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 9px center; background-size: 15px 15px;
}

/* ============================================================
   계약 (2026-10-08) — 계약서 팝업 · 서명 이력 · 대표 서명
   ============================================================ */
/* 안내(성공) 띠 — form-error 와 짝 */
.form-ok { padding: 9px 12px; border-radius: var(--radius-sm, 6px); background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; font-size: 13px; font-weight: 600; }
/* 월별 금액 표 한 줄 — 근무일 시작 · 끝 · 지급일 · 지급액 · 비고 · 삭제 */
.pay-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.2fr) 52px; gap: 6px; width: 100%; align-items: center; }
.pay-row > input { min-width: 0; width: 100%; }
.pay-head { font-size: 11.5px; font-weight: 600; color: var(--text-secondary, #64748b); padding: 0 2px; }
.pay-foot { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-end; flex-wrap: wrap; }
.pay-total { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin-right: auto; }
.pay-total .filter-input { width: 150px; }
@media (max-width: 720px) {
    .pay-head { display: none; }
    .pay-row { grid-template-columns: 1fr 1fr; }
}
/* 서명 링크 + 복사 버튼 */
.sign-link { display: flex; gap: 6px; width: 100%; }
.sign-link .filter-input { flex: 1; min-width: 0; font-size: 12px; }
.sign-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.owner-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.owner-pick-img { height: 48px; max-width: 140px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; padding: 2px 6px; }
.owner-pick .filter-input { width: auto; min-width: 140px; }
/* 서명 이력 타임라인 — 최근 것이 위 */
.ctl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #e2e8f0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ctl-item { position: relative; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 12.5px; }
.ctl-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; }
.ctl-item[data-type="서명"]::before { background: #10b981; }
.ctl-item[data-type="인증실패"]::before, .ctl-item[data-type="잠금"]::before, .ctl-item[data-type="로그인실패"]::before { background: #ef4444; }
.ctl-item[data-type="문자발송"]::before, .ctl-item[data-type="인증성공"]::before, .ctl-item[data-type="로그인"]::before, .ctl-item[data-type="인증번호발송"]::before { background: #3b82f6; }
.ctl-item[data-type="정보입력"]::before, .ctl-item[data-type="정보수정"]::before, .ctl-item[data-type="정보초기화"]::before { background: #f59e0b; }
.ctl-ref { font-size: 11px; color: #1d4ed8; }
.ctl-at { font-variant-numeric: tabular-nums; color: var(--text-secondary, #64748b); }
.ctl-type { font-weight: 700; }
.ctl-who { font-size: 11px; color: #475569; background: #f1f5f9; border-radius: 4px; padding: 0 5px; }
.ctl-detail { color: #334155; }
.ctl-meta { flex-basis: 100%; font-size: 11px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 템플릿 조항 본문 — 길다 */
.form-grid textarea.tpl-body { min-height: 420px; font-size: 13px; line-height: 1.6; }
/* 대표 서명 */
.ceo-sign-now { padding: 18px; min-height: 90px; display: flex; align-items: center; }
.ceo-sign-img { max-height: 110px; max-width: 320px; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 8px; background: #fff; }
.ceo-sign-form { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.ceo-sign-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ceo-pad { position: relative; height: 200px; border: 2px dashed #94a3b8; border-radius: 10px; background: #fff; }
.ceo-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.ceo-pad-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 14px; pointer-events: none; }
/* 대표 서명 목록(여러 장, ADR-032) — 썸네일 + 사용/쉬기 + 삭제 */
.owner-sign-help { padding: 10px 18px 0; }
.owner-sign-list { list-style: none; margin: 0; padding: 14px 18px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.owner-sign-item { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.owner-sign-item[data-off] { background: #f8fafc; }
.owner-sign-item[data-off] .owner-sign-img { opacity: .45; }
.owner-sign-img { width: 100%; height: 90px; object-fit: contain; border: 1px dashed #cbd5e1; border-radius: 8px; background: #fff; }
.owner-sign-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.owner-sign-no { font-weight: 700; }
.owner-sign-at { color: #94a3b8; }
.owner-sign-actions { display: flex; gap: 6px; justify-content: flex-end; }
/* 계약자 정보 입력 상태(ADR-033) */
.info-state { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: #334155; }
.info-state-badge { font-weight: 700; border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.info-state-badge[data-state="입력완료"] { background: #ecfdf5; color: #047857; }
.info-state-badge[data-state="미입력"] { background: #fff7ed; color: #c2410c; }
.info-state-badge[data-state="관리자등록"] { background: #f1f5f9; color: #475569; }
.info-state-badge[data-state="자가가입"] { background: #eff6ff; color: #1d4ed8; }
.ctl-item[data-type="링크재발급"]::before { background: #f59e0b; }

/* 계약 이력 — 6번째부터 숨김, [더보기] 로 펼침 */
.ctl-more-hidden { display: none !important; }
.ctl-more-btn { margin-top: 8px; }

/* 사이드바 즐겨찾기(키트 v4.24.0) — 모음 안 지금 화면 = 원래 메뉴 is-active 와 같은 모양(0056) */
.nav-link.cg-fav-cur { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; border-left-color: var(--sb-accent); box-shadow: none; }
.nav-link.cg-fav-cur .nav-label { color: #fff; }
.cg-fav > .cg-fav-head { padding: 12px 24px 6px; color: rgba(255, 255, 255, .45); opacity: 1; letter-spacing: .02em; }
.cg-fav > .nav-link { padding: 9px 30px 9px 47px; font-weight: 500; }   /* 즐겨찾기 사본 = 1뎁스 리프 모양(colon-hub 와 같게) */

/* ======================================================================
   움직임 — 앱 셸 몫만(0060 → 0061). 버튼·물결·키트 모달·콤보·표 행·탭 패널은 CGrid v4.29.0 키트가 기본으로 맡는다
   (ADMIN_PAGE_RULE §2.21 — 앱에 사본을 두면 물결이 두 개, 모달 닫힘이 두 번 늦어짐). 여기는 사이드바(§2.8 ⑩)와 워크스페이스 탭 셸만.
   ====================================================================== */
:root { --ease-pop: cubic-bezier(.3, 1.6, .5, 1); }
@keyframes app-fade { from { opacity: 0; } to { opacity: 1; } }

/* 사이드바 §2.8 ⑩ — 마우스를 올리면 왼쪽 패딩 +7px 밀림(지금 화면 메뉴는 제자리), 누르면 .985 · 컨트롤 단추 1.15/.9 */
.nav-link { transition: padding-left .2s cubic-bezier(.2, .8, .2, 1), background .2s ease, color .2s ease, transform .1s ease; }
.nav-top:hover:not(.is-active) { padding-left: 31px; }   /* 24 → 31 */
.nav-leaf:hover:not(.is-active), .cg-fav > .nav-link:hover:not(.is-active) { padding-left: 54px; }   /* 47 → 54 */
.nav-link:active, .nav-group-head:active { transform: scale(.985); }
.nav-mini-btn { transition: background .15s, color .15s, transform .2s var(--ease-pop); }
.nav-mini-btn:hover { transform: scale(1.15); }
.nav-mini-btn:active { transform: scale(.9); }

/* 워크스페이스 탭 셸 — 바꿀 때 본문이 부드럽게(숨었던 iframe 이 보일 때마다 다시 돈다), 활성 탭 색은 미끄러지듯 */
.wsframe, #workspace > iframe { animation: app-fade .2s var(--ease-out); }
.ws-tab { transition: background-color .18s var(--ease-out), color .18s; }

@media (prefers-reduced-motion: reduce) {
    .nav-link, .nav-mini-btn, .ws-tab { transition: none !important; }
    .nav-link:active, .nav-group-head:active, .nav-mini-btn:hover, .nav-mini-btn:active { transform: none !important; }
    .nav-top:hover:not(.is-active) { padding-left: 24px; }
    .nav-leaf:hover:not(.is-active), .cg-fav > .nav-link:hover:not(.is-active) { padding-left: 47px; }
    .wsframe, #workspace > iframe { animation: none !important; }
}

/* ---------- 금융 (0066) ---------- */
.fin-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.fin-facts dt { color: #64748b; }
.fin-facts dd { color: #1e293b; word-break: break-all; }
.fin-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.fin-empty { padding: 48px 16px; text-align: center; color: #64748b; }
.fin-controls { padding: 14px 16px; display: grid; gap: 10px; }
.fin-control { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.fin-control-label { flex: 0 0 64px; font-size: 13px; font-weight: 600; color: #475569; line-height: 30px; }
.fin-month { width: 110px; }
.fin-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 0; min-width: 0; }
.fin-chip { height: 30px; padding: 0 12px; font-size: 13px; border: 1px solid var(--border); border-radius: 15px; background: #fff; color: #94a3b8; cursor: pointer; }
.fin-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.fin-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fin-chart { padding: 12px 16px 16px; }
.fin-axis { font-size: 12px; color: #64748b; margin-bottom: 8px; }
.fin-bars { display: flex; align-items: stretch; gap: 6px; height: 200px; border-bottom: 1px solid var(--border); }
.fin-col { position: relative; flex: 1 1 0; min-width: 0; max-width: 56px; display: flex; align-items: flex-end; justify-content: center; }
.fin-bar { width: 100%; max-width: 32px; background: var(--primary); border-radius: 4px 4px 0 0; }
.fin-col:hover .fin-bar, .fin-col:focus .fin-bar { opacity: .75; }
.fin-col-label { position: absolute; top: 100%; margin-top: 4px; font-size: 11px; color: #64748b; white-space: nowrap; }
.fin-chart .fin-bars { margin-bottom: 22px; }
.fin-rank { padding: 12px 16px 16px; display: grid; gap: 8px; max-height: 300px; overflow-y: auto; }
.fin-rank-row { display: grid; grid-template-columns: 72px 1fr 140px; align-items: center; gap: 10px; font-size: 13px; }
.fin-rank-track { height: 10px; background: #f1f5f9; border-radius: 5px; overflow: hidden; }
.fin-rank-fill { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.fin-rank-value { text-align: right; color: #475569; font-variant-numeric: tabular-nums; }
.fin-table-wrap { overflow-x: auto; }
.fin-pivot { width: 100%; border-collapse: collapse; font-size: 13px; }
.fin-pivot th { background: #f8fafc; font-weight: 600; color: #475569; white-space: nowrap; }
.fin-pivot th, .fin-pivot td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.fin-pivot tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }
.fin-name { text-align: left; white-space: nowrap; }
.fin-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-strong { font-weight: 600; }
.fin-tip { position: fixed; z-index: 200; background: #fff; color: #1e293b; border: 1px solid #1a1a2e; border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 600; pointer-events: none; }
@media (max-width: 768px) {
    .fin-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fin-rank-row { grid-template-columns: 60px 1fr; }
    .fin-rank-value { grid-column: 1 / -1; }
}
.fin-income { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.fin-income-input { width: 180px; text-align: right; }
.fin-tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.login-step { font-size: 13px; line-height: 1.5; color: #475569; text-align: center; }
.login-info { font-size: 12.5px; color: #15803d; font-weight: 600; text-align: center; }
.login-resend { margin-top: 8px; }
