/* Design direction mockups: the skeleton shared by the three versions (where things sit, what sticks, what
   scrolls). Each version's theme.css gives it the look of one design system. Loaded after the portal's own styles. */

:root.dx { color-scheme: light; --dx-top-h: 48px; --dx-nav-w: 256px; --dx-rail-w: 48px; --dx-nav-cur: 0px; --dx-gutter: 32px; --dx-gap: 24px; }
:root.dx.dx-in { --dx-nav-cur: var(--dx-nav-w); }
:root.dx, :root.dx body { font-family: var(--dx-font); background: var(--dx-bg); color: var(--dx-text); }
:root.dx body { display: grid; grid-template-columns: var(--dx-nav-cur) minmax(0, 1fr); grid-template-rows: var(--dx-top-h) 1fr auto; min-height: 100vh; font-size: 14px; line-height: 20px; }
:root.dx button:hover { filter: none; }
:root.dx :is(h1, h2, h3, p) { margin: 0; }
:root.dx .dx-i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: square; stroke-linejoin: miter; }

/* ---------- top bar ---------- */
:root.dx body > header { grid-column: 1 / -1; grid-row: 1; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: flex-start; gap: 0; height: var(--dx-top-h); padding: 0; background: var(--dx-top-bg); color: var(--dx-top-text); border-bottom: 1px solid var(--dx-top-border); }
:root.dx #section-nav, :root.dx .ck-theme-seg { display: none; }
:root.dx .dx-icon-btn { display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; padding: 0; border: 0; background: none; color: inherit; }
:root.dx #portal-home { display: flex; align-items: center; flex: none; gap: 12px; height: 100%; padding: 0 16px 0 8px; border: 0; background: none; color: inherit; }
:root.dx #portal-home:hover .portal-title { text-decoration: none; }
:root.dx:not(.dx-in) #portal-home { padding-left: 16px; }                        /* signed out: no navigation button before it */
:root.dx #portal-home .portal-title { display: none; }
:root.dx #portal-home .portal-logo { height: 28px; width: auto; }
:root.dx .dx-product { font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; }
:root.dx .dx-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; height: 100%; margin-right: auto; padding: 0 16px; font-size: 14px; line-height: 20px; white-space: nowrap; color: var(--dx-top-text-2); }
:root.dx .dx-crumb-sec:not(:empty)::after { content: "/"; margin-left: 8px; }
:root.dx .dx-crumb-page { overflow: hidden; text-overflow: ellipsis; color: var(--dx-top-text); font-weight: 600; }
:root.dx .dx-top-date { display: flex; align-items: center; flex: none; gap: 8px; height: 100%; padding: 0 16px; font-size: 14px; white-space: nowrap; color: var(--dx-top-text-2); }
:root.dx #session-controls { position: relative; display: flex; align-items: center; flex: none; gap: 0; height: 100%; font-size: 14px; }
:root.dx #session-controls .dx-acct-btn { display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 16px; border: 0; background: none; color: inherit; font-size: 14px; line-height: 20px; }
:root.dx .dx-avatar { display: inline-grid; place-items: center; flex: none; }
:root.dx .dx-initials { display: none; }
:root.dx #session-controls .dx-acct-menu { position: absolute; right: 0; top: 100%; z-index: 50; display: flex; flex-direction: column; min-width: 208px; background: var(--dx-surface); color: var(--dx-text); box-shadow: var(--dx-shadow-pop); }
:root.dx #session-controls .dx-acct-menu button { width: 100%; border: 0; background: none; color: inherit; text-align: left; white-space: nowrap; font-size: 14px; line-height: 20px; }

