/* budget 화면 전용 스타일. 글자와 간격은 app.css 의 토큰을 쓰고, 옛 화면에서 그대로 가져온 색만 아래에 둔다 */
:root {
  /* 통계 표(옛 border=1 bgcolor=#cccccc 표와 out.js) */
  --st-head: #CCCCCC;      /* 표 머리 칸 회색 */
  --st-border: #999999;    /* 칸 사이 줄 */
  --st-green: #B5FA94;     /* 1단계 이름 줄 */
  --st-sub: #99B5FF;       /* SUB-TOTAL 줄, 고른 줄(INVOICE 현황) */
  --st-total: #CC7092;     /* TOTAL 줄 */
  --st-blue: #0073DE;      /* DA 의 SUB-TOTAL 글자(옛 .blue) */
  --st-red: #FF0000;       /* 괄호 숫자(옛 font color=red) */
  --st-yellow: #FFFF00;    /* INVOICE 현황, 업체지급현황 TOTAL 칸 */
  /* 월평가(옛 monthDa.jsp) */
  --mon-yellow: #FFFF99;   /* 1번 띠와 D/A 달 칸 */
  --mon-sky: #CCFFFF;      /* 2번 띠와 TOTAL D/A 칸 */
  --mon-orange: #FFCC99;   /* 3번 띠와 TOTAL BUDGET 칸 */
  --mon-border: #000000;   /* 옛 bordercolor=#000000 */
  /* 연간 분석(옛 daGroup.jsp, popDaGroupStatDetail.jsp) */
  --yr-head: #4B80F7;      /* 표 머리 파랑, 흰 글자 */
  --yr-line1: #DDEBFF;     /* 줄 띠 1 */
  --yr-line2: #EFF2FB;     /* 줄 띠 2 */
  --yr-total: #ABCDFF;     /* 합계 줄 */
  --yr-hover: #006E92;     /* 배 이름 위에 올렸을 때 */
  --yr-progress: #0000FF;  /* 배 상세 Progress 글자 */
  /* 통계 탭(옛 statTap.jsp) */
  --tab-band: #EEEEEE;
  --tab-line: #209EC5;
  --tab-sep: #C2C2C2;
  --tab-text: #3F3F3F;
  /* 예산 입력(옛 budget.jsp) */
  --bud-gray: #CCCCCC;     /* 입력 표 바탕 */
  --bud-green: #5AFF51;    /* 1단계 줄 */
  --bud-label: #F6F6F8;    /* 계정 이름 칸 */
  --old-box: #CCCCCC;      /* 옛 목록 상자 테두리(border:1px solid #ccc) */
  --note-orange: #FF5A00;  /* 옛 .orange 안내 글자 */
}

/* 옛 화면 폭 700px(제목 그림 title_bg_700.jpg 와 표 width 700).
   w700: 화면 전체를 700 안에, t700: 제목만 700(아래 표가 900, 1000, 1500 으로 넓은 통계 화면) */
.page > h1.page-title.w700, .page > h1.page-title.t700 { max-width: var(--content-w); }
.page:has(> h1.w700) > *:not(.modal-back):not(.confirm-back) { max-width: var(--content-w); }
.page:has(> h1.w700) table.list { min-width: 0; }
.page:has(> h1.w700) table.form { min-width: 0; }
.page:has(> h1.w700) .searchbar input { width: 150px; }

/* 조건 띠: 흰 상자 안 한 줄, 내용 폭만큼만 */
.stat-search { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; width: fit-content; max-width: 100%; padding: var(--sp-2) var(--sp-3); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-control); font-size: var(--fs-sm); margin: 0; }
.stat-search label.inline { display: inline-flex; gap: var(--sp-2); align-items: center; font-weight: 500; }
.stat-search label.inline select, .stat-search label.inline input { font-weight: 400; }
.stat-search .period { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.stat-search input[type=date] { height: var(--h-control); padding: 0 var(--sp-2); border: 1px solid var(--input-line); border-radius: var(--r-control); font: inherit; background: var(--white); }
.stat-search .actions { display: inline-flex; gap: var(--sp-2); align-items: center; }
.stat-search .step { display: inline-flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; width: 100%; }
.stat-search .step b { min-width: 250px; font-weight: 400; }
.stat-search select { max-width: 100%; }

/* 붙은 단추 묶음(월별/일별, 단위) */
.seg { display: inline-flex; border: 1px solid var(--input-line); border-radius: var(--r-control); overflow: hidden; }
.seg button { height: var(--h-control); padding: 0 var(--sp-3); border: 0; border-left: 1px solid var(--input-line); background: var(--white); font: inherit; color: var(--text); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--navy-soft); color: var(--navy); font-weight: 700; }
.excel-icon { width: 16px; height: 16px; flex: none; }
.btn-excel { gap: var(--sp-2); }

