/* 새한선박 그룹웨어 — 디자인 규칙 1~6 (캔버스 「새한선박 그룹웨어 디자인」) 을 그대로 옮긴 공용 스타일 */

:root {
  /* 색: 흰색 + 15칸(상태 4칸은 글자와 바탕 한 쌍) = 20색. 이 밖의 색은 쓰지 않는다 */
  --navy: #1E3A5F;          /* 위쪽 띠, 진한 단추, 지금 메뉴, 표 윗줄 */
  --navy-hover: #2A4E7C;    /* 진한 단추에 마우스 */
  --band: #209EC5;          /* 표 위 3px 띠와 머리줄 밑줄(옛 화면 #209ec5). 모든 표 같게 */
  --navy-soft: #E8EEF6;     /* 고른 줄, 마우스 올린 줄, 눌린 붙은 단추 */
  --bg: #F4F6F9;            /* 화면 바탕, 왼쪽 메뉴 */
  --content-w: 1000px;      /* 목록과 입력 화면 내용 폭(옛 700 은 작은 모니터 기준이라 넓힘). 결재 문서와 invoice 문서는 종이 폭 700 그대로 */
  --label-bg: #EEF2F7;      /* 표 머리, 입력 표 왼쪽 칸 */
  --line: #D5DCE5;          /* 테두리, 줄 사이 */
  --input-line: #7B8798;    /* 입력칸, 고르기, 보통 단추 테두리 */
  --row-line: #E3E8EF;      /* 표 줄 사이, 불러오는 중 줄 */
  --on-navy-dim: #D6DFEB;   /* 위쪽 띠의 고르지 않은 메뉴 */
  --text: #1A2230;
  --text-dim: #5A6575;
  --progress: #1D4ED8;  --progress-bg: #E7EEFD;
  --done: #166534;      --done-bg: #E6F4EA;
  --danger: #B91C1C;    --danger-bg: #FBEAEA;
  --temp: #4B5563;      --temp-bg: #EEF0F3;
  --white: #FFFFFF;

  /* 글자 단계: 옛 홈페이지(본문 11px)처럼 한눈에 많이 보이게 촘촘히 (11-11 사장님 「글자도 커서 한눈에 안 보인다」) */
  --fs-xs: 11px; --fs-sm: 12px; --fs-base: 12px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 18px;
  /* 간격 */
  --sp-1: 4px; --sp-2: 6px; --sp-3: 8px; --sp-4: 12px; --sp-5: 14px; --sp-6: 16px; --sp-7: 20px; --sp-8: 32px;
  /* 높이 */
  --h-control: 28px; --h-small: 24px; --h-tab: 30px; --h-row: 25px; /* 목록 표 한 줄(옛 화면 td height 25). 모든 목록이 같은 높이 */ --h-top: 76px; --h-user: 0px;
  --folder: #D99A2B;        /* 왼쪽 메뉴 폴더 그림(옛 노란 폴더) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  /* 모서리 */
  --r-control: 4px; --r-box: 6px;

  --font: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
/* 본문 칸이 남는 높이를 채움(창 높이 100vh 로 계산하면 가로 스크롤 막대가 생길 때 그 높이만큼 넘쳐 세로 스크롤이 생겼음) */
html:has(body .topbar) { height: 100%; }
body:has(.topbar) { min-height: 100%; display: flex; flex-direction: column; }
/* 반응형 안 함(11-12 사장님 「예전거 처럼 그냥 안보이게, 반응형 하지말고」): 창이 좁아도 배치는 그대로 두고 창 가로 스크롤로 봄 */
body:has(.topbar) { min-width: 1260px; } /* 새 창(인쇄, 년간분석 상세 등)은 빼고 */
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-base); line-height: 1.5; }
a { color: var(--text); }
a:hover { color: var(--navy); }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--progress); outline-offset: 2px; }
/* 화면이 열릴 때 프로그램이 제목으로 커서를 옮김(화면 읽기 프로그램용). 그때 제목에 파란 테두리가 생기지 않게 */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 화면 틀 (규칙 1의 6) ── */
/* 위쪽 띠: 옛 top.jsp 처럼 밝은 바탕에 로고 자리(왼쪽 메뉴 폭)를 따로 두고 로고를 크게, 그 오른쪽에 메뉴. 메뉴 밑 줄 없음(11-12 사장님 「줄이 굳이 필요한지」). 화면과는 아래 인사 줄(userbar)의 밑줄로 나뉨 */
.topbar { min-height: 76px; background: var(--white); color: var(--text); display: flex; flex-wrap: nowrap; align-items: center; gap: var(--sp-1); padding: 0 max(var(--sp-6), calc(100% - 1216px)) 0 0; } /* 오른쪽 인사 줄은 창 끝이 아니라 본문 끝(196 + 20 + 1000 = 1216)에 고정 */
.topbar-logo { width: 196px; flex: none; margin-right: var(--sp-4); display: flex; align-items: center; justify-content: center; text-decoration: none; } /* 로고 자리 = 왼쪽 메뉴 폭(196), 그 가운데 */
.topbar-logo img { display: block; height: 59px; width: auto; }
/* 위쪽 메뉴: 옛 홈페이지처럼 마우스를 올리면 단추가 떠오르고, 들어가 있는 메뉴는 흰 단추 */
.topbar-link { height: 32px; padding: 0 var(--sp-4); display: inline-flex; align-items: center; border-radius: var(--r-box); color: var(--text); font-size: var(--fs-md); font-weight: 500; text-decoration: none; transition: background-color 150ms ease, color 150ms ease, transform 150ms var(--ease-out); }
.topbar-link:hover { background: var(--navy-soft); color: var(--navy); }
.topbar-link:active { transform: scale(0.97); }
.topbar-link[aria-current="page"] { background: var(--navy-soft); color: var(--navy); font-weight: 700; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--text-dim); white-space: nowrap; }
.topbar-who { display: inline-flex; align-items: center; gap: 6px; }
.topbar-who svg { color: var(--navy); }
.topbar-who b { color: var(--text); font-weight: 700; }
.topbar-me { color: var(--text-dim); text-decoration: none; }
.topbar-me:hover { color: var(--navy); text-decoration: underline; }
.logout-button { height: 26px; padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-control); background: var(--white); color: var(--text-dim); font: inherit; cursor: pointer; transition: border-color 120ms ease, color 120ms ease; }
.logout-button:hover { border-color: var(--navy); color: var(--navy); }
.userbar { min-height: var(--h-user); background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-4); padding: 0 var(--sp-6); font-size: var(--fs-sm); color: var(--text-dim); }
.userbar a, .link-button { color: var(--text-dim); }
.inline-form { margin: 0; display: inline; }
.link-button { border: 0; background: transparent; font: inherit; padding: 0; text-decoration: underline; cursor: pointer; }
.frame { display: flex; flex-wrap: nowrap; align-items: stretch; flex: 1 0 auto; }
.page { flex: 999 1 560px; min-width: 0; max-width: 1240px; padding: var(--sp-6) var(--sp-7) var(--sp-8); display: flex; flex-direction: column; gap: var(--sp-4); }
.footer { padding: var(--sp-4) var(--sp-6); font-size: var(--fs-xs); color: var(--text-dim); text-align: center; }
/* 화면 제목: 밑줄 없이(바로 아래 표 윗줄과 두 줄로 겹쳐서. 11-12 사장님) 옛 화면처럼 앞에 하늘색 동그라미 표시 */
.page-title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-lg); font-weight: 700; }
.page-title::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 4px solid var(--band); background: var(--white); box-sizing: border-box; }
.page-title + .btn-row { border-top: 0; padding-top: 0; }
/* 모든 화면 내용 폭의 기본 = 1000(오른쪽 끝이 인사 줄 1216 과 같게). 화면마다 정한 폭이 있으면 그것이 먼저(:where 라 가장 약함). 덮개(창)는 빼고 */
:where(.page) > :where(:not(.modal-back, .confirm-back, .pay-ban-pop, .fwd-back)) { max-width: var(--content-w); } /* 제목 바로 아래 단추 줄은 윗줄 없이(제목 밑 줄처럼 보여서) */

