:root{--navy:#17365d;--blue:#2457a7;--ink:#1c2738;--muted:#68758a;--line:#e1e7ef;--bg:#f4f7fb;--white:#fff;--green:#18794e;--red:#b42318}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Arial,"Malgun Gothic",sans-serif;font-size:14px}
.topbar{min-height:68px;background:#fff;color:#fff;display:flex;align-items:stretch;padding:0;box-shadow:0 2px 8px #0b1f3b18}
.company-logo{width:220px;min-width:220px;background:#fff;display:flex;align-items:center;justify-content:center;padding:8px 16px}.company-logo img{display:block;width:100%;max-width:190px;height:auto;object-fit:contain}.topbar-content{min-width:0;flex:1;background:#102947;display:flex;align-items:center;gap:28px;padding:0 28px}
.brand{font-size:18px;font-weight:800;color:#fff;text-decoration:none;white-space:nowrap}
nav{display:flex;gap:20px;flex:1;flex-wrap:wrap}nav a,.user a{color:#e2ebf7;text-decoration:none;font-size:13px}nav a:hover,.user a:hover{text-decoration:underline}.user{white-space:nowrap;color:#c9d7e9;font-size:12px;display:flex;gap:12px;align-items:center}
main{max-width:1500px;margin:0 auto;padding:30px 28px 54px}.login-main{min-height:calc(100vh - 48px);display:grid;place-items:center}
footer{text-align:center;color:#8b97a8;padding:18px;font-size:12px}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:24px}.page-head h1{font-size:27px;margin:4px 0 8px;letter-spacing:-.7px}.eyebrow{color:var(--blue);font-size:10px;font-weight:800;letter-spacing:1.7px;margin:0}.muted{color:var(--muted);margin:0;line-height:1.6}.actions{display:flex;gap:9px;flex-wrap:wrap}
.button,button{border:1px solid #d0d8e4;background:#fff;border-radius:8px;padding:10px 14px;color:#27364b;font-size:13px;font-weight:700;text-decoration:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}.button:hover,button:hover{background:#f3f6fa}.primary{background:var(--blue)!important;color:#fff!important;border-color:var(--blue)!important}.primary:hover{background:#1d4789!important}.danger{background:#b42318!important;color:#fff!important;border-color:#b42318!important}
.filter{display:flex;align-items:end;gap:10px;background:#fff;padding:14px;border:1px solid var(--line);border-radius:12px;margin-bottom:16px}.filter label{display:flex;flex-direction:column;gap:5px;font-weight:700;font-size:12px}
input,select{width:100%;border:1px solid #ccd5e2;border-radius:7px;padding:10px 11px;background:#fff;color:var(--ink);font:inherit;min-width:0}input:focus,select:focus{outline:2px solid #c7dcff;border-color:#6398e8}label{font-weight:700;font-size:12px;display:flex;flex-direction:column;gap:7px}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:28px}.stat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px 20px;position:relative}.stat span{display:block;color:var(--muted);font-size:12px;font-weight:700}.stat strong{display:inline-block;font-size:27px;margin:12px 6px 0 0;letter-spacing:-.7px}.stat small{color:var(--muted);font-size:11px}
.section-head{display:flex;justify-content:space-between;align-items:center;margin:0 0 12px}.section-head h2,.form-card h2{font-size:17px;margin:0}
.table-wrap{overflow:auto;background:#fff;border:1px solid var(--line);border-radius:12px}table{border-collapse:collapse;width:100%;font-size:12px;white-space:nowrap}th,td{padding:12px 13px;border-bottom:1px solid #edf0f5;text-align:left}th{background:#f7f9fc;color:#536178;font-size:11px;font-weight:800}tbody tr:hover{background:#fafcff}tbody tr:last-child td{border-bottom:0}.num{text-align:right;font-variant-numeric:tabular-nums}.strong{font-weight:800;color:var(--navy)}.empty{text-align:center;color:var(--muted);padding:35px}.row-actions{display:flex;align-items:center;gap:9px}.row-actions a,.link-button{color:var(--blue);text-decoration:none;font-size:12px;font-weight:700;background:none;border:0;padding:0}.row-actions form{display:inline}.link-button.green{color:var(--green)}.link-button.red{color:var(--red)}
.status{display:inline-block;border-radius:20px;padding:5px 8px;background:#edf1f6;color:#526174;font-size:10px;font-weight:800}.status-승인요청{background:#fff2cc;color:#855d00}.status-승인완료{background:#dff5e8;color:#17683f}.status-마감{background:#dce8fa;color:#204e91}
.close-panel{margin-top:18px;border:1px solid #d8e2ef;background:#fff;border-radius:12px;padding:17px 20px;display:flex;justify-content:space-between;align-items:center;gap:16px}.close-panel strong{font-size:14px}.close-panel p{font-size:12px;margin-top:4px}
.form-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:24px;margin-bottom:20px}.field-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.field-grid label.wide{grid-column:span 2}.form-actions{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid var(--line);padding-top:20px;margin-top:24px}
.stack{display:flex;flex-direction:column;gap:16px}.import-card{max-width:900px}.notice{background:#f4f8ff;border:1px solid #d7e5fa;border-radius:9px;padding:16px;margin-top:24px;line-height:1.8}.notice ul{margin-bottom:0;padding-left:20px}.chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}.chips span{background:#f1f4f8;border-radius:6px;padding:6px 8px;color:#4b5c73;font-size:11px}
.messages{margin-bottom:15px}.flash{padding:12px 15px;border-radius:8px;margin-bottom:8px;background:#e4f5eb;color:#17683f}.flash.error{background:#fff0ee;color:#a32219}
.login-card{width:min(420px,100%);background:#fff;border:1px solid var(--line);border-radius:18px;padding:36px;box-shadow:0 16px 50px #19375c12}.login-company-logo{display:block;width:min(310px,100%);height:auto;object-fit:contain;margin:0 0 24px}.login-card h1{font-size:24px;margin:0 0 8px}.login-card .stack{margin-top:24px}.login-card .primary{width:100%;padding:12px}.hint{background:#f6f8fb;border-radius:7px;padding:10px;color:#6d7889;font-size:11px;margin-top:18px}.two-col{display:grid;grid-template-columns:1fr 1.4fr;gap:18px}.inline-form{display:flex;gap:6px}.inline-form input{min-width:130px;padding:7px}.inline-form button{padding:7px 9px}
@media(max-width:1000px){.topbar{align-items:stretch;flex-wrap:wrap}.company-logo{width:190px;min-width:190px}.topbar-content{align-items:flex-start;flex-wrap:wrap;padding:16px 18px;gap:14px}.user{margin-left:auto}main{padding:22px 14px}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.two-col{grid-template-columns:1fr}}
@media(max-width:600px){.page-head{align-items:flex-start;flex-direction:column}.stats{grid-template-columns:1fr 1fr}.field-grid{grid-template-columns:1fr}.field-grid label.wide{grid-column:span 1}.filter{align-items:stretch;flex-wrap:wrap}.filter label{flex:1}.close-panel{align-items:flex-start;flex-direction:column}nav{gap:12px}.topbar{gap:0}.company-logo{width:100%;min-width:0;justify-content:flex-start;padding:10px 16px}.company-logo img{width:190px}.topbar-content{width:100%;padding:14px 16px}.user{margin-left:0}}

.master-tabs{display:flex;gap:8px;margin:-8px 0 18px;border-bottom:1px solid var(--line);padding-bottom:10px}.master-tabs a{padding:9px 14px;border-radius:8px;text-decoration:none;color:#526174;font-weight:700;font-size:13px}.master-tabs a.active{background:#e8f0fc;color:var(--navy)}.manager-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.manager-submit{display:flex;align-items:end}.manager-submit button{min-height:40px}@media(max-width:1000px){.manager-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.manager-grid{grid-template-columns:1fr}.manager-submit{align-items:stretch}}
.button-link{border:1px solid #d0d8e4;background:#fff;border-radius:8px;padding:10px 14px;color:#27364b;font-size:13px;font-weight:700;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}.filter-row{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.filter-row label{min-width:180px;flex:1}

.tab-section-heading{font-size:17px;margin:26px 0 12px}.settlement-tabs{display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:10px;margin:-8px 0 18px}.settlement-tabs .settlement-tab{padding:9px 14px;border-radius:8px;background:transparent;border-color:transparent;color:#526174;font-weight:700;font-size:13px}.settlement-tabs .settlement-tab.active{background:#e8f0fc;border-color:#e8f0fc;color:var(--navy)}.settlement-tab-panel.hidden{display:none}.tab-note{grid-column:1/-1;background:#f4f8ff;border:1px solid #d7e5fa;border-radius:8px;padding:12px}

/* Horizontal entry grid for temporary-haul records */
.haul-table-wrap { width: 100%; overflow-x: auto; margin-top: 8px; }
.table-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-width: 900px; }
.haul-entry-table { width: 100%; min-width: 1120px; border-collapse: collapse; background: var(--card, #fff); }
.haul-entry-table th, .haul-entry-table td { border: 1px solid var(--border, #d9dee7); padding: 7px; text-align: left; white-space: nowrap; }
.haul-entry-table th { background: var(--surface-muted, #f3f5f8); font-size: 13px; }
.haul-entry-table td:first-child { text-align: center; width: 44px; font-weight: 600; }
.haul-entry-table input { width: 100%; min-width: 92px; box-sizing: border-box; padding: 8px; }
.haul-entry-table td:nth-child(4) input, .haul-entry-table td:nth-child(9) input { min-width: 140px; }
.haul-entry-table .button { padding: 7px 10px; }
.haul-entry-table { min-width: 1750px; }
.haul-entry-table input, .haul-entry-table select { width: 100%; min-width: 92px; box-sizing: border-box; padding: 8px; }
.haul-entry-table td:nth-child(4) select { min-width: 190px; }
.haul-entry-table td:nth-child(5) input, .haul-entry-table td:nth-child(7) input, .haul-entry-table td:nth-child(n+10):nth-child(-n+13) input { min-width: 130px; }

/* Clear visual separation between settlement scope selectors and sub-tabs */
.settlement-scope-fields{margin-bottom:28px;padding-bottom:22px;border-bottom:1px solid var(--line);}
.settlement-tabs{margin:0 0 22px;gap:10px;padding-top:2px;padding-bottom:12px;}
@media(max-width:600px){.settlement-scope-fields{margin-bottom:22px;padding-bottom:18px}.settlement-tabs{margin-bottom:20px;}}

/* Daily mileage entry grid */
.mileage-table-wrap { margin-top: 8px; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--border, #dbe2ea); border-radius: 10px; }
.mileage-entry-table { border-collapse: separate; border-spacing: 0; min-width: 1900px; width: max-content; font-size: 12px; }
.mileage-entry-table th, .mileage-entry-table td { padding: 7px 5px; border-right: 1px solid #e4e9f0; border-bottom: 1px solid #e4e9f0; text-align: center; white-space: nowrap; }
.mileage-entry-table thead th { background: #f3f6fa; position: sticky; top: 0; z-index: 1; }
.mileage-entry-table th:nth-child(-n+3), .mileage-entry-table td:nth-child(-n+3) { position: sticky; background: #fff; z-index: 2; }
.mileage-entry-table th:nth-child(1), .mileage-entry-table td:nth-child(1) { left: 0; min-width: 105px; }
.mileage-entry-table th:nth-child(2), .mileage-entry-table td:nth-child(2) { left: 105px; min-width: 55px; }
.mileage-entry-table th:nth-child(3), .mileage-entry-table td:nth-child(3) { left: 160px; min-width: 85px; }
.mileage-entry-table thead th:nth-child(-n+3) { background: #f3f6fa; z-index: 3; }
.mileage-entry-table .mileage-day { width: 54px; min-width: 54px; box-sizing: border-box; padding: 6px 3px; text-align: right; }
.mileage-entry-table .mileage-total { font-weight: 700; min-width: 100px; background: #f7f9fc; }
.mileage-entry-table .mileage-vehicle-no { font-weight: 600; }

.extra-delivery-table { border-collapse: separate; border-spacing: 0; min-width: 1050px; width: 100%; background: var(--card, #fff); }
.extra-delivery-table th, .extra-delivery-table td { border-right: 1px solid #e4e9f0; border-bottom: 1px solid #e4e9f0; padding: 8px; text-align: left; white-space: nowrap; }
.extra-delivery-table th { background: #f3f6fa; }
.extra-delivery-table input, .extra-delivery-table select { box-sizing: border-box; width: 100%; min-width: 90px; padding: 7px; }
.extra-delivery-table td:nth-child(1), .extra-delivery-table td:nth-child(2), .extra-delivery-table td:nth-child(3) { font-weight: 600; }
.extra-delivery-table .extra-base, .extra-delivery-table .extra-over { text-align: right; min-width: 90px; font-variant-numeric: tabular-nums; }

/* Settlement screen: wider canvas and compact tables to reduce horizontal scrolling */
main{max-width:1840px;padding-left:20px;padding-right:20px}
.form-card{width:100%;padding:22px}
.table-actions{min-width:0;flex-wrap:wrap}
.table-scroll,.haul-table-wrap{max-width:100%;overflow-x:auto}
/* Vehicle-based grids (mileage, retroactive and other): fit the available card width */
.mileage-entry-table{min-width:0;width:100%;table-layout:fixed;font-size:11px}
.mileage-entry-table th,.mileage-entry-table td{padding:5px 3px}
.mileage-entry-table th:nth-child(1),.mileage-entry-table td:nth-child(1){left:0;width:105px;min-width:105px}
.mileage-entry-table th:nth-child(2),.mileage-entry-table td:nth-child(2){left:105px;width:54px;min-width:54px}
.mileage-entry-table th:nth-child(3),.mileage-entry-table td:nth-child(3){left:159px;width:82px;min-width:82px}
.mileage-entry-table .mileage-day{width:100%;min-width:0;padding:5px 1px;font-size:10px}
.mileage-entry-table input{min-width:0;width:100%;padding:5px 2px;font-size:10px}
.retroactive-entry-table,.other-entry-table{min-width:0;width:100%;table-layout:fixed}
.retroactive-entry-table th,.other-entry-table th{white-space:normal;word-break:keep-all;font-size:10px;padding:6px 3px}
.retroactive-entry-table td,.other-entry-table td{padding:4px 2px}
.retroactive-entry-table td:nth-child(n+4),.other-entry-table td:nth-child(n+4){width:auto}
/* Temporary haul and loading-support forms */
.haul-entry-table{min-width:0;width:100%;table-layout:fixed;font-size:10px}
.haul-entry-table th,.haul-entry-table td{padding:4px 3px;white-space:normal;word-break:keep-all}
.haul-entry-table input,.haul-entry-table select{min-width:0;width:100%;padding:6px 4px;font-size:10px}
.haul-entry-table td:nth-child(4) select{min-width:0}
.haul-entry-table td:nth-child(4) input,.haul-entry-table td:nth-child(9) input,
.haul-entry-table td:nth-child(5) input,.haul-entry-table td:nth-child(7) input,
.haul-entry-table td:nth-child(n+10):nth-child(-n+13) input{min-width:0}
.extra-delivery-table{min-width:0;width:100%;table-layout:fixed;font-size:10px}
.extra-delivery-table th,.extra-delivery-table td{padding:5px 3px;white-space:normal;word-break:keep-all}
.extra-delivery-table input,.extra-delivery-table select{min-width:0;width:100%;padding:5px 3px;font-size:10px}
@media(max-width:1200px){
 main{padding-left:12px;padding-right:12px}
 .form-card{padding:14px}
 .mileage-entry-table{min-width:1100px;width:max-content;table-layout:auto}
 .retroactive-entry-table,.other-entry-table{min-width:1000px;width:max-content;table-layout:auto}
 .haul-entry-table,.extra-delivery-table{min-width:1050px;width:max-content;table-layout:auto}
}
@media(min-width:1201px){
 .settlement-scope-fields{grid-template-columns:repeat(2,minmax(260px,340px))}
}

/* Settlement detail typography: match the 13px settlement sub-tab label size */
.settlement-tab-panel table,
.settlement-tab-panel table th,
.settlement-tab-panel table td,
.settlement-tab-panel table input,
.settlement-tab-panel table select,
.settlement-tab-panel table textarea {
  font-size: 13px;
}
.settlement-tab-panel table th {
  line-height: 1.35;
}
.settlement-tab-panel table input,
.settlement-tab-panel table select {
  line-height: 1.35;
}
/* Keep compact mileage cells readable without changing their column layout */
.settlement-tab-panel .mileage-entry-table .mileage-day,
.settlement-tab-panel .mileage-entry-table input {
  font-size: 13px;
}


/* Requested settlement-entry refinements */
/* Temporary haul: manager uses the same active-manager suggestions as loading support. */
.haul-entry-table th:nth-child(3),.haul-entry-table td:nth-child(3){width:6.5%;}
.haul-entry-table th:nth-child(4),.haul-entry-table td:nth-child(4){width:14%;}
.haul-entry-table th:nth-child(5),.haul-entry-table td:nth-child(5){width:10%;}
/* Daily mileage: hide number steppers and center entered values. */
.mileage-entry-table input.mileage-day{ text-align:center !important; -moz-appearance:textfield; appearance:textfield; }
.mileage-entry-table input.mileage-day::-webkit-outer-spin-button,
.mileage-entry-table input.mileage-day::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
/* Restore comfortable widths for the two trailing mileage columns. */
.mileage-entry-table th:nth-last-child(2),.mileage-entry-table td:nth-last-child(2){min-width:125px;width:125px;}
.mileage-entry-table th:last-child,.mileage-entry-table td:last-child{min-width:125px;width:125px;}
.mileage-entry-table td:last-child input{min-width:110px;width:100%;}

/* Monthly vehicle settlement grouped wide table */
.monthly-settlement-table{min-width:2600px;table-layout:auto}
.monthly-settlement-table th,.monthly-settlement-table td{white-space:nowrap;text-align:center;vertical-align:middle}
.monthly-settlement-table thead tr:first-child th{background:#e8f0fc;font-weight:800;text-align:center}
.monthly-settlement-table input{min-width:76px;width:88px;text-align:right}
.monthly-settlement-table td:nth-child(-n+6){font-weight:600}
.monthly-settlement-table td.monthly-calculated{font-weight:800;background:#f4f8ff;min-width:95px}
.monthly-settlement-scroll{max-width:100%;overflow-x:auto}

/* Monthly vehicle settlement grouped wide table */
.monthly-settlement-table{min-width:2600px;table-layout:auto}
.monthly-settlement-table th,.monthly-settlement-table td{white-space:nowrap;text-align:center;vertical-align:middle}
.monthly-settlement-table thead tr:first-child th{background:#e8f0fc;font-weight:800;text-align:center}
.monthly-settlement-table input{min-width:76px;width:88px;text-align:right}
.monthly-settlement-table td:nth-child(-n+6){font-weight:600}
.monthly-settlement-table td.monthly-calculated{font-weight:800;background:#f4f8ff;min-width:95px}
.monthly-settlement-scroll{max-width:100%;overflow-x:auto}


/* 월차량정산: 기존 개별 입력 필드 영역은 그룹형 차량별 표로 대체 */
.settlement-tab-panel[data-panel="monthly"] > .field-grid,
.settlement-tab-panel[data-panel="monthly"] .monthly-legacy-fields {
  display: none !important;
}

/* Center/month saved-settlement lookup control */
.fuel-price-lookup-field{min-width:0}
.fuel-price-lookup-row{display:flex;align-items:center;gap:8px}
.fuel-price-lookup-row input{flex:1;min-width:0}
.fuel-price-lookup-row .button{flex:0 0 auto;white-space:nowrap}

/* Keep required markers inline with field names and align center classification controls. */
.field-label-row{display:inline-flex;align-items:center;gap:3px;min-height:15px}
.field-label-row .required{display:inline;color:var(--red);font-weight:800}
.center-code-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
.center-code-controls select,.center-code-controls input{height:40px;min-height:40px}
.center-code-controls input:disabled{background:#f3f5f8;color:#9aa4b2}
@media(max-width:600px){.center-code-controls{grid-template-columns:1fr 1fr}}

/* 정산등록 탭별 세부내역 필터 */
.settlement-filter-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:-10px 0 18px;padding:10px 12px;background:#f7f9fc;border:1px solid var(--line);border-radius:9px}
.settlement-filter-title{font-size:13px;font-weight:800;color:var(--navy);margin-right:4px;white-space:nowrap}
.settlement-filter-bar select,.settlement-filter-bar input{min-width:150px;height:36px;padding:6px 9px;border:1px solid var(--line);border-radius:7px;background:#fff;font-size:13px}
.settlement-filter-bar input{flex:1;min-width:180px}
.settlement-filter-bar select:disabled{background:#f0f2f5;color:#9aa3af}
.settlement-tab-panel tbody tr[hidden]{display:none!important}
@media(max-width:700px){.settlement-filter-bar{align-items:stretch}.settlement-filter-bar select,.settlement-filter-bar input{flex:1 1 42%;min-width:0}}
.monthly-not-applicable { color: #9ca3af; text-align: center; background: #f8fafc; }


/* 정산등록 표 열 정렬 UI */
.settlement-tab-panel th.sortable-column { cursor: pointer; user-select: none; white-space: nowrap; }
.settlement-tab-panel th.sortable-column::after { content: ' ↕'; opacity: .45; font-size: .85em; }
.settlement-tab-panel th.sortable-column.sort-ascending::after { content: ' ▲'; opacity: 1; }
.settlement-tab-panel th.sortable-column.sort-descending::after { content: ' ▼'; opacity: 1; }

/* 월차량정산 하단 합계/평균 행 */
.monthly-settlement-table tfoot td{position:sticky;bottom:0;background:#eaf1fb;font-weight:800;text-align:center;border-top:2px solid #7894bd;z-index:2}
.monthly-settlement-table tfoot .monthly-summary-label{ text-align:center; color:#17365d }
.monthly-settlement-table .monthly-row-total,.monthly-settlement-table .monthly-grand-total{background:#dce9fb;font-weight:900;min-width:120px}

/* 세부 탭별 합계 및 구분별 요약 */
.mileage-entry-table tfoot td,
.haul-entry-table tfoot td,
.extra-delivery-table tfoot td,
.loading-support-table tfoot td{background:#eaf1fb;font-weight:800;text-align:center;border-top:2px solid #7894bd;white-space:nowrap;}
.table-summary-label{color:#17365d;text-align:center;font-weight:800;}
.tab-breakdown-summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0 12px;padding:10px 12px;background:#f7f9fc;border:1px solid var(--line);border-radius:9px;font-size:13px;}
.tab-breakdown-summary>strong{color:#17365d;white-space:nowrap;}
.tab-breakdown-item{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:7px 10px;background:#fff;border:1px solid var(--line);border-radius:7px;}
.tab-breakdown-item>b{color:#17365d;}
.tab-breakdown-item span{white-space:nowrap;color:var(--muted);}
.tab-breakdown-item span strong{color:var(--text);font-variant-numeric:tabular-nums;}

/* 정산 조회: 운임 그룹별 요약 및 차량정보 우선 목록 */
.stats-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inquiry-table { min-width: 1180px; }
.inquiry-table thead .group-heading { text-align: center; background: #eaf0f7; color: #24364b; font-weight: 700; }
.inquiry-table tfoot th { background: #eef2f7; font-weight: 800; }
.inquiry-table td.num, .inquiry-table th.num { white-space: nowrap; }
@media (min-width: 1200px) { .stats-six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* 정산등록 탭별 작업 버튼 우측 정렬 및 간격 축소 */
.tab-export-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;}
.tab-export-actions>.muted{margin-right:auto;flex:1 1 auto;}
.tab-export-actions>.button{padding:7px 10px;font-size:12px;}
.table-actions:has(#load-prev-extra),
.table-actions:has(#load-prev-loading){display:flex;align-items:center;justify-content:flex-end;gap:5px;}
.table-actions:has(#load-prev-extra)>p,
.table-actions:has(#load-prev-loading)>p{margin-right:auto;flex:1 1 auto;}
.table-actions:has(#load-prev-extra)>.button,
.table-actions:has(#load-prev-loading)>.button{padding:7px 10px;font-size:12px;}
@media(max-width:700px){
 .tab-export-actions{gap:4px;}
 .tab-export-actions>.button{padding:6px 7px;font-size:11px;}
 .table-actions:has(#load-prev-extra),.table-actions:has(#load-prev-loading){gap:4px;}
}


/* 정산등록 각 탭 하단 작업 버튼 한 줄 정렬 */
.tab-bottom-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:nowrap;margin-top:18px;padding-top:14px;border-top:1px solid var(--line);}
.tab-bottom-actions .button,.tab-bottom-actions button{white-space:nowrap;min-width:82px;}
@media(max-width:520px){.tab-bottom-actions{gap:5px}.tab-bottom-actions .button,.tab-bottom-actions button{min-width:0;padding-left:12px;padding-right:12px}}

/* Master tabs and Excel actions: aligned on one horizontal row */
.master-tabs{align-items:center;flex-wrap:wrap;}
.master-excel-actions{margin-left:auto;display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-wrap:wrap;}
.master-excel-actions>.button{padding:7px 10px;font-size:12px;white-space:nowrap;}
.master-upload-form{display:none;}
@media(max-width:900px){.master-excel-actions{width:100%;margin-left:0;justify-content:flex-end;}}

/* Vehicle master list: inline column-based search */
.vehicle-list-heading{gap:16px;flex-wrap:wrap}
.vehicle-search-controls{display:flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:wrap}
.vehicle-search-controls select{width:170px;min-width:135px}
.vehicle-search-controls input{width:230px;min-width:160px}
.vehicle-search-controls select,.vehicle-search-controls input{height:38px;padding:7px 10px}
.vehicle-search-controls button{height:38px;white-space:nowrap}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#vehicle-list-table tr[hidden]{display:none}
@media(max-width:680px){.vehicle-search-controls{width:100%;margin-left:0}.vehicle-search-controls input{flex:1;width:auto}}

/* V7: single-line Excel actions and detail filters left aligned */
.settlement-toolbar{display:flex;align-items:center;justify-content:flex-start;gap:12px;flex-wrap:nowrap;margin-bottom:12px;min-width:0}
.settlement-toolbar .tab-export-actions{margin:0;min-width:0;flex:0 0 auto;flex-wrap:nowrap;justify-content:flex-start}
.settlement-filter-slot{display:flex;align-items:center;justify-content:flex-start;min-width:0;flex:0 1 auto}
.settlement-filter-bar{display:flex;align-items:center;justify-content:flex-start;gap:6px;flex-wrap:nowrap;margin:0;padding:0;border:0;background:transparent;min-width:0}
.settlement-filter-bar .settlement-filter-title{display:none}
.settlement-filter-bar select{width:130px;min-width:100px;max-width:145px;height:34px}
.settlement-filter-bar input{width:145px;min-width:100px;max-width:180px;flex:0 1 145px;height:34px}
.settlement-filter-bar .button{white-space:nowrap;height:34px;padding:6px 10px}
@media(max-width:1050px){.settlement-toolbar{overflow-x:auto;justify-content:flex-start}.settlement-filter-slot{flex:0 0 auto}.settlement-filter-bar select,.settlement-filter-bar input{flex:0 0 auto}}

/* V8: filters on the left, Excel actions on the right, same row */
.settlement-toolbar{justify-content:space-between;width:100%;}
.settlement-toolbar .settlement-filter-slot{order:0;justify-content:flex-start;flex:0 1 auto;}
.settlement-toolbar .tab-export-actions{order:1;margin-left:auto;justify-content:flex-end;flex:0 0 auto;}
@media(max-width:1050px){.settlement-toolbar{overflow-x:auto;justify-content:space-between;}.settlement-toolbar .tab-export-actions{margin-left:auto;}}

/* V9: widen the three settlement search fields to 150% of V8. */
.settlement-filter-bar select{width:195px;min-width:150px;max-width:217.5px;flex:0 0 195px}
.settlement-filter-bar input{width:217.5px;min-width:150px;max-width:270px;flex:0 0 217.5px}
/* Keep the existing left-filter / right-Excel alignment and horizontal overflow on narrow screens. */
@media(max-width:1050px){.settlement-filter-bar select{flex:0 0 195px}.settlement-filter-bar input{flex:0 0 217.5px}}

/* V10: right-align only the temporary-haul add-row button */
.temporary-haul-actions { display: flex; justify-content: flex-end; align-items: center; width: 100%; }

/* V12: settlement company registration row layout */
.company-form-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px 16px; }
.company-form-grid > label { grid-column:span 3; min-width:0; }
.company-form-grid > label:nth-child(n+3):nth-child(-n+5) { grid-column:span 2; }
.company-form-grid > label input,.company-form-grid > label select { width:100%; box-sizing:border-box; }
@media(max-width:720px){.company-form-grid {grid-template-columns:1fr;} .company-form-grid > label,.company-form-grid > label:nth-child(n+3):nth-child(-n+5){grid-column:1;}}
.master-sortable-table th[data-sortable] { cursor:pointer; user-select:none; white-space:nowrap; }
.master-sortable-table th[data-sortable]:hover { background:rgba(100,120,150,.10); }
.master-sortable-table th[data-sortable]:focus-visible { outline:2px solid #447ee5; outline-offset:-2px; }
.sort-indicator { margin-left:5px; font-size:.85em; opacity:.65; }

/* V19: vertically scrollable lists with persistent column headings. */
.table-wrap:has(> #center-list-table),
.table-wrap:has(> #company-list-table),
.table-wrap:has(> #vehicle-list-table),
.table-wrap:has(> .inquiry-table),
.settlement-tab-panel .table-scroll,
.settlement-tab-panel .haul-table-wrap {
  max-height: min(68vh, 740px);
  overflow: auto;
  position: relative;
}
.table-wrap:has(> #center-list-table) thead th,
.table-wrap:has(> #company-list-table) thead th,
.table-wrap:has(> #vehicle-list-table) thead th,
.table-wrap:has(> .inquiry-table) thead th,
.settlement-tab-panel .table-scroll thead th,
.settlement-tab-panel .haul-table-wrap thead th {
  position: sticky; top: 0; z-index: 6; background: #f3f6fa;
  box-shadow: inset 0 -1px #dbe2ea;
}
/* Two-row grouped headings: keep the group and field-name rows visible together. */
.inquiry-table thead tr:nth-child(2) th,
.monthly-settlement-table thead tr:nth-child(2) th {
  top: var(--v19-group-header-height, 38px); z-index: 7;
}
.inquiry-table thead tr:first-child th,
.monthly-settlement-table thead tr:first-child th {
  top: 0; z-index: 8; background: #e8f0fc;
}
/* Preserve the existing bottom total row without covering the header. */
/* V20: viewport-bottom horizontal scroll control for monthly settlement */
.monthly-fixed-horizontal-scroll {
  position: fixed;
  bottom: 0;
  z-index: 1100;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #eef2f7;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
  display: none;
}
.monthly-fixed-scroll-spacer { height: 1px; }
.monthly-fixed-horizontal-scroll::-webkit-scrollbar { height: 14px; }
.monthly-fixed-horizontal-scroll::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 7px; }
