/* Shared dashboard workspace. Operational data and component hooks are unchanged. */
:root {
  color-scheme: light;
  --workspace-accent: #2463eb;
  --workspace-accent-soft: #edf3ff;
  --workspace-outer: #e9eaee;
  --bg: #f6f7f9;
  --surface: #fff;
  --surface-alt: #fafbfc;
  --combined-track-bg: #ffecd9;
  --border: #e8eaee;
  --border-light: #f0f1f3;
  --text: #15191f;
  --text-sec: #727985;
  --text-muted: #9299a3;
  --text-xmuted: #c3c8d0;
  --kpi-bg-from: var(--surface);
  --kpi-bg-to: var(--surface);
  --kpi-border: var(--border);
  --kpi-text: var(--text);
  --kpi-text-sec: var(--text-sec);
  --kpi-icon-bg: var(--workspace-accent-soft);
  --kpi-divider: var(--border);
  --kpi-spark: var(--workspace-accent);
  --kpi-spark-fill: #2463eb12;
  --debris-vegetative: #299d58;
  --debris-wood-chips: #9a6c46;
  --debris-cd: #d6a516;
  --tree-hanger: #f5c542;
  --tree-hanger-soft: #f5c54230;
  --tree-leaner: #e6534a;
  --tree-leaner-soft: #e6534a30;
  --shadow-kpi: 0 2px 3px #18223302;
  --shadow-sm: 0 1px 2px #18223304;
  --shadow: 0 8px 30px #18223309;
  --radius-lg: 22px;
  --radius: 12px;
  --sidebar-w: 224px;
  --workspace-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --workspace-outer: #0c1018;
  --bg: #121823;
  --surface: #1a2230;
  --surface-alt: #202a39;
  --combined-track-bg: var(--surface-alt);
  --border: #2b3544;
  --border-light: #253040;
  --text: #eff2f7;
  --text-sec: #a7b1c0;
  --text-muted: #8996a8;
  --workspace-accent: #6996ff;
  --workspace-accent-soft: #263656;
  --kpi-bg-from: var(--surface);
  --kpi-bg-to: var(--surface);
  --kpi-border: var(--border);
  --shadow-kpi: 0 1px 2px #0001;
  --shadow-sm: 0 1px 2px #0001;
  --shadow: 0 8px 30px #0002;
}
html, body { font-family: var(--workspace-font); }
body { background: var(--workspace-outer); color: var(--text); }
body:has(> .app-layout) { padding: 0; }
body > .app-layout { height: 100dvh; min-height: 0; border: 0; border-radius: 0; overflow: hidden; background: var(--bg); }
body > .row-dashboard-content, body:has(> .page-content) { background: var(--bg); }
body.row-dashboard-page .app-layout { height: 100dvh; }
.main { min-height: 0; overflow: hidden; }
/* Navigation */
/* Keep the original navy shell in both dashboard themes. */
.sidebar, .topbar {
  --surface: var(--brand-navy-dark);
  --surface-alt: #ffffff14;
  --border: #ffffff26;
  --text: #fff;
  --text-sec: #c5d0e2;
  --text-muted: #a9bad1;
  --workspace-accent: #fff;
  --workspace-accent-soft: #ffffff24;
}
.sidebar { width: var(--sidebar-w); height: 100%; position: relative; padding: 0 18px 22px; gap: 7px; background: var(--surface); border-color: var(--border); overflow-y: auto; overflow-x: hidden; }
.workspace-brand-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 75px; min-height: 75px; margin-bottom: 14px; }
.workspace-brand { display: inline-flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.workspace-brand-logo { display: block; width: 100%; max-width: 154px; height: auto; }
.sidebar-toggle { margin-left: auto; padding: 0; width: 26px; min-width: 26px; height: 30px; color: var(--text-sec); justify-content: center; border-radius: 6px; }
.sidebar-toggle:hover { background: var(--surface-alt); color: var(--text); }
.workspace-nav-label { align-self: flex-start; margin: 10px 10px 7px; color: var(--text-muted); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-item, .sidebar-item--labeled { position: relative; width: 100%; min-height: 43px; height: auto; padding: 11px 12px; gap: 11px; border-radius: 10px; color: var(--text-sec); text-decoration: none; justify-content: flex-start; }
.sidebar-item-label, .sidebar-item--combined .sidebar-item-label { min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.4; text-transform: none; white-space: normal; }
.sidebar-item > svg, .sidebar-item > img { width: 17px; height: 17px; flex: 0 0 17px; }
.sidebar-item img { filter: brightness(0) invert(1); opacity: .78; }
.sidebar-item:hover { background: var(--surface-alt); color: var(--text); }
.sidebar-item--active { background: var(--workspace-accent-soft); color: var(--workspace-accent); }
.sidebar-item--active::before { content: ""; position: absolute; left: -9px; top: 11px; bottom: 11px; width: 3px; background: var(--workspace-accent); border-radius: 3px; }
.sidebar-item:hover img, .sidebar-item--active img { opacity: 1; }
.sidebar-footer { width: 100%; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 16px; }
.sidebar-footer-note { padding: 12px; margin: 0; font-size: 12px; color: var(--text-muted); }
.sidebar-brand { display: none; }
.sidebar--collapsed { width: 76px; padding: 0 12px 18px; }
.sidebar--collapsed .workspace-brand { display: none; }
.sidebar--collapsed .workspace-brand-row { justify-content: center; }
.sidebar--collapsed .sidebar-toggle { margin: 0; }
.sidebar--collapsed .workspace-nav-label, .sidebar--collapsed .sidebar-footer-note, .sidebar--collapsed .sidebar-item-label { display: none; }
.sidebar--collapsed .sidebar-item--labeled { width: 50px; min-height: 44px; justify-content: center; padding: 0; }
/* Top bar and page controls */
.topbar, body.row-dashboard-page .topbar { position: relative; flex: 0 0 75px; height: 75px; padding: 0 28px; background: var(--surface); border-color: var(--border); }
.topbar-brand { min-width: 0; flex-shrink: 1; gap: 12px; }
.topbar-title { color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.5; letter-spacing: -.2px; }
.workspace-breadcrumb { color: var(--text-muted); font-size: 13px; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.workspace-breadcrumb svg { width: 13px; height: 13px; }
.topbar-right { gap: 10px; }
.theme-toggle { width: 37px; height: 37px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.theme-toggle:hover { color: var(--workspace-accent); background: var(--surface-alt); border-color: var(--border); }
.topbar-chip { min-height: 37px; display: inline-flex; gap: 7px; border: 1px solid var(--border); color: var(--text); background: var(--surface); border-radius: 20px; font-size: 13px; padding: 8px 15px; }
.topbar-chip:hover { background: var(--surface-alt); color: var(--text); border-color: var(--border); }
.topbar-chip svg { width: 14px; height: 14px; }
.workspace-mark { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: var(--workspace-accent-soft); color: var(--workspace-accent); font-size: 11px; font-weight: 650; letter-spacing: -.3px; }
.page-content, .row-dashboard-content { padding: 26px 28px 30px; gap: 20px; }
body.row-dashboard-page .app-layout .row-dashboard-content { height: auto; flex: 1 1 0; overflow: hidden; }
body.row-dashboard-page > .row-dashboard-content { height: 100dvh; overflow: hidden; }
.page-content--shell { padding: 0; min-height: 0; flex: 1 1 0; overflow: hidden; }
.page-content--shell > [hidden] { display: none; }
.layout-shell-frame { flex: 1; height: 100%; min-height: 0; width: 100%; border: 0; background: var(--bg); }
/* All six existing metrics, with the same data and units. */
.kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi-card { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-kpi); border-radius: 20px; min-height: 146px; padding: 19px 21px 17px; grid-template-rows: minmax(34px, auto) minmax(44px, auto) 20px; }
.kpi-card:hover { transform: none; box-shadow: var(--shadow-kpi); border-color: #d5deec; }
.kpi-card-top { align-items: center; padding-bottom: 6px; }
.kpi-card-label, .operations-dashboard .kpi-card-label { color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.4; overflow: visible; white-space: normal; text-transform: capitalize; }
.kpi-card-icon { width: 24px; height: 24px; color: var(--workspace-accent); }
.kpi-card-icon img { height: 16px; max-width: 19px; filter: brightness(0) saturate(100%) invert(32%) sepia(90%) saturate(3959%) hue-rotate(215deg); }
.kpi-card-icon--mask { color: var(--hub-side-bg, #203f6a); }
.kpi-card-icon--mask::before { content: ""; display: block; width: 19px; height: 16px; background: currentColor; -webkit-mask: var(--kpi-icon) center / contain no-repeat; mask: var(--kpi-icon) center / contain no-repeat; }
[data-theme="dark"] .kpi-card-icon--mask { color: #f47b20; }
.kpi-card-value, .kpi-card-segment-value { font-size: var(--kpi-value-fit-size, 30px); font-weight: 600; line-height: 1.2; letter-spacing: -1px; justify-self: start; color: var(--text); }
.kpi-card-value.skeleton, .kpi-card-segment-value.skeleton { color: var(--text-muted); }
.kpi-card-unit, .kpi-card-segment-label, .operations-dashboard .kpi-card-unit { color: var(--text-sec); font-size: 12px; font-weight: 400; line-height: 1.6; text-transform: capitalize; text-align: left; justify-self: start; }
.kpi-card-split { column-gap: 14px; align-self: stretch; }
.kpi-card-segment { justify-items: start; grid-template-rows: minmax(44px, auto) 20px; }
.kpi-card-split-divider { height: 30px; background: var(--border); }
/* Charts and project panels */
.mid-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
.row-dashboard-content .mid-row, .combined-dashboard .mid-row { flex: 0 0 auto; }
.chart-panel { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-kpi); padding: 21px; min-width: 0; }
.chart-panel-header { align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; gap: 12px; }
.chart-panel-title { color: var(--text); font-size: 15px; font-weight: 550; letter-spacing: -.2px; }
.chart-legend { gap: 12px; }
.chart-legend-item { color: var(--text-sec); font-size: 12px; font-weight: 400; }
.chart-legend-swatch { width: 8px; height: 8px; }
.chart-body { flex: 0 0 auto; height: 265px; min-height: 265px; border: 0; }
.dashboard-chart { flex: 0 0 auto; }
.dashboard-plot { height: 270px; }
.chart-grid-line { stroke: var(--border); stroke-dasharray: 4 5; }
.chart-y-axis-line, .chart-y-axis-tick { stroke: var(--border); }
.chart-y-axis-label, .chart-x-label { font-weight: 400; font-size: 12px; }
.chart-hover-guide { stroke: var(--text-muted); }
.chart-hover-band:hover { fill: #2463eb05; }
.bar-track, .bar-value-label { display: none; }
.chart-empty { color: var(--text-sec); font-size: 13px; }
.dashboard-chart svg text { fill: var(--text-sec); font: 12px var(--workspace-font); }
.dashboard-day-hit:hover, .dashboard-day-hit:focus { fill: #2463eb06; }
.chart-tooltip, .dashboard-chart-tooltip { border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: 0 4px 16px #18223314; border-radius: 10px; padding: 13px; font-size: 12px; }
.chart-tooltip-date, .chart-tooltip-item { color: var(--text-sec); }
.chart-tooltip-total { color: var(--text); font-weight: 600; }
.dashboard-tooltip-total { border-color: var(--border); }
.dashboard-chart-tooltip b { font-weight: 550; }
.map-cost-row, .combined-bottom { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); min-height: 360px; gap: 18px; }
.row-dashboard-content .map-cost-row, .combined-dashboard .combined-bottom { flex: 0 0 auto; min-height: 360px; }
.map-panel { padding: 0; }
.map-panel .boundary-map, .row-dashboard-content .boundary-map { min-height: 390px; }
.cost-panel { min-height: 360px; }
.combined-rankings, .combined-projects { overflow: visible; }
.combined-rankings { justify-content: space-around; gap: 0; }
.combined-rank { grid-template-columns: minmax(76px, 1fr) minmax(40px, 2.3fr) 105px; gap: 14px; min-height: 36px; font-size: 13px; flex: 0 0 auto; }
.combined-rank > span { color: var(--text-sec); }
.combined-rank strong { font-weight: 500; }
.combined-bar-track { background: var(--combined-track-bg); height: 9px; border-radius: 3px; }
.combined-bar { border-radius: 3px; background: linear-gradient(90deg, #ffc080, #f47b20); }
.combined-project { padding: 13px 0; border-bottom: 1px dashed var(--border); }
.combined-project > div { font-size: 13px; }
.combined-project a, .combined-project strong { color: var(--text); font-weight: 500; }
.combined-project a:hover { color: var(--workspace-accent); }
.combined-coverage { color: var(--text-sec); font-size: 12px; }
/* Generic layouts share the same shell. */
.widget-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-kpi); }
.widget-head h2 { font: 550 16px var(--workspace-font); }
.widget-type { font-size: 12px; color: var(--text-sec); font-weight: 500; letter-spacing: .04em; }
.viewer-layout-shell { border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: none; }
:focus-visible { outline: 2px solid var(--workspace-accent); outline-offset: 3px; }
@media (min-width: 1700px) { .kpi-row { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  :root { --sidebar-w: 195px; }
  .sidebar { padding-inline: 12px; }
  .workspace-brand { font-size: 18px; }
  .page-content, .row-dashboard-content { padding: 22px; }
  .page-content--shell { padding: 0; }
  .row-dashboard-content .chart-panel { min-height: 0; }
}
@media (min-width: 1180px) { .operations-dashboard .kpi-row { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 900px) { .mid-row, .map-cost-row, .combined-bottom { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  body:has(> .app-layout) { padding: 0; }
  body > .app-layout, body.row-dashboard-page .app-layout { height: 100dvh; border-radius: 0; border: 0; }
  .sidebar { width: 66px; padding: 0 8px 16px; }
  .workspace-brand-row { justify-content: center; }
  .workspace-brand { display: none; }
  .sidebar-toggle { margin: 0; }
  .workspace-nav-label, .sidebar-item-label, .sidebar-item--combined .sidebar-item-label, .sidebar-footer-note { display: none; }
  .sidebar-item, .sidebar-item--labeled { justify-content: center; padding: 12px; }
  .sidebar--collapsed { width: 66px; }
  .sidebar--collapsed .sidebar-item--labeled { width: 49px; }
  .topbar, body.row-dashboard-page .topbar { padding: 0 18px; height: 65px; flex-basis: 65px; }
  .workspace-breadcrumb, .workspace-mark { display: none; }
  .topbar-title { font-size: 13px; }
  .topbar-right { gap: 6px; }
  .topbar-chip { padding: 8px; }
  .topbar-chip .workspace-button-label { display: none; }
  .page-content, .row-dashboard-content { padding: 20px 16px; gap: 16px; }
  .page-content--shell { padding: 0; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi-card { padding: 16px; min-height: 135px; }
  .kpi-card-value, .kpi-card-segment-value { font-size: var(--kpi-value-fit-size, 27px); }
  .chart-panel { padding: 18px; }
  .dashboard-plot { height: 280px; }
  .combined-rank { grid-template-columns: 62px minmax(20px, 1fr) 95px; gap: 8px; }
}
@media (max-width: 460px) {
  .sidebar { display: flex; width: 52px; padding-inline: 5px; }
  .sidebar-item, .sidebar-item--labeled { padding: 11px 8px; min-height: 42px; }
  .sidebar--collapsed { width: 52px; }
  .sidebar--collapsed .sidebar-item--labeled { width: 41px; }
  .sidebar-item--active::before { left: -4px; }
  .topbar, body.row-dashboard-page .topbar { padding-inline: 12px; }
  .topbar-chip { display: none; }
  .page-content, .row-dashboard-content { padding: 18px 12px; }
  .page-content--shell { padding: 0; }
  .kpi-row { grid-template-columns: 1fr; }
}

.workspace-project-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cost-donut-track { stroke: var(--border); }
/* Map overlays remain usable in either theme and match the workspace panels. */
:root body .map-basemap-toggle,
:root body .map-fullscreen-button,
:root body .map-legend,
:root body .boundary-map .esri-widget--button:not(:where(.map-search-control *)),
:root body .boundary-map .esri-menu,
:root body .boundary-map .esri-search__suggestions-menu,
:root body .boundary-map .esri-search__sources-menu {
  background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); border-radius: 10px;
}
:root body .map-filter-toggle { color: var(--text); font-size: 12px; font-weight: 500; text-transform: none; }
:root body .map-filter-label { color: var(--text-sec); text-transform: none; font-size: 12px; font-weight: 400; }
:root body .map-filter-select,
:root body .map-filter-text-input,
:root body .map-date-input,
:root body .map-date-clear {
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); font-size: 12px; font-weight: 400; color-scheme: inherit; border-radius: 6px;
}
:root body .map-legend-item { font-weight: 500; font-size: 12px; }
:root body .map-filter-text-input::placeholder { color: var(--text-muted); }
:root body .boundary-map .esri-menu__list-item { color: var(--text); font-weight: 400; }
:root body .map-date-clear:hover,
:root body .map-fullscreen-button:hover,
:root body .map-filter-toggle:hover,
:root body .map-basemap-toggle:hover { background: var(--workspace-accent-soft); color: var(--workspace-accent); }
/* Settings uses the same sidebar, controls, card surfaces, and typography. */
.workspace-admin { --navy: var(--workspace-accent); --navy-2: var(--workspace-accent); --orange: var(--workspace-accent); --orange-dark: #1551dc; font-family: var(--workspace-font); }
.workspace-admin .admin-shell { width: 100%; max-width: none; margin: 0; padding: 26px 28px; overflow: auto; flex: 1; min-height: 0; }
.workspace-admin .admin-hero { padding: 0 0 24px; border: 0; border-radius: 0; box-shadow: none; background: none; color: var(--text); align-items: center; }
.workspace-admin .admin-hero h1 { font-size: 26px; font-weight: 600; letter-spacing: -.8px; }
.workspace-admin .admin-eyebrow { display: none; }
.workspace-admin .panel-eyebrow { color: var(--text-muted); font-size: 11px; font-weight: 500; letter-spacing: .07em; }
.workspace-admin .hero-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; }
.workspace-admin .admin-grid { margin-top: 0; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); }
.workspace-admin .admin-panel { padding: 22px; background: var(--surface); box-shadow: var(--shadow-kpi); border: 1px solid var(--border); border-radius: 22px; }
.workspace-admin .panel-head h2 { font-size: 18px; font-weight: 550; letter-spacing: -.3px; }
.workspace-admin .form-section h3 { font-size: 15px; font-weight: 550; }
.workspace-admin .field > span { font-size: 13px; font-weight: 500; }
.workspace-admin .field input, .workspace-admin .field select, .workspace-admin .field textarea { background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14px; border-radius: 9px; }
.workspace-admin .field input:focus, .workspace-admin .field select:focus, .workspace-admin .field textarea:focus { border-color: var(--workspace-accent); box-shadow: 0 0 0 3px var(--workspace-accent-soft); outline: none; }
.workspace-admin .dashboard-layout-card { background: var(--surface); border-color: var(--border); padding: 14px; border-radius: 14px; grid-template-columns: minmax(0, 1fr) minmax(130px, 40%); }
.workspace-admin .dashboard-layout-card[data-selected="true"] { background: var(--workspace-accent-soft); border-color: var(--workspace-accent); box-shadow: none; }
.workspace-admin .dashboard-layout-copy h4 { font-size: 14px; font-weight: 550; }
.workspace-admin .dashboard-layout-pill { font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--workspace-accent); background: var(--workspace-accent-soft); }
.workspace-admin .dashboard-layout-card:hover { transform: none; }
.workspace-admin .primary-button { background: #2463eb; border-color: #1551dc; color: white; font-size: 13px; font-weight: 500; border-radius: 20px; min-height: 38px; box-shadow: inset 0 0 0 2px #ffffff20; }
.workspace-admin .ghost-button { font-size: 13px; font-weight: 500; border-radius: 20px; min-height: 38px; }
.workspace-admin .project-card, .workspace-admin .form-section, .workspace-admin .layout-config-section { background: var(--surface); border-color: var(--border); box-shadow: none; }
.workspace-admin .dashboard-layout-preview { background: var(--bg); border-color: var(--border); }
.workspace-admin .toggle-list-option input:checked + .toggle-switch { background: var(--workspace-accent); border-color: var(--workspace-accent); }
@media (max-width: 1100px) {
  .workspace-admin .admin-grid { grid-template-columns: 1fr; }
  .workspace-admin .admin-shell { padding: 22px; }
}
@media (max-width: 760px) {
  .workspace-admin .admin-shell { padding: 20px 14px; }
  .workspace-admin .admin-panel { padding: 18px; }
  .workspace-admin .dashboard-layout-card { grid-template-columns: 1fr; }
}

.page-content--viewer { flex: 1 1 0; min-height: 0; overflow: auto; }
.page-content--viewer .viewer-layout-shell { min-height: 0; height: 100%; }
.page-content--viewer .viewer-layout-frame { min-height: 0; height: 100%; background: var(--surface); }
.page-content--embedded-viewer { height: 100dvh; }
.workspace-admin .layout-preview-shell { border-color: var(--border); box-shadow: none; background: var(--bg); }
.workspace-admin .layout-preview-frame { background: var(--bg); }
@media (max-width: 760px) {
  .app-layout { position: relative; }
  .sidebar:not(.sidebar--collapsed) { position: absolute; inset: 0 auto 0 0; width: 224px; z-index: 100; padding: 0 18px 20px; box-shadow: 10px 0 30px #18223312; }
  .sidebar:not(.sidebar--collapsed) .workspace-brand { display: inline-flex; }
  .sidebar:not(.sidebar--collapsed) .workspace-brand-row { justify-content: flex-start; }
  .sidebar:not(.sidebar--collapsed) .sidebar-toggle { margin-left: auto; }
  .sidebar:not(.sidebar--collapsed) .workspace-nav-label, .sidebar:not(.sidebar--collapsed) .sidebar-footer-note { display: block; }
  .sidebar:not(.sidebar--collapsed) .sidebar-item { justify-content: flex-start; }
  .sidebar:not(.sidebar--collapsed) .sidebar-item-label { display: inline; }
  .app-layout:has(> .sidebar:not(.sidebar--collapsed)) > .main { margin-left: 66px; }
}
@media (max-width: 460px) {
  .app-layout:has(> .sidebar:not(.sidebar--collapsed)) > .main { margin-left: 52px; }
}

:root body .map-date-details { background: var(--surface); border-color: var(--border); color: var(--text); }
.map-date-details-header, .map-date-details-section, .map-point-details-row { border-color: var(--border); }
.map-date-details-header h3 { font-size: 20px; font-weight: 600; letter-spacing: -.4px; }
.map-date-details-eyebrow, .map-date-details-section h4, .map-date-details-breakdown p { font-size: 12px; font-weight: 500; text-transform: none; line-height: 1.4; }
.map-date-details-metric, .map-date-details-empty, .map-point-details-close { background: var(--surface-alt); border-color: var(--border); }
.map-date-details-metric span, .map-date-details-metric small, .map-point-details-row span { font-size: 12px; font-weight: 400; text-transform: none; line-height: 1.4; white-space: normal; }
.map-date-details-metric strong { font-size: 18px; font-weight: 600; }
.map-date-details-row, .map-point-details-row strong, .map-date-details-empty, .map-point-details-close { font-size: 13px; font-weight: 500; }
.map-point-details-close:hover { background: var(--workspace-accent-soft); color: var(--workspace-accent); }
.map-empty-title { font-size: 15px; font-weight: 550; }
.map-empty-copy { font-size: 13px; }

/* Size each dashboard row to the available viewport, including embedded layouts. */
html:has(body.row-dashboard-page), body.row-dashboard-page { height: 100%; overflow: hidden; }
.row-dashboard-content {
  display: grid;
  grid-template-rows: max-content minmax(0, .95fr) minmax(0, 1.05fr);
  container-type: inline-size;
  container-name: dashboard;
  min-width: 0;
  padding: 16px 20px;
  gap: 12px;
}
.row-dashboard-content.dashboard--compact { grid-template-rows: max-content minmax(0, 1.2fr) minmax(0, .8fr); }
.operations-dashboard { position: relative; }
.row-dashboard-content.combined-dashboard:not(.dashboard--compact):not(.dashboard--short) { grid-template-rows: auto minmax(0, 1.25fr) minmax(0, .75fr); }
.chart-panel--debris .chart-legend-swatch { border-radius: 3px; }
.chart-panel--debris .chart-grid-line { stroke-opacity: .7; }
.chart-panel--debris .dashboard-day-hit:hover, .chart-panel--debris .dashboard-day-hit:focus { fill: #2463eb0b; }
.dashboard-day-hit { cursor: pointer; }
.dashboard-area-start { stop-opacity: .30; }
.dashboard-area-middle { stop-opacity: .11; }
[data-theme="dark"] .dashboard-area-start { stop-opacity: .36; }
[data-theme="dark"] .dashboard-area-middle { stop-opacity: .13; }
.dashboard-day-hit[aria-pressed="true"] { fill: #2463eb16; stroke: var(--workspace-accent); stroke-width: 1; stroke-dasharray: 3 3; }
.dashboard-tooltip-hint { margin-top: 7px; color: var(--text-sec); font-size: 11px; }
.dashboard-fleet-caption { color: var(--text-sec); font-size: 11px; }
.dashboard-chart svg .dashboard-fleet-label { fill: var(--text-sec); font-weight: 400; }
.dashboard-chart svg .dashboard-fleet-value { fill: var(--text); font-weight: 400; font-variant-numeric: tabular-nums; }
.dashboard-chart svg .dashboard-fleet-value--missing { fill: var(--text-sec); font-weight: 400; }
.dashboard-fleet-cell--missing { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.dashboard-day-hit.dashboard-fleet-day[aria-pressed="true"] { fill: #2463eb08; stroke-dasharray: none; }
.combined-rankings .combined-rank { appearance: none; border: 0; padding: 2px 10px; border-radius: 5px; background: transparent; color: var(--text); font-family: inherit; text-align: left; cursor: pointer; }
.combined-rankings .combined-rank:hover, .combined-rankings .combined-rank[data-selected="true"] { background: var(--workspace-accent-soft); }
.combined-rankings .combined-rank[data-selected="true"] > span:first-child { color: var(--workspace-accent); font-weight: 600; }
.combined-rankings .combined-rank:focus-visible { outline-offset: -2px; }
.combined-rankings .combined-bar-track, .combined-rankings .combined-bar { display: block; }
.combined-project--selected { background: var(--workspace-accent-soft); border-radius: 5px; }
.dashboard-timing {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 1px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-sec);
  font-size: 11px;
  line-height: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@container (max-width: 520px) {
  .dashboard-timing { font-size: 10px; gap: 4px; }
}
.row-dashboard-content .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.row-dashboard-content .kpi-card { min-height: 0; padding: 12px 16px; grid-template-rows: minmax(26px, auto) minmax(32px, auto) minmax(18px, auto); }

.row-dashboard-content .kpi-card-segment { grid-template-rows: minmax(32px, auto) 18px; }
.operations-dashboard .kpi-card-segment { container-type: inline-size; }
.row-dashboard-content.operations-dashboard .kpi-card-segment-value { font-size: clamp(12px, 36cqi, 28px); }
.row-dashboard-content.operations-dashboard .kpi-card-segment-label { font-size: clamp(9px, 24cqi, 12px); line-height: 1.4; white-space: nowrap; }
.row-dashboard-content.operations-dashboard .kpi-card--haul .kpi-card-segment-value { font-size: clamp(12px, 29cqi, 28px); }
.row-dashboard-content .kpi-card-value, .row-dashboard-content .kpi-card-segment-value { font-size: min(28px, var(--kpi-value-fit-size, 28px)); }
.row-dashboard-content .mid-row, .row-dashboard-content .map-cost-row {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  gap: 12px;
}
.row-dashboard-content .chart-panel { min-height: 0; min-width: 0; padding: 14px 16px; }
.row-dashboard-content .chart-panel-header { flex: 0 0 auto; gap: 8px; margin-bottom: 10px; }
.row-dashboard-content .chart-body { flex: 1 1 0; height: auto; min-height: 0; }
.row-dashboard-content .chart-svg { height: 100%; }
.row-dashboard-content .chart-empty { flex: 1; height: 100%; min-height: 0; }
.row-dashboard-content .dashboard-chart { position: relative; flex: 1 1 0; min-height: 0; }
.row-dashboard-content .dashboard-plot { flex: 1 1 0; height: auto; min-height: 0; }
.row-dashboard-content .map-panel { padding: 0; }
.row-dashboard-content .boundary-map { flex: 1 1 0; height: 100%; min-height: 0; }
.row-dashboard-content .map-empty, .row-dashboard-content .cost-panel-empty { min-height: 0; height: 100%; }
.row-dashboard-content .cost-panel { gap: 10px; }
.row-dashboard-content .cost-panel-body { overflow: auto; }
.row-dashboard-content .combined-rankings, .row-dashboard-content .combined-projects { min-height: 0; overflow: auto; }
/* Wrapped labels and FM buttons set row height; scroll the list instead of compressing rows. */
.row-dashboard-content .combined-rankings { display: grid; grid-template-columns: fit-content(160px) minmax(40px, 1fr) max-content; grid-auto-rows: max-content; align-content: start; gap: 4px 12px; }
.row-dashboard-content .combined-rank { grid-column: 1 / -1; grid-template-columns: subgrid; min-height: 22px; column-gap: inherit; font-size: 12px; }
.row-dashboard-content .combined-projects { display: flex; flex-direction: column; }
.row-dashboard-content .combined-project { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; min-height: 22px; padding: 1px 0; }
.row-dashboard-content .combined-project > div { font-size: 12px; gap: 8px; }
.row-dashboard-content .workspace-project-name { gap: 7px; }
.row-dashboard-content .combined-project strong { flex-shrink: 0; }
.dashboard-panel-tabs, .dashboard-chart-tabs { display: none; }
@container (min-width: 1000px) {
  .row-dashboard-content .kpi-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@container (min-width: 901px) {
  .operations-dashboard > .mid-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .combined-dashboard > .combined-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
/* On narrow screens, switch panels instead of squeezing or stacking the charts. */
@container (max-width: 900px) {
  .row-dashboard-content .kpi-card { padding-block: 8px; grid-template-rows: minmax(26px, auto) minmax(28px, auto) minmax(16px, auto); }
  .row-dashboard-content .kpi-card-segment { grid-template-rows: minmax(28px, auto) 16px; }
  .row-dashboard-content .mid-row, .row-dashboard-content .map-cost-row { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
  .dashboard-panel-tabs { display: flex; gap: 4px; }
  .row-dashboard-content .dashboard-panel:not(.dashboard-panel--selected) { display: none; }
}
@container (max-width: 760px) {
  .row-dashboard-content .kpi-card { padding: 10px; }
  .row-dashboard-content .kpi-card-label { font-size: 12px; }
  .row-dashboard-content .chart-panel { padding: 10px; }
  .row-dashboard-content .map-panel { padding: 0; }
  .row-dashboard-content .chart-panel-title { font-size: 13px; }
  .row-dashboard-content .combined-rankings { grid-template-columns: fit-content(140px) minmax(20px, 1fr) max-content; column-gap: 10px; }
}
@container (max-width: 520px) {
  .row-dashboard-content .kpi-row { gap: 6px; }
  .row-dashboard-content .kpi-card { padding: 8px; grid-template-rows: minmax(34px, auto) minmax(28px, auto) minmax(16px, auto); border-radius: 12px; }
  .row-dashboard-content .kpi-card-icon { display: none; }
  .row-dashboard-content .kpi-card-value, .row-dashboard-content .kpi-card-segment-value { font-size: min(20px, var(--kpi-value-fit-size, 20px)); }
  .row-dashboard-content .kpi-card-split { gap: 4px; }
  .row-dashboard-content .kpi-card-unit, .row-dashboard-content .kpi-card-segment-label { font-size: 10px; }
  .row-dashboard-content .combined-rankings { grid-template-columns: minmax(0, 1fr) max-content; column-gap: 8px; }
  .row-dashboard-content .combined-rank { min-height: 34px; gap: 2px 8px; }
  .row-dashboard-content .combined-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .row-dashboard-content .combined-project > div { flex-wrap: wrap; gap: 2px; }
}
@container (max-width: 360px) {
  .row-dashboard-content.operations-dashboard .kpi-card { padding-inline: 6px; }
}

/* Car browsers and short landscape windows: keep totals visible and dedicate
   the remaining height to one chart. The regular desktop layout stays intact. */
.row-dashboard-content.dashboard--short {
  grid-template-rows: auto 44px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 16px 20px;
}
.dashboard--short .dashboard-chart-tabs { display: flex; gap: 4px; min-width: 0; }
.dashboard-chart-tabs button {
  min-width: 0; min-height: 44px; padding: 0 18px; border: 0;
  border-radius: 8px; background: transparent; color: var(--text-sec);
  font: 500 13px var(--workspace-font); cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.dashboard-chart-tabs button[aria-selected="true"] { background: var(--workspace-accent-soft); color: var(--workspace-accent); }
.row-dashboard-content.dashboard--short > .mid-row,
.row-dashboard-content.dashboard--short > .map-cost-row {
  grid-row: 3; grid-column: 1; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.row-dashboard-content.dashboard--short > :is(.mid-row, .map-cost-row):not(.dashboard-row--focused),
.dashboard--short .dashboard-panel-tabs,
.row-dashboard-content.dashboard--short .dashboard-panel:not(.dashboard-panel--focused) { display: none; }
.row-dashboard-content.dashboard--short .kpi-row { gap: 8px; }
.row-dashboard-content.dashboard--short-wide .kpi-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.row-dashboard-content.dashboard--short .kpi-card { padding: 8px 10px; grid-template-rows: minmax(34px, auto) minmax(26px, auto) 16px; border-radius: 14px; }
.row-dashboard-content.dashboard--short .kpi-card-top { gap: 4px; }
.row-dashboard-content.dashboard--short .kpi-card-label { font-size: 12px; }
.row-dashboard-content.dashboard--short .kpi-card-icon { width: 18px; flex-basis: 18px; }
.row-dashboard-content.dashboard--short .kpi-card-icon--mask::before { width: 16px; height: 16px; }
.row-dashboard-content.dashboard--short .kpi-card-value { font-size: min(24px, var(--kpi-value-fit-size, 24px)); }
.row-dashboard-content.dashboard--short .kpi-card-segment { grid-template-rows: minmax(26px, auto) 16px; }
.row-dashboard-content.dashboard--short .kpi-card-segment-value { font-size: clamp(16px, 36cqi, 24px); }
.row-dashboard-content.dashboard--short .kpi-card-unit { font-size: 11px; }
.row-dashboard-content.dashboard--short .kpi-card-split { column-gap: 5px; }
.row-dashboard-content.dashboard--short .chart-panel { padding: 12px 14px; border-radius: 16px; }
.row-dashboard-content.dashboard--short .chart-panel-header { margin-bottom: 8px; }
.dashboard--short .dashboard-timing { left: 16px; right: 16px; bottom: 2px; }
@container (min-width: 521px) and (max-width: 759px) {
  .row-dashboard-content.dashboard--short:not(.dashboard--short-wide) .kpi-card { padding-block: 4px; grid-template-rows: minmax(20px, auto) minmax(24px, auto) 16px; }
  .row-dashboard-content.dashboard--short:not(.dashboard--short-wide) :is(.kpi-card-value, .kpi-card-segment-value) { font-size: 22px; }
  .row-dashboard-content.dashboard--short:not(.dashboard--short-wide) .kpi-card-icon { display: none; }
  .row-dashboard-content.dashboard--short:not(.dashboard--short-wide) .kpi-card-segment { grid-template-rows: minmax(24px, auto) 16px; }
}
@container (max-width: 520px) {
  .dashboard--short .dashboard-chart-tabs button { flex: 1; padding-inline: 4px; }
}

/* Preserve aligned project bars in browsers that predate CSS subgrid. */
@supports not (grid-template-columns: subgrid) {
  .row-dashboard-content .combined-rank { grid-template-columns: minmax(70px, 140px) minmax(20px, 1fr) 100px; }
  @container (max-width: 520px) {
    .row-dashboard-content .combined-rank { grid-template-columns: minmax(0, 1fr) max-content; }
  }
}
@container dashboard (max-width: 1200px) {
  /* Keep the full accessible label while shortening the visible direction. */
  .kpi-haul-prefix { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* The map surface must fit its card, including compact dashboard rows. */
.row-dashboard-content .boundary-map-view { min-height: 0; flex: 1 1 0; }
.row-dashboard-content .boundary-map:fullscreen,
.row-dashboard-content .boundary-map:-webkit-full-screen { height: 100dvh; min-height: 100dvh; }

/* Project detail cards use the map's right column without a full-height donut. */
.row-dashboard-content .map-cost-row.map-cost-row--map-only { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.row-dashboard-content .map-cost-row--map-only > .dashboard-panel-tabs { display: none; }
.row-dashboard-content:not(.combined-dashboard):not(.dashboard--compact):not(.dashboard--short) .cost-panel { align-self: start; }
.row-dashboard-content.row-dashboard--fleet:not(.dashboard--compact):not(.dashboard--short) { grid-template-rows: max-content minmax(0, 1fr) minmax(0, 1.25fr); }
.row-dashboard-content:not(.combined-dashboard).dashboard--compact:not(.dashboard--short) { grid-template-rows: max-content minmax(0, 1fr) minmax(190px, 1fr); }
.row-dashboard-content:not(.dashboard--compact):not(.dashboard--short) .map-cost-row--fleet { grid-template-rows: minmax(0, auto) minmax(170px, 1fr); }
.row-dashboard-content:not(.dashboard--compact):not(.dashboard--short) .map-cost-row--fleet .map-panel { grid-column: 1; grid-row: 1 / 3; }
.row-dashboard-content:not(.dashboard--compact):not(.dashboard--short) .map-cost-row--fleet .cost-panel { grid-column: 2; grid-row: 1; max-height: 100%; }
.row-dashboard-content:not(.dashboard--compact):not(.dashboard--short) .map-cost-row--fleet .project-fleet-panel { grid-column: 2; grid-row: 2; }
.row-dashboard-content :is(.cost-panel, .project-fleet-panel) { border-radius: 14px; }
.cost-panel-header { align-items: center; }
.cost-period { color: var(--text-sec); font-size: 11px; white-space: nowrap; }
.row-dashboard-content .cost-panel { gap: 12px; }
.cost-panel-total { color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.7px; }
.cost-breakdown { display: grid; gap: 12px; padding-bottom: 2px; }
.cost-breakdown-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; gap: 5px 10px; align-items: baseline; font-size: 12px; line-height: 1.3; }
.cost-breakdown-row strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-breakdown-label { color: var(--text-sec); }
.cost-breakdown-percent { color: var(--text-sec); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.cost-breakdown-track { grid-column: 1 / -1; height: 4px; border-radius: 3px; background: var(--border); overflow: hidden; }
.cost-breakdown-track span { display: block; height: 100%; border-radius: inherit; }
.row-dashboard-content .project-fleet-panel { gap: 0; border-radius: 22px; }
.project-fleet-body { flex: 1; min-height: 0; overflow: auto; }
.project-fleet-table { width: 100%; height: 100%; border-collapse: separate; border-spacing: 8px 10px; font-size: 12px; table-layout: fixed; }
.project-fleet-table th { color: var(--text-sec); font-weight: 400; text-align: center; padding: 0; line-height: 1.3; }
.project-fleet-table thead th { height: 30px; font-size: 12px; }
.fleet-date { display: block; margin-top: 3px; font-size: 11px; }
.project-fleet-table th:first-child { width: 92px; text-align: left; }
.project-fleet-table td { padding: 0; text-align: center; font-variant-numeric: tabular-nums; }
.fleet-count { display: flex; align-items: center; justify-content: center; height: 36px; max-height: 100%; border-radius: 4px; color: var(--text); background: color-mix(in srgb, var(--text-sec) calc(var(--fleet-intensity) * 100%), transparent); }
.fleet-count--missing { border: 1px dashed var(--border); color: var(--text-sec); }
.dashboard-panel-tabs button { border: 0; border-radius: 7px; padding: 5px 12px; background: transparent; color: var(--text-sec); font: 500 12px var(--workspace-font); cursor: pointer; }
.dashboard-panel-tabs button[aria-selected="true"] { background: var(--workspace-accent-soft); color: var(--workspace-accent); }
.dashboard-panel-tabs button, .dashboard-chart-tabs button { transition: none; }
@container (min-width: 901px) and (max-width: 1100px) {
  .row-dashboard--fleet:not(.dashboard--short) .map-cost-row { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
  .row-dashboard--fleet:not(.dashboard--short) .map-cost-row > .dashboard-panel-tabs { display: flex; gap: 4px; }
  .row-dashboard--fleet:not(.dashboard--short) .map-cost-row .dashboard-panel:not(.dashboard-panel--selected) { display: none; }
}
@container (max-width: 420px) {
  .cost-panel-total { font-size: 28px; }
  .project-fleet-table { border-spacing: 3px; font-size: 11px; }
  .project-fleet-table th:first-child { width: 62px; }
}

@container (max-width: 1200px) {
  .project-fleet-table { border-spacing: 4px 6px; }
  .project-fleet-table th:first-child { width: 60px; }
  .project-fleet-table thead th { font-size: 10px; }
  .fleet-date { font-size: 9px; }
}
.row-dashboard-content.dashboard--short .fleet-date { display: none; }
.row-dashboard-content.dashboard--short .project-fleet-table { border-spacing: 4px; }
/* Keep the three vehicle rows visible when the project card is short. */
.project-fleet-body { container: project-fleet / size; }
@container project-fleet (max-height: 160px) {
  .project-fleet-table { border-spacing: 4px; font-size: 11px; }
  .project-fleet-table thead th { height: 16px; font-size: 10px; }
  .fleet-date { display: none; }
  .fleet-count { height: 22px; }
}
@container project-fleet (max-height: 110px) {
  .project-fleet-table { border-spacing: 3px; font-size: 10px; }
  .fleet-count { height: 18px; }
}

/* Separate project filtering from WebDirect navigation. */
.combined-rank-name { display: flex; align-items: center; min-width: 0; gap: 6px; }
.combined-rank-name .combined-rank-filter { flex: 1; min-width: 0; }
.combined-rank-filter { appearance: none; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.combined-open-project { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 4px; color: #f58220; text-decoration: none; }
.combined-open-project svg { width: 14px; height: 14px; }
.combined-open-project:hover { color: #ff9b45; background: rgb(245 130 32 / 12%); }
.combined-open-project:focus-visible { outline: 2px solid #f58220; outline-offset: 2px; }

.dashboard-timing .row-data-status { color: inherit; font-size: inherit; line-height: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-day-hit[role="img"] { cursor: default; }
