/**
 * Public/css/workspace.css — Workspace Topbar & Layout Fixes
 */

:root, :root[data-theme=dark], [data-theme=dark], html {
  color-scheme: light !important;
  --surface: #fff !important;
  --surface-soft: #f8f9fa !important;
  --surface-hover: #f1f3f5 !important;
  --sidebar: #f8f9fa !important;
  --text: #15191d !important;
  --muted: #758089 !important;
  --line: #e5e8ea !important;
}

.workspace-app .workspace-topbar,
.workspace-app .workspace-topbar.jianyue-topbar,
:root[data-theme=dark] .workspace-app .workspace-topbar,
:root[data-theme=dark] .workspace-app .workspace-topbar.jianyue-topbar {
  color: #1e2432 !important;
  background: #fff !important;
  border-bottom: 1px solid #e2e5ed !important;
}

.jianyue-topbar .workspace-primary-nav .nav-item,
:root[data-theme=dark] .jianyue-topbar .workspace-primary-nav .nav-item {
  color: #6f7c8e !important;
}

.jianyue-topbar .workspace-primary-nav .nav-item:hover,
:root[data-theme=dark] .jianyue-topbar .workspace-primary-nav .nav-item:hover {
  color: #344c77 !important;
  background: #f6f8fb !important;
}

.jianyue-topbar .workspace-primary-nav .nav-item.active,
:root[data-theme=dark] .jianyue-topbar .workspace-primary-nav .nav-item.active {
  color: #263247 !important;
}

.jianyue-topbar .workspace-user-avatar.workspace-user-name,
:root[data-theme=dark] .jianyue-topbar .workspace-user-avatar.workspace-user-name {
  color: #2f548e !important;
  background: #edf3fc !important;
  border-color: #d1dced !important;
}

.jianyue-topbar .workspace-signout,
:root[data-theme=dark] .jianyue-topbar .workspace-signout {
  color: #536073 !important;
  background: #fff !important;
  border: 1px solid #dfe5ec !important;
}

.jianyue-topbar .workspace-fleet-health span,
:root[data-theme=dark] .jianyue-topbar .workspace-fleet-health span {
  color: #6b7280 !important;
  background: #f2f3f7 !important;
  border: 1px solid #e2e5ed !important;
}

.jianyue-topbar .workspace-fleet-health .is-online,
:root[data-theme=dark] .jianyue-topbar .workspace-fleet-health .is-online {
  color: #07875f !important;
  background: #ecfdf5 !important;
  border-color: #c8f1df !important;
}

.jianyue-topbar .topbar-currency-trigger,
.jianyue-topbar .topbar-report-trigger,
:root[data-theme=dark] .jianyue-topbar .topbar-currency-trigger,
:root[data-theme=dark] .jianyue-topbar .topbar-report-trigger {
  color: #536073 !important;
  background: #fff !important;
  border: 1px solid #dfe5ec !important;
}

.jianyue-topbar .icon-button,
:root[data-theme=dark] .jianyue-topbar .icon-button {
  color: #6b7280 !important;
}

.appearance-control {
  display: none !important;
}

/* ── Scroll Fix: ensure single root scroll container and no trapped scroll latching ── */
html {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100%;
}

body {
  overflow: visible !important;
  height: auto !important;
  min-height: 100%;
}

#root,
.app-shell.workspace-app {
  overflow: visible !important;
  height: auto !important;
  min-height: 100dvh;
}

main.workspace {
  overflow: visible !important;
  height: auto !important;
  min-height: 100dvh;
  display: block !important;
}

.workspace-page-region,
.module-route-builds,
.module-route-devices,
.module-route-inject,
.module-route-settings {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}

.content.device-workspace.jianyue-device-page.jy-list,
.content.jianyue-device-page.jy-list {
  min-height: 0 !important;
  height: auto !important;
  flex: 1;
}

.module-route-builds > .content,
.workspace-app :is(.module-route-builds, .module-route-inject, .module-route-settings) > .content {
  height: auto !important;
  overflow: visible !important;
  padding-bottom: 90px !important;
}