/* 보고 표: 옛 회색 표(머리 #cccccc, 칸은 흰 바탕, 줄 높이 30) */
.report-wrap { width: 100%; overflow-x: auto; background: var(--white); border: 1px solid var(--st-border); }
.report-wrap.w700 { max-width: var(--content-w); }
.report-wrap.mid { max-width: 900px; }
.report-wrap.w1000 { max-width: 1002px; } /* 표 1000 + 양쪽 테두리 1px. 1000 이면 상자 안쪽이 998 이라 표가 2px 넘쳐 가로 스크롤이 생겼음 */
.report-wrap.w1500 { max-width: 1502px; }
/* 월평가(옛 monthDa.jsp, 표 1500): 본문 칸 최대 폭(1240)을 풀어 넓은 모니터에서는 표가 한 번에 다 보이게. 좁으면 표 안에서 좌우로 밀기 */
main.page:has(table.month-table) { max-width: none; }
table.report { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
table.report th { height: 30px; padding: 2px var(--sp-2); background: var(--st-head); border: 1px solid var(--st-border); font-weight: 700; color: var(--text); text-align: center; white-space: nowrap; }
table.report td { height: 30px; padding: 2px var(--sp-2); background: var(--white); border: 1px solid var(--st-border); vertical-align: middle; }
table.report tr > :first-child { border-left: 0; }
table.report tr > :last-child { border-right: 0; }
table.report thead tr:first-child th { border-top: 0; }
table.report td.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.report td.center { text-align: center; }
table.report .minus { color: var(--st-red); }
table.report.grid tr.head td { background: var(--st-green); }
table.report tr.sub td { background: var(--st-sub); }
table.report.da tr.sub td { color: var(--st-blue); }
table.report tr.total td { font-weight: 700; background: var(--st-total); }
table.report tbody tr.pick td { background: var(--st-sub); }
table.report tbody tr.clickable { cursor: pointer; }
table.report td.empty { text-align: center; color: var(--text-dim); padding: var(--sp-6) 0; }
table.report .gap-col { width: 50px; background: var(--white); border-top-color: transparent; border-bottom-color: transparent; }
table.report td.desc { overflow-wrap: anywhere; min-width: 200px; padding-left: 10px; }
table.report .sticky { position: sticky; left: 0; z-index: 1; }
table.report.w-wide { min-width: 998px; } /* 1000 칸 상자 안쪽(테두리 빼고 998)에 꼭 맞게. 통계 탭 화면 상자는 1000 이라 1000 이면 2px 넘쳐 가로 스크롤이 생겼음 */
table.report.w-month { width: 1500px; }
/* 옛 링크는 주소 없는 a 라 검은 글자 */
table.report a { color: inherit; text-decoration: none; cursor: pointer; }
table.report a:hover { text-decoration: underline; }

/* 간단히 보기(옛 dis.jsp): 회색 표가 아니고 목록 모양(윗줄, 줄 사이 옅은 선, 세로줄 없음), 값은 가운데 머리 아래 오른쪽 */
.report-wrap.simple { max-width: var(--content-w); border: 0; border-top: 3px solid var(--band); border-radius: 0; }
.report-wrap.simple table.report th { background: var(--label-bg); font-weight: 500; border: 0; border-bottom: 1px solid var(--line); }
.report-wrap.simple table.report td { height: 25px; border: 0; border-bottom: 1px solid var(--row-line); }
.report-wrap.simple table.report tr.total td { background: var(--white); font-weight: 400; }

/* INVOICE 현황, 업체지급현황 TOTAL: 앞 칸은 빈 흰 칸, TOTAL 과 두 금액만 노랑 굵게 */
table.report tr.inv-total td.yellow { background: var(--st-yellow); font-weight: 700; text-align: center; }
table.report tr.inv-total td.yellow.money { text-align: right; padding-right: 10px; }
table.report.inv td.money { padding-right: 10px; }

/* 계정별 INVOICE(옛 invoiceDept.jsp): 이름 두 줄과 TOTAL 은 흰 줄, 내용 줄 높이 60, No 는 위에 */
table.report.dept tr.dept-name td { text-align: center; }
table.report.dept tr.dept-row td { height: 60px; }
table.report.dept tr.dept-row td.no { vertical-align: top; }
table.report.dept tr.dept-total td { background: var(--white); font-weight: 400; }
table.report td.dept-desc { line-height: 1.5; }

/* 통계 탭(옛 statTap.jsp): 회색 띠, 아래 파란 줄, 고른 탭은 파란 테두리 흰 바탕 굵게, 나머지는 오른쪽 회색 줄 */
.tabs { display: flex; flex-wrap: wrap; align-items: flex-end; height: 34px; padding-left: 10px; background: var(--tab-band); border-bottom: 1px solid var(--tab-line); }
.tabs button { height: 34px; padding: 0 15px; border: 0; border-right: 1px solid var(--tab-sep); background: transparent; font: inherit; color: var(--tab-text); cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: #000; font-weight: 700; background: var(--white); border: 1px solid var(--tab-line); border-bottom-color: var(--white); }

/* 세부계정 고르기 목록 3개(계정별 INVOICE, 옛 너비 150, 100, 100) */
.dept-pick { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-start; width: 100%; }
.dept-pick > b { font-weight: 700; padding-top: var(--sp-2); }
.dept-pick select[size] { height: auto; padding: var(--sp-1); font-size: var(--fs-sm); max-width: 100%; }
.dept-pick .w150 { width: 150px; }
.dept-pick .w100 { width: 100px; }

/* 연간 분석(옛 daGroup.jsp): 제목 아래 굵은 기간, 배마다 400px 흰 카드가 왼쪽부터 흐름 */
.period-line { margin: 0 0 0 24px; font-weight: 700; font-size: var(--fs-base); }
.cards { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.card { width: 420px; max-width: 100%; padding: 10px; background: var(--white); }
.card-head { margin-left: 10px; }
.card-head .link-button { color: var(--text); font-size: var(--fs-base); font-weight: 700; text-decoration: none; text-align: left; }
.card-head .link-button:hover { color: var(--yr-hover); }
.card table { border-collapse: separate; border-spacing: 2px; width: 380px; max-width: 100%; margin: 5px auto 0; font-size: var(--fs-sm); background: var(--white); }
.card th { height: 25px; padding: 0 var(--sp-2); text-align: center; background: var(--yr-head); color: var(--white); font-weight: 700; }
.card td { height: 25px; padding: 0 var(--sp-2); text-align: center; font-weight: 400; font-variant-numeric: tabular-nums; }
.card tbody tr:not(.total):nth-child(odd) td { background: var(--yr-line1); }
.card tbody tr:not(.total):nth-child(even) td { background: var(--yr-line2); }
.card td:first-child { font-weight: 700; }
.card tbody tr.total td { font-weight: 700; background: var(--yr-total); }
.rate { color: var(--yr-progress); }

/* 연간 분석 배 상세 새 창(옛 popDaGroupStatDetail.jsp): 메뉴 없이, 흰 상자 1300px, 머리 파랑, 줄 띠, 합계 줄 */
.pop-page { padding: 10px; display: flex; flex-direction: column; gap: var(--sp-2); background: var(--bg); min-height: 100vh; }
.pop-title { font-size: var(--fs-base); font-weight: 700; margin: 0; }
.pop-page .report-wrap { max-width: 1320px; padding: 5px; border: 0; }
table.report.year-detail th { background: var(--yr-head); color: var(--white); border-color: var(--white); height: 25px; }
table.report.year-detail td { text-align: center; height: 25px; width: 100px; border-color: var(--white); }
table.report.year-detail tbody tr:not(.total):nth-child(odd) td { background: var(--yr-line1); }
table.report.year-detail tbody tr:not(.total):nth-child(even) td { background: var(--yr-line2); }
table.report.year-detail tr.total td { background: var(--yr-total); font-weight: 400; }
table.report.year-detail tr.total td.money { text-align: right; font-weight: 700; }

/* 연간 분석 설정(옛 daGroupSetting.jsp): 왼쪽 그룹 목록 300x400, 오른쪽 입력 400 */
.split { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-start; }
.split-left { flex: 0 0 300px; max-width: 100%; height: 400px; overflow-y: auto; background: var(--white); border: 1px solid var(--old-box); padding: var(--sp-1); }
.split-right { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.split-right .btn-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: flex-end; }
.split-right table.form { min-width: 0; }
.split-right table.form > tbody > tr > th, .split-right table.form > tr > th { width: 100px; white-space: nowrap; }
.split-right table.form th.top { vertical-align: top; padding-top: var(--sp-2); white-space: normal; }
.split-right .pick-btn { margin-top: var(--sp-1); }
.split-right h2 { font-size: var(--fs-sm); font-weight: 700; padding: 0 0 var(--sp-1) 10px; border-bottom: 1px solid var(--old-box); }
table.form input.w150 { width: 150px !important; max-width: 100%; }
table.form input.w250 { width: 250px !important; max-width: 100%; }
.pick-list { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.pick-list .folder { padding: 2px var(--sp-1); color: var(--text-dim); font-weight: 500; }
.pick-list button { width: 100%; text-align: left; border: 0; background: transparent; font: inherit; color: var(--text); padding: 2px var(--sp-2) 2px var(--sp-6); border-radius: var(--r-control); cursor: pointer; }
.pick-list button:hover { background: var(--bg); }
.pick-list button[aria-current="true"] { background: var(--navy-soft); color: var(--navy); font-weight: 700; }
.chosen { width: 100%; max-width: 300px; box-sizing: border-box; height: 280px; overflow-y: auto; border: 1px solid var(--old-box); padding: 10px var(--sp-2) var(--sp-2); font-size: var(--fs-sm); background: var(--white); }
.chosen div { padding: 1px 0; }
.hint-inline { font-size: var(--fs-sm); color: var(--text-dim); }
.sort-input { width: 40px !important; }

/* 계정 나무(옛 daInfo.jsp, daSort.jsp 의 20줄 목록 상자): 글자칸 150, 상자는 내용 폭, 줄 높이 20 */
.tree-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.page > .tree-bar input[type=text] { width: 150px; max-width: 100%; }
.modal .tree-bar input[type=text] { width: 200px; max-width: 100%; }
.modal label.inline { display: inline-flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); font-weight: 500; }
.tree { list-style: none; margin: 0; padding: 2px; width: max-content; min-width: 200px; max-width: 100%; max-height: 404px; overflow-y: auto; background: var(--white); border: 1px solid var(--input-line); font-size: var(--fs-sm); }
.tree.small { width: auto; max-height: 300px; }
.tree-row { display: flex; align-items: center; gap: var(--sp-1); width: 100%; height: 20px; border: 0; background: transparent; font: inherit; color: var(--text); text-align: left; padding: 0 var(--sp-2); cursor: pointer; white-space: nowrap; }
.tree-row:hover { background: var(--bg); }
.tree-row[aria-selected="true"] { background: var(--navy-soft); color: var(--navy); font-weight: 700; }
.tree-row .arrow { width: 14px; flex: none; color: var(--text-dim); font-size: 10px; }
.tree-row .sortno { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.pick-two { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-start; }
.pick-two > div { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.pick-two h3 { font-size: var(--fs-sm); font-weight: 700; }
.pick-two select[size] { height: 300px; width: 100%; padding: var(--sp-1); font-size: var(--fs-sm); }

/* 입력 표 공통 */
table.form tr.group-head th { background: var(--white); font-weight: 700; }
table.form .money-pair { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center; }
table.form .money-pair label { display: inline-flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); }
table.form .money-pair input { width: 160px !important; text-align: right; font-variant-numeric: tabular-nums; }
table.form .ym { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
table.form .ym select { width: auto !important; }
table.form .short { width: 200px !important; max-width: 100%; }
.btn-row.end { justify-content: flex-end; }
table.form label.inline { display: inline-flex; gap: var(--sp-2); align-items: center; font-weight: 500; }
table.form .ym .btn { width: auto; }
.denied { margin: 0; padding: var(--sp-7) 0; text-align: center; color: var(--text-dim); }

/* 계정 추가(옛 daInsert.jsp): 10줄 목록 4개(너비 150, 100, 100, 200), 이름 칸 좁게 */
table.form.da-insert > tbody > tr > th { width: 90px; }
table.form.da-edit > tbody > tr > th { width: 70px; }
/* 월평가 조건: 옛처럼 선박 줄, 색 띠 3개, 단추가 위에서 아래로 */
.stat-search.month-search { flex-direction: column; align-items: flex-start; }
.stat-search .ship-line { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.dept-boxes { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: flex-start; }
.dept-boxes select[size] { height: auto; padding: var(--sp-1); font-size: var(--fs-sm); max-width: 100%; }
.dept-boxes .w150 { width: 150px !important; }
.dept-boxes .w100 { width: 100px !important; }
.dept-boxes .w200 { width: 200px !important; }
table.form td.add-line { font-weight: 700; }
table.form td.add-line input { font-weight: 400; margin: 0 var(--sp-2); }
.note-orange { color: var(--note-orange); font-weight: 400; font-size: var(--fs-sm); }

/* 월평가: 조건 띠 3개는 옛처럼 500px 색 띠, 표는 검은 줄과 짝 칸 같은 색, 숫자 가운데 */
.stat-search .step.mon-yellow, .stat-search .step.mon-sky, .stat-search .step.mon-orange { width: 520px; max-width: 100%; min-height: 30px; padding: 1px var(--sp-2); gap: var(--sp-1); }
.stat-search .step.mon-yellow b, .stat-search .step.mon-sky b, .stat-search .step.mon-orange b { min-width: 230px; }
.stat-search .step select { padding: 0 var(--sp-1); }
.mon-yellow { background: var(--mon-yellow); }
.mon-sky { background: var(--mon-sky); }
.mon-orange { background: var(--mon-orange); }
table.report.month-table th, table.report.month-table td { border-color: var(--mon-border); }
table.report.month-table td.mon-yellow { background: var(--mon-yellow); }
table.report.month-table td.mon-sky { background: var(--mon-sky); }
table.report.month-table td.mon-orange { background: var(--mon-orange); }
table.report.month-table td.mon-green { background: var(--st-green); }
table.report.month-table th.gap-col { background: var(--white); border-top-color: transparent; }
table.report.month-table td.gap-col { background: var(--white); }
/* 옛 monthDa.jsp 빈 칸 border-top-style/border-bottom-style: hidden — 덩어리 사이가 끊겨 보이게(양옆 세로선은 남김) */
table.report.month-table .gap-col { border-top-style: hidden; border-bottom-style: hidden; }
table.report.month-table tr.sub td:not(.gap-col) { background: var(--st-sub); font-weight: 700; }
table.report.month-table tr.total td:not(.gap-col) { background: var(--st-total); }



/* 예산 입력: 옛 budget.jsp 색(표 바탕 회색, 1단계 줄 초록, 계정 이름 칸 옅은 회색)과 폭 700px */
table.form.budget-input { max-width: var(--content-w); background: var(--bud-gray); }
table.form.budget-input > tbody > tr > th, table.form.budget-input > tbody > tr > td { background: var(--bud-gray); border-bottom-color: var(--white); padding-top: 2px; padding-bottom: 2px; }
table.form.budget-input tr.group-head th { background: var(--bud-green); font-weight: 700; }
table.form.budget-input tr.bud-line > th { background: var(--bud-label); padding-left: var(--sp-6); }
table.form.budget-input tr.bud-line > td { background: var(--white); }
table.form.budget-input .money-pair input { width: 140px !important; }
table.form.budget-input tr.bud-line input, table.form.budget-input tr.bud-line select { height: var(--h-small); }
.page:has(table.budget-input) > *:not(.modal-back):not(.confirm-back):not(.page-title) { max-width: var(--content-w); }
