:root{font-family:Arial,"Noto Sans",sans-serif;color:#244455;background:#f4f7fa;font-size:16px}*{box-sizing:border-box}body{margin:0}main{max-width:1450px;margin:auto;padding:24px}header{border-bottom:1px solid #cbd9e2}h1{font-size:26px}h2{font-size:20px}a{color:#245f82}form#entry,section{background:white;border:1px solid #d2dfe8;border-radius:10px;padding:18px;margin:18px 0}fieldset{border:0;padding:0;margin:0}legend{font-weight:bold;margin-bottom:14px}.grid{display:flex;flex-wrap:wrap;gap:12px}label{display:flex;flex-direction:column;gap:6px;flex:1 1 230px;min-width:0}.wide{flex-basis:480px}input,select,button{font:inherit;min-height:42px;border:1px solid #b7cdda;border-radius:6px;padding:9px;max-width:100%}select,input{width:100%;background:white;color:inherit}button{background:#eef5fa;color:#245f82;cursor:pointer}#save{background:#246885;color:white}button:disabled{opacity:.6;cursor:default}.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:15px}th{background:#edf4f8}td,th{padding:10px;border-bottom:1px solid #d9e4eb;vertical-align:top}td{overflow-wrap:anywhere}td small{display:block;margin-top:4px;color:#526b78}td button{font-size:14px;padding:6px;margin:2px}#message{white-space:pre-wrap}#message.error{color:#a32c27}dialog{width:min(800px,94vw);border:1px solid #bdced9;border-radius:12px;max-height:90vh;overflow:auto}dialog::backdrop{background:#17374666}.history-item{border-bottom:1px solid #d9e4eb;padding:12px 0;white-space:pre-wrap}[hidden]{display:none!important}:focus-visible{outline:3px solid #72abc9;outline-offset:2px}@media(max-width:600px){main{padding:12px}form#entry,section{padding:12px}.wide{flex-basis:100%}table{min-width:850px}}
:root #oa-module-sidebar nav{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}#oa-module-sidebar button[aria-current="page"]{background:#246885;color:white}#category-help{color:#526b78;font-size:14px;margin-top:-8px}
/* Event history only; manager tracking/ledger and company-time forms unchanged. */
#history-panel section[aria-labelledby="history-title"] #query{gap:8px;align-items:end}
#history-panel section[aria-labelledby="history-title"] #query label{flex:0 1 150px;font-size:13px;gap:4px}
#history-panel section[aria-labelledby="history-title"] #query label.wide{flex:1 1 240px}
#history-panel section[aria-labelledby="history-title"] #query .actions{margin:0;gap:6px}
#history-panel section[aria-labelledby="history-title"] #query :is(input,button){min-height:34px;padding:5px 7px;font-size:13px}
#history-panel section[aria-labelledby="history-title"] table{table-layout:fixed;min-width:830px;font-size:13px;line-height:1.35}
#history-panel section[aria-labelledby="history-title"] :is(td,th){padding:5px 6px}
#history-panel section[aria-labelledby="history-title"] th:nth-child(1){width:18%}#history-panel section[aria-labelledby="history-title"] th:nth-child(2){width:7%}#history-panel section[aria-labelledby="history-title"] th:nth-child(3){width:22%}#history-panel section[aria-labelledby="history-title"] th:nth-child(4){width:13%}#history-panel section[aria-labelledby="history-title"] th:nth-child(5){width:16%}#history-panel section[aria-labelledby="history-title"] th:nth-child(6){width:12%}#history-panel section[aria-labelledby="history-title"] th:nth-child(7){width:12%}
#rows td:first-child small{white-space:nowrap;font-size:10px;overflow-wrap:normal}
#rows td:first-child small [data-gate-ui]{display:block;white-space:normal}
#rows td:last-child{white-space:nowrap}#rows td:last-child button{min-height:30px;padding:4px 6px;font-size:12px;margin:0 2px}
#rows .gate-event-driver{font-size:12px;margin-top:3px}
.company-times-table{table-layout:fixed;min-width:1000px;font-size:13px}.company-times-table th,.company-times-table td{padding:8px 6px}.company-times-table th:nth-child(1){width:7%}.company-times-table th:nth-child(2){width:14%}.company-times-table th:nth-child(3){width:16%}.company-times-table th:nth-child(4){width:9%}.company-times-table th:nth-child(5){width:11%}.company-times-table th:nth-child(6),.company-times-table th:nth-child(7){width:18%}.company-times-table th:nth-child(8){width:7%}.company-times-table input{font-size:12px;min-height:36px;padding:4px}.company-times-table .company-plate{font-weight:bold;white-space:nowrap}.company-times-table small{font-weight:normal;font-size:11px}.company-times-table button{font-size:12px;padding:6px}.company-times-table input:disabled{color:#244455;background:#f0f5f8;opacity:1}#company-error{font-size:13px;color:#246885}#history-panel>summary{cursor:pointer;padding:12px 0;font-weight:bold}
.company-times-table{min-width:960px}.company-times-table th:nth-child(1){width:18%}.company-times-table th:nth-child(2){width:17%}.company-times-table th:nth-child(3){width:13%}.company-times-table th:nth-child(4){width:19%}.company-times-table th:nth-child(5){width:24%}.company-times-table th:nth-child(6){width:9%}.company-time-fields{display:flex;gap:5px;align-items:center}.company-time-fields input[type=date]{flex:1 1 115px;min-width:105px;width:115px}.company-time-fields input[type=text]{flex:0 0 70px;width:70px;text-align:center;font:15px/1.2 monospace}.company-time-fields select{width:74px;min-width:0;min-height:36px;padding:4px;font:14px/1.2 monospace}.company-time-fields select:disabled{color:#244455;background:#f0f5f8;opacity:1}.company-times-table .company-plate small{white-space:normal}.company-planned strong{display:block;font-size:17px;line-height:1.5}
.company-time-fields input[type=datetime-local]{width:100%;min-width:0;font:13px/1.2 sans-serif;min-height:36px}.company-times-table th:nth-child(1){width:17%}.company-times-table th:nth-child(2){width:14%}.company-times-table th:nth-child(3){width:13%}.company-times-table th:nth-child(4),.company-times-table th:nth-child(5){width:24%}.company-times-table th:nth-child(6){width:8%}
.manager-checkbox{flex:0 1 210px;flex-direction:row;align-items:center;align-self:center}.manager-checkbox input{width:20px;min-height:20px;height:20px}#manager-help{font-size:13px;color:#526b78;margin:10px 0}#manager-quick{margin:0}#manager-quick button{min-width:160px;font-weight:bold}#manager-quick button[data-manager-direction=out]{background:#246885;color:white}#manager-quick button[data-manager-direction=in]{background:#e1f2ea;color:#215e48}#manager-matches{font-size:12px;color:#526b78}#entry .grid{gap:10px}#entry label{flex-basis:220px}#entry label.wide{flex-basis:100%}
.manager-history-table{font-size:14px}.manager-history-table td,.manager-history-table th{padding:6px}.manager-history-table td:last-child{white-space:nowrap;min-width:140px}.manager-history-table td button{min-height:30px;padding:4px 6px;font-size:12px}.manager-history-table td:nth-child(3){min-width:140px}.manager-history-table td small{font-size:11px;margin-top:3px}#entry #manager-search-field,#entry #manager-field,#entry #manager-transport-field{flex-basis:220px}#entry .manager-checkbox{flex-basis:190px}#entry #manager-vehicle-field{flex-basis:190px}
.manager-person-picker{position:relative}#manager-options{position:absolute;z-index:20;top:100%;left:0;right:0;max-height:240px;overflow:auto;background:white;border:1px solid #b7cdda;border-radius:6px;box-shadow:0 6px 18px #17374626}#manager-options button{display:block;width:100%;text-align:left;border:0;border-radius:0;padding:9px;background:white;font-size:14px}#manager-options button:hover,#manager-options button[aria-selected=true]{background:#e2eff7}#manager-options p{padding:8px;font-size:13px}.manager-roundtrip-table{font-size:14px;table-layout:fixed;min-width:760px}.manager-roundtrip-table th:nth-child(1){width:24%}.manager-roundtrip-table th:nth-child(2){width:16%}.manager-roundtrip-table th:nth-child(3){width:14%}.manager-roundtrip-table th:nth-child(4){width:34%}.manager-roundtrip-table th:nth-child(5){width:12%}.manager-roundtrip-table td,.manager-roundtrip-table th{padding:7px}.manager-roundtrip-table input{font-size:13px;padding:5px;min-height:36px}.manager-roundtrip-table button{font-size:12px;padding:5px;min-height:32px}.manager-roundtrip-table small{font-size:11px}#manager-trip-message{font-size:13px;color:#246885}#entry #manager-search-field{flex-basis:330px}
:root { --gate-review-note: #77521a; }
#manager-ledger{padding:12px;margin:12px 0}
#manager-ledger h2{margin:0 0 8px}
#manager-ledger p{margin:6px 0;font-size:13px}
#manager-ledger-query{gap:8px;align-items:flex-end}
#manager-ledger-query label{gap:3px;font-size:14px}
#manager-ledger-query input,#manager-ledger-query button{min-height:34px;padding:5px 8px;font-size:14px}
#manager-ledger-query .actions{margin-top:0;gap:6px}
#manager-ledger table{font-size:14px;line-height:1.35}
#manager-ledger td,#manager-ledger th{padding:5px 7px;vertical-align:middle}
#manager-ledger .manager-day-band th{padding:6px 7px;border-top:2px solid #8db5cd;background:#d5e8f4;color:#204c68}
#manager-ledger .manager-row-actions{gap:4px}
#manager-ledger td:last-child .manager-row-actions button{min-height:28px;margin:0;font-size:12px;padding:3px 6px!important}
#manager-ledger td small{margin-top:2px;font-size:11px}
.return-transport summary { cursor: pointer; font-size: 12px; padding: 3px 0; }
.return-transport select,.return-transport input { margin-top: 3px; font-size: 13px; }
.review-hint { color: var(--gate-review-note); line-height: 1.5; }
.manager-review-help { font-size: 12px; color: #526b7b; margin: 6px 0; }
.manager-day-band th { background: #d5e8f4; color: #204c68; text-align: left; padding: 10px 8px; border-top: 2px solid #8db5cd; font-weight: 700; }
.manager-roundtrip-table .trip-direction{display:block;margin:0 0 2px;color:#456778}.manager-roundtrip-table .return-transport{font-size:11px;margin-top:2px}.manager-roundtrip-table td{vertical-align:middle}.manager-roundtrip-table small:empty{display:none}.manager-checkbox{display:flex;align-items:center;gap:6px}.manager-checkbox input{width:auto;min-height:0}
.manager-datetime{display:flex;align-items:center;gap:3px}.manager-datetime input[type=date]{flex:1;min-width:120px;width:135px}.manager-datetime select{width:58px;flex:none;padding:5px 2px;min-height:36px}.manager-datetime input{box-sizing:border-box}.time-field{display:flex;flex-direction:column;gap:4px;flex:1 1 280px}#entry #time-field{flex-basis:280px}
.manager-roundtrip-table{min-width:1000px}.manager-roundtrip-table th:nth-child(1){width:20%}.manager-roundtrip-table th:nth-child(2),.manager-roundtrip-table th:nth-child(3){width:28%}.manager-roundtrip-table th:nth-child(4){width:16%}.manager-roundtrip-table th:nth-child(5){width:8%}.manager-saved-date,.manager-saved-time{display:block}.manager-saved-time{font-size:16px;line-height:1.5}.manager-roundtrip-table .return-transport{font-size:13px}
.manager-history-fixed>summary{display:none}.manager-history-fixed{display:block}#manager-ledger td:last-child button,.manager-roundtrip-table td:last-child button{margin:2px;font-size:12px;padding:4px;min-height:30px}#manager-edit{width:min(760px,90vw);border:1px solid #b7cdda;border-radius:8px}#manager-edit::backdrop{background:#17374655}#manager-edit .grid>label,#manager-edit .grid>.edit-clock{flex:1 1 280px}#manager-edit .edit-clock>span{display:block;margin-bottom:5px}#manager-action-status{font-size:13px;color:#246885}
.manager-roundtrip-table th:nth-child(1){width:20%}.manager-roundtrip-table th:nth-child(4){width:10%}.manager-roundtrip-table th:nth-child(5){width:14%}.manager-row-actions{display:flex;align-items:center;gap:4px;flex-wrap:nowrap;white-space:nowrap}.manager-row-actions button{margin:0!important;padding:4px 6px!important;flex:none}.manager-time-warning td{background:#fff0ef;color:#a12626}.manager-time-warning td:nth-child(2),.manager-time-warning td:nth-child(3){font-weight:600}.manager-warning-note{max-width:330px;font-size:12px;line-height:1.5}.manager-warning-note [data-gate-ui]{display:block}#manager-ledger-warning{color:#a12626;font-size:13px}#manager-delete{max-width:430px;border:1px solid #b7cdda;border-radius:8px}#manager-delete::backdrop{background:#17374655}
#manager-ledger-rows .manager-overnight-approved td,#manager-trip-rows .manager-overnight-approved td{background:#fff5cf;color:#654c13}
/* Keep all five columns visible on a narrow desktop without changing controls. */
#manager-trips .table-wrap{container-type:inline-size}
@container (min-width:820px) and (max-width:1199px){
 .manager-roundtrip-table{min-width:0}
 .manager-roundtrip-table th:nth-child(1){width:26%}
 .manager-roundtrip-table th:nth-child(2),.manager-roundtrip-table th:nth-child(3){width:18%}
 .manager-roundtrip-table th:nth-child(4){width:10%}
 .manager-roundtrip-table th:nth-child(5){width:28%}
 .manager-roundtrip-table .manager-datetime{display:grid;grid-template-columns:58px 8px 58px;gap:3px;align-items:center}
 .manager-roundtrip-table .manager-datetime input[type=date]{grid-column:1/-1;min-width:0;width:100%}
 .manager-roundtrip-table .manager-datetime select{font-size:14px;width:58px}
 .manager-roundtrip-table [data-trip-person]{font-size:13px;padding:5px}
}
@container (min-width:1200px){
 .manager-roundtrip-table{min-width:0}
 .manager-roundtrip-table th:nth-child(1){width:20%}
 .manager-roundtrip-table th:nth-child(2),.manager-roundtrip-table th:nth-child(3){width:22%}
 .manager-roundtrip-table th:nth-child(4){width:12%}
 .manager-roundtrip-table th:nth-child(5){width:24%}
}
/* Keep both actual-time controls and Save in the ordinary desktop pane. */
@media screen{#company-dispatch .company-times-table{min-width:850px;width:100%}}
.gate-inline-entry>td{padding:8px!important;background:#f1f8fb}.gate-inline-entry #fields{margin:0;padding:8px;border-color:#9bbccc}.gate-inline-entry .grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 10px}.gate-inline-entry .grid .wide{grid-column:span 2}.gate-inline-entry #reason-field{grid-column:auto}.gate-inline-entry #time-field{grid-column:span 2}.gate-inline-entry input,.gate-inline-entry select{padding:6px 8px;font-size:13px}.gate-inline-entry .actions{margin-top:6px}.gate-inline-entry legend{font-size:13px}
@media(max-width:650px){.gate-inline-entry .grid{grid-template-columns:1fr}.gate-inline-entry .grid .wide,.gate-inline-entry #time-field,.gate-inline-entry #reason-field{grid-column:auto}}
.gate-inline-entry #fields .grid{display:grid!important;gap:6px 10px!important}.gate-inline-entry #fields .grid>label,.gate-inline-entry #fields .grid>.time-field{min-width:0;gap:4px}.gate-inline-entry #fields input,.gate-inline-entry #fields select{padding:6px 8px!important}
#supplier-time24:not([hidden]){display:flex;align-items:center;gap:5px;min-width:0}
#supplier-time24 .manager-datetime{flex:1;min-width:0}
.company-time-fields>div,.company-time-fields .manager-datetime{width:100%;min-width:0}.company-time-fields .manager-datetime{flex-wrap:wrap}.company-time-fields .manager-datetime input[type=date]{flex:1 1 100%;min-width:0;width:100%;min-height:30px}.company-time-fields .manager-datetime select{width:54px;min-height:30px;font-size:13px}.company-time-fields .manager-datetime{gap:2px}
#company-dispatch .company-times-table th:nth-child(4){width:17%}#company-dispatch .company-times-table th:nth-child(5){width:25%}#company-dispatch .company-times-table th:nth-child(6){width:14%}#company-dispatch td:last-child button{display:inline-block;margin:0 3px 3px 0}#company-dispatch .company-departures-table th:nth-child(1){width:20%}#company-dispatch .company-departures-table th:nth-child(2){width:20%}#company-dispatch .company-departures-table th:nth-child(3){width:17%}#company-dispatch .company-departures-table th:nth-child(4){width:25%}#company-dispatch .company-departures-table th:nth-child(5){width:18%}
#supplier-time24 input[type=date]{min-width:100px;width:100%;padding:6px 8px}
#supplier-time24 select{width:58px;min-width:58px;padding:5px 2px!important}
#supplier-time24 button{flex:none;padding:6px 8px;white-space:nowrap}
@media(max-width:480px){#supplier-time24:not([hidden]){flex-wrap:wrap}}

/* Emphasize the plate in every company-car stage. */
.company-times-table .company-plate-number{display:block;font-size:22px;font-weight:700;line-height:1.3;white-space:nowrap}

/* History remains compact and scrolls independently of active entry forms. */
#company-history-query{gap:8px;align-items:flex-end;margin:10px 0}
#company-history-query label{flex:0 1 180px;font-size:13px;gap:3px}
#company-history-query label.wide{flex:1 1 280px}
#company-history-query .actions{margin:0;gap:6px}
#company-history-query :is(input,button){min-height:34px;padding:5px 8px;font-size:13px}
#company-history-count{font-size:13px;margin:8px 0}
#company-dispatch .company-history-scroll{max-height:350px;overflow:auto;border:1px solid #d9e4eb;border-radius:6px;scrollbar-gutter:stable}
#company-dispatch .company-history-table{min-width:920px;font-size:13px;line-height:1.25}
#company-dispatch .company-history-table :is(th,td){padding:5px 7px;vertical-align:middle}
#company-dispatch .company-history-table th{position:sticky;top:0;z-index:1;background:#edf4f8;box-shadow:0 1px #d9e4eb}
#company-dispatch .company-history-table th:nth-child(1){width:18%}
#company-dispatch .company-history-table th:nth-child(2){width:14%}
#company-dispatch .company-history-table th:nth-child(3){width:18%}
#company-dispatch .company-history-table th:nth-child(4),#company-dispatch .company-history-table th:nth-child(5){width:19%}
#company-dispatch .company-history-table th:nth-child(6){width:12%}
#company-dispatch .company-history-table .company-plate-number{font-size:17px;line-height:1.25}
#company-dispatch .company-history-table small{font-size:11px;line-height:1.2;margin-top:2px}
#company-dispatch .company-history-table time{white-space:nowrap}
#company-dispatch .company-history-actions{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
#company-dispatch .company-history-actions small{flex-basis:100%;order:2;margin:0}
#company-dispatch .company-history-actions button{min-height:28px;padding:3px 6px;font-size:12px;margin:0}
#company-dispatch .company-history-state{font-size:11px;color:#526b78;white-space:nowrap}
#company-dispatch .company-history-table [data-feedback]:empty{display:none}

@media screen and (max-width:600px) {
  #manager-trips .manager-roundtrip-table {min-width:1100px;}
  html body :is(#manager-edit,#manager-delete)[data-oa-detail-standard] {
    inset-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right));
    width:auto;
    margin-inline:0;
  }
}