/* 왼쪽 메뉴: 옛 홈페이지처럼 폴더 나무(폴더를 누르면 접히고 펴짐, 점선으로 이어짐) */
.leftmenu { flex: 1 1 196px; max-width: 196px; min-width: 196px; background: var(--white); border-right: 1px solid var(--line); padding: var(--sp-4) var(--sp-3) var(--sp-7); font-size: var(--fs-sm); }
.leftmenu-title { margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--navy-soft); color: var(--navy); border-radius: var(--r-box); font-size: var(--fs-md); font-weight: 700; }
.menu-tree, .menu-tree ul { list-style: none; margin: 0; padding: 0 0 0 18px; }
.menu-tree li { position: relative; }
/* 점선: 맨 위 메뉴도 옛처럼 줄을 긋고 안으로 들임. 세로줄은 마지막 메뉴에서 멈추고, 메뉴마다 가로줄 */
.menu-tree li::before { content: ""; position: absolute; left: -10px; top: 0; bottom: 0; border-left: 1px dotted var(--input-line); }
.menu-tree li:first-child::before { top: 6px; }
.menu-tree ul > li:first-child::before { top: 0; }
.menu-tree li:last-child::before { bottom: auto; height: 12px; }
.menu-tree li::after { content: ""; position: absolute; left: -10px; top: 12px; width: 8px; border-top: 1px dotted var(--input-line); }
/* 폴더 접기 상자(옛 ⊟ ⊞) */
.menu-toggle { position: absolute; left: -15px; top: 7px; z-index: 1; width: 11px; height: 11px; border: 1px solid var(--input-line); background: var(--white); }
.menu-toggle::before, .menu-toggle::after { content: ""; position: absolute; background: var(--text-dim); }
.menu-toggle::before { left: 2px; right: 2px; top: 4px; height: 1px; }
.menu-toggle::after { top: 2px; bottom: 2px; left: 4px; width: 1px; }
.menu-tree details[open] > summary .menu-toggle::after { display: none; }
.menu-tree summary { list-style: none; display: flex; align-items: center; gap: var(--sp-2); min-height: 24px; padding: 0 var(--sp-2) 0 2px; border-radius: var(--r-control); cursor: pointer; font-weight: 700; color: var(--text); user-select: none; transition: background-color 120ms ease, color 120ms ease; }
.menu-tree summary::-webkit-details-marker { display: none; }
.menu-tree summary::before { content: ""; flex: none; width: 16px; height: 16px; background: var(--folder); -webkit-mask: var(--icon-folder) center / contain no-repeat; mask: var(--icon-folder) center / contain no-repeat; }
.menu-tree details[open] > summary::before { -webkit-mask-image: var(--icon-folder-open); mask-image: var(--icon-folder-open); }
.menu-tree details[open]:not(:has(li)) > summary::before { -webkit-mask-image: var(--icon-folder); mask-image: var(--icon-folder); }
.menu-tree summary:hover { background: var(--navy-soft); color: var(--navy); }
.menu-file :is(a, button) { display: flex; align-items: center; gap: var(--sp-2); min-height: 24px; padding: 0 var(--sp-2) 0 2px; border-radius: var(--r-control); text-decoration: none; color: var(--text); transition: background-color 120ms ease, color 120ms ease; }
.menu-file :is(a, button)::before { content: ""; flex: none; width: 14px; height: 14px; background: var(--text-dim); -webkit-mask: var(--icon-file) center / contain no-repeat; mask: var(--icon-file) center / contain no-repeat; }
.menu-file button { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.menu-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.menu-file :is(a, button):hover { background: var(--navy-soft); color: var(--navy); }
.menu-file :is(a, button):hover::before { background: var(--navy); }
/* 들어가 있는 메뉴: 옛처럼 빨간 글자(남색 제목 띠와 헷갈리지 않게) */
.menu-file :is(a, button)[aria-current] { background: var(--danger-bg); color: var(--danger); font-weight: 700; }
.menu-file :is(a, button)[aria-current]::before { background: var(--danger); }
.menu-file .count { flex: none; min-width: 20px; padding: 0 var(--sp-1); text-align: center; background: var(--navy); color: var(--white); border-radius: 9px; font-size: var(--fs-xs); font-weight: 700; line-height: 16px; }

:root {
  --icon-folder: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M216,72H131.31L104,44.69A15.88,15.88,0,0,0,92.69,40H40A16,16,0,0,0,24,56V200.62A15.41,15.41,0,0,0,39.39,216h177.5A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72ZM40,56H92.69l16,16H40Z'/%3E%3C/svg%3E");
  --icon-folder-open: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.470A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z'/%3E%3C/svg%3E");
  --icon-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z'/%3E%3C/svg%3E");
}

/* ── 단추 다섯 가지 (규칙 1의 7) ── */
.btn { height: var(--h-control); padding: 0 var(--sp-4); display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-control); font: inherit; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background-color 120ms ease-out, transform 120ms ease-out; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: var(--white); font-weight: 500; padding: 0 var(--sp-5); }
.btn-primary:hover { background: var(--navy-hover); color: var(--white); }
.btn-secondary { background: var(--white); border-color: var(--input-line); color: var(--text); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--white); border-color: var(--danger); color: var(--danger); }
.btn-danger-fill { background: var(--danger); border-color: var(--danger); color: var(--white); font-weight: 500; }
.btn-text { background: transparent; color: var(--navy); text-decoration: underline; padding: 0 var(--sp-3); }
.btn-small { height: var(--h-small); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: flex-start; padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.icon-button { width: 32px; height: 32px; border: 0; background: transparent; font-size: var(--fs-lg); color: var(--text-dim); cursor: pointer; border-radius: var(--r-control); }

/* 입력칸 */
input:not([type]), input[type=text], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=email], select, textarea { height: var(--h-control); padding: 0 var(--sp-3); border: 1px solid var(--input-line); border-radius: var(--r-control); font: inherit; color: var(--text); background: var(--white); }
textarea { height: auto; padding: var(--sp-2) var(--sp-3); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); }

