/* The header spans the workspace and the rail so that navigation stays in place
   when a dashboard row opens its monitor. */
body.route-admin {
  --workspace-header: 3.6rem;
  --sidebar-w: 12.75rem;
  --workspace-bar: #101923;
  --workspace-accent: #9de4d0;
  --workspace-link: #8dbbff;
  --workspace-selection: #263b53;
}

:root[data-app-theme="light"] body.route-admin {
  --workspace-bar: #162b38;
  --workspace-accent: #a2f0d6;
  --workspace-link: #2059ae;
  --workspace-selection: #e8f0fa;
}

.app-shell { grid-template-rows: auto 1fr; }
.app-shell > .app-header {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  min-width: 0;
  height: var(--workspace-header);
  min-height: var(--workspace-header);
  padding: 0.4rem 1.15rem;
  gap: 1rem;
  border: 0;
  background: var(--workspace-bar);
}
.workspace-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  flex: none;
}
.workspace-brand .brand-mark { color: var(--workspace-accent); width: 1.8rem; height: 1.8rem; flex-basis: 1.8rem; }
.workspace-brand .brand-mark svg path { stroke: #173d39; }
.workspace-brand .brand-text strong { color: #f9fcff; font-size: 1.1rem; letter-spacing: -.055em; }
.app-header .actions-area { min-width: 0; width: auto; }
.app-header .global-search { flex: 0 1 22rem; width: auto; background: #ffffff0d; border-color: #ffffff32; }
.app-header .global-search > i { color: #e3eaf1; }
.app-header .global-search input { color: #f7fbfd; }
.app-header .global-search input::placeholder { color: #bed0dc; }
.workspace-last-ping { display:flex; align-items:center; gap:.45rem; white-space:nowrap; margin-left:auto; color:#c2d2dc; font-size:.74rem; }
.workspace-last-ping time { font: 500 .75rem var(--font-mono); color:#f6fbff; }
.workspace-last-ping[hidden], #recentMonitorNav[hidden] { display:none; }
.app-header .profile-trigger { min-width:0; min-height:2.5rem; border:0; background:transparent; color:#f6fbff; }
.app-header .profile-trigger-copy small,.app-header .profile-chevron { color:#c2d2dc; }
.app-header .profile-avatar { background:#2e4859; color:#eef9ff; }
.app-header .profile-dropdown { max-width:calc(100vw - 1.25rem); }
.app-sidebar .workspace-switcher { flex:0 0 auto; width:100%; min-width:0; justify-content:space-between; padding-bottom:1rem; border-bottom:1px solid var(--line); }
.app-sidebar .org-switcher-wrap { flex:1; min-width:0; }
.app-sidebar .org-switcher-trigger { width:100%; justify-content:flex-start; gap:.42rem; padding:.4rem .3rem; border:0; background:transparent; }
.app-sidebar .org-switcher-name { min-width:0; }
.app-sidebar #orgSwitcherRoleBadge { display:none; }
.app-sidebar .org-switcher-trigger > .fa-chevron-down { margin-left:auto; }
.app-sidebar #btnEditWorkspace { width:1.9rem; min-width:1.9rem; height:2rem; border:0; background:transparent; }
.app-sidebar .org-switcher-menu { left:0; right:auto; z-index:230; }
.app-sidebar .section-tab { padding:.55rem .6rem; }
.app-sidebar .section-tab.is-active { color:var(--workspace-link); background:var(--workspace-selection); }
.app-sidebar .section-tab.is-active i { color:inherit; }
.app-sidebar .section-tab.is-active::before { display:none; }
#btnRecentMonitor span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
:is(.section-dashboard, .section-dashboard-view, .section-monitor-detail) .app-container { max-width:none; }

@media (min-width:901px) {
  body.route-admin .app-sidebar { top:var(--workspace-header); height:calc(100dvh - var(--workspace-header)); z-index:20; padding:.9rem .65rem; }
}
@media (max-width:900px) {
  body.route-admin:not(.nav-open) .app-sidebar { visibility:hidden; }
  .app-shell > .app-header { gap:.45rem; padding-inline:.7rem; }
  .app-header .actions-area { display:flex; flex-direction:row; align-items:center; justify-content:flex-end; gap:.3rem; }
  .app-header .profile-trigger { min-width:2.5rem; width:2.5rem; }
  .app-header .profile-trigger-copy,.app-header .profile-chevron { display:none; }
  .app-header .mobile-nav-toggle { width:2.5rem; height:2.75rem; color:#e5eff5; border:0; background:transparent; margin:0; }
  .app-sidebar .workspace-switcher { align-items:center; }
  .app-sidebar .org-switcher-menu { max-width:min(330px, calc(100vw - 2.5rem)); }
}
@media (max-width:480px) {
  body.route-admin { --workspace-header:3.25rem; }
  .app-shell > .app-header { padding-inline:.4rem; gap:.18rem; }
  .workspace-brand { gap:.35rem; }
  .workspace-brand .brand-text strong { font-size:.98rem; }
  .workspace-brand .brand-mark { width:1.55rem; height:1.55rem; flex-basis:1.55rem; }
  .workspace-last-ping > span { display:none; }
  .workspace-last-ping time { font-size:.65rem; }
}
