#content .profitCompact .summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:8px 0}
#content .profitCompact .summaryitem{min-width:0;padding:7px 9px;min-height:56px}
#content .profitCompact .summaryitem strong{font-size:14px;overflow-wrap:anywhere}
#content .profitCompact .summaryitem small{font-size:9px;line-height:1.15}
.profitReportGroup{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(360px,1fr);gap:12px;align-items:start;margin:12px 0}.profitReportGroup>h3{grid-column:1/-1;margin:0}.profitReportGroup .panel{margin:0}.profitReportGroup>table,.profitReportGroup>.tablewrap{margin:0;min-width:0}.profitReportGroup table{font-size:12px}.profitReportGroup .profitChartRow{grid-template-columns:80px minmax(80px,1fr) 150px}
.profitAnalysis>.panelhead{padding:10px 14px}.profitAnalysis>.panelhead h2{font-size:18px}.profitAnalysis>.panelbody{padding:0 12px 12px}.profitAnalysis .profitReportGroup .panelhead h2,.profitAnalysis .profitReportGroup>h3,.profitAnalysis .jobMarginReport .panelhead h2{display:none}.profitAnalysis .jobMarginReport{grid-column:1/-1;margin-top:12px}
.profitChart .panelbody{padding:14px}.profitChartLegend{display:flex;gap:16px;margin-bottom:10px}.profitChartLegend span:first-child{color:#2563eb}.profitChartLegend span:last-child{color:#ef4444}.profitChartRow{display:grid;grid-template-columns:85px minmax(100px,1fr) 180px;gap:10px;align-items:center;margin:8px 0}.profitChartBars{display:grid;gap:3px}.profitChartBar{height:10px;border-radius:3px}.profitBar{background:#2563eb}.expenseBar{background:#ef4444}.profitChartRow>span{font-size:12px;text-align:right}.profitChart small{display:block;margin-top:12px;color:#64748b}
.profitOperatingNote{margin:0 0 12px;padding:9px 12px;border-left:3px solid #2563eb;background:#eff6ff;color:#475569;font-size:12px;line-height:1.45}
.profitCalculationHint{margin:12px 0 0;padding:10px 12px;border-left:3px solid #64748b;background:#f8fafc;color:#475569;font-size:12px;line-height:1.5}
.incomeChart .profitChartLegend span:first-child{color:#059669}.incomeChart .profitChartLegend span:last-child{color:#7c3aed}.incomeLabourBar{background:#10b981}.incomePartsBar{background:#8b5cf6}
.expenditureChart .profitChartLegend span:first-child{color:#ea580c}.expenditureChart .profitChartLegend span:last-child{color:#dc2626}.purchaseExpenseBar{background:#f97316}.otherExpenseBar{background:#dc2626}
@media(max-width:1100px){.profitReportGroup{grid-template-columns:1fr}.profitReportGroup>table,.profitReportGroup>.tablewrap{grid-column:1}.profitReportGroup .profitChartRow{grid-template-columns:70px minmax(60px,1fr)}}
@media(max-width:900px){#content .profitCompact .summary{grid-template-columns:repeat(2,minmax(0,1fr))}.profitChartRow{grid-template-columns:70px minmax(60px,1fr);}.profitChartRow>span{grid-column:2;text-align:left}}
.profitAnalysis .profitReportGroup .panelhead h2,.profitAnalysis .jobMarginReport .panelhead h2{display:none}.profitAnalysis .profitReportGroup>h3{display:block;grid-column:1/-1;margin:0}.profitAnalysis .incomeGroup{order:1}.profitAnalysis .expenditureGroup{order:2}.profitAnalysis .profitGroup{order:3}.profitAnalysis .jobMarginReport{order:4}.profitAnalysis .profitGroup:before{content:'Profit vs Expenditure';grid-column:1/-1;font-size:18px;font-weight:700;color:#1e293b}.profitAnalysis .expenditureGroup>h3{font-size:0}.profitAnalysis .expenditureGroup>h3:after{content:'Total Expenditure by Source';font-size:18px}
.profitAnalysis>.panelbody{display:flex;flex-direction:column}.profitAnalysis .profitReportGroup,.profitAnalysis .jobMarginReport{flex:none}
.profitAnalysis .profitReportGroup{display:flex;flex-direction:column}.profitAnalysis .profitReportGroup>h3{order:0}.profitAnalysis .profitReportGroup>.panel{order:1}.profitAnalysis .profitReportGroup>.tablewrap,.profitAnalysis .profitReportGroup>table{order:2}.profitAnalysis .profitGroup:before{order:0}.profitAnalysis .profitGroup>.panel{order:1}.profitAnalysis .profitGroup>.tablewrap,.profitAnalysis .profitGroup>table{order:2}
.profitAnalysis h3,.profitAnalysis .jobMarginReport .panelhead{display:flex;align-items:center;justify-content:space-between;gap:8px}.profitExport{margin-left:auto;padding:7px 12px;height:32px;font-size:12px;line-height:1;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;background:#2563eb;color:#fff;border:0;border-radius:4px;box-shadow:0 2px 4px rgba(37,99,235,.25)}.profitExport:before{content:'⇩';font-size:17px;font-weight:800;line-height:1;margin-right:6px}.profitExport:hover{filter:brightness(.92);transform:translateY(-1px)}
.profitReportGroup~.profitReportGroup{min-width:0}.toolbar:has(#profitPeriod){display:flex;flex-wrap:wrap;gap:6px;align-items:center;overflow:visible}.toolbar:has(#profitPeriod) .search{min-width:120px;max-width:190px}.toolbar:has(#profitPeriod) [data-action="printReport"]{display:none}.toolbar:has(#profitPeriod) label{white-space:nowrap}
.profitAnalysis .profitGroup .panelhead h2,.profitAnalysis .jobMarginReport .panelhead h2{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:18px}
.toolbar:has(#profitPeriod){flex-wrap:nowrap;gap:4px;white-space:nowrap;overflow:hidden}.toolbar:has(#profitPeriod)>label:first-child{width:92px}.toolbar:has(#profitPeriod)>label:first-child select{width:100%;min-width:0}.toolbar:has(#profitPeriod) .search{width:135px;min-width:0}.toolbar:has(#profitPeriod)>label:not(:first-child){display:flex;align-items:center;gap:3px}.toolbar:has(#profitPeriod)>label:not(:first-child) input{width:112px;min-width:0}.toolbar:has(#profitPeriod) .spacer{display:block;flex:1;min-width:4px}.toolbar:has(#profitPeriod)>button[data-action="export"]{margin-left:auto;flex:0 0 auto;padding:7px 10px}
.profitCompact .summaryitem:nth-child(2){display:none}
.profitCompact .summaryitem:nth-child(5) strong,.profitCompact .summaryitem:nth-child(7) strong,.jobMarginReport table td:last-child{font-weight:800;color:#b91c1c}.jobMarginReport table td:last-child{background:#fef2f2}.profitCompact .summaryitem:nth-child(5),.profitCompact .summaryitem:nth-child(7){border-bottom:3px solid #dc2626}
.profitAnalysis .tablewrap{overflow-x:auto}.profitAnalysis table{width:100%;table-layout:fixed}.profitAnalysis th,.profitAnalysis td{white-space:normal;overflow-wrap:anywhere;word-break:break-word}
@media(max-width:900px){.profitAnalysis table{font-size:10px}.profitAnalysis th,.profitAnalysis td{padding:5px 4px}.profitAnalysis .jobMarginReport table{font-size:9px}.profitAnalysis .jobMarginReport th,.profitAnalysis .jobMarginReport td{padding:4px 3px}}