/* 목록과 상자 */
.panel { background: var(--white); border: 1px solid var(--line); border-top: 2px solid var(--navy); border-radius: var(--r-box); padding: var(--sp-4) var(--sp-4) var(--sp-2); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-2); }
.panel-head h2 { font-size: var(--fs-md); font-weight: 700; }
.panel-head a { font-size: var(--fs-sm); color: var(--text-dim); }
.date-list { list-style: none; margin: 0; padding: 0; }
.date-list li { display: flex; gap: var(--sp-6); padding: var(--sp-2) 0; border-bottom: 1px solid var(--row-line); font-size: var(--fs-base); }
.date-list li:last-child { border-bottom: 0; }
.date-list .date { width: 96px; flex: none; color: var(--text-dim); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.date-list a { text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.empty { margin: 0; padding: var(--sp-4) 0; text-align: center; color: var(--text-dim); font-size: var(--fs-sm); }
/* 불러오는 중 회색 줄: 0.3초 안에 자료가 오면 아예 안 보이게 늦게 띄움 */
.skeleton { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-2) 0; animation: skeleton-late 1ms linear 300ms both; }
@keyframes skeleton-late { from { opacity: 0; } to { opacity: 1; } }
.skeleton span { height: 12px; background: var(--row-line); border-radius: 3px; }
.tag-text { color: var(--progress); }

/* 메인 (본보기 2) */
.home { display: flex; flex-wrap: wrap; gap: var(--sp-6); align-items: flex-start; width: 100%; max-width: 1100px; margin: 0 auto; }
.page:has(.home) { max-width: none; padding-top: var(--sp-7); }
.home-me { flex: 0 0 220px; background: var(--white); border: 1px solid var(--line); border-top: 2px solid var(--navy); border-radius: var(--r-box); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); }
.home-dep { font-size: var(--fs-xs); color: var(--text-dim); }
.home-name { font-size: var(--fs-lg); font-weight: 700; padding-bottom: var(--sp-4); margin-bottom: var(--sp-2); border-bottom: 1px solid var(--row-line); }
.home-main { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-6); }
.notice-box { background: var(--navy-soft); border: 1px solid var(--navy); border-radius: var(--r-box); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); }
.notice-box-head { display: flex; justify-content: space-between; align-items: center; }
.notice-box-head h2 { font-size: var(--fs-md); font-weight: 700; }
.notice-line { text-decoration: none; padding: var(--sp-1) 0; }

