.panel::before,
.panel::after {
  opacity: 0;
}

@media (hover: hover) {
  .panel:hover:not(:has(.panel:hover))::before,
  .panel:hover:not(:has(.panel:hover))::after {
    opacity: 1;
  }
}

.dashboard-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.dashboard-shell > header {
  box-sizing: border-box;
  max-height: 45vh;
  max-height: 45dvh;
  overflow: auto;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.dashboard-workspace > nav,
.dashboard-workspace > main {
  overflow: auto;
  overscroll-behavior: contain;
}

.dashboard-workspace > main > *,
.dashboard-workspace > nav > * {
  flex-shrink: 0;
}

/* Keep the stacked navigation reachable without pushing the workspace offscreen. */
@media (max-width: 791px) {
  .dashboard-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: fit-content(25%) minmax(0, 1fr);
  }
}

/* The console menu is the same on every staff screen: Monitoring on top, Administration anchored to the bottom. */
.dashboard-workspace > nav .nav-admin {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border, #252a2f);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* What a staff screen holds (a site's sections, a site's machines) sits as tabs above the content. */
.section-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.section-tabs .lbl { margin-right: 4px; }
.section-tabs .seg {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border, #252a2f);
  border-radius: 2px;
  background: transparent;
  color: var(--muted-strong, #aeb7c0);
  font: 600 12px 'Chakra Petch', sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
}
.section-tabs a.seg:hover { color: var(--text, #e8ecef); border-color: var(--strong-border, #3a4148); }
.section-tabs .seg.on { border-color: var(--accent, #c6ff3d); color: var(--accent, #c6ff3d); background: rgba(var(--accent-rgb, 198, 255, 61), .07); }
.section-tabs .seg .chip { margin-left: 8px; }

/* Client → Site → Machine: one row per step, aligned on their labels, set apart from the content below. */
.context-tabs { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border, #252a2f); }
.context-tabs:not(:has(.seg)) { display: none; }
.context-tabs .section-tabs > .lbl { min-width: 76px; }
