/* Fit the actual form and rows, not just the outer dialog. */
body #driverCostsDialog #driverCostsPanel{box-sizing:border-box!important;margin:0!important;padding:12px!important;width:100%!important;max-width:none!important;min-height:100%;border:0!important}
body #driverCostsDialog .driverDetailHead{margin:0 0 10px!important;padding:0!important;min-height:44px!important;gap:12px!important;align-items:center!important}
body #driverCostsDialog .driverDetailHead h3{font-size:20px!important;margin:0!important}
body #driverCostsDialog .driverDetailHead p{font-size:14px!important;margin:4px 0!important}
body #driverCostsDialog .grid{gap:8px!important;margin:0!important;grid-template-columns:1fr 1fr!important}
body #driverCostsDialog .field{margin:0!important;gap:3px!important}
body #driverCostsDialog label{font-size:14px!important;margin:0!important}
body #driverCostsDialog :is(input,select){height:40px!important;min-height:40px!important;padding:6px 10px!important;font-size:16px!important}
body #driverCostsDialog #saveDriverCost{min-height:40px!important;padding:7px 12px!important;font-size:14px!important;margin:8px 0!important}
body #driverCostsDialog .table{margin:0!important;max-height:none!important;overflow:visible!important}
body #driverCostsDialog table{width:100%!important;min-width:0!important;font-size:14px!important;table-layout:fixed}
body #driverCostsDialog th,body #driverCostsDialog td{padding:3px 10px!important;height:auto!important;font-size:14px!important;line-height:1.25!important}
body #driverCostsDialog th{padding:6px 10px!important}
body #driverCostsDialog th:first-child{width:55%}
body #driverCostsDialog .actions{display:flex!important;gap:6px!important;margin:0!important}
body #driverCostsDialog td button{margin:0!important;min-height:36px!important;height:36px!important;padding:6px 10px!important;font-size:14px!important}
@media(max-width:600px){body #driverCostsDialog #driverCostsPanel{padding:8px!important}body #driverCostsDialog .driverDetailHead p{display:none}body #driverCostsDialog th:first-child{width:45%}body #driverCostsDialog td,body #driverCostsDialog th{padding:3px 5px!important}body #driverCostsDialog td button{min-height:44px!important;height:44px!important}body #driverCostsDialog .driverDetailHead h3{font-size:18px!important}}

body #driverCostsDialog .grid{grid-template-columns:2fr 1fr 1fr!important}body #driverCostsDialog .costActions{flex-wrap:nowrap;overflow-x:auto;margin:8px 0!important;align-items:stretch}body #driverCostsDialog .costActions button{margin:0!important;min-height:40px!important;white-space:nowrap}#costRatesDialog{box-sizing:border-box;width:calc(100vw - 16px);height:calc(100dvh - 16px);max-width:none;max-height:none;padding:16px;border:1px solid #cbd9e9;border-radius:14px;color:#183b58}#costRatesDialog header,#costRatesDialog .actions{display:flex;gap:8px;align-items:center;overflow-x:auto}#costRatesDialog header h2{margin:0;font-size:20px}#costRatesDialog label{display:flex;flex-direction:column;gap:4px}#costRatesDialog input,#costRatesDialog select{min-height:44px;box-sizing:border-box;max-width:100%;padding:8px}#costRatesDialog .rateGrid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:10px;margin:12px 0}#costRatesDialog details{padding:8px 0;border-bottom:1px solid #dbe4ed}#costRatesDialog summary{cursor:pointer}#costRatesDialog .actions button{white-space:nowrap;min-height:44px}#costRatesDialog::backdrop{background:#12345655}@media(max-width:600px){body #driverCostsDialog .grid{grid-template-columns:1fr 1fr!important}body #driverCostsDialog .grid>.field:first-child{grid-column:1/-1}#costRatesDialog .rateGrid{grid-template-columns:1fr 1fr}#costRatesDialog .rateGrid>label:first-child{grid-column:1/-1}}
#costRatesDialog{overflow-x:hidden!important}#costRatesDialog header{position:static!important;inset:auto!important;transform:none!important;flex-wrap:nowrap!important;padding:0!important;margin:0!important;background:white!important}#costRatesDialog header .btn{flex:0 0 auto!important;width:auto!important}#costRatesDialog .rateGrid{grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr)}#costRatesDialog label{min-width:0!important}#costRatesDialog input,#costRatesDialog select{width:100%!important;min-width:0!important}#costRatesDialog p{line-height:1.4;margin:10px 0}body #driverCostsDialog .grid{grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr)!important}@media(max-width:600px){#costRatesDialog .rateGrid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}#costRatesDialog header h2{font-size:18px}body #driverCostsDialog .grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}}
#driverCostSaveStatus:empty{display:none}#driverCostSaveStatus{padding:8px 12px;margin:6px 0!important;border-radius:8px}.rateSuccess{color:#12612d;background:#eef9f0}.rateError{color:#a51f2b;background:#fff0f0}#driverCostPlanned{font-size:14px;margin:6px 0 10px;padding:8px 10px;background:#f3f7ff;border:1px solid #d6e3f7;border-radius:8px}#driverCostPlanned p{margin:4px 0;line-height:1.4}#driverCostPlanned summary{cursor:pointer;font-weight:700;padding:5px 0}.rateHistoryLine{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 0;border-bottom:1px solid #edf1f7}.rateHistoryLine button{flex:0 0 auto}#costRatesDialog .rateGrid{grid-template-columns:minmax(0,2fr) minmax(0,2fr) minmax(0,1fr) minmax(0,1fr)}#costRatesDialog select{font-size:14px}#costRatesDialog [role=status]:not(:empty){padding:8px;border-radius:8px}body #driverCostsDialog .costActions .btn{background:#1263e6!important;color:white!important;flex:1 0 auto!important}#costRatesDialog [hidden]{display:none!important}@media(max-width:700px){#costRatesDialog .rateGrid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}#costRatesDialog .rateGrid>label:nth-child(2){grid-column:1/-1}}
html:has(#costRatesDialog[open]),body:has(#costRatesDialog[open]){overflow:hidden!important}body:has(#costRatesDialog[open]) #driverCostsDialog{overflow:hidden!important}
body #driverCostsDialog #driverCostsPanel .costActions{align-items:stretch!important}body #driverCostsDialog #driverCostsPanel .costActions>button.btn{height:44px!important;min-height:44px!important;max-height:44px!important;margin:0!important;padding:8px 12px!important;flex:1 0 auto!important;line-height:1.2!important}
/* Compact driver costs: readable rows, one action row, touch targets on phones. */
body #driverCostsDialog #driverCostsPanel{padding:10px 12px!important;min-height:0!important}
body #driverCostsDialog #driverCostsPanel .driverDetailHead{min-height:38px!important;margin:0 0 8px!important;gap:10px!important}
body #driverCostsDialog #driverCostsPanel .driverDetailHead h3{font-size:20px!important;line-height:1.2!important}
body #driverCostsDialog #driverCostsPanel .driverDetailHead p{margin:2px 0 0!important;font-size:13px!important}
body #driverCostsDialog #driverCostsPanel #closeDriverCosts{height:38px!important;min-height:38px!important;padding:6px 12px!important;font-size:14px!important;margin:0!important}
body #driverCostsDialog #driverCostsPanel .grid{gap:8px!important}
body #driverCostsDialog #driverCostsPanel label{font-size:13px!important;line-height:1.2!important}
body #driverCostsDialog #driverCostsPanel :is(input,select){height:36px!important;min-height:36px!important;padding:5px 9px!important;font-size:15px!important}
body #driverCostsDialog #driverCostsPanel .costActions{gap:8px!important;margin:8px 0!important;display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important}
body #driverCostsDialog #driverCostsPanel .costActions>button.btn{height:38px!important;min-height:38px!important;max-height:38px!important;flex:1 0 0!important;min-width:max-content!important;font-size:14px!important;padding:6px 12px!important;box-shadow:none!important}
body #driverCostsDialog #driverCostsPanel #driverCostPlanned{margin:6px 0 8px!important;padding:6px 9px!important;font-size:13px!important}
body #driverCostsDialog #driverCostsPanel #driverCostPlanned p{margin:2px 0!important}
body #driverCostsDialog #driverCostsPanel #driverCostPlanned summary{padding:3px 0!important}
body #driverCostsDialog #driverCostsPanel table{border-collapse:collapse!important;font-size:14px!important}
body #driverCostsDialog #driverCostsPanel th{padding:6px 9px!important;font-size:13px!important;background:#edf3fb!important}
body #driverCostsDialog #driverCostsPanel th:first-child{width:58%!important}
body #driverCostsDialog #driverCostsPanel th:nth-child(2){width:24%!important}
body #driverCostsDialog #driverCostsPanel th:last-child{width:18%!important}
body #driverCostsDialog #driverCostsPanel :is(th,td):last-child{text-align:right!important}
body #driverCostsDialog #driverCostsPanel td{padding:2px 9px!important;font-size:14px!important;line-height:1.25!important;vertical-align:middle!important;height:auto!important}
body #driverCostsDialog #driverCostsPanel tbody tr:nth-child(even){background:#f8fafd!important}
body #driverCostsDialog #driverCostsPanel tbody tr:hover{background:#edf4ff!important}
body #driverCostsDialog #driverCostsPanel td button{height:28px!important;min-height:28px!important;max-height:28px!important;padding:3px 10px!important;font-size:13px!important;border-radius:7px!important;background:#1263e6!important;color:#fff!important;border-color:#1263e6!important;box-shadow:none!important}
@media(max-width:600px),(pointer:coarse){body #driverCostsDialog #driverCostsPanel :is(input,select),body #driverCostsDialog #driverCostsPanel td button,body #driverCostsDialog #driverCostsPanel #closeDriverCosts,body #driverCostsDialog #driverCostsPanel .costActions>button.btn{height:44px!important;min-height:44px!important;max-height:none!important}body #driverCostsDialog #driverCostsPanel :is(input,select){font-size:16px!important}}
@media(max-width:600px){body #driverCostsDialog #driverCostsPanel{padding:8px!important}body #driverCostsDialog #driverCostsPanel th:first-child{width:48%!important}body #driverCostsDialog #driverCostsPanel th:nth-child(2){width:24%!important}body #driverCostsDialog #driverCostsPanel th:last-child{width:28%!important}body #driverCostsDialog #driverCostsPanel :is(th,td){padding:3px 5px!important}body #driverCostsDialog #driverCostsPanel .costActions>button.btn{flex:1 0 auto!important}body #driverCostsDialog #driverCostsPanel td button{padding:5px 8px!important}}
html:has(#driverCostsDialog[open]),body:has(#driverCostsDialog[open]){overflow:hidden!important}body #driverCostsDialog #driverCostsPanel th:last-child{text-align:left!important}

#costRateEditDialog{width:min(680px,96vw);max-width:96vw;box-sizing:border-box;padding:16px}#costRateEditDialog .rateGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:12px}#costRateEditDialog label{display:flex;flex-direction:column;gap:6px;min-width:0}#costRateEditDialog input,#costRateEditDialog select{width:100%;box-sizing:border-box;min-height:44px}#costRateEditDialog .actions,#costRatesDialog .rateHistoryLine>.actions{display:flex;gap:8px;flex-wrap:wrap;width:auto;flex:0 0 auto}#costRatesDialog .rateHistoryLine{display:flex;align-items:center;gap:12px;flex-wrap:wrap}#costRatesDialog .rateHistoryLine>span{flex:1 1 220px;min-width:0}#costRateEditDialog .actions{margin-top:16px}

#hourlyCostSettings{border:1px solid #ccdbee;border-radius:12px;padding:12px;margin:12px 0}#hourlyCostSettings .rateGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:10px;align-items:end}#hourlyCostSettings label{display:flex;flex-direction:column;gap:5px}#hourlyCostSettings input{width:100%;min-width:0;box-sizing:border-box}#hourlyCostSettings p{margin:8px 0}

#hourlyCostSettings[hidden]{display:none!important}body #driverCostsDialog #driverCostsPanel th{width:auto!important}body #driverCostsDialog #driverCostsPanel th:first-child{width:24%!important}body #driverCostsDialog #driverCostsPanel .costActions{display:flex!important;flex-wrap:wrap!important;gap:8px}body #driverCostsDialog #driverCostsPanel .costActions>button{flex:1!important}body #driverCostsDialog #driverCostRows .driverRateActions{flex-wrap:wrap;overflow:visible}body #driverCostsDialog #driverCostRows select{max-width:100%;width:100%}@media(max-width:700px){body #driverCostsDialog #driverCostsPanel table{table-layout:auto;min-width:650px!important}body #driverCostsDialog #driverCostsPanel .table{overflow-x:auto!important}}

body #driverCostsDialog #driverCostsPanel #hourlyCostSettings .hourlyPause{display:flex;flex-direction:row;align-items:center;gap:8px;margin:10px 0}body #driverCostsDialog #driverCostsPanel #hourlyCostSettings .hourlyPause input[type=checkbox]{width:22px!important;height:22px!important;min-height:22px!important;max-height:22px!important;flex:0 0 22px}

body #driverCostsDialog #driverCostsPanel .driverCostOverview{display:block!important;width:100%!important;max-height:none!important;overflow:visible!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview table{min-width:0!important;table-layout:fixed!important;width:100%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:first-child{width:19%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:last-child{width:30%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview td{overflow-wrap:anywhere;white-space:normal!important}
body #driverCostsDialog #driverCostsPanel .driverRateActions{display:flex!important;flex-wrap:nowrap!important;gap:5px!important}
body #driverCostsDialog #driverCostsPanel .driverRateActions>.btn{min-width:0!important;flex:1 1 0!important;white-space:normal!important;height:auto!important;min-height:36px!important;max-height:none!important;padding:5px!important}
@media(max-width:1000px){body #driverCostsDialog #driverCostsPanel .driverCostOverview thead{display:none!important}body #driverCostsDialog #driverCostsPanel .driverCostOverview :is(table,tbody){display:block!important}body #driverCostsDialog #driverCostsPanel .driverCostOverview tr{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:10px;border-bottom:1px solid #d5dfec}body #driverCostsDialog #driverCostsPanel .driverCostOverview td{display:block!important;width:auto!important;border:0!important}body #driverCostsDialog #driverCostsPanel .driverCostOverview td:before{content:attr(data-label);display:block;font-size:12px;color:#60748b}body #driverCostsDialog #driverCostsPanel .driverCostOverview .costOverviewActions{grid-column:1/-1}}

/* Explicit eight-column widths replace legacy three-column sizing. */
body #driverCostsDialog #driverCostsPanel .driverCostOverview th{white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.25!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:nth-child(1){width:19%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:nth-child(2){width:9%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:nth-child(3){width:9%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:nth-child(4){width:9%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:nth-child(5){width:9%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:nth-child(6){width:9%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:nth-child(7){width:10%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:nth-child(8){width:26%!important}

#hourlyTariffDialog{box-sizing:border-box;width:min(900px,calc(100vw - 24px));max-height:calc(100dvh - 24px);border:1px solid #cbd9e9;border-radius:14px;padding:18px;color:#183b58;overflow:auto}#hourlyTariffDialog::backdrop{background:#12345688}#hourlyTariffDialog .hourTariffHead{display:flex;align-items:center;gap:14px;background:#0b3855;color:white;border-radius:10px;padding:12px;margin-bottom:16px}#hourlyTariffDialog h2{margin:0;font-size:22px}#hourlyTariffDialog label{display:flex;flex-direction:column;gap:5px;min-width:0}#hourlyTariffDialog input,#hourlyTariffDialog select{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:8px;border:1px solid #cbd9e9;border-radius:8px;font:inherit}#hourlyTariffDialog .rateGrid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;align-items:end}#hourlyTariffDialog .btn{background:#1263e6;color:white;min-height:44px}body #driverCostsDialog .costActions{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));overflow:visible!important}body #driverCostsDialog .costActions button{min-width:0!important;white-space:normal!important;width:100%}@media(max-width:650px){#hourlyTariffDialog .rateGrid{grid-template-columns:1fr}body #driverCostsDialog .costActions{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Compact seven-column overview and combined hourly/approval form. */
body #driverCostsDialog #driverCostsPanel .driverCostOverview th,body #driverCostsDialog #driverCostsPanel .driverCostOverview td{width:auto!important;padding:7px 10px!important;white-space:normal!important;overflow-wrap:anywhere}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:first-child,body #driverCostsDialog #driverCostsPanel .driverCostOverview td:first-child{width:24%!important}
#hourlyTariffDialog #hourlyCostSettings{margin:12px 0 0;padding:12px 0 0;border:0;border-top:1px solid #dbe3ee}
#hourlyTariffDialog #hourlyCostSettings p{margin:8px 0;font-size:14px}
#hourlyTariffDialog #hourlyCostSettings h3{margin:8px 0}
#hourlyTariffDialog .rateGrid{display:grid;gap:10px;align-items:end;grid-template-columns:repeat(3,minmax(0,1fr))}
#hourlyTariffDialog .hourlyPause{display:flex;align-items:center;gap:8px;margin:10px 0}
#hourlyTariffDialog .hourlyPause input{width:20px!important;height:20px!important;min-height:20px!important;margin:0}
#hourlyTariffDialog .btn{white-space:normal;min-height:40px;margin:0}
@media(max-width:650px){#hourlyTariffDialog .rateGrid{grid-template-columns:1fr}}

.costStandalone{box-sizing:border-box;width:min(1000px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:16px;border:1px solid #cbd9e9;border-radius:14px;color:#183b58}
.costStandalone::backdrop{background:#12345688}
.costStandalone header{display:flex;align-items:center;gap:14px;background:#0b3855;color:white;padding:12px;border-radius:10px;margin-bottom:14px}
.costStandalone h2{margin:0;font-size:22px}
.costStandalone .grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;margin-bottom:12px}
.costStandalone input,.costStandalone select{box-sizing:border-box;width:100%;min-width:0;padding:10px;border:1px solid #cbd9e9;border-radius:9px;font:inherit}
.costStandalone .btn{background:#1263e6;color:white;min-height:42px}
.costStandalone .rateHistoryLine{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid #dbe3ee}
@media(max-width:650px){.costStandalone .grid{grid-template-columns:1fr}}
/* Chauffeurskosten: full-width workspace with compact responsive controls. */
body #driverCostsDialog #driverCostsPanel{min-height:100%!important;max-width:100%!important;overflow-wrap:break-word}
body #driverCostsDialog #driverCostsPanel .costActions{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;overflow:visible!important;gap:6px!important}
body #driverCostsDialog #driverCostsPanel .costActions>button.btn{min-width:0!important;width:100%!important;height:auto!important;min-height:40px!important;max-height:none!important;white-space:normal!important;padding:7px!important;font-size:14px!important}
body #driverCostsDialog #driverCostsPanel #driverCostHoursCaption{font-size:13px!important;line-height:1.35!important;margin:8px 0!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview{min-width:0!important;max-width:100%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview :is(th,td){padding:6px 9px!important;font-size:14px!important;line-height:1.3!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:nth-child(n){width:15%!important}
body #driverCostsDialog #driverCostsPanel .driverCostOverview th:first-child{width:25%!important}
@media(max-width:1000px){
 body #driverCostsDialog #driverCostsPanel .driverCostOverview tr{gap:4px!important;padding:7px!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
 body #driverCostsDialog #driverCostsPanel .driverCostOverview td{width:auto!important;min-width:0!important;text-align:left!important;padding:4px!important}
 body #driverCostsDialog #driverCostsPanel .driverCostOverview td:first-child{grid-column:1/-1;width:auto!important}
}
@media(max-width:650px){
 body #driverCostsDialog #driverCostsPanel .costActions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body #driverCostsDialog #driverCostsPanel .costActions>button.btn:last-child:nth-child(odd){grid-column:1/-1}
 body #driverCostsDialog #driverCostsPanel .driverCostOverview tr{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* Compact hourly workspace; pause choice stays beside approval. */
body #hourlyTariffDialog{position:fixed;inset:8px;margin:auto;box-sizing:border-box;width:calc(100vw - 16px);max-width:none;max-height:calc(100dvh - 16px);height:auto;padding:12px;overflow:auto;font-size:14px}
body #hourlyTariffDialog .hourTariffHead{padding:8px 10px;margin-bottom:10px;gap:10px}
body #hourlyTariffDialog h2{font-size:20px}
body #hourlyTariffDialog p{margin:6px 0;line-height:1.35}
body #hourlyTariffDialog p:empty{display:none}
body #hourlyTariffDialog .rateGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
body #hourlyTariffDialog #hourlyCostSettings .rateGrid{grid-template-columns:repeat(4,minmax(0,1fr))}
body #hourlyTariffDialog :is(input,select){min-height:40px;padding:7px;font-size:14px}
body #hourlyTariffDialog .btn{min-width:0;min-height:40px;padding:8px 12px;font-size:14px;line-height:1.25}
body #hourlyTariffDialog #hourlyCostSettings{padding:8px 0 0;margin:8px 0 0}
body #hourlyTariffDialog #hourlyCostSettings h3{font-size:17px;margin:4px 0}
body #hourlyTariffDialog .hourApprovalRow{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;gap:12px;margin:8px 0}
body #hourlyTariffDialog .hourlyPause{flex-direction:row;align-items:center;gap:7px;margin:0;min-width:0}
body #hourlyTariffDialog .hourlyPause input{flex:0 0 20px;width:20px;height:20px;min-height:20px;padding:0}
body #hourlyTariffDialog #hourlyCostSettings small{display:block;line-height:1.35;margin:6px 0}
@media(max-width:650px){
 body #hourlyTariffDialog{padding:8px;inset:4px;width:calc(100vw - 8px);max-height:calc(100dvh - 8px)}
 body #hourlyTariffDialog .rateGrid,body #hourlyTariffDialog #hourlyCostSettings .rateGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
 body #hourlyTariffDialog .hourApprovalRow{gap:8px}
 body #hourlyTariffDialog .hourApprovalRow>*{flex:1 1 0}
 body #hourlyTariffDialog .hourApprovalRow .btn{font-size:13px;padding:8px}
}

/* Weekend allowance: compact, full-width responsive workspace. */
body #costRatesDialog.weekendExpense{position:fixed;inset:8px;margin:auto;width:calc(100vw - 16px);height:auto;max-height:calc(100dvh - 16px);padding:12px;overflow-y:auto;font-size:14px}
body #costRatesDialog.weekendExpense header{background:#0b3855!important;color:white;padding:8px 10px!important;border-radius:10px;gap:10px;overflow:visible}
body #costRatesDialog.weekendExpense header h2{font-size:20px;min-width:0;overflow-wrap:anywhere}
body #costRatesDialog.weekendExpense p{margin:7px 0;line-height:1.35}
body #costRatesDialog.weekendExpense p:empty{display:none}
body #costRatesDialog.weekendExpense .rateGrid{grid-template-columns:minmax(0,2fr) minmax(0,2fr) minmax(0,1fr) minmax(0,1fr);gap:8px;margin:8px 0}
body #costRatesDialog.weekendExpense :is(input,select){min-height:40px;padding:7px;font:inherit;border:1px solid #cbd9e9;border-radius:8px}
body #costRatesDialog.weekendExpense .btn{min-width:0;min-height:40px;padding:8px 12px;font-size:14px;white-space:normal;background:#1263e6;color:white}
body #costRatesDialog.weekendExpense .actions{overflow:visible;flex-wrap:wrap}
body #costRatesDialog.weekendExpense h3{font-size:17px;margin:10px 0 6px}
body #costRatesDialog.weekendExpense section>.rateGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
body #costRatesDialog.weekendExpense .rateHistoryLine{gap:8px;padding:5px 0}
@media(max-width:700px){
 body #costRatesDialog.weekendExpense{inset:4px;width:calc(100vw - 8px);max-height:calc(100dvh - 8px);padding:8px}
 body #costRatesDialog.weekendExpense .rateGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
 body #costRatesDialog.weekendExpense .rateGrid>label{grid-column:auto}
 body #costRatesDialog.weekendExpense header h2{font-size:17px}
}
@media(max-width:420px){body #costRatesDialog.weekendExpense>.rateGrid>label:first-child,body #costRatesDialog.weekendExpense>.rateGrid>label:nth-child(3){grid-column:1/-1}}

/* Tariff history uses the same compact workspace as weekend expenses. */
body #costRatesDialog.tariffHistory{position:fixed;inset:8px;margin:auto;width:calc(100vw - 16px);height:auto;max-height:calc(100dvh - 16px);padding:12px;overflow-y:auto;font-size:14px}
body #costRatesDialog.tariffHistory header{background:#0b3855!important;color:white;padding:8px 10px!important;border-radius:10px;gap:10px}
body #costRatesDialog.tariffHistory header h2{font-size:20px;min-width:0}
body #costRatesDialog.tariffHistory p{margin:8px 0;line-height:1.35}
body #costRatesDialog.tariffHistory p:empty{display:none}
body #costRatesDialog.tariffHistory>.rateGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:end;margin:10px 0}
body #costRatesDialog.tariffHistory :is(input,select){min-height:40px;padding:7px;font:inherit;border:1px solid #cbd9e9;border-radius:8px}
body #costRatesDialog.tariffHistory .btn{min-width:0;min-height:40px;padding:8px 12px;font-size:14px;white-space:normal;background:#1263e6;color:white}
body #costRatesDialog .currentRatesButton{align-self:end;min-height:40px;background:#1263e6;color:white}
body #costRatesDialog.tariffHistory .rateHistoryLine{gap:8px;padding:6px 0}
body #costRatesDialog.tariffHistory .rateHistoryLine>span{min-width:0;overflow-wrap:anywhere}
@media(max-width:650px){body #costRatesDialog.tariffHistory{inset:4px;width:calc(100vw - 8px);max-height:calc(100dvh - 8px);padding:8px}body #costRatesDialog.tariffHistory>.rateGrid{grid-template-columns:repeat(2,minmax(0,1fr))}body #costRatesDialog.tariffHistory .currentRatesButton{grid-column:1/-1}body #costRatesDialog.tariffHistory header h2{font-size:17px}}

body #driverCostRows .driverCostName{background:none;border:0;color:#153b54;font:inherit;font-weight:700;text-align:left;padding:5px 0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
body #driverCostRows .driverCostName:focus-visible{outline:2px solid #1263e6;outline-offset:3px}
body #driverCostChoices .driverCostChoiceActions{display:flex;gap:8px;flex-wrap:wrap}
body #driverCostChoices .btn{flex:1;min-width:150px;min-height:40px;background:#1263e6;color:white}
body #driverCostChoices td{width:100%!important;grid-column:1/-1}

/* Keep the entire hours entry workflow together in one fluid row. */
body #hourlyTariffDialog #hourlyCostSettings .rateGrid.hourEntryRow{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.65fr) minmax(0,.55fr) minmax(0,1.45fr) minmax(0,1.25fr) minmax(0,1.5fr);align-items:end;gap:8px;width:100%}
body #hourlyTariffDialog .hourEntryRow>*{min-width:0;max-width:100%;box-sizing:border-box}
body #hourlyTariffDialog .hourEntryRow input:not([type=checkbox]){width:100%;box-sizing:border-box}
body #hourlyTariffDialog .hourEntryRow .hourlyPause{display:flex;min-height:40px;line-height:1.2;font-size:14px}
body #hourlyTariffDialog .hourEntryRow .btn{width:100%;white-space:normal;overflow-wrap:anywhere}
@media(max-width:700px){body #hourlyTariffDialog #hourlyCostSettings .rateGrid.hourEntryRow{gap:4px}body #hourlyTariffDialog .hourEntryRow :is(label,.btn,input){font-size:11px;padding:4px}body #hourlyTariffDialog .hourEntryRow .hourlyPause{font-size:11px;gap:3px}}

/* Keep driver editing available through names; only remove redundant toolbar entries. */
@layer clbvMobileWorkspace {
 body #driverCostsPanel .costActions > :is(#openDayCostForm,#openHourlyTariff,#weeklyExpenseOpen) {display:none!important}
 body #driverCostsDialog #driverCostsPanel .costActions {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}
 body #driverCostsDialog #driverCostsPanel .costActions > button.btn {grid-column:auto!important;min-width:0!important;width:100%!important;white-space:normal!important}
}
/* Driver costs: compact normal-flow header; never cover the toolbar on scroll. */
@layer portal-sticky-header {
 @media screen {
  body dialog#driverCostsDialog#driverCostsDialog :is(.portalBackHeader,.driverDetailHead),
  body dialog#driverCostsDialog#driverCostsDialog>header {
   position:relative!important;top:auto!important;inset:auto!important;
   min-height:48px!important;height:auto!important;margin:0 0 6px!important;
   padding:6px 10px!important;gap:10px!important;
  }
  body dialog#driverCostsDialog#driverCostsDialog :is(.portalBackHeader,.driverDetailHead)::before {
   width:40px!important;height:40px!important;min-width:40px!important;
   background-size:contain!important;
  }
  body dialog#driverCostsDialog#driverCostsDialog :is(.portalBackHeader,.driverDetailHead) img {
   width:40px!important;height:40px!important;object-fit:contain!important;
  }
  body dialog#driverCostsDialog#driverCostsDialog #driverCostsPanel {
   box-sizing:border-box!important;width:100%!important;min-height:100%!important;
   padding:8px!important;margin:0!important;
  }
  body dialog#driverCostsDialog#driverCostsDialog #driverCostsPanel .costActions>button.btn {
   min-height:36px!important;padding:5px 7px!important;font-size:14px!important;
  }
  body dialog#driverCostsDialog#driverCostsDialog #driverCostHoursCaption,
  body dialog#driverCostsDialog#driverCostsDialog #driverCostPlanned {
   font-size:12px!important;line-height:1.3!important;margin:5px 0!important;
  }
  body dialog#driverCostsDialog#driverCostsDialog #driverCostPlanned {padding:5px 8px!important}
  body dialog#driverCostsDialog#driverCostsDialog #driverCostSaveStatus {margin:4px 0!important;padding:5px 8px!important;font-size:13px!important}
 }
 @media screen and (min-width:1001px) {
  body dialog#driverCostsDialog#driverCostsDialog #driverCostsPanel .driverCostOverview :is(th,td) {
   padding:3px 8px!important;height:auto!important;font-size:14px!important;line-height:1.2!important;
  }
  body dialog#driverCostsDialog#driverCostsDialog #driverCostRows .driverCostName {
   min-height:28px!important;height:auto!important;padding:4px 9px!important;
   font-size:14px!important;line-height:1.2!important;max-width:100%!important;
   white-space:normal!important;text-decoration:none!important;
  }
 }
 @media screen and (max-width:1000px) {
  body dialog#driverCostsDialog#driverCostsDialog #driverCostRows .driverCostName {min-height:44px!important;height:auto!important;max-width:100%!important;white-space:normal!important}
 }
}


/* Compact tariff history: wrap text and actions instead of clipping. */
body #costRatesDialog.tariffHistory{padding:10px!important;font-size:14px!important;overflow:auto!important}
body #costRatesDialog.tariffHistory header{flex-wrap:wrap!important;overflow:visible!important;gap:8px!important}
body #costRatesDialog.tariffHistory header h2{flex:1;min-width:160px;overflow-wrap:anywhere;font-size:18px!important}
body #costRatesDialog.tariffHistory>.rateGrid{grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr))!important;margin:8px 0!important}
body #costRatesDialog.tariffHistory>.rateGrid>*{grid-column:auto!important;min-width:0!important}
body #costRatesDialog.tariffHistory .rateHistoryLine{display:flex!important;flex-wrap:wrap!important;padding:4px 0!important;gap:6px 12px!important;align-items:center!important}
body #costRatesDialog.tariffHistory .rateHistoryLine>span{flex:1 1 300px;line-height:1.35;overflow-wrap:anywhere}
body #costRatesDialog.tariffHistory .rateHistoryLine>.actions{display:flex!important;flex:0 1 auto!important;flex-wrap:wrap!important;overflow:visible!important;gap:6px!important;margin:0!important;max-width:100%}
body #costRatesDialog.tariffHistory .rateHistoryLine .btn{flex:1 1 auto!important;min-height:36px!important;padding:6px 10px!important;margin:0!important;height:auto!important;white-space:normal!important;overflow-wrap:anywhere}
@media(max-width:600px){body #costRatesDialog.tariffHistory .rateHistoryLine>.actions{flex:1 1 100%!important}body #costRatesDialog.tariffHistory .rateHistoryLine .btn{min-height:44px!important}}