/* 로그인 (본보기 1): 옛 배경 그림을 그대로 깔고 원 안에 입력칸 */
/* 로그인(11-18 새로): 배경은 바다 사진 한 장(img/login_sea.jpg, 힉스필드 Nano Banana Pro 로 만들고 위아래 띠 잘라냄).
   로고, LOGIN 글자, 동그라미, 주소와 COPYRIGHT 줄은 전부 진짜 글자와 그림으로 사진 위에 올린다(전엔 그림에 박혀 있었음) */
.login-page { position: relative; min-height: 100vh; min-width: 1100px; display: flex; flex-direction: column;
  background: #EAF3FA url('img/login_sea.jpg') no-repeat 0 42% / cover; }   /* 사진 왼쪽 끝을 창 왼쪽 벽에 붙임(배가 안 잘림, 로고 자리 계산의 기준) */
.login-page::after { content: ""; position: absolute; inset: auto 0 0 0; height: 150px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.88) 70%); }
/* 로고는 왼쪽 벽을 따라가고, 왼쪽 끝을 배 왼쪽 끝과 세로로 맞춤(11-18 사장님 「왼쪽 벽 따라다니게, 배랑 세로 위치 맞게」).
   배 왼쪽 끝 = 사진(2400x1003)의 x 176. 사진은 cover 라 배율 = max(창폭/2400, 창높이/1003) → 176 x 배율 */