/* ---------- left navigation ---------- */
:root.dx .dx-nav { position: fixed; left: 0; top: var(--dx-top-h); bottom: 0; z-index: 30; width: var(--dx-nav-w); overflow: hidden auto; background: var(--dx-nav-bg); border-right: 1px solid var(--dx-nav-border); }
:root.dx :is(.dx-nav-list, .dx-nav-kids) { list-style: none; margin: 0; padding: 0; }
:root.dx .dx-nav-item { display: flex; align-items: center; width: 100%; border: 0; background: none; color: var(--dx-nav-text); font-size: 14px; line-height: 20px; text-align: left; white-space: nowrap; overflow: hidden; }
:root.dx .dx-nav-text { overflow: hidden; text-overflow: ellipsis; }
:root.dx .dx-nav-tag { flex: none; margin-left: auto; }
:root.dx .dx-nav-scrim { display: none; }
:root.dx .dx-nav-sec:not(.dx-open) > .dx-nav-kids { display: none; }               /* one section open at a time: the one you are in */
@media (min-width: 1056px) {
  /* Collapsed: an icon rail that opens over the page while the pointer or the keyboard is in it. */
  :root.dx.dx-in.dx-rail { --dx-nav-cur: var(--dx-rail-w); }
  :root.dx.dx-rail .dx-nav:not(:hover):not(:focus-within) { width: var(--dx-rail-w); }
  :root.dx.dx-rail .dx-nav:is(:hover, :focus-within) { box-shadow: var(--dx-shadow-pop); }
  :root.dx.dx-rail .dx-nav:not(:hover):not(:focus-within) :is(.dx-nav-text, .dx-nav-kids, .dx-nav-tag) { display: none; }
}
@media (max-width: 1055px) {
  /* Narrow window: the navigation opens over the page from the top bar button. */
  :root.dx.dx-in { --dx-nav-cur: 0px; --dx-gutter: 16px; }
  :root.dx .dx-nav { transform: translateX(-100%); }
  :root.dx.dx-nav-open .dx-nav { transform: none; box-shadow: var(--dx-shadow-pop); }
  :root.dx.dx-nav-open .dx-nav-scrim { display: block; position: fixed; inset: var(--dx-top-h) 0 0 0; z-index: 29; background: var(--dx-scrim); }
  :root.dx .dx-crumb-sec, :root.dx .dx-top-date, :root.dx #signed-in { display: none; }
}

/* ---------- page ---------- */
:root.dx main { grid-column: 2; grid-row: 2; min-width: 0; padding: 0; }
:root.dx footer { grid-column: 2; grid-row: 3; padding: 16px var(--dx-gutter); text-align: left; font-size: 12px; line-height: 16px; color: var(--dx-text-3); }
:root.dx main > section.sc, :root.dx #accounts-panel { padding: 24px var(--dx-gutter) 32px; }
:root.dx main > section.sc > .sc-tabs { display: none; }                       /* the left navigation lists these views */
:root.dx[data-dx-view="scorecards:exec"] #scorecards-panel > :is(.sc-head, details.sc-defs) { display: none; }
:root.dx #sc-exec { display: flex; flex-direction: column; gap: var(--dx-gap); }
:root.dx #sc-exec > .ex-toolbar { display: none; }                             /* its controls now sit in the filter row */
:root.dx .dx-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
:root.dx .dx-ph-text { min-width: 0; }
:root.dx .dx-sub { display: flex; flex-wrap: wrap; gap: 0 8px; color: var(--dx-text-2); }
:root.dx .dx-sub span + span::before { content: "·"; margin-right: 8px; }
:root.dx .dx-btn { display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; }

