.application-shell { --menu-width: 200px; --context-width: 450px; }
#app-shell { grid-row: 2; display: grid; grid-template-columns: var(--menu-width) minmax(0,1fr); min-height: 0; min-width: 0; }
.application-shell #operation-layout { grid-row: auto; min-height: 0; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); }
#app-menu { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: 19px 10px 12px; background: #14323f; color: #d5e6e9; }
.app-menu-heading { padding: 0 10px 20px; display: grid; gap: 6px; }
.app-menu-heading strong { font-size: 1rem; color: #fff; }
.app-menu-heading span { font-size: .8125rem; color: #a9c6cf; }
.app-menu-group { padding: 0 12px 8px; font-size: .6875rem; letter-spacing: .1em; color: #96bac5; }
#app-menu .workspace-nav { display: flex; flex-direction: column; gap: 4px; overflow: visible; padding: 0; margin: 0; background: transparent; }
#app-menu .view-tab { display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 10px; border: 0; border-radius: 6px; color: #d4e4e9; background: transparent; text-align: left; font-size: .875rem; white-space: normal; line-height: 1.4; }
#app-menu .view-tab svg { width: 21px; height: 21px; flex-shrink: 0; }
#app-menu .view-tab.active { background: #23606a; color: #fff; }
#app-menu .view-tab:hover { background: #244c5c; }
#app-menu .view-tab.active::after { display: none; }
#app-menu .workspace-nav { border-bottom: 0; }
#app-menu .app-menu-shortcuts { display: grid; gap: 8px; padding: 17px 0 0; margin-top: 20px; border-top: 1px solid #3b5864; border-bottom: 0; background: transparent; }
#app-menu .app-menu-shortcuts .button { width: 100%; min-height: 42px; white-space: normal; justify-content: flex-start; text-align: left; font-size: .8125rem; color: #d4e4e9; background: transparent; border-color: #385664; }
#app-menu-toggle, #app-menu-backdrop { display: none; }
.application-shell #map-stage { display: none; }
.application-shell #operations-dock { min-width: 0; border-left: 0; grid-column: 1; grid-row: 1; }
#page-content { min-height: 0; min-width: 0; flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.application-shell #page-content > :not([hidden]) { display: block !important; }
.application-shell #page-content > [hidden] { display: none !important; }
.application-shell .dock-heading { background: #f7fafb; border-bottom: 1px solid #d7e3e8; min-height: 68px; padding: 14px 22px; }
.application-shell .dock-heading .eyebrow { display: block; margin-bottom: 6px; }
.application-shell .dock-heading strong { font-size: 1.1rem; }
.application-shell #page-content > .workspace, .application-shell #page-content > .drivers-view, .application-shell #page-content > .zones-view, .application-shell #page-content > #view-dispatch, .application-shell #page-content > .simulation-view { padding: 20px; }
.application-shell #page-content .records-scroll { max-height: none; }
.application-shell #page-content .fleet-search { grid-template-columns: minmax(180px,1fr) 210px; }
.application-shell #page-content .fleet-search input, .application-shell #page-content .fleet-search select { font-size: .875rem; }
#context-pane { display: none; min-height: 0; min-width: 0; flex-direction: column; border-left: 1px solid #cddce1; background: #f1f6f7; grid-row: 1; }
.application-shell.context-open #context-pane { display: flex; grid-column: 2; }
.application-shell.context-open:not(.map-page) #operation-layout { grid-template-columns: minmax(0,1fr) var(--context-width); }
.application-shell.map-page #operation-layout { grid-template-columns: minmax(0,1fr) var(--context-width); }
.application-shell.map-page #map-stage { display: grid; grid-column: 1; grid-row: 1; visibility: visible; }
.application-shell.map-page #operations-dock { grid-column: 2; }
.application-shell.map-page.context-open #operations-dock { display: none; }
.application-shell.map-context #operation-layout { grid-template-columns: minmax(0,1fr) var(--context-width); }
.application-shell.map-context #map-stage { display: grid; visibility: visible; grid-column: 1; grid-row: 1; }
.application-shell.map-context #operations-dock { display: none; }
.application-shell.context-wide { --context-width: min(680px,55vw); }
.application-shell.map-only #operation-layout { grid-template-columns: minmax(0,1fr); }
.application-shell.map-only #map-stage { display: grid; visibility: visible; }
.application-shell.map-only #context-pane, .application-shell.map-only #operations-dock { display: none; }
.context-header { flex-shrink: 0; background: #fff; border-bottom: 1px solid #d7e3e8; }
.context-navigation { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #e7edef; }
#context-trail { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 0; overflow-x: auto; font-size: .75rem; color: #567481; white-space: nowrap; scrollbar-width: none; }
#context-trail button { color: #287581; background: transparent; border: 0; padding: 5px 0; font-size: inherit; }
.breadcrumb-divider { color: #a0b4bd; }
.context-title-row { padding: 11px 14px; display: flex; justify-content: space-between; gap: 8px; align-items: center; color: #254e5d; }
.context-title-row strong { min-width: 0; overflow-wrap: anywhere; font-size: .9375rem; }
.context-title-row > div { display: flex; flex-shrink: 0; gap: 5px; }
.context-title-row .button { font-size: .75rem; }
.application-shell #dock-content { background: #f2f6f8; }
.application-shell #context-pane .inspector-close { display: none; }
.application-shell #stack-custom { padding: 16px; background: #fff; min-height: 100%; }
.application-shell #stack-custom #view-simulation, .application-shell #stack-custom #view-zones { display: block !important; padding: 0; }
.context-links { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 14px; }
.reports-view { padding: 22px; min-width: 0; }
.reports-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.reports-heading h1 { font-size: 1.45rem; color: #224957; margin: 7px 0; }
.reports-heading p { color: #597683; font-size: .9375rem; line-height: 1.6; }
.reports-heading .eyebrow { font-size: .6875rem; color: #54828d; }
.report-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 16px; border: 1px solid #d8e5e8; border-radius: 8px; background: #fff; }
.report-filters label { display: grid; gap: 7px; font-size: .875rem; color: #3e6574; min-width: 0; }
.report-filters select { min-width: 0; width: 100%; font-size: .875rem; }
.report-tabs { display: flex; gap: 8px; margin: 18px 0 12px; border-bottom: 1px solid #cbdce1; }
.report-tabs .tab { min-height: 44px; font-size: .9375rem; padding: 10px 16px; }
.report-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 16px 0; }
.report-kpis > div { min-width: 0; padding: 17px; border: 1px solid #d3e3e6; border-radius: 7px; background: #fff; }
.report-kpis span { display: block; font-size: .8125rem; line-height: 1.6; color: #53727f; }
.report-kpis strong { display: block; color: #234f5e; font-size: 1.25rem; margin-top: 8px; }
.report-overview { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(230px,1fr); gap: 14px; }
.report-card { padding: 18px; margin: 0 0 16px; border: 1px solid #d8e4e8; border-radius: 8px; background: #fff; min-width: 0; }
.report-card h2, .report-detail h2 { font-size: 1.1rem; color: #295463; margin-bottom: 13px; }
#report-notes p { font-size: .875rem; color: #52717e; line-height: 1.75; margin: 12px 0; }
.report-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .75rem; margin-bottom: 18px; color: #526e7a; }
.report-legend > span { padding: 0; font-size: inherit; }
.report-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; }
.report-legend .empty::before, .report-day-track .empty { background: #d29b4a; }
.report-legend .loaded::before, .report-day-track .loaded { background: #31978b; }
.report-legend .unknown::before, .report-day-track .unknown { background: #9aadb6; }
.report-day { display: grid; grid-template-columns: 44px minmax(0,1fr) 80px; gap: 10px; align-items: center; margin: 12px 0; font-size: .8125rem; color: #54717c; }
.report-day strong { text-align: right; font-size: .75rem; font-weight: 500; }
.report-day-track { height: 16px; border-radius: 3px; background: #edf3f5; overflow: hidden; }
.report-day-track > div { height: 100%; display: flex; }
.report-day-track i { display: block; height: 100%; }
.report-table-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.report-table-heading > div { display: flex; flex-wrap: wrap; gap: 7px; }
.report-sort { display: flex; gap: 9px; align-items: center; margin: 10px 0 16px; font-size: .875rem; color: #547581; }
.report-sort select { font-size: .875rem; max-width: 220px; }
.report-table-scroll { overflow: auto; }
.report-table { width: 100%; min-width: 850px; border-collapse: collapse; font-size: .875rem; }
.report-table th, .report-table td { border-bottom: 1px solid #e0e9ec; padding: 13px 9px; text-align: right; vertical-align: top; }
.report-table th:first-child { text-align: left; min-width: 150px; }
.report-table thead { color: #567784; background: #f6f9fa; font-size: .8125rem; }
.report-table small { display: block; font-size: .75rem; color: #68838e; line-height: 1.6; margin-top: 5px; font-weight: 400; }
.report-entity { color: #276a78; font-size: .875rem; font-weight: 600; border: 0; background: transparent; text-align: left; padding: 0; min-height: 32px; }
#report-columns { display: none; }
#view-reports[aria-busy=true] .report-table { opacity: .5; pointer-events: none; }
.report-detail .report-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
.report-detail .report-kpis > div { padding: 12px; }
.report-detail .report-kpis strong { font-size: 1.05rem; }
.report-detail h3 { font-size: 1rem; margin: 22px 0 12px; color: #315c6c; }
.report-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0; }
.report-detail .hint, .report-loading { font-size: .875rem; line-height: 1.7; }
.report-leg { display: grid; gap: 5px; padding: 13px 0; border-bottom: 1px solid #e0e9ec; font-size: .875rem; line-height: 1.6; }
.report-leg small { color: #66818c; font-size: .8125rem; }
@media(max-width:1200px) and (min-width:761px) { .application-shell { --menu-width: 76px; --context-width: 420px; } .app-menu-heading,.app-menu-group,#app-menu .view-tab > span { display: none; } #app-menu .view-tab { justify-content: center; } #app-menu .app-menu-shortcuts .button { font-size: .6875rem; padding: 8px 3px; justify-content: center; } .report-overview { grid-template-columns: minmax(0,1fr); } .report-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:1000px) { .application-shell.context-open:not(.map-page):not(.map-context) #operations-dock { display: none; } .application-shell.context-open:not(.map-page):not(.map-context) #operation-layout { grid-template-columns: minmax(0,1fr); } .application-shell.context-open:not(.map-page):not(.map-context) #context-pane { grid-column: 1; } }
@media(max-width:760px) {
  .application-shell.context-open:not(.map-page) #operation-layout { grid-template-columns: minmax(0,1fr); }
  .application-shell:not(.map-page):not(.map-context) #workspace-expand-fleet { display: none; }
  .application-shell.wide-dock #operation-layout, .application-shell.panel-focus #operation-layout { grid-template-rows: minmax(0,1fr); }
  #app-shell { grid-template-columns: minmax(0,1fr); }
  #app-menu { position: fixed; inset: var(--header-height) auto 0 0; width: min(290px,85vw); z-index: 2200; transform: translateX(-100%); box-shadow: 6px 0 24px #102a3b40; }
  .menu-open #app-menu { transform: translateX(0); }
  #app-menu-toggle { display: inline-flex; width: 42px; min-width: 42px; min-height: 38px; padding: 6px; background: #214554; border-color: #45616c; color: #fff; }
  #app-menu-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  #app-menu-backdrop:not([hidden]) { display: block; position: fixed; inset: var(--header-height) 0 0; z-index: 2100; border: 0; background: #122d3b70; }
  .application-shell .topbar { gap: 9px; padding-inline: 8px; }
  .application-shell .brand { font-size: 1.1rem; }
  .application-shell .connection { min-width: 0; max-width: 122px; overflow: hidden; text-overflow: ellipsis; font-size: .625rem; }
  .application-shell #operation-layout, .application-shell.map-page #operation-layout, .application-shell.map-context #operation-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); }
  .application-shell.map-page:not(.context-open) #operations-dock { display: none; }
  .application-shell.map-page #map-stage { grid-row: 1; }
  .application-shell.context-open #context-pane { grid-column: 1; grid-row: 1; border-left: 0; }
  .application-shell.map-page.context-open:not(.panel-focus) #operation-layout, .application-shell.map-context.context-open:not(.panel-focus) #operation-layout { grid-template-rows: minmax(170px,35%) minmax(0,1fr); }
  .application-shell.map-page.context-open:not(.panel-focus) #context-pane, .application-shell.map-context.context-open:not(.panel-focus) #context-pane { grid-row: 2; }
  .application-shell.panel-focus #map-stage { display: none; }
  .application-shell .dock-heading { min-height: 56px; padding: 12px 14px; }
  .application-shell .dock-heading .eyebrow { display: none; }
  .application-shell .dock-heading strong { font-size: 1rem; }
  .application-shell #page-content > .workspace,.application-shell #page-content > .drivers-view,.application-shell #page-content > .zones-view,.application-shell #page-content > #view-dispatch,.application-shell #page-content > .simulation-view { padding: 8px; }
  .application-shell #page-content .fleet-search { grid-template-columns: minmax(0,1fr) 118px; }
  .context-navigation { padding: 7px 9px; }
  .context-navigation .button,.context-navigation .text-button { min-height: 40px; font-size: .875rem; }
  .context-title-row { padding: 7px 10px; }
  .context-title-row strong { font-size: .875rem; }
  .context-title-row .button { min-height: 38px; }
  .application-shell #stack-custom { padding: 14px; }
  .reports-view { padding: 13px 10px; }
  .reports-heading h1 { font-size: 1.25rem; }
  .reports-heading .button { width: 100%; min-height: 44px; }
  .report-filters { grid-template-columns: minmax(0,1fr); padding: 12px; gap: 11px; }
  .report-filters select,.report-sort select { font-size: 16px; min-height: 44px; }
  .report-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .report-kpis > div { padding: 12px; }
  .report-kpis strong { font-size: 1.05rem; }
  .report-overview { grid-template-columns: minmax(0,1fr); }
  .report-card { padding: 13px; }
  .report-tabs .tab { padding: 10px 13px; }
  #report-columns { display: inline-flex; }
  .report-table-heading .button { min-height: 44px; font-size: .8125rem; }
  .reports-view:not(.report-all-columns) .report-table { min-width: 0; table-layout: fixed; }
  .reports-view:not(.report-all-columns) .report-table :is(th,td) { display: none; padding: 11px 5px; }
  .reports-view:not(.report-all-columns) .report-table :is(th,td):is(:nth-child(1),:nth-child(3),:nth-child(6)) { display: table-cell; overflow-wrap: anywhere; min-width: 0; }
  .reports-view:not(.report-all-columns) .report-table th:first-child { width: 45%; }
  .report-entity { min-height: 44px; }
}