.login-top { position: absolute; top: 40px; left: max(7.333vw, 17.547vh); z-index: 1; }
.login-logo { display: block; height: 62px; width: auto; }
.login-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 126px 0 170px; }
.login-circle { width: 380px; height: 380px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.82), rgba(255,255,255,.58) 70%);
  border: 1px solid rgba(255,255,255,.95); box-shadow: 0 18px 50px rgba(30,58,95,.22), inset 0 0 0 6px rgba(255,255,255,.35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.login-title { margin: 0 0 22px; font-size: 40px; font-weight: 300; letter-spacing: .14em; color: var(--navy); line-height: 1; }
.login-form { width: 272px; display: grid; grid-template-columns: 56px minmax(0, 1fr) 70px; column-gap: 8px; row-gap: 8px; align-items: center; }
.login-form label[for] { font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.login-form input:not([type=checkbox]) { width: 100%; height: 30px; background: rgba(255,255,255,.92); }
.login-button { grid-column: 3; grid-row: 1 / span 2; height: 68px; border: 1px solid var(--navy); background: var(--navy); color: var(--white); border-radius: var(--r-box); font: inherit; font-weight: 700; cursor: pointer; }
.login-button:hover { background: var(--navy-hover); }
.login-save { grid-column: 2 / span 2; display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.login-save input { width: 16px; height: 16px; accent-color: var(--navy); }
.login-error { grid-column: 1 / span 3; text-align: center; font-size: var(--fs-xs); font-weight: 500; color: var(--danger); }
.login-foot { position: absolute; left: 0; right: 0; bottom: 26px; z-index: 1; text-align: center; font-size: var(--fs-xs); line-height: 1.7; color: #3E4A5A; }
.login-foot p { margin: 0; }


/* 오류 화면 (규칙 2의 9) */
.error-page { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-box); padding: var(--sp-7); display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; max-width: 560px; }
.error-page h1 { font-size: var(--fs-lg); }
.error-page p { margin: 0; color: var(--text-dim); }

/* 왼쪽 메뉴 숫자: 결재요구 = 남색(할 일), 반려와 오늘 완료 = 빨강(새로 생김), 나머지 = 흐림 */
.menu-file .count.new { background: var(--danger); color: var(--white); }
.menu-file .count:not(.todo):not(.new) { background: transparent; color: var(--text-dim); font-weight: 500; }


/* 검색줄 (규칙 3의 2): 표 위 왼쪽 */
.searchbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: 0; }
.searchbar input { width: 240px; max-width: 100%; }

/* 목록 표 (규칙 3) */
.table-wrap { width: 100%; overflow-x: auto; background: var(--white); border: 0; border-top: 3px solid var(--band); border-radius: 0; }
table.list { width: 100%; min-width: 860px; border-collapse: collapse; font-size: var(--fs-base); }
table.list th { height: 22px; /* 목록 머리줄(옛 th height 22). 모든 목록 같게 */ background: var(--white); color: var(--text); font-weight: 700; font-size: var(--fs-base); border-bottom: 1px solid var(--band); padding: 0 var(--sp-2); text-align: center; white-space: nowrap; }
table.list th.left { text-align: left; }
table.list td { height: var(--h-row); padding: 2px var(--sp-2); border-bottom: 1px solid var(--row-line); vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td, table.list tbody tr.selected td { background: var(--navy-soft); }
table.list td.center { text-align: center; }
table.list td.right { text-align: right; }
table.list .dim { color: var(--text-dim); }
table.list .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list input[type=checkbox] { width: 13px; height: 13px; margin: 0; accent-color: var(--navy); vertical-align: middle; }
table.list .empty { padding: var(--sp-7) 0; }
.w-150 { width: 150px; } .nowrap { white-space: nowrap; }
.w-check { width: 40px; } .w-no { width: 64px; } .w-90 { width: 90px; } .w-100 { width: 104px; } .w-110 { width: 112px; } .w-136 { width: 140px; }
.title-link { text-decoration: none; overflow-wrap: anywhere; }
.title-link:hover { text-decoration: underline; }
.title-link.strong { font-weight: 700; }
.tag-important { margin-left: var(--sp-1); padding: 0 var(--sp-1); border: 1px solid var(--danger); color: var(--danger); border-radius: var(--r-control); font-size: var(--fs-xs); }

/* 머리 글자 정렬 단추 */
.sort-button { border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; padding: 0 var(--sp-1); display: inline-flex; gap: 2px; align-items: center; }
.sort-button:hover { color: var(--navy); text-decoration: underline; }
.sort-mark { font-size: 10px; color: var(--navy); min-width: 10px; }

/* 쪽 번호 (규칙 3의 4): 표 아래 가운데 */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-1); }
.pager-link { min-width: 32px; height: var(--h-small); padding: 0 var(--sp-2); border: 1px solid var(--line); background: var(--white); border-radius: var(--r-control); font: inherit; font-size: var(--fs-sm); color: var(--text); cursor: pointer; }
.pager-link:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.pager-link:disabled { color: var(--line); cursor: default; }
.pager-link[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: var(--white); font-weight: 700; }

/* 의견 (n): 마우스를 올리면 의견 상자 */
.remark-wrap { position: relative; display: inline-block; margin-left: var(--sp-1); }
.remark-count { border: 0; background: transparent; padding: 0 2px; font: inherit; font-size: var(--fs-sm); color: var(--progress); cursor: pointer; }
.remark-pop { position: absolute; left: 0; top: 100%; z-index: 20; width: 340px; max-width: 80vw; margin-top: var(--sp-1); padding: var(--sp-2) var(--sp-3); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: 0 4px 12px rgba(26,34,48,.12); display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 400; white-space: normal; }
.remark-item { display: block; overflow-wrap: anywhere; }
.remark-item .who { font-weight: 700; }

/* 결과 알림 띠 (규칙 2의 4): 오른쪽 위 */
.toasts { position: fixed; top: var(--sp-4); right: var(--sp-4); z-index: 900; display: flex; flex-direction: column; gap: var(--sp-2); max-width: 360px; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-box); border: 1px solid; font-size: var(--fs-base); }
.toast.ok { background: var(--done-bg); border-color: var(--done); color: var(--done); }
.toast.fail { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.toast .icon-button { color: inherit; }


/* 결재 상세 (본보기 3) */
.title-row { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 2px solid var(--navy); }
.title-row .page-title { padding: 0; border: 0; }
.doc { background: var(--white); border: 1px solid var(--line); padding: 28px var(--sp-7); display: flex; flex-direction: column; gap: var(--sp-5); }
.doc-no { font-size: var(--fs-sm); color: var(--text-dim); }
.table-scroll { width: 100%; overflow-x: auto; }
table.approval { border-collapse: collapse; width: 100%; min-width: 640px; table-layout: fixed; font-size: var(--fs-xs); text-align: center; background: var(--white); }
table.approval th, table.approval td { border: 1px solid var(--text); padding: var(--sp-1); }
table.approval .label { width: 72px; background: var(--label-bg); font-weight: 500; text-align: left; padding: var(--sp-1) var(--sp-2); }
table.approval .label.center { text-align: center; }
table.approval .value { width: 140px; text-align: left; padding: var(--sp-1) var(--sp-2); font-weight: 700; }
table.approval .value-plain { text-align: left; padding: var(--sp-1) var(--sp-2); }
table.approval .pos { background: var(--label-bg); }
table.approval .sign { height: 52px; vertical-align: middle; }
table.approval .sign.turn { background: var(--progress-bg); }
table.approval .blank { border-left-color: transparent; border-bottom-color: transparent; }
.state.done { color: var(--navy); } .state.turn { color: var(--progress); } .state.wait { color: var(--text-dim); } .state.ban { color: var(--danger); }
table.info { border-collapse: collapse; width: 100%; min-width: 640px; font-size: var(--fs-base); }
table.info > tbody > tr > th, table.info > tr > th { width: 180px; text-align: left; padding: var(--sp-3) var(--sp-4); background: var(--label-bg); border-bottom: 1px solid var(--line); font-weight: 500; vertical-align: middle; }
table.info > tbody > tr > td, table.info > tr > td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
table.info > tbody > tr:first-child > *, table.info > tr:first-child > * { border-top: 3px solid var(--band); }
table.info th.top { vertical-align: top; }
table.info .strong { font-weight: 500; }
table.info .da { color: var(--progress); font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--text-dim); }
.small { font-size: var(--fs-sm); }
.gap { display: inline-block; width: var(--sp-4); }
.pre { white-space: pre-wrap; margin: 0; font: inherit; overflow-wrap: anywhere; }
.checks { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); }
.checks .on { font-weight: 500; }
.files { display: flex; flex-direction: column; font-size: var(--fs-sm); }
.file { display: flex; gap: var(--sp-3); padding: var(--sp-1) 0; }
.file-label { width: 44px; flex: none; color: var(--text-dim); }
.file a { overflow-wrap: anywhere; }
.prodoc { overflow-x: auto; }
.prodoc img { max-width: 100%; height: auto; }
.prodoc table { border-collapse: collapse; }
table.amount { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); margin: var(--sp-1) 0; }
table.amount th { background: var(--label-bg); font-weight: 500; border: 1px solid var(--line); padding: var(--sp-1) var(--sp-2); text-align: center; }
table.amount td { border: 1px solid var(--line); padding: var(--sp-1) var(--sp-2); }
table.amount td.center { text-align: center; } table.amount td.right { text-align: right; }
table.amount.settle th { width: 180px; text-align: left; }
table.amount.settle tr.advance td, table.amount.settle tr.advance th { background: var(--temp-bg); }
.note { margin: var(--sp-1) 0 0; }
.remarks { display: flex; flex-direction: column; gap: var(--sp-2); }
.remarks h3, .ban-box h3 { font-size: var(--fs-md); font-weight: 700; }
.remark { border-top: 1px solid var(--line); padding: var(--sp-3) 0 0; font-size: var(--fs-sm); }
.remark .who { color: var(--progress); font-weight: 500; }
.ban-box { background: var(--danger-bg); border: 1px solid var(--danger); border-radius: var(--r-box); padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-sm); }
.ban-box h3 { color: var(--danger); }
.ban-box .who { font-weight: 700; }

