:root{--app-header-h:58px;--sticky-gap:8px;--app-sticky-top:calc(var(--app-header-h) + var(--sticky-gap));--view-controls-h:46px}
body{font-family:Inter,Arial,sans-serif;margin:0;background:#0b1220;color:#e5e7eb}
header{padding:14px 16px;border-bottom:1px solid #243041;background:#0f172a;position:sticky;top:0;z-index:60}
h1{margin:0 0 10px 0;font-size:20px}.controls{display:flex;gap:8px;flex-wrap:wrap}
main{padding:14px;display:grid;gap:14px}.panel{border:2px solid #243041;background:#0f172a;border-radius:12px;padding:12px}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.between{justify-content:space-between}.end{justify-content:flex-end}
input,select,button{background:#111827;color:#e5e7eb;border:1px solid #374151;border-radius:8px;padding:7px 9px}
input[type="checkbox"],input[type="radio"]{width:auto;height:auto;padding:0;border:none;background:transparent;accent-color:#22c55e}
button{cursor:pointer}.viewBtn.active,.filterBtn.active{border-color:#22c55e}.hidden{display:none !important}.muted{color:#93a4bf}
button.btnSuccess{background:#14532d !important;border-color:#22c55e !important;color:#dcfce7 !important}
button.btnDanger{background:#5f1d1d !important;border-color:#ef4444 !important;color:#fee2e2 !important}
button.btnInfo{background:#1e3a8a !important;border-color:#3b82f6 !important;color:#dbeafe !important}
button.btnWarn{background:#7c2d12 !important;border-color:#f97316 !important;color:#ffedd5 !important}
button.btnNeutral{background:#334155 !important;border-color:#64748b !important;color:#e2e8f0 !important}
button.btnExit{background:#854d0e !important;border-color:#facc15 !important;color:#fef9c3 !important}
.compactResourceTable th,.compactResourceTable td{font-size:12px;padding:4px 6px;line-height:1.2}
.compactResourceTable a{color:#93c5fd;text-decoration:none}
.compactResourceTable a:hover{text-decoration:underline}
#viewSwitchRow{gap:6px;flex-wrap:wrap}
.customViewChip{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border:1px solid #334155;border-radius:999px;background:#111827;font-size:12px}
.customViewChip.active{border-color:#22c55e;background:#0b2a1a}
.customViewChip.pinned{box-shadow:inset 0 0 0 1px #eab308}
.customViewChip.drag-over{outline:2px dashed #60a5fa;outline-offset:2px}
.customPinBtn{padding:1px 4px;line-height:1;font-size:12px}
.customViewName{cursor:pointer}
.customViewMenuWrap{position:relative}
.customViewMenuBtn{padding:1px 6px;line-height:1}
.customViewMenu{position:absolute;top:20px;right:0;display:grid;gap:4px;background:#0f172a;border:1px solid #334155;border-radius:8px;padding:6px;z-index:20}
.customViewMenu.hidden{display:none !important}
#addCustomViewBtn{font-weight:800;padding:4px 10px}
.iconBtn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0}
#eventTypeFilterBtn{border-color:#4b5f79;color:#dbe7f6}
#eventTypeFilterBtn:hover{border-color:#7aa2d8}
#eventTypeFilterMenu{min-width:180px;max-height:280px;overflow:auto}
.entryPanelForm{display:block;width:100%;max-width:760px}
.entryPanelForm label{display:grid;grid-template-columns:180px 420px;align-items:center;gap:8px;margin:6px 0}
.entryPanelForm label input,.entryPanelForm label select{width:420px;max-width:420px;box-sizing:border-box}
.entryPanelForm label .inlinePair{display:flex;gap:8px;width:420px;max-width:420px}
.entryPanelForm label .inlinePair select{width:206px;max-width:206px}
.entryPanelForm label .inlinePair input{width:300px;max-width:300px}
.entryPanelForm label .inlinePair button{width:112px;max-width:112px;padding:7px 6px}
.entryPanelForm label.hidden{display:none !important}
.entryPanelForm label.checkboxLabel{display:flex;align-items:center;gap:8px;grid-template-columns:none}
.peopleCard{border:2px solid #334155;border-radius:10px;padding:12px;background:#0b1324;margin-bottom:10px}
.peopleCard h4{margin:0 0 8px 0;color:#cbd5e1}
.docTypeBtn.active{border-color:#22c55e;background:#0b2a1a}
.docDropZone{width:420px;height:140px;border:1px dashed #64748b;border-radius:10px;background:#334155;color:#e5e7eb;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;margin-left:188px}
.docDropIcon{font-size:30px;line-height:1}
.docLayout{display:flex;gap:24px;align-items:flex-start}
.docListPanel{min-width:260px;max-width:320px;border:1px solid #334155;border-radius:10px;padding:10px;background:#0b1324}
.calendarGrid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.dayHead{font-size:11px;line-height:1;color:#9db0ce;padding:1px 4px}
.dayCell{height:clamp(92px,11.5vh,140px);border:2px solid #2a3a52;border-radius:10px;padding:8px;background:#0b1324;display:flex;flex-direction:column;gap:6px;position:relative;overflow:hidden}
.dayItems{display:flex;flex-direction:column;gap:6px;overflow:auto;min-height:0;flex:1;padding-right:2px}
.dayItems > *,.weekItems > *{flex:0 0 auto}
.dayCell.weekend{background:#172032}
.dayCell.today{background:#1f2f4d; border-color:#4f46e5}
.dayCell.today.weekend{background:#25375a}
.dayCell.empty{visibility:hidden;pointer-events:none}
.dayCell .date{font-size:12px;color:#9db0ce}
.dayAddBtn{position:absolute;top:6px;right:6px;width:24px;height:24px;padding:0;border-radius:999px;font-weight:700;font-size:16px;line-height:1;display:none;align-items:center;justify-content:center;background:#1f2937;border:1px solid #4b5563;color:#e5e7eb}
body.ios-mobile .dayAddBtn{display:flex}
.dayAddBtn:active{transform:scale(.97)}
.tripPill{font-size:11px;background:#1f2937;border:1px solid #334155;border-radius:999px;padding:3px 7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tripPill.tripExpanded{white-space:nowrap;line-height:1.15;border-radius:10px;text-overflow:ellipsis}
.tripPill.stPlanning,.tlItem.stPlanning{background:#713f12;border-color:#f59e0b;color:#fef3c7}
.tripPill.stHold,.tlItem.stHold{background:#1e3a8a;border-color:#3b82f6;color:#dbeafe}
.tripPill.stReleased,.tlItem.stReleased{background:#14532d;border-color:#22c55e;color:#dcfce7}
.tripPill.stCancelled,.tlItem.stCancelled{background:#7f1d1d;border-color:#ef4444;color:#fee2e2}
.tripPill.conflictPill,.tlItem.conflictPill,.mxDutyText.conflictPill{position:relative;border-color:#ef4444 !important;box-shadow:inset 0 0 0 1px rgba(239,68,68,.45)}
.tripPill.conflictPill::before,.tlItem.conflictPill::before,.mxDutyText.conflictPill::before{content:'';display:inline-block;width:8px;height:8px;border-radius:999px;background:#ef4444;box-shadow:0 0 0 2px rgba(127,29,29,.35);margin-right:6px;vertical-align:middle}
.tripPill.mxQuick,.tlItem.mxQuick{background:#14532d;border-color:#22c55e;color:#dcfce7}
.tripPill.mxLong,.tlItem.mxLong{background:#713f12;border-color:#f59e0b;color:#fef3c7}
.tripPill.mxOos,.tlItem.mxOos{background:#7f1d1d;border-color:#ef4444;color:#fee2e2}
.mxDutyText{font-size:11px;padding:2px 4px;margin-bottom:3px;color:#f8fafc;background:rgba(148,163,184,.18);border-left:3px solid #38bdf8;border-radius:4px;cursor:pointer;white-space:pre-line;overflow:hidden;text-overflow:ellipsis;line-height:1.25}
.weekGrid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.weekCol{border:2px solid #2a3a52;border-radius:10px;height:clamp(110px,18vh,170px);padding:8px;background:#0b1324;display:flex;flex-direction:column;overflow:hidden;position:relative}
.weekItems{display:flex;flex-direction:column;gap:6px;overflow:auto;min-height:0;flex:1;padding-right:2px}
.weekCol.today{background:#1f2f4d;border-color:#4f46e5}
.weekCol.today.weekend{background:#25375a}
.timelineBoard{display:grid;gap:8px;overflow:auto}
.timelineCard{border:1px solid #334155;border-radius:10px;padding:8px;background:#0b1324}
.timelineGrid{display:grid;grid-template-columns:220px repeat(7,minmax(170px,1fr));border:1px solid #334155;border-radius:10px;overflow:hidden}
.tlCell{border-right:1px solid #243041;border-bottom:1px solid #243041;min-height:72px;padding:6px;background:#0b1324}
.tlHead{background:#111a2c;font-weight:600;color:#cbd5e1;position:sticky;top:0;z-index:1}
.tlRes{background:#0f172a;font-weight:600;position:sticky;left:0;z-index:1}
.tlResLabel{display:flex;align-items:center;gap:6px;font-weight:600}
.tlResLabel input{transform:scale(1.05)}
.tlResOff{opacity:.55}
#calendarWorkspace{display:grid;grid-template-columns:280px minmax(0,1fr) 360px;gap:12px;align-items:start}
#calendarWorkspace.resourcesCollapsed.eventsCollapsed{gap:0}
#calendarWorkspace.resourcesCollapsed{grid-template-columns:0 minmax(0,1fr) 360px}
#calendarWorkspace.eventsCollapsed{grid-template-columns:280px minmax(0,1fr) 0}
#calendarWorkspace.resourcesCollapsed.eventsCollapsed{grid-template-columns:0 minmax(0,1fr) 0}
#calendarMain{min-width:0;display:grid;gap:12px}
#monthPanel{height:calc(100vh - var(--app-sticky-top) - var(--view-controls-h) - 32px);overflow:hidden;position:sticky;top:calc(var(--app-sticky-top) + var(--view-controls-h) + 8px);padding:6px 8px 8px}
#monthGrid{height:100%;grid-template-rows:16px repeat(6,minmax(0,1fr));align-content:stretch}
#monthPanel .dayCell{height:clamp(92px,11.5vh,140px);min-height:0}
.dayItems,.weekItems{scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.45) transparent}
.dayItems::-webkit-scrollbar,.weekItems::-webkit-scrollbar{width:6px}
.dayItems::-webkit-scrollbar-thumb,.weekItems::-webkit-scrollbar-thumb{background:rgba(148,163,184,.42);border-radius:999px}
.dayItems::-webkit-scrollbar-track,.weekItems::-webkit-scrollbar-track{background:transparent}
#timelineResourceWrap{padding:8px;position:sticky;top:var(--app-sticky-top);max-height:calc(100vh - var(--app-sticky-top) - 16px);overflow:hidden;z-index:30;font-size:11px}
#timelineResourceHeader{margin-bottom:8px}
#viewControlPanel{position:sticky;top:var(--app-sticky-top);z-index:40;width:fit-content;max-width:calc(100% - 120px);justify-self:center}
#tlResourceCollapse{font-weight:600;font-size:11px;padding:6px 8px}
#timelineResourcePicker{display:grid;grid-template-columns:1fr;gap:10px;max-height:calc(100vh - var(--app-sticky-top) - 72px);overflow:auto;padding-right:4px}
#timelineResourceWrap.collapsed #timelineResourcePicker{display:none}
#calendarWorkspace.resourcesCollapsed #timelineResourceWrap{padding:0;min-width:0;width:max-content;justify-self:start;overflow:visible;border:none;background:transparent;box-shadow:none}
#calendarWorkspace.resourcesCollapsed #timelineResourceHeader{margin-bottom:0}
#calendarWorkspace.resourcesCollapsed #tlResourceCollapse{writing-mode:horizontal-tb;transform:none;height:auto;min-width:34px;padding:6px 8px;font-weight:600}

#calendarEventsWrap{position:sticky;top:var(--app-sticky-top);max-height:calc(100vh - var(--app-sticky-top) - 16px);overflow:hidden;padding:8px;z-index:30}
#calendarEventsHeader{margin-bottom:8px}
#calendarEventsHeaderLeft{gap:8px;align-items:center}
#calendarEventsFilters{gap:6px}
#eventsHorizonSelect{min-width:130px;font-size:11px;padding:4px 6px}
#eventsHorizonDays{width:72px;font-size:11px;padding:4px 6px}
#calendarEventsWrap,#calendarEventsWrap table,#calendarEventsWrap th,#calendarEventsWrap td,#calendarEventsWrap button{font-size:11px}
#calendarEventsWrap th,#calendarEventsWrap td{padding:6px 8px}
#calendarEventsBody{max-height:calc(100vh - var(--app-sticky-top) - 96px);overflow:auto;padding-right:4px}
#calendarEventsWrap.collapsed #calendarEventsBody,#calendarEventsWrap.collapsed #calendarEventsFilters{display:none}
#calendarEventsWrap.collapsed #calendarEventsHeaderLeft > :not(#collapseEventsBtn){display:none}
#calendarEventsWrap.collapsed #calendarEventsHeader{justify-content:flex-start}
#calendarWorkspace.eventsCollapsed #calendarEventsWrap{padding:0;min-width:0;width:max-content;justify-self:end;overflow:visible;border:none;background:transparent;box-shadow:none}
#calendarWorkspace.eventsCollapsed #calendarEventsHeader{margin-bottom:0}
#calendarWorkspace.eventsCollapsed #collapseEventsBtn{writing-mode:horizontal-tb;transform:none;height:auto;min-width:34px;padding:6px 8px;font-weight:600}
.tlPickGroupWrap{display:flex;flex-direction:column;min-width:0}
.tlPickGroup{border:1px solid #334155;border-radius:8px;padding:4px;background:#0b1324;height:124px;overflow:visible;display:flex;flex-direction:column}
.tlPickTitleRow{display:flex;align-items:center;justify-content:space-between;position:relative;margin-bottom:5px}
.tlPickTitle{font-size:11px;font-weight:700;color:#e2e8f0}
.tlMenuBtn{padding:0 5px;line-height:1;font-size:10px}
.tlPickMenu{position:absolute;top:50%;right:22px;transform:translateY(-50%);display:flex;flex-direction:row;gap:4px;z-index:12;padding:3px 4px;border:1px solid #334155;border-radius:8px;background:#020817;box-shadow:0 6px 14px rgba(0,0,0,.45)}
.tlPickMenu.hidden{display:none !important}
.tlPickMenu button{padding:2px 6px;font-size:10px;line-height:1.1;background:#0f172a;border:1px solid #334155;border-radius:6px;color:#cbd5e1;text-align:center;white-space:nowrap}
.tlPickMenu button:hover{background:#111f34;border-color:#3b82f6;color:#e2e8f0}
.tlGroup-department{max-width:none}
.tlPickEntries{display:grid;column-gap:6px;row-gap:1px;overflow:auto;flex:1;padding-top:2px;align-content:start;grid-auto-rows:min-content}
.tlPickEntries.oneCol{grid-template-columns:1fr}
.tlPickEntries.twoCol{grid-template-columns:repeat(2,minmax(110px,1fr))}
.tlPickGroup label{display:inline-grid;grid-template-columns:14px auto;align-items:center;column-gap:4px;margin:0;color:#cbd5e1;font-size:11px;line-height:1.05;width:max-content;max-width:max-content;justify-self:start}
#crewIdExtraButtons{display:flex;gap:8px;flex-wrap:wrap}
.settingsCard{border:2px solid #334155;border-radius:10px;padding:14px;margin:12px 0;background:#0b1324}
.settingsCard h4{margin:0}
.settingsCardHead{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.settingsGrid{display:grid;grid-template-columns:repeat(3,minmax(240px,1fr));gap:12px;align-items:end}
.flightLogEditorGrid{grid-template-columns:repeat(4,minmax(180px,1fr));}
@media (max-width:1400px){.flightLogEditorGrid{grid-template-columns:repeat(3,minmax(180px,1fr));}}
@media (max-width:1024px){.flightLogEditorGrid{grid-template-columns:repeat(2,minmax(180px,1fr));}}
.settingsGrid label{min-width:0}

.aircraftMxGrid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(420px,0.8fr);gap:12px;align-items:start}
.aircraftUsageAuditCard{border:1px solid #334155;border-radius:10px;padding:10px;background:#0b1324}
.aircraftUsageAuditListWrap{max-height:340px;overflow:auto;border:1px solid #223047;border-radius:8px}
.aircraftUsageAuditTable{width:100%;border-collapse:collapse;font-size:12px}
.aircraftUsageAuditTable th,.aircraftUsageAuditTable td{padding:6px 8px;border-bottom:1px solid #203046;vertical-align:top}
.aircraftUsageAuditTable th{position:sticky;top:0;background:#0f1e35;z-index:1}
@media (max-width:1200px){.aircraftMxGrid{grid-template-columns:1fr}}
body.light .aircraftUsageAuditCard{background:#eef3f9;border-color:#b8c6d6}
body.light .aircraftUsageAuditListWrap{border-color:#cbd5e1}
body.light .aircraftUsageAuditTable th{background:#dde7f2}
body.light .aircraftUsageAuditTable th, body.light .aircraftUsageAuditTable td{border-bottom-color:#d5deea}
.settingsGrid label input,.settingsGrid label select{width:100%;box-sizing:border-box}
.settingsGrid label.checkboxLabel{display:inline-flex;align-items:center;gap:8px;align-self:end}
.settingsGrid label.checkboxLabel input[type="checkbox"]{width:auto;flex:0 0 auto}
.settingsGrid button{justify-self:start}
th,td{padding:10px 12px}
#eventTypesBody tr.inactiveRow{opacity:.55}
#audienceWrap{position:relative}
.audienceCol{grid-column:3}
#audienceWrap .audienceMenu{position:absolute;z-index:30;right:0;left:auto}
.audienceMenu{border:1px solid #334155;border-radius:10px;background:#0f172a;padding:10px;display:grid;gap:6px;min-width:240px;margin-top:6px}
.audienceMenu.hidden{display:none !important}
.audRow{display:grid;grid-template-columns:1fr 24px;align-items:center;column-gap:12px;min-height:30px}
.audRow span{display:block}
.audRow input[type="checkbox"]{margin:0;justify-self:center;align-self:center}
#globalAudienceBtn{width:100%;text-align:left}
@media(max-width:1700px){#calendarWorkspace{grid-template-columns:240px minmax(0,1fr) 320px;}#calendarWorkspace.resourcesCollapsed{grid-template-columns:0 minmax(0,1fr) 320px}}
@media(max-width:1300px){#calendarWorkspace,#calendarWorkspace.resourcesCollapsed,#calendarWorkspace.eventsCollapsed,#calendarWorkspace.resourcesCollapsed.eventsCollapsed{grid-template-columns:1fr;}#timelineResourceWrap,#calendarEventsWrap{position:relative;top:0;max-height:none}#timelineResourcePicker,#calendarEventsBody{max-height:none}#viewControlPanel{max-width:100%;justify-self:stretch}#monthPanel{height:auto;overflow:visible;position:relative;top:0}#monthGrid{height:auto;grid-template-rows:auto}}
.tlSlot{position:relative}
.tlSlot.weekend{background:#172032}
.tlSlot.today{background:#1f2f4d;box-shadow:inset 0 0 0 2px #4f46e5}
.tlSlot.today.weekend{background:#25375a}
.tlHead.weekend{background:#172032}
.tlHead.today{background:#243a63;box-shadow:inset 0 -2px 0 #4f46e5}
.tlHead.today.weekend{background:#2a426f}
.tlItem{display:block;width:100%;text-align:left;font-size:11px;border:1px solid #3b82f6;background:#0f2a4a;border-radius:6px;padding:4px;margin-bottom:4px;color:#dbeafe}
.tlItem.tripExpanded{white-space:pre-line;line-height:1.15}
.tlItem.event{border-color:#a855f7;background:#2a1242;color:#f3e8ff}
.tlItem.mx{border-color:#f59e0b;background:#3a2506;color:#fde68a}
.modal{position:fixed;inset:0;background:rgba(2,6,23,.72);display:grid;place-items:center;padding:8px;z-index:5000}
.modal.hidden{display:none !important}
.modalCard{width:min(1680px,98vw);max-height:96vh;overflow:auto;background:#0f172a;border:1px solid #334155;border-radius:12px;padding:16px;box-sizing:border-box}
#adminModal .modalCard{width:min(1860px,99vw)}
#loginModal .modalCard{width:min(460px,92vw);max-width:92vw;overflow-x:hidden}
#loginModal .entryPanelForm{display:block;max-width:100%}
#loginModal .entryPanelForm label{display:flex;flex-direction:column;gap:6px;grid-template-columns:none;margin:6px 0;min-width:0}
#loginModal .entryPanelForm label input{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
#tripTopPanel{position:relative;top:auto;z-index:auto;background:#0f172a;isolation:isolate;border-bottom:none;box-shadow:none;margin:0}
#mxDutyBuilder .row > label{display:flex;flex-direction:column;gap:4px;min-width:160px}
.mxPicker{min-height:110px;max-height:140px;overflow:auto;border:1px solid #334155;border-radius:8px;padding:6px;display:flex;flex-direction:column;gap:4px}
.mxPickItem{display:flex;flex-direction:row !important;align-items:center;justify-content:space-between;gap:6px;font-size:12px}
.eventAttendeeList{min-width:220px;max-width:320px;border:1px solid #334155;border-radius:8px;padding:6px;max-height:120px;overflow:auto}
.eventAttendeeItem{display:flex;justify-content:space-between;align-items:center;font-size:12px;padding:2px 0}
.eventAttendeeItem button{padding:1px 6px;font-size:11px}
[id^="legDetailsPanel"] .row label{flex:1 1 180px}
[id^="legCrewRow"]{margin-bottom:2px}
[id^="legCrewRow"] label{min-width:130px}
#tripTopPanel{padding:8px 10px}
#tripTopPanel .row{margin:0}
#tripTopPanel label{margin-bottom:0;font-size:11px;line-height:1.1}
#tripTopGrid{display:block}
#tripTopFields .row{display:flex;gap:6px;flex-wrap:nowrap;align-items:flex-end}
#tripPeopleRow{margin-top:5px !important}
#tripRouteRow label{min-width:0;flex:1 1 0}
#tripRouteRow label:nth-child(1){max-width:108px;flex:0 0 108px}
#tripRouteRow label:nth-child(2){max-width:86px;flex:0 0 86px}
#tripRouteRow label:nth-child(3){max-width:190px;flex:0 0 190px}
#tripRouteRow label:nth-child(4){max-width:118px;flex:0 0 118px}
#tripRouteRow label:nth-child(5){max-width:150px;flex:0 0 150px}
#tripRouteRow label:nth-child(6){max-width:150px;flex:0 0 150px}
#tripPeopleRow label{min-width:0;max-width:150px;flex:0 0 150px}
#tripTopPanel input,#tripTopPanel select{height:30px;font-size:11px;padding:3px 7px;box-sizing:border-box}
#tripRouteRow input,#tripRouteRow select{height:30px !important;min-height:30px;box-sizing:border-box}
#authorizer{text-transform:uppercase;letter-spacing:.4px}
#tripTitle,#tripNumber{letter-spacing:.2px}
#tripTopPanel textarea{font-size:11px;padding:6px 8px;line-height:1.2;border-radius:8px;border:1px solid #334155;background:#111827;color:#dbe7f6}
body.light #tripTopPanel textarea{background:#ffffff !important;color:#1f2d3d !important;border-color:#aebfd3 !important}
body.light #tripStickyHeader{background:#f1f3f7 !important;border-bottom-color:#cfd6e1 !important;box-shadow:0 8px 14px rgba(148,163,184,.18)}
body.light #tripModalTopRow{background:transparent !important;border-bottom-color:#cfd6e1 !important}
body.light #tripTopPanel{background:#f1f3f7 !important;border-bottom:none !important;box-shadow:none !important}
#tripTopNotesWrap{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:10px}
#tripTopNotesWrap .tripNoteField{display:flex;flex-direction:column;gap:3px;min-width:0}
#tripTopNotesWrap textarea{min-height:38px;max-height:72px;height:40px;resize:vertical}
@media(max-width:1180px){#tripTopNotesWrap{grid-template-columns:1fr}}
.panelHead{display:flex;align-items:center;gap:8px}
.collapseSummary{display:none;margin-left:auto;font-size:12px;color:#9db0ce;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:70%}
.legReplanActions{display:inline-flex;gap:6px;margin-left:8px}
.legReplanActions > button{padding:2px 8px;font-size:12px}
.svcSideTools{display:flex;flex-direction:column;gap:4px;margin-top:6px}
.svcSideTools>button{padding:2px 6px;font-size:11px;line-height:1.2}
.tripFlowStrip{margin-top:6px;padding:6px;border:1px solid #2d3b52;border-radius:10px;background:#0b1628;display:flex;gap:8px;overflow-x:auto;align-items:center}
.tripFlowLegPair{min-width:108px;display:flex;flex-direction:column;align-items:center;gap:2px}
.tripFlowPill{padding:2px 8px;border:1px solid #4b5f79;border-radius:999px;font-size:11px;font-weight:600;letter-spacing:.1px}
.tripFlowTime{font-size:10px;color:#97a9c3}
.tripFlowConn{display:flex;align-items:center;gap:5px;min-width:132px}
.tripFlowTurnInput{width:58px;padding:2px 3px;font-size:10px;text-align:center}
.tripFlowLockBtn{padding:0;border:none;background:transparent;font-size:9px;font-weight:600;letter-spacing:.1px}
.tripFlowLockBtn.locked{color:#fca5a5}
.tripFlowLockBtn.unlocked{color:#9ca3af}
.collapseBtn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:26px;padding:0 10px;border-radius:999px;border:1px solid #334155;background:#1f2a44;color:#cfe0ff;font-size:11px;font-weight:700;letter-spacing:.1px;line-height:1;min-width:0;white-space:nowrap}
.collapseBtn:hover{background:#24324f;border-color:#3b82f6}
.collapseBtn:focus-visible{outline:2px solid #60a5fa;outline-offset:1px}
.legBulkBtn{background:#0f233d;border-color:#3b4f6b;color:#dbeafe}
.legBulkBtn:hover{background:#163052;border-color:#60a5fa}
.collapsiblePanel.collapsed > :not(.panelHead){display:none}
.collapsiblePanel.collapsed #tripTopGrid,.collapsiblePanel.collapsed #tripPassengerCard{display:none !important}
.collapsiblePanel.collapsed .collapseSummary{display:block}
#tripTopPanel .collapseSummary{margin-left:8px;max-width:none;text-align:left}
#tripTopPanel.collapsed #tripTopSummary{display:inline-flex;align-items:center}
[id^="legDetailsPanel"].collapsed > :not(h3){display:none}
[id^="legDetailsPanel"].collapsed h3 .collapseSummary{display:block}
[id^="legDetailsPanel"] h3{display:flex;align-items:flex-start;gap:8px}
[id^="legDetailsPanel"] h3 .legHdrActionStart{margin-left:auto}
[id^="legDetailsPanel"] h3 .collapseSummary{max-width:none;flex:1}
#tripStickyHeader{position:sticky;top:0;z-index:3300;background:#0f172a;padding:2px 0 8px;border-bottom:1px solid #22314a;box-shadow:0 10px 16px rgba(2,6,23,.35);isolation:isolate}
#tripModalTopRow{margin-bottom:4px;position:relative;top:auto;z-index:auto;background:transparent;padding:2px 0 6px;border-bottom:1px solid #22314a}
#tripHeaderTitle{display:flex;align-items:baseline;gap:8px}
#eventHeaderTitle{display:flex;align-items:baseline;gap:8px}
.conflictBadge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;background:#b91c1c;border:1px solid #ef4444;color:#fee2e2;font-size:11px;font-weight:700;line-height:1.2}
.conflictBadge.hidden{display:none !important}
body.light .conflictBadge{background:#ef4444;border-color:#b91c1c;color:#fff1f2}
#modalDateInline{font-size:13px;color:#9db0ce;font-weight:500}
#tripHeaderActions{gap:6px;align-items:flex-end;flex-wrap:wrap}
#tripStatusHeaderLabel{display:flex;flex-direction:column;gap:3px;min-width:140px;font-size:11px;color:#9db0ce;margin-right:4px}
#tripStatusHeaderLabel select{min-width:140px;height:30px;font-size:11px}
#createTripBtn{background:#166534;border-color:#22c55e;color:#ecfdf5}
#updateTripBtn{background:#1d4ed8;border-color:#60a5fa;color:#eff6ff}
#releaseTripBtn{background:#334155;border-color:#64748b;color:#e2e8f0}
@keyframes pulseBlue{0%,100%{box-shadow:0 0 0 0 rgba(59,130,246,.45)}50%{box-shadow:0 0 0 6px rgba(59,130,246,.15)}}
@keyframes pulseYellow{0%,100%{box-shadow:0 0 0 0 rgba(234,179,8,.45)}50%{box-shadow:0 0 0 6px rgba(234,179,8,.15)}}
@keyframes pulseGreen{0%,100%{box-shadow:0 0 0 0 rgba(34,197,94,.45)}50%{box-shadow:0 0 0 6px rgba(34,197,94,.15)}}
#tripModalCard.tripPulsePlanning{animation:pulseBlue 1.8s infinite}
#tripModalCard.tripPulseHold{animation:pulseYellow 1.8s infinite}
#tripModalCard.tripPulseReleased{animation:pulseGreen 1.8s infinite}
#tripModal .row{gap:10px}
#tripModal label{display:flex;flex-direction:column;gap:4px;min-width:150px}
#tripModal .end button{min-width:100px}
#legOpsRow label{min-width:120px}

#tripModal .legTopRow{align-items:flex-end;gap:8px}
#tripModal .legTopRow label{min-width:0}
#tripModal .legTopRow .icaoField{width:88px;flex:0 0 88px}
#tripModal .legTopRow .icaoField input{text-transform:uppercase;text-align:center;letter-spacing:.6px}
#tripModal .legTopRow .dtField{width:150px;flex:0 0 150px}
#tripModal .legTopRow .dtField.timeField{width:120px;flex:0 0 120px}
#tripModal [id^="legCrewRow"] label{width:122px;min-width:122px;flex:0 0 122px}
#tripModal [id^="legCrewRow"] label:first-child{width:140px;min-width:140px;flex:0 0 140px}
#tripModal .legBlockTime{display:flex;align-items:center;justify-content:center;height:34px;padding:0 10px;border:1px solid #334155;border-radius:8px;background:#111827;color:#dbe7f6;font-size:12px;font-weight:700;min-width:96px}
#tripModal .legFlightLogCard{margin-top:2px;padding:4px 6px;border-color:#2f3a4e;background:transparent}
#tripModal .legFlightLogHead{margin-bottom:4px}
#tripModal .legFlightLogBody{display:grid;gap:4px;position:relative;padding-right:314px}
#tripModal .legFlightLogBody.hidden{display:none}
#tripModal #collapseLegFlightLogBtn{min-width:110px}
#flightLogEditorModal .flightLogEditorModalCard{max-height:92vh;display:flex;flex-direction:column}
#flightLogEditorMount{margin-top:6px;overflow:auto;min-height:220px}
#flightLogEditorMount .legFlightLogBody{display:grid;gap:10px;position:relative;padding-right:0}
#flightLogEditorMount .flightLogRowCompact{gap:10px;flex-wrap:wrap;align-items:flex-end}
#flightLogEditorMount .flightLogRowCompact label{width:180px;flex:0 0 180px;font-size:12px;line-height:1.2}
#flightLogEditorMount .flightLogRowCompact input,#flightLogEditorMount .flightLogRowCompact select{font-size:12px;height:34px;padding:6px 8px;border:1px solid #334155;border-radius:8px;background:#0f172a;width:100%;box-sizing:border-box}
#flightLogEditorMount .flightLogRowCompact label.inlineCheck{width:74px;flex:0 0 74px;min-width:74px}
#flightLogEditorMount .flightLogRowCompact .inlineCheck{height:auto;padding:0;border:none;border-radius:0;background:transparent;display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px}
#flightLogEditorMount .flightLogRowCompact .inlineCheck input{width:16px;height:16px;margin:0}
#flightLogEditorMount .flightLogRowCompact .inlineCheck span{display:block;font-size:11px;line-height:1.1;color:#cbd5e1;white-space:nowrap;text-align:center}
body.light #flightLogEditorMount .flightLogRowCompact .inlineCheck span{color:#334155}
#flightLogEditorMount .flightLogOooiRow label.oooiField{width:260px;flex:0 0 260px}
#flightLogEditorMount .flightLogOooiRow .row{gap:8px !important;display:flex;align-items:center}
#flightLogEditorMount .flightLogOooiRow .row input[type="date"]{min-width:150px}
#flightLogEditorMount .flightLogOooiRow .row input[type="text"]{width:92px}
#flightLogEditorMount [id^="flFlightTime"],#flightLogEditorMount [id^="flBlockTime"]{height:34px;font-size:12px;padding:0 8px;display:flex;align-items:center;border:1px solid #334155;border-radius:8px;background:#0f172a;color:#dbe7f6}
#flightLogEditorMount #flFuelCostOut,#flightLogEditorMount #flDistanceOut{height:34px;display:flex;align-items:center;padding:0 8px;border:1px solid #334155;border-radius:8px;background:#0f172a}
#flightLogEditorMount .flightVorStack{position:static;display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:10px;width:100%;margin-top:2px}
body.light #flightLogEditorModal .flightLogEditorModalCard{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}
body.light #flightLogEditorMount .flightLogRowCompact input,
body.light #flightLogEditorMount .flightLogRowCompact select{background:#ffffff;border-color:#cbd5e1;color:#0f172a}
body.light #flightLogEditorMount #flFuelCostOut,
body.light #flightLogEditorMount #flDistanceOut,
body.light #flightLogEditorMount [id^="flFlightTime"],
body.light #flightLogEditorMount [id^="flBlockTime"]{background:#eef2f7;border-color:#cbd5e1;color:#1e293b}
body.light #flightLogEditorMount .flightLogRowCompact label{color:#334155}
#tripModal .legFlightLogBody label{min-width:96px;font-size:10px;line-height:1.05;gap:2px}
#tripModal .flightLogRowCompact{gap:4px;align-items:flex-end}
#tripModal .flightLogRowCompact label{min-width:0;width:112px;flex:0 0 112px}
#tripModal .flightLogRowCompact input,#tripModal .flightLogRowCompact select{font-size:10px;padding:1px 2px;height:20px;line-height:1.1;border:none;border-bottom:1px dotted #64748b;border-radius:0;background:transparent;box-shadow:none}
#tripModal .flightLogRowCompact input:focus,#tripModal .flightLogRowCompact select:focus{outline:none;border-bottom-color:#93c5fd}
#tripModal .flightLogRowCompact .inlineCheck{width:auto;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:0 4px;height:20px;border:none;border-radius:0;background:transparent;font-size:10px;line-height:1}
#tripModal .flightLogRowCompact .inlineCheck input{height:auto;padding:0;margin:0}
#tripModal .flightLogRowCompact .inlineCheck span{line-height:1;display:inline-block;transform:none}
#tripModal .legFlightLogBody input[type="checkbox"]{margin-right:0}
#tripModal .flightLogOooiRow label.oooiField{width:166px;flex:0 0 166px}
#tripModal [id^="flOutUtc"],#tripModal [id^="flOffUtc"],#tripModal [id^="flOnUtc"],#tripModal [id^="flInUtc"]{min-width:156px}
#tripModal [id^="flTakeoffType"],#tripModal [id^="flLandingType"]{min-width:64px;max-width:72px}
#tripModal .narrowType{width:78px;flex:0 0 78px}
#tripModal [id^="flFlightTime"],#tripModal [id^="flBlockTime"]{min-width:84px;border:none !important;background:transparent !important;padding:0 2px;height:20px;font-size:10px;color:#9db0ce;justify-content:flex-start}
#tripModal .smallLabel{font-size:9px}
#tripModal .smallLabel input{font-size:10px}
#tripModal .flightTypeRow{justify-content:flex-start}
#tripModal .flightVorStack{position:absolute;top:-28px;right:366px;display:grid;grid-template-columns:1fr;gap:4px;width:142px}
#tripModal .flightVorStack label{width:100%;flex:1 1 auto}
#tripModal .flightVorStack input,#tripModal .flightVorStack select{width:100%;max-width:none;box-sizing:border-box}
#tripModal [id^="flVorId"],#tripModal [id^="flVorBearing1"],#tripModal [id^="flVorBearing2"],#tripModal [id^="flVorCheckType"],#tripModal [id^="flVorCheckDateUtc"]{width:100%;max-width:100%;box-sizing:border-box}
.legServicesWrap{display:grid;grid-template-columns:minmax(860px,1fr) minmax(300px,360px);gap:10px;align-items:start}
.legPaxCard{padding:10px}
#legSelectedPassengers{max-height:360px;overflow:auto}
.servicesMatrix{border:1px solid #334155;border-radius:10px;padding:10px;background:#0b1324}
.legServicesWrap{display:grid;grid-template-columns:minmax(860px,1fr) minmax(300px,360px);gap:10px;align-items:start}
.legPaxCard{padding:10px}
.servicesHeader{font-weight:600;color:#c8d4ea;margin-bottom:8px}
.servicesCols{display:grid;grid-template-columns:84px repeat(7,minmax(96px,1fr)) 74px;gap:6px;font-size:12px;color:#9db0ce;margin-bottom:4px}
.servicesCols > div{text-align:center}
.servicesRowGrid{display:grid;grid-template-columns:84px repeat(7,minmax(96px,1fr)) 74px;gap:6px;margin-bottom:0}
.servicesRowGrid + .servicesRowGrid{margin-top:6px}
.servicesRowGrid>.svcSide{align-self:center;justify-self:center;width:100%;max-width:78px}
.svcSide{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:1px solid #4b5f79;border-radius:14px;background:#0f2138;color:#dbeafe;font-weight:700;padding:4px 8px;min-height:46px}
.svcSideLabelText{font-weight:800;letter-spacing:.35px;font-size:15px;line-height:1}
.svcToolsHead{font-size:11px;color:#9db0ce}
.svcEndTools{display:flex;flex-direction:column;gap:4px;align-items:stretch;justify-content:center;min-height:74px}
.svcSideBtn{padding:2px 6px;font-size:10px;line-height:1.15;border-radius:6px;width:100%}
.svcSideBtn.top{order:1}
.svcSideBtn.bottom{order:2}
#tripModal textarea.serviceBox{min-height:92px;resize:vertical;line-height:1.25;border-radius:10px;padding:8px}
#eventNotesWrap label{display:flex;flex-direction:column;justify-content:center;min-height:120px;gap:8px}
#eventNotes{min-height:110px;resize:vertical}

/* Event modal spacing/alignment for non-roster event types */
#eventModalCard:not(.rosterMode) #eventPrimaryRow,
#eventModalCard:not(.rosterMode) #eventDateRow,
#eventModalCard:not(.rosterMode) #eventTimeRow{gap:14px;align-items:flex-end}
#eventModalCard:not(.rosterMode) #eventPrimaryRow > label,
#eventModalCard:not(.rosterMode) #eventDateRow > label,
#eventModalCard:not(.rosterMode) #eventTimeRow > label{display:flex;flex-direction:column;gap:6px;min-width:170px}
#eventModalCard #eventPrimaryRow > label.hidden,
#eventModalCard #eventDateRow > label.hidden,
#eventModalCard #eventTimeRow > label.hidden{display:none !important}
#eventModalCard #eventAllDayWrap{display:inline-flex !important;flex-direction:row !important;align-items:center !important;gap:8px;min-width:auto;align-self:flex-end}
#eventModalCard #eventAllDayWrap input[type="checkbox"]{margin:0}
#eventModalCard:not(.rosterMode) #eventNameWrap{min-width:260px}
#eventModalCard:not(.rosterMode) #eventAttendeesWrap{min-width:320px}
#eventModalCard:not(.rosterMode) #eventAttendeesWrap .inlinePair{display:flex;gap:8px;align-items:center}
#eventModalCard:not(.rosterMode) #eventAttendeesWrap .inlinePair input{min-width:170px}
#eventModalCard:not(.rosterMode) #eventAttendeeList{margin-top:20px}
pre{background:#020617;border:1px solid #334155;border-radius:8px;padding:8px;max-height:120px;overflow:auto}
.hoverCard{position:fixed;z-index:9999;width:520px;max-width:94vw;max-height:280px;overflow:auto;background:#0b1324;color:#e5edf8;border:1px solid #334155;border-radius:10px;padding:8px;font-size:12px;line-height:1.35;box-shadow:0 12px 28px rgba(0,0,0,.45);pointer-events:none}
.hoverCard .muted{color:#94a3b8}
.hoverCardInner{display:flex;flex-direction:column;gap:6px}
.hoverHead{font-weight:800;color:#f8fafc}
.hoverTripGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.hoverCol{display:flex;flex-direction:column;gap:6px;min-width:0}
.hoverChips{display:flex;flex-wrap:wrap;gap:6px}
.hoverChip{display:inline-flex;gap:4px;align-items:center;border:1px solid #334155;border-radius:999px;padding:2px 8px;font-size:11px;background:#0f1a30}
.hoverChip.ok{border-color:#14532d;color:#86efac;background:#052e16}
.hoverChip.warn{border-color:#854d0e;color:#fde68a;background:#422006}
.hoverChip.bad{border-color:#7f1d1d;color:#fecaca;background:#450a0a}
.hoverNotes{border-top:1px dashed #334155;padding-top:5px}
body.light .hoverCard{background:#f8fafc;color:#111827;border-color:#94a3b8}
body.light .hoverCard .muted{color:#475569}
body.light .hoverHead{color:#0f172a}
body.light .hoverChip{background:#eef2f7;border-color:#cbd5e1;color:#0f172a}
@media (max-width:680px){.hoverTripGrid{grid-template-columns:1fr}}
.contextMenu{position:fixed;background:#111827;border:1px solid #334155;border-radius:8px;padding:6px;z-index:1000}
.contextMenu button{display:block;width:100%;text-align:left}
body.light .contextMenu{background:#dfe6ef !important;border-color:#9fb2c8 !important}
body.light .contextMenu button{background:#edf2f7 !important;color:#1f3044 !important;border-color:#a8bbd1 !important}
body.light #eventTypeFilterBtn{color:#29415d;border-color:#9fb2c8;background:#edf2f7}
.appToast{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:#16a34a;color:#fff;border:2px solid #dcfce7;border-radius:14px;padding:18px 34px;font-weight:800;font-size:28px;letter-spacing:.4px;z-index:12000;box-shadow:0 18px 42px rgba(0,0,0,.45);display:flex;flex-direction:column;gap:10px;align-items:center;min-width:360px;max-width:80vw;text-align:center}
.appToast.hidden{display:none !important}
.appToast.error{background:#b91c1c;border-color:#fecaca}
.appToast.info{background:#1d4ed8;border-color:#bfdbfe}
#appToastActions{justify-content:center;gap:10px}
#appToastOk,#appToastCancel{background:#fff;color:#111827;border:1px solid #d1d5db;border-radius:10px;padding:8px 16px;font-size:16px;font-weight:700}
#acVorDueDate.vorDueWarn{background:#fef08a;color:#111827;border-color:#eab308}
#acVorDueDate.vorDueOverdue{background:#ef4444;color:#fff;border-color:#b91c1c}
@media(max-width:900px){.calendarGrid,.weekGrid{grid-template-columns:repeat(2,1fr)}}
.rangeLabelBtn{background:transparent;border:none;color:inherit;font-weight:700;padding:4px 8px;border-radius:8px;cursor:pointer}
.rangeLabelBtn:hover{background:rgba(148,163,184,.16)}
.statusDot{display:inline-block;width:10px;height:10px;border-radius:999px;background:#64748b}
.statusDot.trip{background:#22c55e}.statusDot.event{background:#a855f7}.statusDot.mx{background:#f59e0b}.statusDot.duty{background:#38bdf8}

body.light{background:#eceff3;color:#2b3747}
body.light header{background:#e8ebf0 !important;border-color:#c9d1dc !important}
body.light .panel,body.light .modalCard,body.light .settingsCard,body.light .docListPanel,body.light .servicesMatrix{background:#f1f3f7 !important;color:#2b3747 !important;border-color:#cfd6e1 !important}
body.light .peopleCard{background:#e9edf3 !important;border-color:#c3ccd9 !important;color:#2a3646 !important}
body.light .peopleCard h4{color:#1f2d3d !important}
body.light .tlPickTitle{color:#2d3f53}
body.light .tlMenuBtn{background:#e3e9f1 !important;color:#2a3a4d !important;border-color:#9fb2c8 !important}
body.light .tlPickMenu button{background:transparent !important;color:#2a3a4d !important;border:none !important}
body.light .tlPickGroup{background:#dfe6ef !important;border-color:#b8c8da !important}
body.light .tlPickGroup label{color:#314154}
body.light .mxPicker{background:#e3e8ef;border-color:#a7b7ca}
body.light .eventAttendeeList{background:#e3e8ef;border-color:#a7b7ca}
body.light .eventAttendeeItem{color:#2a3a4d}
body.light .dayHead{color:#5f7289}
body.light .dayCell{background:#edf1f6 !important;border-color:#c9d4e2 !important;color:#243244 !important}
body.light .dayCell.weekend{background:#e4eaf2 !important}
body.light .dayCell.today{background:#d6e2f2 !important;border-color:#7396c2 !important}
body.light .dayCell.today.weekend{background:#cfddef !important}
body.light .weekCol{background:#edf1f6 !important;border-color:#c9d4e2 !important}
body.light .weekCol.weekend{background:#e4eaf2 !important}
body.light .weekCol.today{background:#d6e2f2 !important;border-color:#7396c2 !important}
body.light .weekCol.today.weekend{background:#cfddef !important}
body.light .tlCell{background:#edf1f6 !important;border-color:#c9d4e2 !important;color:#243244 !important}
body.light .tlHead{background:#dbe4ef !important}
body.light .tlSlot.weekend{background:#e4eaf2 !important}
body.light .tlSlot.today{background:#d6e2f2 !important}
body.light .tlSlot.today.weekend{background:#cfddef !important}
body.light input,body.light select,body.light button,body.light textarea{background:#edf1f6;color:#2b3747;border-color:#bcc7d5}
body.light .muted{color:#6a7a8f}
body.light .tripPill{background:#dbe7f6;border-color:#9fb6d3;color:#1a2e44}
body.light .tlItem{background:#dbe7f6;border-color:#9fb6d3;color:#1a2e44}
body.light .tripPill.stPlanning,body.light .tlItem.stPlanning{background:#fde68a;border-color:#d97706;color:#5b3b00}
body.light .tripPill.stHold,body.light .tlItem.stHold{background:#bfdbfe;border-color:#2563eb;color:#0f2e66}
body.light .tripPill.stReleased,body.light .tlItem.stReleased{background:#bbf7d0;border-color:#16a34a;color:#14532d}
body.light .tripPill.stCancelled,body.light .tlItem.stCancelled{background:#fecaca;border-color:#dc2626;color:#7f1d1d}
body.light .tlItem.event{background:#eadcf7;border-color:#bca3db;color:#3a2558}
body.light .tlItem.mx{background:#f3e7cc;border-color:#d8b97f;color:#5a3d0f}
body.light .tripPill.mxQuick, body.light .tlItem.mxQuick{background:#bfe8cc;border-color:#1f8a43;color:#0c3d20}
body.light .tripPill.mxLong, body.light .tlItem.mxLong{background:#ffe4a8;border-color:#b7791f;color:#5a3b00}
body.light .tripPill.mxOos, body.light .tlItem.mxOos{background:#f6bcbc;border-color:#c53030;color:#531313}
body.light .mxDutyText{background:#d8e5f5;border-left-color:#4f82b5;color:#20354a}
body.light .tripPill,body.light .tlItem{color:#162334}
body.light .dayCell .date{color:#405267;font-weight:600}
body.light .dayAddBtn{background:#d9e3ef;border-color:#9fb2c8;color:#22364d}
body.light label,body.light .servicesHeader,body.light .servicesCols,body.light .entryPanelForm label,body.light .muted{color:#4a5f75 !important}
body.light .svcSide{background:#dde7f4 !important;border-color:#9eb4cc !important;color:#203247 !important;border-radius:14px !important}
body.light .servicesMatrix{background:#e4eaf2 !important;border-color:#b8c6d6 !important}
body.light .viewBtn.active,body.light .filterBtn.active,body.light .docTypeBtn.active,body.light .peopleTabBtn.active{background:#cfe2c8 !important;border-color:#5f946f !important;color:#173424 !important;font-weight:700}
body.light .customViewChip{background:#dde5ef;border-color:#9fb2c8;color:#26384b}
body.light .customViewChip.active{background:#cfe2c8;border-color:#5f946f;color:#173424}
body.light .customPinBtn{background:#e3e9f1;color:#2a3a4d;border-color:#9fb2c8}
body.light .customViewMenu{background:#e6ecf3;border-color:#9fb2c8}
body.light .customViewMenu button{background:#edf2f7;color:#2a3a4d;border-color:#a8bbd1}
body.light .paxCol{background:#e3e8ef !important;border-color:#a7b7ca !important}
body.light .paxHead{color:#4a5f75 !important;border-bottom-color:#b8c6d6 !important}
body.light .paxItem{border-bottom-color:#c4cfdd !important;color:#243244 !important}
body.light #tripModal .paxChk{color:#4a5f75 !important}
body.light .paxItem.selectedPax{background:rgba(34,197,94,.18) !important}
body.light #tripModal .legBlockTime{background:#dbe4ef !important;border-color:#9fb2c8 !important;color:#1f3248 !important}
body.light #tripModal .flightLogRowCompact .inlineCheck{background:#dbe4ef !important;border-color:#9fb2c8 !important;color:#1f3248 !important}
body.light #tripModal .flightLogRowCompact .inlineCheck span{color:#1f3248 !important}


/* Trip leg layout baseline (restored) */
#tripModal{padding:0;place-items:stretch}
#tripModalCard{width:100vw;max-width:100vw;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;padding:0 14px 14px 14px}
#resourcesModalCard,#eventModalCard,#debugLogModalCard,#quickContactModalCard,#trashModalCard,#dutyLogEditModalCard{width:min(1860px,99vw);min-height:86vh}
#pilotLogsModal .modalCard{width:min(1860px,99vw);min-height:86vh}
#tripModal .panel{border-radius:10px}
#legPanelsWrap .panel{padding:10px}

/* Top leg rows */
#legPanelsWrap .row{gap:10px}
#legPanelsWrap label{min-width:120px}

.serviceCell{display:flex;flex-direction:column;gap:4px;min-width:0;align-items:center;justify-content:center}
#tripModal textarea.serviceBox{min-height:92px;resize:vertical;line-height:1.25;border-radius:10px;padding:8px 8px 10px 8px;margin:0}
.serviceStatusSelect{height:24px;font-size:11px;border:1px solid #334155;border-radius:8px;background:#0f172a;color:#cbd5e1;padding:0 6px;width:100%;max-width:none}
body.light .serviceStatusSelect{background:#e8eef6;border-color:#9fb2c8;color:#1f3248}
.serviceBoxHidden,.serviceStatusHidden{display:none !important}
.serviceEditorBtn{width:auto;min-width:74px;min-height:30px;text-align:center;border-radius:999px;border:1px solid #3b4a62;background:#0e1b31;color:#dbe7f6;padding:4px 10px;display:inline-flex;align-items:center;justify-content:center;line-height:1.1}
.serviceEditorBtn .svcEditorHead{font-size:11px;font-weight:700;letter-spacing:.15px;white-space:nowrap}
.servicesHeader{display:flex;align-items:center;justify-content:space-between;gap:8px}
.svcFilterToggle{display:inline-flex;gap:4px}
.svcFilterToggle button{border:1px solid #3b4a62;background:#0f172a;color:#9fb3cc;border-radius:999px;padding:1px 8px;font-size:10px;line-height:1.2;cursor:pointer}
.svcFilterToggle button.active{background:#1d4ed8;color:#eaf2ff;border-color:#3b82f6}
.svcClosedItem{opacity:.22;filter:saturate(.4)}
body.light .svcFilterToggle button{background:#eef3f9;border-color:#b7c5d6;color:#41566f}
.svcBulkActions{display:flex;flex-direction:column;gap:2px;margin-top:4px;width:100%}
.svcSideTools{width:100%;display:flex;justify-content:center}
.svcBulkBtn{border:1px solid #3b4a62;background:#0f172a;color:#9fb3cc;border-radius:999px;padding:1px 6px;font-size:10px;line-height:1.2;cursor:pointer;opacity:.92}
.svcEndTools .svcBulkActions{margin-top:0;width:72px}
.svcEndTools .svcBulkBtn{padding:2px 4px;font-size:9px;white-space:nowrap}
.svcBulkBtn:hover{color:#dbe7f6;opacity:1}
body.light .svcBulkBtn{background:#eef3f9;border-color:#b7c5d6;color:#41566f}
.serviceEditorBtn .svcEditorPreview{display:none}
.serviceEditorBtn.svcComplete{background:#123a25;border-color:#1f7a48}
.serviceEditorBtn.svcPending{background:#4a3810;border-color:#9a6b0f}
.serviceEditorBtn.svcNotNeeded{background:#1f2937;border-color:#475569}
body.light .serviceEditorBtn{background:#e7edf6;border-color:#aebfd3;color:#1f3248}
body.light .serviceEditorBtn.svcComplete{background:#ddf0e3;border-color:#8fbe9f}
body.light .serviceEditorBtn.svcPending{background:#f6eccf;border-color:#d1b170}
body.light .serviceEditorBtn.svcNotNeeded{background:#e5eaf1;border-color:#b4c0cf}
#serviceEditorModal textarea{width:100%;box-sizing:border-box;min-height:280px;resize:vertical}
body.light .tripFlowStrip{background:#e7edf5 !important;border-color:#aebfd3 !important}
body.light .tripFlowPill{background:#dde7f3 !important;border-color:#9fb2c8 !important;color:#203247 !important}
body.light .tripFlowTime{color:#4b5f76 !important}
body.light .tripFlowTurnInput{background:#f3f6fb !important;border-color:#9fb2c8 !important;color:#203247 !important}
body.light .tripFlowLockBtn.locked{color:#b42318 !important}
body.light .tripFlowLockBtn.unlocked{color:#6b7280 !important}
.tripValidationChip{display:inline-flex;align-items:center;padding:2px 8px;border:1px solid #475569;border-radius:999px;font-size:10px;font-weight:700;color:#cbd5e1;background:#0f172a}
.tripValidationChip.ok{color:#bbf7d0;border-color:#16a34a;background:#052e16}
.tripValidationChip.warn{color:#fde68a;border-color:#d97706;background:#451a03}
.tripValidationChip.err{color:#fecaca;border-color:#dc2626;background:#450a0a}
body.light .tripValidationChip{color:#334155;background:#e2e8f0;border-color:#94a3b8}
body.light .tripValidationChip.ok{color:#166534;background:#dcfce7;border-color:#22c55e}
body.light .tripValidationChip.warn{color:#92400e;background:#fef3c7;border-color:#f59e0b}
body.light .tripValidationChip.err{color:#991b1b;background:#fee2e2;border-color:#ef4444}

.flQcChip,button.flQcChip{border:1px solid #475569 !important;border-radius:999px;padding:2px 10px;font-size:11px;font-weight:700;background:#0f172a !important;color:#cbd5e1 !important}
.flQcChip.ok,button.flQcChip.ok{border-color:#15803d !important;background:#052e16 !important;color:#bbf7d0 !important}
.flQcChip.warn,button.flQcChip.warn{border-color:#b45309 !important;background:#451a03 !important;color:#fde68a !important}
.flQcChip.err,button.flQcChip.err{border-color:#b91c1c !important;background:#450a0a !important;color:#fecaca !important}
.flQcPanel{margin:4px 0 8px 0;padding:8px;border:1px solid #334155;border-radius:8px;background:#0b1324}
.flQcTitle{font-size:12px;font-weight:700;color:#cbd5e1;margin-bottom:4px}
.flQcPanel ul{margin:0;padding-left:18px;display:grid;gap:2px}
.flQcPanel li{font-size:12px;line-height:1.25;color:#cbd5e1}
.flQcPanel li.err{color:#fecaca}
.flQcPanel li.warn{color:#fde68a}
.flQcPanel li.info{color:#bfdbfe}
body.light .flQcChip,body.light button.flQcChip{background:#e2e8f0 !important;color:#334155 !important;border-color:#94a3b8 !important}
body.light .flQcChip.ok,body.light button.flQcChip.ok{background:#dcfce7 !important;color:#166534 !important;border-color:#22c55e !important}
body.light .flQcChip.warn,body.light button.flQcChip.warn{background:#fef3c7 !important;color:#92400e !important;border-color:#f59e0b !important}
body.light .flQcChip.err,body.light button.flQcChip.err{background:#fee2e2 !important;color:#991b1b !important;border-color:#ef4444 !important}
#flightLogEditorQcState.flQcChip{display:inline-flex;align-items:center}
body.light .flQcPanel{background:#eaf0f7;border-color:#b8c6d6}
body.light .flQcTitle{color:#2b3f56}
body.light .flQcPanel li{color:#2b3f56}

/* Leg services + passenger side card */
.legServicesWrap{display:grid;grid-template-columns:minmax(900px,1fr) minmax(560px,700px);gap:8px;align-items:start;margin-top:4px}
.legPaxCard{padding:8px;margin:-80px 0 0 0 !important;min-width:560px}
.legServicesWrap .servicesMatrix{height:auto;padding-bottom:2px}
@media(max-width:1650px){.legServicesWrap{grid-template-columns:1fr}.legPaxCard{min-width:0}}
.legPaxLayout{display:grid;grid-template-columns:1fr;gap:8px;align-items:start}
.legPaxLeft{display:grid;gap:4px;align-content:start}
.legPaxLeft input{width:100%;box-sizing:border-box}
.legPaxRight{display:grid;gap:4px;margin-top:2px}
#legSelectedPassengers,[id^="legSelectedPassengers"]{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:4px;min-height:0;align-items:start}
.paxCol{border:1px solid #334155;border-radius:8px;padding:4px;background:#0b1324;display:grid;grid-auto-rows:minmax(20px,auto);gap:2px}
.paxHead{display:grid;grid-template-columns:minmax(0,1fr) 40px 30px;align-items:center;font-size:10px;color:#9db0ce;border-bottom:1px solid #253043;padding:1px 0 2px 2px;column-gap:4px}
.paxHead span:nth-child(2),.paxHead span:nth-child(3){text-align:center}
.paxItem{display:grid;grid-template-columns:minmax(0,1fr) 40px 30px;align-items:center;font-size:11px;border-bottom:1px solid #253043;padding:1px 0 1px 2px;column-gap:4px;min-height:24px;overflow:hidden}
.paxItem:last-child{border-bottom:none}
.paxItem.selectedPax{outline:2px solid #22c55e;outline-offset:-2px;background:rgba(34,197,94,.12)}
.paxNameCell{display:flex;align-items:center;justify-content:flex-start;gap:6px;min-width:0;overflow:hidden}
.paxRmBtn{width:16px;height:16px;min-width:16px;line-height:14px;padding:0;border-radius:4px;border:1px solid #475569;background:#0f172a;color:#cbd5e1;font-size:12px;font-weight:700;cursor:pointer}
.paxRmBtn:hover{background:#7f1d1d;border-color:#ef4444;color:#fff}
.paxName{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.paxLeadCol,.paxEsCol{display:flex;align-items:center;justify-content:center}
#tripModal .paxChk{display:inline-flex !important;flex-direction:row !important;align-items:center;justify-content:center;font-size:10px;color:#9db0ce;min-height:18px}
.paxChk input{transform:scale(1.0);margin:0;accent-color:#22c55e}
.paxLeadChk,.paxEsChk{min-width:18px}
.paxEsSpacer{display:inline-block;width:18px;height:16px}
.legPassengerMatch{font-size:11px;min-height:16px}
.legPassengerMatch .matchBtn{margin:1px 3px 0 0;padding:1px 5px;font-size:10px}
@media(max-width:900px){.legPaxLayout{grid-template-columns:1fr}.legPaxRight{order:2}#legSelectedPassengers,[id^="legSelectedPassengers"]{grid-template-columns:1fr}}
[id^="legPassengerInput"]{width:100%;min-width:220px;box-sizing:border-box}
[id^="legSelectedPassengers"]{max-height:170px;overflow:auto}

/* card breathing room */
#legPanelsWrap .panel{margin:8px 0}
.servicesMatrix{margin:0}

/* header action colors */
#saveDraftBtn{background:#1d4ed8;border-color:#3b82f6;color:#fff}
#deleteTripBtn{background:#b91c1c;border-color:#ef4444;color:#fff}
#createTripBtn{background:#15803d;border-color:#22c55e;color:#fff}

#legPanelsWrap [id^="legDetailsPanel"] h3{font-size:18px;font-weight:700;letter-spacing:.1px}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderTitle{display:inline-flex;line-height:1.15}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderTitle.is-expanded{align-items:center}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderTitle.is-collapsed{flex-direction:column;gap:2px;min-width:210px;align-items:flex-start}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderRoute{font-size:15px;font-weight:700;display:inline-flex;align-items:center;gap:6px}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderTag{font-size:10px;font-weight:700;letter-spacing:.3px;color:#9db0ce;border:1px solid #334155;border-radius:999px;padding:1px 6px}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderMeta{display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;font-size:12px;color:#9db0ce;width:100%}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderTitle.is-collapsed .legHeaderMeta{justify-content:center;align-items:flex-start}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderTimes{font-weight:600}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderSubMeta{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:#8ea1bc;line-height:1.1}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderDate{font-weight:700}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderBlock{font-weight:600}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderPurpose{font-weight:600}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderDot{opacity:.7}
#legPanelsWrap [id^="legDetailsPanel"] .legHeaderArrow{opacity:.9}
#legPanelsWrap [id^="legCrewRow"] label{min-width:140px}
.legPaxCard .servicesHeader{margin-bottom:8px}
.legPaxLeft button#legRemovePassengerBtn,[id^="legRemovePassengerBtn"]{width:max-content}
.paxHead{font-size:11px}

#tripModal .servicesCols,#tripModal .servicesRowGrid{grid-template-columns:84px repeat(7,minmax(72px,1fr)) 74px}

/* Compact leg services glance layout */
#tripModal .servicesHeader{margin-bottom:6px}
#tripModal .servicesCols{display:none !important}
#tripModal .servicesRowGrid{grid-template-columns:76px repeat(7,minmax(62px,1fr));gap:4px}
#tripModal .servicesRowGrid>.svcEndTools{display:none !important}
#tripModal .servicesRowGrid>.svcSide{max-width:none;min-height:34px;border-radius:10px;padding:3px 6px;gap:1px}
#tripModal .svcSideLabelText{font-size:12px;letter-spacing:.25px}
#tripModal .svcSideMeta{font-size:10px;color:#9db0ce;line-height:1}
#tripModal .serviceCell{gap:2px}
#tripModal .serviceEditorBtn{min-width:0;width:100%;min-height:28px;height:28px;padding:2px 5px;border-radius:8px;justify-content:space-between}
#tripModal .serviceEditorBtn .svcEditorHead{font-size:10px;letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:80%}
#tripModal .serviceEditorBtn .svcEditorStat{font-size:12px;font-weight:800;line-height:1}

/* Trip builder leg section rebalance: tighter services, cleaner pax/flightlog layout */
#tripModal .legServicesWrap{grid-template-columns:minmax(0,1fr) minmax(360px,440px) !important;gap:10px !important;align-items:start;margin-top:6px}
#tripModal .legServicesWrap .servicesMatrix{padding:8px 8px 6px 8px}
#tripModal .legPaxCard{padding:8px !important;margin:0 !important;min-width:0 !important}
#tripModal .legPaxLayout{gap:6px}

/* Cut services visual width roughly in half vs prior full-size cards */
#tripModal .servicesRowGrid{grid-template-columns:68px repeat(7,minmax(44px,1fr)) !important;gap:3px !important}
#tripModal .servicesRowGrid>.svcSide{min-height:30px;padding:2px 4px}
#tripModal .svcSideLabelText{font-size:11px}
#tripModal .serviceEditorBtn{height:24px;min-height:24px;padding:1px 4px;border-radius:7px}
#tripModal .serviceEditorBtn .svcEditorHead{font-size:9px;max-width:75%}
#tripModal .serviceEditorBtn .svcEditorStat{font-size:11px}

/* Flight log card: cleaner separation and less cramped head */
#tripModal .legFlightLogCard{margin-top:8px;padding:8px 10px;border-radius:10px}
#tripModal .legFlightLogHead{margin-bottom:6px}

@media (max-width:1400px){
  #tripModal .legServicesWrap{grid-template-columns:1fr !important}
}

/* Bob pass: services much narrower, readable pax editor, compact flight-log when collapsed */
#tripModal .servicesMatrix{width:max-content;max-width:100%}
#tripModal .servicesRowGrid{grid-template-columns:68px repeat(7,74px) !important;justify-content:start}
#tripModal .serviceEditorBtn{width:74px;min-width:74px;max-width:74px;padding:2px 4px;height:26px;min-height:26px}
#tripModal .serviceEditorBtn .svcEditorHead{max-width:56px;font-size:10px}

#tripModal .legPaxCard{max-width:none}
#tripModal .legPaxLeft input{font-size:13px;padding:8px 10px}
#tripModal #legSelectedPassengers,
#tripModal [id^="legSelectedPassengers"]{grid-template-columns:repeat(2,minmax(160px,1fr));max-height:230px;overflow:auto}
#tripModal .paxItem{font-size:12px;line-height:1.25;padding:6px 8px}

#tripModal .legFlightLogCard{width:100%;max-width:none}
#tripModal .legFlightLogCard:has(#legFlightLogBody.hidden){max-width:560px}

/* Layout correction: pax left, services right, no pax scrolling, bigger service chips */
#tripModal .legServicesWrap{grid-template-columns:minmax(420px,46%) minmax(0,54%) !important;align-items:start}
#tripModal .legPaxCard{order:1;max-width:none;width:100%}
#tripModal .legServicesWrap .servicesMatrix{order:2;width:100%;max-width:none}

#tripModal #legSelectedPassengers,
#tripModal [id^="legSelectedPassengers"]{grid-template-columns:repeat(2,minmax(170px,1fr));max-height:none !important;overflow:visible !important}

#tripModal .servicesRowGrid{grid-template-columns:72px repeat(7,minmax(86px,1fr)) !important;gap:5px !important}
#tripModal .serviceEditorBtn{width:100%;min-width:0;max-width:none;height:30px;min-height:30px;padding:2px 6px}
#tripModal .serviceEditorBtn .svcEditorHead{max-width:none;font-size:11px}
#tripModal .serviceEditorBtn .svcEditorStat{font-size:13px}

@media (max-width:1500px){
  #tripModal .legServicesWrap{grid-template-columns:1fr !important}
  #tripModal .legPaxCard,#tripModal .legServicesWrap .servicesMatrix{order:initial}
}

/* Final layout pass: contain services, pax left, flight log directly under services */
#tripModal .legServicesWrap{grid-template-columns:minmax(420px,46%) minmax(0,54%) !important}
#tripModal .legPaxCard{order:1}
#tripModal .legServicesWrap .servicesMatrix{order:2;min-width:0;max-width:100%;width:100%;box-sizing:border-box;overflow:hidden}
#tripModal .servicesRowGrid{grid-template-columns:80px repeat(7,minmax(0,1fr)) !important}
#tripModal .servicesRowGrid{width:100%;box-sizing:border-box}
#tripModal .serviceEditorBtn{width:100%;min-width:0;max-width:none;height:30px;min-height:30px}

/* Keep passenger list fully visible (no internal scroll) */
#tripModal #legSelectedPassengers,
#tripModal [id^="legSelectedPassengers"]{max-height:none !important;overflow:visible !important}

/* Dock flight log under right/services column on desktop */
#tripModal .legFlightLogCard{width:54%;margin-left:calc(46% + 10px);margin-top:6px}

@media (max-width:1500px){
  #tripModal .legFlightLogCard{width:100%;margin-left:0}
}

/* Hard lock: 2-column leg cards (left pax, right services+flight log) */
#tripModal #legDetailsPanel,
#tripModal [id^="legDetailsPanel_"]{
  display:grid;
  grid-template-columns:minmax(420px,46%) minmax(0,1fr);
  grid-template-rows:auto auto auto auto;
  column-gap:20px;
  row-gap:2px;
  align-items:start;
}
#tripModal #legDetailsPanel>h3,
#tripModal #legDetailsPanel>.legTopRow,
#tripModal [id^="legDetailsPanel_"]>h3,
#tripModal [id^="legDetailsPanel_"]>.legTopRow{
  grid-column:1 / -1;
}
#tripModal .legServicesWrap{display:contents !important}
#tripModal .legPaxCard{grid-column:1;grid-row:3 / span 2;order:initial;width:100%;max-width:none;margin:0 !important}
#tripModal .servicesMatrix{grid-column:2;grid-row:3;order:initial;width:100% !important;max-width:none !important;overflow:hidden;box-sizing:border-box}
#tripModal .legFlightLogCard{grid-column:2;grid-row:4;width:100%;margin:0 !important;max-width:none;box-sizing:border-box;align-self:start}
#tripModal .legFlightLogCard:has(#legFlightLogBody.hidden){max-width:none}

@media (max-width:1500px){
  #tripModal #legDetailsPanel,
  #tripModal [id^="legDetailsPanel_"]{grid-template-columns:1fr}
  #tripModal .legPaxCard,
  #tripModal .servicesMatrix,
  #tripModal .legFlightLogCard{grid-column:1;grid-row:auto}
  #tripModal .legServicesWrap{display:grid !important}
}

/* Final canonical leg layout (single source of truth) */
#tripModal #legDetailsPanel,
#tripModal [id^="legDetailsPanel_"]{display:block !important}

#tripModal .legServicesWrap{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  column-gap:48px !important;
  row-gap:0;
  align-items:start;
}

#tripModal .legPaxCard{
  grid-column:1;
  grid-row:1;
  width:100%;
  min-width:0;
  max-width:none;
  margin:0 !important;
}

/* Right column stack: services then flight log (same width, same left edge) */
#tripModal .legRightCol{
  grid-column:2;
  display:grid;
  row-gap:14px;
  min-width:0;
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  padding-left:0;
  overflow:hidden;
}

#tripModal .legRightCol .servicesMatrix{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  overflow:hidden;
  margin-top:4px;
}

#tripModal .legRightCol .legFlightLogCard{
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  margin:0 !important;
  margin-left:0 !important;
  box-sizing:border-box;
  justify-self:stretch !important;
}
#tripModal .legRightCol .legFlightLogCard:has(#legFlightLogBody.hidden){max-width:none !important}

/* FBO/DEP-ARR lane nudged right; uniform chip sizing */
#tripModal .servicesRowGrid{grid-template-columns:82px repeat(7,minmax(0,1fr)) !important}
#tripModal .serviceEditorBtn{width:100%;min-width:0;max-width:none;height:30px;min-height:30px}

/* Ensure leg collapse always wins */
#tripModal [id^="legDetailsPanel"].collapsed > :not(h3){display:none !important}
#tripModal [id^="legDetailsPanel"].collapsed h3 .collapseSummary{display:block !important}

@media (max-width:1500px){
  #tripModal .legServicesWrap{grid-template-columns:1fr !important}
  #tripModal .legPaxCard,
  #tripModal .legServicesWrap > .legRightCol{
    grid-column:1;
    grid-row:auto;
    width:100%;
    min-width:0;
    max-width:none;
    margin-left:0;
  }
}
#tripModal .servicesCols{display:none}

.globalSearchResults{position:fixed;top:56px;left:50%;transform:translateX(-50%);width:min(960px,96vw);max-height:58vh;overflow:auto;background:#0b1324;border:1px solid #334155;border-radius:10px;z-index:1200;padding:8px}
.globalSearchResults .gsRow{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:6px 8px;border-bottom:1px solid #1f2a44;cursor:pointer}
.globalSearchResults .gsRow:last-child{border-bottom:none}
.globalSearchResults .gsKind{font-size:10px;padding:2px 6px;border:1px solid #475569;border-radius:999px;color:#cbd5e1}
.globalSearchResults .gsMeta{font-size:11px;color:#9db0ce}
.searchStateBadge{display:inline-flex;align-items:center;gap:6px;font-size:11px;padding:2px 8px;border:1px solid #3b82f6;border-radius:999px;color:#dbeafe;background:#1e3a8a;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.searchStateBadge.hidden{display:none}
.searchClearBtn{padding:5px 8px;font-size:12px}
.reportingWorkspace{min-height:70vh}
.reportingShell{border:1px dashed rgba(148,163,184,.45);border-radius:10px;padding:12px;background:rgba(15,23,42,.35)}
.reportingBuilderView{min-height:58vh}
.reportingTopActions{display:grid;gap:6px;padding:8px;border:1px solid #334155;border-radius:8px;background:rgba(15,23,42,.45)}
.reportingAdvanced summary{cursor:pointer;color:#cbd5e1}
.reportingResultView{display:flex;flex-direction:column;min-height:58vh}
.reportingResultView.hidden{display:none}
.reportingKpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin-bottom:10px}
.reportingKpi{border:1px solid #334155;border-radius:8px;padding:8px;background:rgba(15,23,42,.55)}
.reportingKpiLabel{font-size:11px;color:#93a4bf}
.reportingKpiValue{font-size:18px;font-weight:700;color:#e2e8f0}
.reportingTableWrap{overflow:auto;border:1px solid #334155;border-radius:8px;max-height:62vh}
.reportingTable{width:100%;border-collapse:collapse;font-size:12px}
.reportingTable th,.reportingTable td{padding:6px 8px;border-bottom:1px solid #1f2a44;text-align:left;white-space:nowrap}
.reportingTable thead th{position:sticky;top:0;background:#0f172a}
.reportingFiltersPanel{margin-top:8px;border:1px solid #334155;border-radius:8px;padding:8px;background:rgba(15,23,42,.45)}
.reportingFiltersList{display:grid;gap:6px}
.reportingFilterRow{display:grid;grid-template-columns:minmax(240px,1.2fr) 120px minmax(180px,1fr) auto;gap:6px;align-items:center}
.reportingFilterRow button{padding:6px 8px}
.reportingFieldBuilder{min-width:320px;max-width:700px;flex:1 1 360px;border:1px solid #334155;border-radius:8px;padding:6px;background:rgba(15,23,42,.35)}
.reportingBuilderGrid > label{display:flex;flex-direction:column;gap:4px}
.reportingBuilderGrid > .reportingFieldBuilder{align-self:stretch}
.reportingControlCard{display:flex;flex-direction:column;gap:6px;min-width:320px;flex:1 1 360px;border:1px solid #334155;border-radius:8px;padding:8px;background:rgba(15,23,42,.35)}
.reportingControlCard label{display:flex;flex-direction:column;gap:4px}
.reportingRunBar{display:inline-flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid #334155;border-radius:8px;background:rgba(15,23,42,.35)}
#reportingAvailableColumns{max-height:280px}
.reportingPickList{display:grid;gap:6px}
.reportingPickRow{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:6px;align-items:center}
.reportingPickRow button{padding:6px 8px}
.reportingAggregatesList{display:grid;gap:6px}
.reportingAggregateRow{display:grid;grid-template-columns:120px minmax(240px,1.2fr) minmax(160px,1fr) auto;gap:6px;align-items:center}
.reportingAggregateRow button{padding:6px 8px}
body.light .globalSearchResults{background:#eef3f9;border-color:#a7b7ca}
body.light .globalSearchResults .gsRow{border-bottom-color:#c7d2e2}
body.light .globalSearchResults .gsKind{color:#2a3a4d;border-color:#9fb2c8}
body.light .globalSearchResults .gsMeta{color:#4a5f75}
body.light .searchStateBadge{background:#e0ebff;border-color:#93c5fd;color:#1e3a8a}
body.light .reportingShell{background:#f8fbff;border-color:#cbd5e1}
body.light .reportingTopActions{background:#f8fbff;border-color:#cbd5e1}
body.light .reportingKpi{background:#f8fbff;border-color:#cbd5e1}
body.light .reportingKpiValue{color:#1f2937}
body.light .reportingTableWrap{border-color:#cbd5e1}
body.light .reportingTable th,body.light .reportingTable td{border-bottom-color:#e2e8f0}
body.light .reportingTable thead th{background:#f8fafc}
body.light .reportingFiltersPanel{background:#f8fbff;border-color:#cbd5e1}
body.light .reportingFieldBuilder{background:#f8fbff;border-color:#cbd5e1}
body.light .reportingControlCard{background:#f8fbff;border-color:#cbd5e1}
body.light .reportingRunBar{background:#f8fbff;border-color:#cbd5e1}

.configHomeGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px}
.configHomeCard{border:1px solid #334155;border-radius:10px;padding:10px;background:rgba(15,23,42,.5)}
.configHomeCard h4{margin:0 0 6px 0}
.configHomeCard .muted{min-height:36px}
body.light .configHomeCard{background:#f8fbff;border-color:#cbd5e1}

.resourceHygieneSummary{margin:8px 0 10px 0;padding:8px 10px;border:1px solid #f59e0b;border-radius:8px;background:rgba(245,158,11,.12)}
.resourceHygieneSummary ul{margin:6px 0 0 18px;padding:0}
.resourceFlagRow{background:rgba(245,158,11,.14)}
body.light .resourceHygieneSummary{background:#fff7e6}

/* semantic button colors must win in both dark/light */
button.btnSuccess{background:#14532d !important;border-color:#22c55e !important;color:#dcfce7 !important}
button.btnDanger{background:#7f1d1d !important;border-color:#ef4444 !important;color:#fee2e2 !important}
button.btnInfo{background:#1e3a8a !important;border-color:#3b82f6 !important;color:#dbeafe !important}
button.btnWarn{background:#7c2d12 !important;border-color:#f97316 !important;color:#ffedd5 !important}
button.btnNeutral{background:#334155 !important;border-color:#64748b !important;color:#e2e8f0 !important}
button.btnExit{background:#854d0e !important;border-color:#facc15 !important;color:#fef9c3 !important}

/* Softer semantic palette for light mode */
body.light button.btnSuccess{background:#e3efe5 !important;border-color:#a8c8ad !important;color:#275e33 !important}
body.light button.btnDanger{background:#f3e5e7 !important;border-color:#d5a7ae !important;color:#7a2a35 !important}
body.light button.btnInfo{background:#e4ebf7 !important;border-color:#a8b9db !important;color:#294771 !important}
body.light button.btnWarn{background:#f6ebdd !important;border-color:#d9bb95 !important;color:#7a5120 !important}
body.light button.btnNeutral{background:#edf1f6 !important;border-color:#bcc7d5 !important;color:#34465c !important}
body.light button.btnExit{background:#f4efd8 !important;border-color:#ddcd8e !important;color:#6f5a1b !important}

/* Crew Desk phase-1 layout: sticky context + single scroll workspace */
#crewDeskPanel{display:flex;flex-direction:column;gap:10px;height:calc(100vh - 170px);min-height:720px;max-height:940px;overflow:hidden}
#crewDeskPanel.hidden{display:none}
#crewDeskStickyTripStrip{flex:0 0 auto;position:sticky;top:0;z-index:6;padding:10px 12px;border:1px solid #334155;background:rgba(15,23,42,.95);backdrop-filter:blur(2px)}
#crewDeskStickyTripStrip h4{margin:0 0 6px 0}
#crewDeskMainScroll{flex:1 1 auto;overflow:auto;display:block;min-height:0;padding-right:2px}
#crewDeskTopCards{display:grid;grid-template-columns:minmax(300px,1.35fr) minmax(760px,3.65fr);gap:10px;min-height:0}
#crewDeskTopCards>.panel{display:flex;flex-direction:column;min-height:0;padding:10px 12px}
#crewDeskTopCards>.panel h4{margin:0 0 8px 0}
#crewDeskTopCards>.crewDeskCoverageCard{max-height:560px;overflow:hidden}
#crewDeskCoverage{flex:1 1 auto;overflow:auto;min-height:0}
#crewDeskCoverageDetail{flex:0 0 auto;margin-top:8px;padding:8px 10px;border:1px solid #334155;border-radius:8px;max-height:220px;overflow:auto;background:rgba(15,23,42,.55)}
.crewDeskCoverageDetailTitle{font-weight:700;font-size:11px;margin-bottom:4px;color:#cbd5e1;text-transform:uppercase;letter-spacing:.3px}
.crewDeskCoverageDetailLine{font-size:11px;line-height:1.3;color:#dbe5f4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crewDeskCoverageRowFlash{outline:2px solid #22c55e;outline-offset:-2px;animation:crewDeskRowFlash 1.1s ease-out}
@keyframes crewDeskRowFlash{0%{background:rgba(34,197,94,.22)}100%{background:transparent}}
body.light #crewDeskCoverageDetail{background:#f8fbff;border-color:#cbd5e1}
body.light .crewDeskCoverageDetailTitle{color:#334155}
body.light .crewDeskCoverageDetailLine{color:#1f2937}
#crewDeskCurrency{overflow:auto;min-height:0}
.crewDeskReadinessTable{width:max-content;min-width:100%;table-layout:fixed}
.crewDeskReadinessTable th:nth-child(1){min-width:120px}
.crewDeskReadinessTable th:nth-child(2),.crewDeskReadinessTable th:nth-child(3),.crewDeskReadinessTable th:nth-child(4){min-width:62px}
.crewDeskReadinessTable th:nth-child(5){min-width:560px}
.crewDeskReadinessTable th:nth-child(6){min-width:110px}
.crewDeskReadinessTable th:nth-child(7){min-width:90px}
.crewDeskReadinessHeadStrip{margin-top:4px}
.crewDeskReadinessHeadStrip .crewDeskBalHeadCell{font-size:10px;line-height:1.1}
.crewDeskCurrChip{display:inline-flex;align-items:center;justify-content:center;padding:1px 7px;border-radius:999px;font-size:11px;font-weight:800;border:1px solid transparent;line-height:1.2}
.crewDeskCurrChip.current{background:#14532d;border-color:#22c55e;color:#dcfce7}
.crewDeskCurrChip.risk{background:#7c2d12;border-color:#fb923c;color:#ffedd5}
.crewDeskCurrAltTag{display:inline-flex;align-items:center;justify-content:center;margin-left:4px;padding:1px 6px;border-radius:999px;font-size:10px;font-weight:800;border:1px solid #60a5fa;background:#1e3a8a;color:#dbeafe}
body.light .crewDeskCurrChip.current{background:#e6f7ec;border-color:#86efac;color:#166534}
body.light .crewDeskCurrChip.risk{background:#fff4e5;border-color:#fdba74;color:#9a3412}
body.light .crewDeskCurrAltTag{background:#e0ebff;border-color:#93c5fd;color:#1e3a8a}
#crewDeskCoverage table thead th,#crewDeskCurrency table thead th{position:sticky;top:0;z-index:2;background:#0f172a}
body.light #crewDeskStickyTripStrip{background:rgba(248,250,252,.96);border-color:#cbd5e1}
body.light #crewDeskCoverage table thead th,body.light #crewDeskCurrency table thead th{background:#f8fafc}
#crewDeskWorkbench{overflow:auto;max-height:220px}
.crewDeskBalanceCard{display:flex;flex-direction:column;min-height:0;overflow:hidden}
#crewDeskBalanceLegend{margin:4px 0 6px 0;font-size:11px}
.crewDeskBalanceTable{width:100%;table-layout:fixed;border-collapse:collapse;font-size:11px}
.crewDeskBalanceTable th,.crewDeskBalanceTable td{padding:2px 4px;vertical-align:middle}
.crewDeskBalanceTable th{text-align:left}
.crewDeskBalName{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.crewDeskBalHeadStrip,.crewDeskBalStrip{display:grid;grid-template-columns:repeat(29,minmax(0,1fr));gap:1px}
.crewDeskBalHeadStrip{margin-top:2px}
.crewDeskBalHeadCell{font-size:9px;line-height:1;text-align:center;color:#9ca3af;white-space:nowrap}
.crewDeskBalHeadCell.today{color:#dbeafe;font-weight:700}
body.light .crewDeskBalHeadCell{color:#64748b}
body.light .crewDeskBalHeadCell.today{color:#0f172a;font-weight:800;background:#dbeafe;border:1px solid #93c5fd;border-radius:3px;padding:0 1px}
.crewDeskBalCell{height:10px;border-radius:2px;background:#1f2937;position:relative}
.crewDeskBalCell.l1{background:#14532d}
.crewDeskBalCell.l2{background:#a16207}
.crewDeskBalCell.l3{background:#7f1d1d}
.crewDeskBalCell.future{opacity:.85}

/* Pilot balance board clarity in light mode */
body.light .crewDeskBalCell{background:#ffffff;border:1px solid #d1d5db}
body.light .crewDeskBalCell.l1{background:#16a34a;border-color:#15803d}
body.light .crewDeskBalCell.l2{background:#facc15;border-color:#ca8a04}
body.light .crewDeskBalCell.l3{background:#ef4444;border-color:#b91c1c}
.crewDeskBalCell.today{outline:1px solid #93c5fd;outline-offset:0}
body.light .crewDeskBalCell.today{outline:1px solid #2563eb}
.crewDeskBalCell.overnight::after{content:'';position:absolute;right:1px;top:1px;width:3px;height:3px;border-radius:50%;background:#f8fafc}
.crewDeskBalMetric{text-align:center;font-variant-numeric:tabular-nums;white-space:nowrap}
.crewDeskBalBadge{text-align:center;font-weight:700;padding:2px 6px;border-radius:999px;display:inline-block}
.crewDeskBalBadge.light{background:#1e3a8a;color:#dbeafe}
.crewDeskBalBadge.balanced{background:#14532d;color:#dcfce7}
.crewDeskBalBadge.heavy{background:#7c2d12;color:#ffedd5}
.crewDeskBalBadge.overloaded{background:#7f1d1d;color:#fee2e2}
@media(max-width:1380px){#crewDeskPanel{height:calc(100vh - 150px);min-height:680px}#crewDeskTopCards{grid-template-columns:1fr}}
#crewDeskPanel table{font-size:12px;line-height:1.2}
#crewDeskPanel td,#crewDeskPanel th{padding:4px 6px;vertical-align:top}
#crewDeskPanel td{word-break:break-word}
#crewDeskPanel .muted{font-size:11px}
.crewDeskCoverageTable{width:100%;table-layout:fixed}
.crewDeskCoverageTable th{text-align:center}
.crewDeskCoverageTable td{vertical-align:middle}
.crewDeskCoverageTable .tripCol{text-align:left}
.crewDeskCoverageTable .centerCol,.crewDeskCoverageTable .actionsCol{text-align:center}
.crewDeskCoverageTable .requestedCol{text-align:left;white-space:normal}
.crewDeskRequestPill{display:inline-flex;align-items:center;justify-content:center;min-width:40px;padding:4px 10px;margin:1px 4px 1px 0;border-radius:999px;font-size:12px;font-weight:800;letter-spacing:.4px;background:#3f1d1d;border:1px solid #ef4444;color:#fee2e2}
body.light .crewDeskRequestPill{background:#fddede;border-color:#e11d48;color:#7f1d1d}
.crewDeskStateChips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 8px 0}
.crewDeskStateChip{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:700;border:1px solid transparent}
.crewDeskStateChip.role{background:#1f2937;border-color:#475569;color:#e2e8f0}
.crewDeskStateChip.request{background:#1e3a8a;border-color:#3b82f6;color:#dbeafe}
.crewDeskStateChip.brief{background:#78350f;border-color:#f59e0b;color:#fef3c7}
.crewDeskStateChip.ack{background:#14532d;border-color:#22c55e;color:#dcfce7}
.crewDeskStateChip.neutral{background:#334155;border-color:#64748b;color:#cbd5e1}
body.light .crewDeskStateChip.role{background:#eef2f7;border-color:#cbd5e1;color:#334155}
body.light .crewDeskStateChip.request{background:#e0ebff;border-color:#93c5fd;color:#1e3a8a}
body.light .crewDeskStateChip.brief{background:#fff4d6;border-color:#fbbf24;color:#854d0e}
body.light .crewDeskStateChip.ack{background:#e3f5e8;border-color:#86efac;color:#166534}
body.light .crewDeskStateChip.neutral{background:#edf2f8;border-color:#cbd5e1;color:#475569}
.crewDeskTripSelectBtn{all:unset;cursor:pointer;display:inline-block;color:inherit;font-weight:600;line-height:1.2}
.crewDeskTripSelectBtn:hover{text-decoration:underline}
.crewDeskTripSelectBtn.active{text-decoration:underline;color:#93c5fd}
.crewDeskCoverageRowSelected td{background:rgba(59,130,246,.08)}
.crewDeskCoverageRowSelected td{border-top:1px solid #60a5fa;border-bottom:1px solid #60a5fa}
.crewDeskCoverageRowSelected td:first-child{border-left:2px solid #60a5fa;border-top-left-radius:6px;border-bottom-left-radius:6px}
.crewDeskCoverageRowSelected td:last-child{border-right:2px solid #60a5fa;border-top-right-radius:6px;border-bottom-right-radius:6px}
body.light .crewDeskCoverageRowSelected td{background:#eaf2ff;border-top-color:#60a5fa;border-bottom-color:#60a5fa}



/* Dep/Arr layout baseline (requested) */
#tripModal .legTopRow{
  display:flex;
  gap:12px;
  align-items:center;
  min-width:0;
}
#tripModal .legDepArrStack{display:grid;grid-template-rows:auto auto auto auto;gap:4px}
#tripModal .airportNotesHint{font-size:11px;line-height:1.25;padding:2px 4px;border-left:2px solid #4b5563;opacity:.9}
body.light #tripModal .airportNotesHint{border-left-color:#94a3b8}
#tripModal .airportNotesHint{white-space:pre-line}
#tripModal .legLine{display:flex;gap:6px;align-items:flex-end}
#tripModal .legTopRow .icaoField{width:72px;flex:0 0 72px}
#tripModal .legTopRow .icaoField input{text-transform:uppercase;text-align:center;letter-spacing:.5px}
#tripModal .legTopRow .dtField{width:156px;flex:0 0 156px}
#tripModal .legTopRow .dtField.timeField{width:126px;flex:0 0 126px;white-space:nowrap}
#tripModal .legTopRow .dtField.timeField .timeLabelRow{display:flex;align-items:baseline;gap:3px;white-space:nowrap}
#tripModal .legTopRow .dtField.timeField .muted{display:inline !important;font-size:10px;line-height:1.05;margin-left:0}
#tripModal .legBlockInline{border:none !important;background:transparent !important;min-width:92px;padding:0 4px;height:auto;align-self:center;justify-self:center;font-size:13px;font-weight:800;color:#6b8fce;transform:none;margin:0 6px 0 -24px;opacity:.95;text-align:center;line-height:1.1;position:relative}
body.light #tripModal .legBlockInline{color:#315d9e}
@media(max-width:1320px){
  #tripModal .legTopRow{display:grid;grid-template-columns:1fr;align-items:stretch}
}

/* strict crew-box widths (4-letter IDs) */
#tripModal [id^="legCrewRow"]{
  display:flex !important;
  gap:6px !important;
  align-items:flex-end !important;
  flex-wrap:nowrap !important;
  overflow-x:auto;
  margin-left:0;
  justify-content:flex-start;
  min-width:0;
  flex:1 1 auto;
}
#tripModal [id^="legCrewRow"] label{
  flex:0 0 auto !important;
  width:auto !important;
  min-width:0 !important;
}
#tripModal [id^="legCrewRow"] label.purposeField,
#tripModal [id^="legCrewRow"] label:first-child{
  width:96px !important;
  margin-left:0;
}
#tripModal [id^="legCrewRow"] label input,
#tripModal [id^="legCrewRow"] label select{
  width:72px !important;
  min-width:72px !important;
  max-width:72px !important;
  box-sizing:border-box;
}
#tripModal [id^="legCrewRow"] label.purposeField select,
#tripModal [id^="legCrewRow"] label:first-child select{
  width:96px !important;
  min-width:96px !important;
  max-width:96px !important;
}

#tripDutyLogsPanel{margin-top:10px;padding:10px;border:1px solid #2a3348;border-radius:8px;background:#0f1726}
#tripDutyLogsBody{max-height:180px;overflow:auto}
#tripModalCard.dutyLogsTall #tripDutyLogsBody{max-height:52vh}
#tripModalCard.dutyLogsTall .tripDutyGrid{max-height:50vh}
#adminDutyLogsPanel table td,#adminDutyLogsPanel table th{text-align:left}
.tripDutyLogRow{gap:12px;flex-wrap:wrap;padding:8px 0}
.dutyLogsFilterActions{align-items:end;gap:8px}
.dutyLogEditActions{gap:8px;margin-top:8px}
.tripDutyLogRowBtn{width:100%;text-align:left;background:transparent !important;border:none;color:inherit;cursor:pointer;border-left:2px solid transparent;padding-left:6px;border-radius:0}
.tripDutyWarnRow{background:transparent !important}
.dutyLogsPanelActions{gap:8px;align-items:center}
#tripDutyLogsPanel.collapsed #tripDutyLogsBody{display:none}
.tripDutyGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px;max-height:260px;overflow:auto}
.tripDutyCol{border:1px solid #2a3348;border-radius:8px;background:#0b1322}
.tripDutyColHead{padding:6px 8px;font-weight:700;border-bottom:1px solid #2a3348}
.tripDutyColBody{padding:4px 8px}
.tripDutyColBody .tripDutyLogRow{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
.tripDutyColBody .tripDutyLogRow + .tripDutyLogRow{border-top:1px solid #3a475f}
#collapseTripDutyLogsBtn{text-align:left}
/* Duty log card theme + stable hover behavior */
.tripDutyCol{border-color:#2a3348;background:#0b1322}
.tripDutyColHead{border-bottom-color:#2a3348}
.tripDutyLogRowBtn{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
@media (hover:hover){
  .tripDutyLogRowBtn:hover{border-left-color:#60a5fa;color:#93c5fd;background:transparent}
}
.tripDutyLogRowBtn:focus-visible{outline:1px solid #60a5fa;border-left-color:#60a5fa;background:transparent}

body.light .tripDutyCol{background:#f8fafc;border-color:#cbd5e1}
body.light .tripDutyColHead{border-bottom-color:#cbd5e1;color:#0f172a}
body.light .tripDutyLogRow{border-top-color:#e2e8f0}
body.light .tripDutyColBody .tripDutyLogRow + .tripDutyLogRow{border-top-color:#cbd5e1}
body.light .tripDutyLogRowBtn{color:#0f172a}
@media (hover:hover){
  body.light .tripDutyLogRowBtn:hover{border-left-color:#3b82f6;color:#1e3a8a}
}
body.light .tripDutyLogRowBtn:focus-visible{outline:1px solid #3b82f6;border-left-color:#3b82f6;background:transparent}
.tripDutyWarnRow{background:transparent}
.tripDutyWarnChip{display:inline-block;margin-left:6px;padding:0 6px;border-radius:10px;border:1px solid #f59e0b;color:#f59e0b;font-size:11px;font-weight:700}
body.light .tripDutyWarnRow{background:rgba(245,158,11,.12)}
body.light .tripDutyWarnChip{border-color:#b45309;color:#b45309;background:#fff7ed}
/* Keep dark-mode duty rows stable on hover (no light flash) */
body:not(.light) .tripDutyLogRowBtn:hover,
body:not(.light) .tripDutyLogRowBtn:active,
body:not(.light) .tripDutyLogRowBtn:focus{background:transparent !important}

/* Pilot logbook modal styling */
#pilotLogsModal .modalCard{background:linear-gradient(180deg,#0f172a 0%,#0b1324 100%);border-color:#334155;padding:16px 16px 14px}
#pilotLogsSubhead{font-size:11px;letter-spacing:.4px;text-transform:uppercase;margin:-4px 0 10px 0}
#pilotLogsModal .entryPanelForm{display:flex;max-width:none;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-bottom:10px}
#pilotLogsModal .entryPanelForm label{display:flex;flex-direction:column;gap:5px;margin:0;grid-template-columns:none;min-width:150px;color:#cbd5e1}
#pilotLogsModal .entryPanelForm label input{width:180px;max-width:180px}
#pilotLogsModal .entryPanelForm label button{min-width:130px;font-weight:600}
.pilotLogbookWrap{border:1px solid #334155;border-radius:10px;background:#0a1222}
.pilotLogbookTable{width:100%;border-collapse:separate;border-spacing:0;font-size:12px;table-layout:fixed}
.linkBtn{all:unset;cursor:pointer;color:#93c5fd;text-decoration:underline;font-weight:600}
.linkBtn:hover{color:#bfdbfe}
.qualActionsCell{white-space:nowrap}
.qualActionsCell button{display:inline-flex;margin-right:6px}
.qualActionsCell button:last-child{margin-right:0}
#peopleTab_qualifications table{font-size:11px}
#peopleTab_qualifications th,#peopleTab_qualifications td{padding:6px 8px;vertical-align:middle}
#peopleTab_qualifications th:nth-child(1),#peopleTab_qualifications td:nth-child(1){min-width:140px}
#peopleTab_qualifications th:nth-child(5),#peopleTab_qualifications td:nth-child(5),
#peopleTab_qualifications th:nth-child(7),#peopleTab_qualifications td:nth-child(7){white-space:nowrap}
body.light .linkBtn{color:#1d4ed8}
.pilotLogbookTable .plColDate{width:92px}
.pilotLogbookTable .plColType{width:78px}
.pilotLogbookTable .plColTail{width:86px}
.pilotLogbookTable .plColIcao{width:82px}
.pilotLogbookTable .plColTime{width:72px}
.pilotLogbookTable .plColCount{width:76px}
.pilotLogbookTable thead th{position:sticky;top:0;z-index:2;background:#111a2c;color:#dbe7f6;text-transform:uppercase;letter-spacing:.5px;font-size:10px;border-top:1px solid #475569;border-bottom:2px solid #334155;white-space:nowrap}
.pilotLogbookTable td,.pilotLogbookTable th{padding:7px 8px;border-right:1px solid rgba(71,85,105,.28)}
.pilotLogbookTable td:last-child,.pilotLogbookTable th:last-child{border-right:none}
/* Jepp-style section dividers */
.pilotLogbookTable th:nth-child(5),.pilotLogbookTable td:nth-child(5),
.pilotLogbookTable th:nth-child(10),.pilotLogbookTable td:nth-child(10),
.pilotLogbookTable th:nth-child(12),.pilotLogbookTable td:nth-child(12){border-right:2px solid rgba(148,163,184,.55)}
.pilotLogbookTable tbody td{border-bottom:1px solid rgba(71,85,105,.3)}
.pilotLogbookTable tbody tr:nth-child(odd){background:rgba(15,23,42,.45)}
.pilotLogbookTable tbody tr:nth-child(even){background:rgba(2,6,23,.3)}
.pilotLogbookTable tbody tr:hover{background:rgba(30,58,138,.18)}
.pilotLogbookTable td:nth-child(1),.pilotLogbookTable td:nth-child(2),.pilotLogbookTable td:nth-child(3),.pilotLogbookTable td:nth-child(4),.pilotLogbookTable td:nth-child(5){font-weight:600;color:#dbe7f6}
.pilotLogbookTable td:nth-child(1){letter-spacing:.2px}
.pilotLogbookTable td:nth-child(n+6){font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-align:right}
.pilotLogbookTable tfoot th{position:sticky;bottom:0;background:#172554;color:#eff6ff;border-top:1px solid #60a5fa;font-weight:800;text-transform:uppercase;letter-spacing:.4px}
body.light #pilotLogsModal .modalCard{background:#f4f7fb;border-color:#bcc7d5}
body.light #pilotLogsSubhead{color:#60758d !important}
body.light .pilotLogbookWrap{background:#ffffff;border-color:#bcc7d5}
body.light .pilotLogbookTable thead th{background:#e8eef6;color:#31465f;border-top-color:#cbd5e1;border-bottom-color:#bcc7d5}
body.light .pilotLogbookTable td,body.light .pilotLogbookTable th{border-right-color:#d7e0eb}
body.light .pilotLogbookTable th:nth-child(5),body.light .pilotLogbookTable td:nth-child(5),
body.light .pilotLogbookTable th:nth-child(10),body.light .pilotLogbookTable td:nth-child(10),
body.light .pilotLogbookTable th:nth-child(12),body.light .pilotLogbookTable td:nth-child(12){border-right-color:#9fb2c8}
body.light .pilotLogbookTable tbody tr:nth-child(odd){background:#f8fafd}
body.light .pilotLogbookTable tbody tr:nth-child(even){background:#f1f5fb}
body.light .pilotLogbookTable tbody tr:hover{background:#e8f0ff}
body.light .pilotLogbookTable tbody td{border-bottom-color:#d7e0eb;color:#243244}
body.light .pilotLogbookTable td:nth-child(1),body.light .pilotLogbookTable td:nth-child(2),body.light .pilotLogbookTable td:nth-child(3),body.light .pilotLogbookTable td:nth-child(4),body.light .pilotLogbookTable td:nth-child(5){color:#1f2d3d}
body.light .pilotLogbookTable tfoot th{background:#dbeafe;color:#1e3a8a;border-top-color:#93c5fd}


/* ===== Leg editor layout lock (final) ===== */
#tripModal .legServicesWrap{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  column-gap:44px !important;
  row-gap:0 !important;
  align-items:start !important;
}
#tripModal .legServicesWrap > .legPaxCard{
  grid-column:1 !important;
  width:100% !important;
  margin:0 !important;
  padding-right:8px !important;
  box-sizing:border-box !important;
}
#tripModal .legServicesWrap > .legRightCol{
  grid-column:2 !important;
  display:grid !important;
  grid-template-columns:1fr !important;
  row-gap:14px !important;
  width:100% !important;
  margin:0 !important;
  padding:0 0 0 8px !important;
  box-sizing:border-box !important;
}
#tripModal .legServicesWrap > .legRightCol > .legTopRow,
#tripModal .legServicesWrap > .legRightCol > .servicesMatrix,
#tripModal .legServicesWrap > .legRightCol > .legFlightLogCard{
  grid-column:1 !important;
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  box-sizing:border-box !important;
}
#tripModal .legServicesWrap > .legRightCol > .legTopRow{grid-row:1 !important}

/* Flight log lock action should be performed in full Flight Log modal only */
#tripModal #legPanelsWrap [id^="flCompleteBtn"]{display:none !important}
#tripModal .legServicesWrap > .legRightCol > .servicesMatrix{grid-row:2 !important}
#tripModal .legServicesWrap > .legRightCol > .legFlightLogCard{grid-row:3 !important}
#tripModal .legServicesWrap > .legRightCol > .legFlightLogCard:has(#legFlightLogBody.hidden){max-width:none !important}
#tripModal .servicesRowGrid{grid-template-columns:82px repeat(7,minmax(0,1fr)) !important}
#tripModal .serviceEditorBtn{height:30px !important;min-height:30px !important}
@media (max-width:1500px){
  #tripModal .legServicesWrap{grid-template-columns:1fr !important;row-gap:8px !important}
  #tripModal .legServicesWrap > .legPaxCard,
  #tripModal .legServicesWrap > .legRightCol{grid-column:1 !important;padding:0 !important}
}