/* one filter row */
:root.dx .dx-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; }
:root.dx .dx-f { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
:root.dx .dx-f-l, :root.dx #ex-prior { padding: 0; border-radius: 0 !important; background: none; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--dx-text-2); white-space: nowrap; }
:root.dx .dx-period { display: flex; align-items: center; }
:root.dx .sc-seg { display: inline-flex; margin: 0; }
:root.dx .sc-seg button { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; white-space: nowrap; }
:root.dx .sc-seg button::after { content: attr(data-label); display: block; height: 0; overflow: hidden; visibility: hidden; font-weight: 600; }
:root.dx :is(#ex-prev, #ex-next) { position: relative; flex: none; width: 32px; height: 32px; padding: 0; font-size: 0; }
:root.dx :is(#ex-prev, #ex-next)::before { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 1.5px 1.5px; transform: translate(-30%, -50%) rotate(45deg); }
:root.dx #ex-next::before { transform: translate(-70%, -50%) rotate(-135deg); }
:root.dx #ex-day { min-width: 208px; max-width: 100%; height: 32px; margin: 0; font-size: 14px; line-height: 20px; font-weight: 400; -webkit-appearance: none; appearance: none; cursor: pointer; }

/* status line */
:root.dx .dx-status { display: flex; align-items: flex-start; }
:root.dx .dx-status-i { display: inline-grid; flex: none; }
:root.dx .dx-status[data-level="warn"] .dx-i-info, :root.dx .dx-status[data-level="info"] .dx-i-warn { display: none; }
:root.dx .dx-issues { display: flex; flex-direction: column; flex: 1; min-width: 0; }
:root.dx .dx-issues .sc-banner { margin: 0; padding: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; }
:root.dx .dx-issues .dx-lead { order: -1; }
:root.dx .dx-status:not(.dx-open) .dx-issues .sc-banner:not(.dx-lead) { display: none; }
:root.dx .dx-status:not(.dx-open) .dx-issues .dx-lead { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
:root.dx .dx-status.dx-open .dx-issues .sc-banner + .sc-banner { margin-top: 8px; }
:root.dx .dx-status-more { flex: none; white-space: nowrap; }

/* key figures */
:root.dx .dx-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
:root.dx .dx-kpi { display: flex; flex-direction: column; min-width: 0; }
:root.dx .dx-kpi-l, :root.dx .dx-kpi-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root.dx .dx-kpi-ctx::after { content: " · "; }
:root.dx .dx-kpi-v { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
:root.dx .dx-kpi-s { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
:root.dx .dx-kpi-parts { overflow: hidden; text-overflow: ellipsis; }
:root.dx .dx-tag { display: inline-flex; align-items: center; flex: none; white-space: nowrap; }
:root.dx .dx-kpi-state { display: none; }
@media (max-width: 1280px) { :root.dx .dx-kpis { grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); } }

/* panels: table and trend */
:root.dx .dx-body { display: flex; flex-direction: column; gap: var(--dx-gap); min-width: 0; }
:root.dx .dx-panel { min-width: 0; margin: 0; }
:root.dx .dx-panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
:root.dx .dx-panel-titles { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 16px; min-width: 0; margin-right: auto; }
:root.dx .dx-panel-trend .sc-card-head { margin: 0; }

/* the table: sticky header rows and first column, zebra rows, one line per cell */
:root.dx #ex-table { overflow: auto; max-height: calc(100vh - var(--dx-top-h) - 16px); margin: 0; border: 0; border-radius: 0; background: var(--dx-surface); overscroll-behavior-x: contain; }
:root.dx #ex-table .ex-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: var(--dx-cell-fs); line-height: var(--dx-cell-lh); color: var(--dx-text); font-variant-numeric: tabular-nums; }
:root.dx #ex-table .ex-table :is(th, td) { box-sizing: border-box; height: var(--dx-row-h); padding: 0 var(--dx-cell-px); border: 0; border-bottom: 1px solid var(--dx-border); background: var(--dx-surface); text-align: right; vertical-align: middle; white-space: nowrap; font-style: normal; }
:root.dx #ex-table .ex-table .ex-left { text-align: left; }
:root.dx #ex-table .ex-table .ex-edge { border-left: 1px solid var(--dx-border-2); }
:root.dx #ex-table .ex-table thead th { position: sticky; z-index: 3; }
:root.dx #ex-table .ex-table thead tr:first-child th { top: 0; height: var(--dx-ghead-h); text-align: left; }
:root.dx #ex-table .ex-table thead tr:last-child th { top: var(--dx-ghead-h); height: var(--dx-lhead-h); padding-top: 4px; padding-bottom: 8px; vertical-align: bottom; white-space: normal; }
:root.dx #ex-table .ex-table thead tr:last-child th:first-child { left: 0; z-index: 5; }
:root.dx #ex-table .ex-table tbody td:first-child:not([colspan]) { position: sticky; left: 0; z-index: 2; box-shadow: inset -1px 0 0 var(--dx-border-2); }
:root.dx #ex-table .ex-table thead tr:last-child th:first-child { box-shadow: inset -1px 0 0 var(--dx-border-2); }
/* the whole first column stays: the corner above Area, and the labels of rows that span the table (Direct labor,
   Kraut + Kimchi ...); column group names stop beside the corner while their columns are in view */
:root.dx #ex-table .ex-table thead tr:first-child th:first-child { left: 0; z-index: 6; }
:root.dx #ex-table .ex-table .dx-stick { position: sticky; left: var(--dx-cell-px); display: inline-block; }
:root.dx #ex-table .ex-table thead .dx-stick { left: calc(var(--dx-corner-w, 0px) + var(--dx-cell-px)); }
:root.dx #ex-table .ex-table tr.ex-rehead th:not(.ex-g):not(.ex-blank) { white-space: nowrap; background: var(--dx-layer, #f4f4f4); }   /* column names again above Indirect labor (user 11/19, 11/23): the top header scrolls away with the page */
:root.dx #ex-table .ex-table tr.ex-rehead th:first-child { position: sticky; left: 0; z-index: 2; }
:root.dx #ex-table .ex-table tr.ex-rehead-g th { text-align: left; }
:root.dx #ex-table .ex-table td.ex-name { max-width: 224px; overflow: hidden; text-overflow: ellipsis; }
:root.dx #ex-table .ex-table td.ex-sku { max-width: 184px; overflow: hidden; text-overflow: ellipsis; color: var(--dx-text-2); }
:root.dx #ex-table .ex-table td.ex-sku div { overflow: hidden; text-overflow: ellipsis; }
:root.dx #ex-table .ex-table thead tr:last-child th[data-c*=" "] { min-width: var(--dx-th-min); }
:root.dx #ex-table .ex-table thead tr:last-child th:is([data-c="OT %"], [data-c="Fcst var $"], [data-c="OT Hrs"], [data-c="Target / Hr"]) { min-width: 0; white-space: nowrap; }
:root.dx #ex-table .ex-table tr.dx-z td { background: var(--dx-zebra); }
:root.dx #ex-table .ex-table tr.ex-idle td { color: var(--dx-text-disabled); }
:root.dx #ex-table .ex-table tr.ex-line { cursor: pointer; }
:root.dx #ex-table .ex-table tr.ex-line:hover td { background: var(--dx-hover); }
:root.dx #ex-table .ex-table tr.ex-sel td { background: var(--dx-selected); }
:root.dx #ex-table .ex-table tr.ex-sel td:first-child { box-shadow: inset 3px 0 0 var(--dx-accent), inset -1px 0 0 var(--dx-border-2); }
:root.dx #ex-table .ex-table tr td.ex-good { color: var(--dx-good); }   /* "tr" so a status cell on an idle (gray) row keeps its color */
:root.dx #ex-table .ex-table tr td.ex-bad { color: var(--dx-bad); }
:root.dx #ex-table .ex-table td.ex-click { text-decoration: none; cursor: pointer; }
:root.dx #ex-table .ex-table td.ex-click:hover { text-decoration: underline; }
/* column groups: the switch shows one group at a time or all of them */
:root.dx #ex-table[data-cols="cost"] :is([data-g="out"], [data-g="hc"]),
:root.dx #ex-table[data-cols="out"] :is([data-g="cost"], [data-g="hc"]),
:root.dx #ex-table[data-cols="hc"] :is([data-g="cost"], [data-g="out"]) { display: none; }

/* trend: area picker and chart */
:root.dx #ex-areas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin: 0; }
:root.dx #ex-areas :is(.sc-qf, .sc-qf-row) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
:root.dx #ex-areas .sc-qf { order: 2; margin-left: auto; gap: 0; }
:root.dx #ex-areas .sc-qf .sc-qf-l { display: none; }
:root.dx #ex-areas .sc-qf-l { min-width: 0; margin: 0; font-size: 12px; line-height: 16px; color: var(--dx-text-2); }
:root.dx #ex-areas .sc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
:root.dx #ex-areas .sc-chips button { display: inline-flex; align-items: center; opacity: 1; white-space: nowrap; }
:root.dx #ex-areas .sc-sw { flex: none; }

/* "About this page" */
:root.dx .dx-scrim { position: fixed; inset: 0; z-index: 60; background: var(--dx-scrim); }
:root.dx .dx-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; display: flex; flex-direction: column; width: min(400px, 100vw); background: var(--dx-surface); color: var(--dx-text); box-shadow: var(--dx-shadow-pop); outline: none; }
:root.dx .dx-drawer-head { display: flex; align-items: center; justify-content: space-between; flex: none; }
:root.dx .dx-drawer-body { overflow: auto; }
:root.dx .dx-drawer-list { margin: 8px 0 0; padding-left: 20px; }
:root.dx .dx-drawer-note { margin-top: 8px; }
:root.dx .dx-defs { margin: 0; color: inherit; font-size: inherit; }
:root.dx .dx-defs > summary { display: none; }
:root.dx .dx-defs > p { color: inherit; font-size: inherit; line-height: inherit; }

/* who was on the clock (the dashboard's own dialog) */
:root.dx dialog.ex-roster { font-family: var(--dx-font); color: var(--dx-text); background: var(--dx-surface); }