/* 인쇄 미리보기 (본보기 9) */
.print-page { min-height: 100vh; background: var(--text-dim); display: flex; flex-direction: column; align-items: center; gap: var(--sp-6); padding-bottom: var(--sp-7); }
.print-bar { position: sticky; top: 0; z-index: 10; align-self: stretch; height: 56px; background: var(--white); border-bottom: 2px solid var(--navy); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--sp-5); }
.print-bar b { font-size: var(--fs-md); }
.btn-row-plain { display: flex; gap: var(--sp-2); }
.paper { width: 794px; max-width: calc(100% - 32px); min-height: 1123px; background: var(--white); padding: 57px; }
.paper .doc { border: 0; padding: 0; font-size: var(--fs-xs); }
/* 종이에는 흰 바탕, 검은 선만(본보기 9) */
.paper table th, .paper table td, .paper table.approval .pos, .paper table.approval .sign.turn, .paper .ban-box { background: var(--white); }
.paper table.approval th, .paper table.approval td { border-color: var(--text); }
.paper table.info th, .paper table.info td { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); }
.paper table.info th { width: 150px; }
@media print {
  @page { size: A4; margin: 15mm; }
  .print-bar { display: none; }
  .print-page { background: var(--white); padding: 0; gap: 0; display: block; }
  .paper { width: auto; max-width: none; min-height: 0; padding: 0; break-after: page; }
  .paper:last-child { break-after: auto; }
  .paper * { color: var(--text) !important; background: transparent !important; border-color: var(--text) !important; }
  .paper a { text-decoration: none; }
}

