@@ -85,40 +85,84 @@ export function LogSheet({ logSheet }: LogSheetProps) {
8585 const totalHours = statusRows . reduce ( ( sum , row ) => sum + totals [ row . key ] , 0 ) ;
8686
8787 return (
88- < section className = "rounded-xl border border-gray-300 bg-white p-3 shadow-lg" >
89- < h3 className = "mb-2 text-lg font-semibold text-gray-900" > Driver's Daily Log</ h3 >
90-
91- < div className = "mb-2 flex flex-wrap gap-x-4 gap-y-1 rounded border border-gray-300 px-2 py-1.5 text-xs text-gray-800" >
92- < span >
93- < span className = "font-semibold" > Date:</ span > { logSheet . date }
94- </ span >
95- < span >
96- < span className = "font-semibold" > Carrier:</ span > Spotter ELD
97- </ span >
98- < span >
99- < span className = "font-semibold" > Total Miles:</ span > { logSheet . total_miles . toFixed ( 1 ) }
100- </ span >
88+ < section className = "rounded-xl border border-gray-300 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-800" >
89+ < div className = "mb-3 flex flex-wrap items-end justify-between gap-2 border-b border-gray-200 pb-2 dark:border-gray-700" >
90+ < div >
91+ < h3 className = "text-base font-semibold text-gray-900 dark:text-gray-100" >
92+ Driver's Daily Log
93+ </ h3 >
94+ < p className = "text-[11px] uppercase tracking-wide text-gray-500 dark:text-gray-400" >
95+ (One per 24-hour period)
96+ </ p >
97+ </ div >
98+ < div className = "flex flex-wrap gap-x-4 gap-y-0.5 text-xs text-gray-800 dark:text-gray-200" >
99+ < span >
100+ < span className = "font-semibold" > Date:</ span > { logSheet . date }
101+ </ span >
102+ < span >
103+ < span className = "font-semibold" > Carrier:</ span > Spotter ELD
104+ </ span >
105+ < span >
106+ < span className = "font-semibold" > Total Miles:</ span > { " " }
107+ { logSheet . total_miles . toFixed ( 1 ) }
108+ </ span >
109+ </ div >
101110 </ div >
102111
103- { /* Fluid layout: 24 hour bands × 4 fifteen-minute ticks — fits container width, no horizontal scroll */ }
104- < div className = "w-full max-w-full overflow-hidden rounded border border-gray-300" >
105- < div className = "flex min-h-[22px] border-b border-gray-300 bg-black text-[9px] font-semibold leading-none text-white" >
112+ { /* FMCSA-style identification fields. Blank lines preserve the look of the
113+ paper form; values are intentionally empty in this app. */ }
114+ < div className = "mb-3 grid gap-2 text-[11px] text-gray-800 sm:grid-cols-2 dark:text-gray-200" >
115+ < div className = "flex items-end gap-2 border-b border-gray-300 pb-0.5 dark:border-gray-600" >
116+ < span className = "font-semibold uppercase tracking-wide text-gray-600 dark:text-gray-400" >
117+ Driver:
118+ </ span >
119+ < span className = "flex-1" > </ span >
120+ </ div >
121+ < div className = "flex items-end gap-2 border-b border-gray-300 pb-0.5 dark:border-gray-600" >
122+ < span className = "font-semibold uppercase tracking-wide text-gray-600 dark:text-gray-400" >
123+ Co-Driver:
124+ </ span >
125+ < span className = "flex-1 text-gray-500 dark:text-gray-500" > N/A</ span >
126+ </ div >
127+ < div className = "flex items-end gap-2 border-b border-gray-300 pb-0.5 dark:border-gray-600" >
128+ < span className = "font-semibold uppercase tracking-wide text-gray-600 dark:text-gray-400" >
129+ Vehicle No:
130+ </ span >
131+ < span className = "flex-1" > </ span >
132+ </ div >
133+ < div className = "flex items-end gap-2 border-b border-gray-300 pb-0.5 dark:border-gray-600" >
134+ < span className = "font-semibold uppercase tracking-wide text-gray-600 dark:text-gray-400" >
135+ Trailer No:
136+ </ span >
137+ < span className = "flex-1" > </ span >
138+ </ div >
139+ </ div >
140+
141+ { /* Fluid layout: 24 hour bands × 4 fifteen-minute ticks — fits container
142+ width, no horizontal scroll. The grid is intentionally anchored to a
143+ white "paper" surface even in dark mode, matching the FMCSA paper
144+ form — it sits inside the dark card like a printed sheet. */ }
145+ < div className = "w-full max-w-full overflow-hidden rounded border border-gray-300 bg-white text-gray-900 dark:border-gray-600" >
146+ < div className = "flex min-h-[24px] border-b border-gray-300 bg-black text-[10px] font-semibold leading-none text-white" >
106147 < div className = "flex w-[5.25rem] shrink-0 items-center justify-center border-r border-gray-600 px-0.5 py-1" >
107148 Status
108149 </ div >
150+ { /* 24 hour-label cells matching the 24 hour columns in the data
151+ rows below, plus a fixed-width "Mid-nght" boundary marker on the
152+ right. The data rows have a matching empty spacer of the same
153+ width so the 24 hour columns stay aligned with their labels. */ }
109154 < div className = "flex min-w-0 flex-1" >
110155 { HOURS . map ( ( hour ) => (
111156 < div
112157 key = { hour }
113158 className = { `flex min-w-0 flex-1 items-center justify-center whitespace-pre-line border-r border-gray-600 py-0.5 text-center leading-tight ${
114- hour === 0 || hour === 12 ? "text-[8px ] font-bold text-yellow-300" : ""
159+ hour === 0 || hour === 12 ? "text-[9px ] font-bold text-yellow-300" : ""
115160 } `}
116161 >
117162 { HOUR_LABELS [ hour ] }
118163 </ div >
119164 ) ) }
120- { /* Right midnight boundary marker */ }
121- < div className = "flex w-[2.2ch] shrink-0 items-center justify-center whitespace-pre-line border-l border-gray-600 py-0.5 text-center text-[8px] font-bold leading-tight text-yellow-300" >
165+ < div className = "flex w-10 shrink-0 items-center justify-center whitespace-pre-line py-0.5 text-center text-[9px] font-bold leading-tight text-yellow-300" >
122166 { "Mid-\nnght" }
123167 </ div >
124168 </ div >
@@ -134,7 +178,7 @@ export function LogSheet({ logSheet }: LogSheetProps) {
134178 </ div >
135179 < div className = "flex min-w-0 flex-1" >
136180 { HOURS . map ( ( hour ) => (
137- < div key = { hour } className = "flex min-w-0 flex-1 border-r border-gray-200 last:border-r-0 " >
181+ < div key = { hour } className = "flex min-w-0 flex-1 border-r border-gray-300 " >
138182 { [ 0 , 1 , 2 , 3 ] . map ( ( quarter ) => {
139183 const slot = hour * 4 + quarter ;
140184 const active = slots [ slot ] === row . key ;
@@ -149,6 +193,9 @@ export function LogSheet({ logSheet }: LogSheetProps) {
149193 } ) }
150194 </ div >
151195 ) ) }
196+ { /* Empty spacer matching the right "Mid-nght" header cell so the
197+ 24 hour columns stay perfectly aligned with the labels above. */ }
198+ < div className = "w-10 shrink-0 bg-white" aria-hidden = "true" />
152199 </ div >
153200 < div className = "flex w-14 shrink-0 items-center justify-center border-l border-gray-300 px-0.5 py-0.5 text-[11px] font-semibold tabular-nums" >
154201 { totals [ row . key ] . toFixed ( 2 ) }
@@ -158,17 +205,27 @@ export function LogSheet({ logSheet }: LogSheetProps) {
158205 </ div >
159206
160207 < div className = "mt-2 grid gap-2 md:grid-cols-[1fr_auto] md:items-start" >
161- < div className = "rounded border border-gray-300 px-2 py-1.5" >
162- < p className = "mb-1 text-[11px] font-semibold uppercase tracking-wide text-gray-700" > Remarks</ p >
163- < ul className = "space-y-0.5 text-[11px] leading-snug text-gray-700" >
208+ < div className = "rounded border border-gray-300 px-2 py-1.5 dark:border-gray-600 dark:bg-gray-900/40" >
209+ < p className = "mb-1 text-[11px] font-semibold uppercase tracking-wide text-gray-700 dark:text-gray-300" >
210+ Remarks
211+ </ p >
212+ < ul className = "space-y-0.5 text-[11px] leading-snug text-gray-700 dark:text-gray-200" >
164213 { remarks . map ( ( remark , index ) => (
165214 < li key = { `${ remark } -${ index } ` } > { remark } </ li >
166215 ) ) }
167216 </ ul >
168217 </ div >
169- < div className = "rounded border border-gray-300 px-2 py-1.5 text-[11px] md:min-w-[11rem]" >
170- < p className = "mb-1 font-semibold uppercase tracking-wide text-gray-700" > Daily Check</ p >
171- < p className = { Math . abs ( totalHours - 24 ) <= 0.25 ? "font-semibold text-green-700" : "font-semibold text-red-700" } >
218+ < div className = "rounded border border-gray-300 px-2 py-1.5 text-[11px] md:min-w-[11rem] dark:border-gray-600 dark:bg-gray-900/40" >
219+ < p className = "mb-1 font-semibold uppercase tracking-wide text-gray-700 dark:text-gray-300" >
220+ Daily Check
221+ </ p >
222+ < p
223+ className = {
224+ Math . abs ( totalHours - 24 ) <= 0.25
225+ ? "font-semibold text-green-700 dark:text-green-400"
226+ : "font-semibold text-red-700 dark:text-red-400"
227+ }
228+ >
172229 Sum: { totalHours . toFixed ( 2 ) } / 24.00 h
173230 </ p >
174231 </ div >
0 commit comments