/* 팝업 창 (본보기 10) */
.modal-back { position: fixed; inset: 0; z-index: 800; background: rgba(26,34,48,.45); display: flex; align-items: center; justify-content: center; padding: var(--sp-4); }
.modal { width: 520px; max-width: 100%; max-height: calc(100vh - 32px); background: var(--white); border-radius: var(--r-box); box-shadow: 0 12px 32px rgba(26,34,48,.18); display: flex; flex-direction: column; overflow: hidden; }
.modal:focus { outline: none; }
.modal-small { width: 400px; } .modal-wide { width: 760px; }
.confirm-back { z-index: 950; }
.confirm-text { margin: 0; font-size: var(--fs-base); white-space: pre-line; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3) var(--sp-5); border-bottom: 2px solid var(--navy); }
.modal-head h2 { font-size: var(--fs-md); font-weight: 700; }
.modal-body { padding: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); overflow-y: auto; }
.modal-foot { display: flex; gap: var(--sp-2); justify-content: center; padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); background: var(--bg); }
.field { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-sm); font-weight: 500; }
.field input, .field select, .field textarea { font-weight: 400; width: 100%; }
.field select[size] { height: auto; padding: var(--sp-1); font-size: var(--fs-sm); }
.field-error { color: var(--danger); font-size: var(--fs-xs); font-weight: 500; }
.req { color: var(--danger); }

/* 입력 표 (본보기 4): 왼쪽 이름 칸 + 오른쪽 입력 칸. table.info 와 같은 모양 */
table.form { border-collapse: collapse; width: 100%; min-width: 600px; font-size: var(--fs-base); background: var(--white); }
table.form > tbody > tr > th, table.form > tr > th { width: 120px; text-align: left; padding: var(--sp-1) var(--sp-3); background: var(--label-bg); border-bottom: 1px solid var(--line); font-weight: 500; vertical-align: middle; }
table.form > tbody > tr > td, table.form > tr > td { padding: 3px var(--sp-3); border-bottom: 1px solid var(--line); }
table.form > tbody > tr:first-child > *, table.form > tr:first-child > * { border-top: 3px solid var(--band); }
table.form input:not([type=checkbox]):not([type=radio]):not([type=file]), table.form select, table.form textarea { width: 100%; }
table.form .inline { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
table.form .inline input:not([type=checkbox]):not([type=radio]):not([type=file]), table.form .inline select { width: auto; }
.checkline { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); margin-right: var(--sp-3); }
.checkline input { width: 16px; height: 16px; accent-color: var(--navy); }

/* 첨부 5칸 */
.file-slots { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-sm); }
.file-slot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); min-height: 32px; }
.file-slot input[type=file] { font: inherit; font-size: var(--fs-sm); }

/* 글 편집 칸 */
.editor { border: 1px solid var(--input-line); border-radius: var(--r-control); background: var(--white); }
.editor-bar { display: flex; gap: var(--sp-1); padding: var(--sp-1); border-bottom: 1px solid var(--line); background: var(--bg); }
.editor-btn { min-width: 32px; height: 28px; border: 1px solid var(--line); background: var(--white); border-radius: var(--r-control); font: inherit; font-size: var(--fs-sm); cursor: pointer; padding: 0 var(--sp-2); }
.editor-btn:hover { border-color: var(--navy); }
.editor-body { min-height: 320px; padding: var(--sp-3); outline: none; overflow-wrap: anywhere; overflow-x: auto; }
.editor-body:focus { box-shadow: inset 0 0 0 2px var(--navy); }
.editor-body img { max-width: 100%; height: auto; }

/* 폰과 좁은 화면 (규칙 6의 5): 960 아래부터 왼쪽 메뉴는 위로 */


@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

#blazor-error-ui { background: var(--danger-bg); color: var(--danger); bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: var(--sp-2) var(--sp-6); position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { border: 0; background: transparent; cursor: pointer; position: absolute; right: var(--sp-3); top: var(--sp-1); font-size: var(--fs-lg); color: var(--danger); }
.item-tree { margin: var(--sp-2); font-size: var(--fs-sm); }
/* 아이템, 메뉴 관리 화면의 나무(옛 *_item.jsp, itemManage.jsp): 옛처럼 열고 닫기 없이 늘 펼친 폴더 하나, 그 아래 파일은 한 칸 들여씀 */
:is(.item-list, .board-item-left, .split-left) ul.item-tree { padding: var(--sp-1) 0 var(--sp-1) var(--sp-3); }
:is(.item-list, .board-item-left, .split-left) .item-tree .item-folder-body > ul { padding: 2px 0 0 20px; }
.item-tree li::before, .item-tree li::after { content: none; }
.item-folder { display: flex; align-items: center; gap: var(--sp-2); min-height: 24px; padding: 0 var(--sp-2) 0 2px; font-weight: 700; color: var(--text); }
.item-folder::before { content: ""; flex: none; width: 16px; height: 16px; background: var(--folder); -webkit-mask: var(--icon-folder-open) center / contain no-repeat; mask: var(--icon-folder-open) center / contain no-repeat; }
/* 제목 밑줄 바로 아래 표 윗줄이 겹쳐 두 줄로 보이지 않게(제목 바로 다음 표는 윗줄 없음) */


/* 입력 화면(입력 표가 있는 화면)은 옛 홈페이지처럼 폭을 좁혀 한눈에 보이게(11-11 사장님 「좀 작게, 전에 거처럼 한눈에」) */
.page:has(table.form) > *:not(.modal-back):not(.confirm-back) { max-width: var(--content-w); }
.page:has(table.form) > .page-title, .page:has(table.form) > .title-row { max-width: none; }
.page:has(table.form) table.list { min-width: 0; }
