/* Industrial console: shared layout, accessibility and component styling.
   Visual language shared with the OPC UA Simulator. */
:root {
  color-scheme: light;
  --bg: #f3f6fa; --surface: #fff; --surface-soft: #f7f9fc;
  --line: #e1e8f0; --line-soft: #e9eef4;
  --text: #182b45; --ink: var(--text); --muted: #61748b;
  --primary: #087e8b; --primary-strong: #066774; --accent: var(--primary);
  --blue: var(--primary); --blue-soft: #eaf5f5;
  --green: var(--primary); --green-dark: var(--primary-strong); --mint: var(--blue-soft);
  --success: #087d58; --danger: #b42318;
  --nav-bg: #10283b; --nav-hover: #214457; --nav-line: #294557; --nav-text: #c3d4df;
  --sidebar: 272px;
  --focus-ring: 0 0 0 3px rgb(8 126 139 / 20%);
}
html { scrollbar-gutter: stable; }
body { line-height: 1.45; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
a { color: var(--primary); }
body.app-sidebar-page { padding-left: var(--sidebar); }
body.app-sidebar-page.app-sidebar-collapsed { --sidebar: 68px; }
body .app-sidebar {
  position: fixed; inset: 0 auto 0 0; height: 100dvh; width: var(--sidebar);
  padding: 16px 12px 10px; background: var(--nav-bg); color: var(--nav-text);
  border-right: 1px solid var(--nav-line); box-shadow: none; z-index: 40;
}
.app-sidebar-brand { padding: 4px 8px 20px; border-bottom-color: var(--nav-line); }
.app-sidebar-logo { color: #fff; }
.app-sidebar-logo-mark { flex: 0 0 34px; border-radius: 5px; background: var(--primary); box-shadow: none; }
.app-sidebar-logo-copy strong { font-size: .9rem; letter-spacing: .03em; }
.app-sidebar-logo-copy small { font-size: .7rem; }
.app-sidebar-logo-copy strong::after, .app-sidebar-logo-copy small::after { content: none; }
.app-sidebar-logo-copy small, .app-sidebar-user-copy small { color: var(--nav-text); }
body .app-sidebar-nav { flex: 1; flex-direction: column; gap: 4px; padding-top: 16px; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #50657b transparent; }
body .app-sidebar-label { display: flex; min-height: 34px; padding: 14px 10px 6px; color: #94a9bd; font-size: .68rem; letter-spacing: .08em; }
.app-sidebar-label a { color: var(--nav-text); }
.app-sidebar-link { flex-shrink: 0; min-height: 40px; padding: 10px; border-radius: 5px; color: var(--nav-text); font-weight: 500; font-size: .85rem; }
.app-sidebar-link:hover, .app-sidebar-link:focus-visible, .app-sidebar-link.active { background: var(--nav-hover); color: #fff; }
.app-sidebar-link.active { box-shadow: inset 3px 0 var(--primary); }
.app-sidebar-text { min-width: 0; white-space: normal; line-height: 1.3; }
.app-sidebar-icon { display: grid; place-items: center; flex: 0 0 20px; color: inherit; }
.app-sidebar-icon svg, .shell-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-count, .app-sidebar-link.active .nav-count { color: var(--nav-text); background: var(--nav-hover); border-color: var(--nav-line); font-weight: 600; }
.app-sidebar-footer { flex-shrink: 0; margin-top: 12px; padding: 12px 6px 4px; border-color: var(--nav-line); }
.app-sidebar-user-copy { min-width: 0; overflow-wrap: anywhere; }
.app-sidebar-logout { color: var(--nav-text); }
.app-sidebar-logout:hover { color: #fff; }
.app-sidebar-collapsed .app-sidebar { padding-inline: 10px; }
.app-sidebar-collapsed .app-sidebar-brand { padding-inline: 6px; }
.app-sidebar-collapsed .app-sidebar-link { justify-content: center; padding-inline: 10px; }
.app-sidebar-collapsed :is(.app-sidebar-logo-copy,.nav-count,.app-sidebar-user-copy,.app-sidebar-user-avatar) { display: none; }
.app-sidebar-collapsed .app-sidebar-label { font-size: 0; min-height: 17px; padding: 0; margin: 6px 3px; border-top: 1px solid var(--nav-line); }
.app-sidebar-collapsed .app-sidebar-label a { display: none; }
.app-sidebar-collapsed .app-sidebar-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.app-sidebar-collapsed .app-sidebar-footer { justify-content: center; }
.topbar { height: 60px; padding: 0 24px; background: var(--surface); box-shadow: none; }
.topbar-inner { gap: 16px; min-width: 0; justify-content: flex-start; }
.shell-toggle { flex: 0 0 34px; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); }
.shell-toggle:hover { background: var(--blue-soft); color: var(--primary); }
.mobile-close { display: none; }
.breadcrumbs { display: flex; min-width: 0; overflow: hidden; }
.breadcrumbs > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.topbar-search { min-width: 0; max-width: 420px; }
.topbar-search input { min-width: 0; min-height: 36px; background: var(--surface); }
.topbar-search .btn { border-radius: 0 5px 5px 0; min-height: 36px; }
.topbar-status { white-space: nowrap; }
.sidebar-backdrop { display: none; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 10px 14px; background: var(--surface); color: var(--primary); border: 1px solid var(--primary); border-radius: 5px; }
.skip-link:focus { top: 8px; }
.nx { width: 100%; min-width: 0; max-width: 1600px; padding: 26px 28px 44px; }
body :is(.nx,dialog) :where(.card,.grid,.formgrid,.settings-layout,.route-grid,.route-card,.page-heading,.workspace-grid,.section-title) { min-width: 0; max-width: 100%; }
body :is(.card,.workspace-card,.hero-panel,.server-card,.structure-server,.hierarchy-server,.route-editor-panel,.route-card,.payload-editor,.tag-picker,.structure-toolbar,.tree-server) { border-radius: 8px; box-shadow: none; }
body .card { padding: 20px; }
body :is(.workspace-card,.hero-panel,.server-card-header,.structure-server-header,.hierarchy-server-header,.route-editor-panel,.payload-editor,.structure-toolbar) { background: var(--surface); border-color: var(--line); }
body :is(.hierarchy-server,.structure-group-header) { background: var(--surface-soft); }
body .hero-panel { padding: 24px; }
.hero-panel::after { content: none; }
body :is(.page-heading h1,.hero-panel h1,.hero-panel h2) { font-size: clamp(1.3rem, 2vw, 1.65rem); line-height: 1.3; letter-spacing: -.02em; }
.page-heading { flex-wrap: wrap; align-items: center; }
.page-heading p, .hero-panel p { color: var(--muted); }
.eyebrow { color: var(--primary-strong); font-weight: 600; }
.metric { color: var(--text); font-size: 28px; font-variant-numeric: tabular-nums; }
.server-cell { display: flex; align-items: flex-start; gap: 10px; }
.server-cell .hierarchy-icon { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 5px; background: var(--blue-soft); }
.structure-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.global-search-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.global-search-form label { flex: 1 1 240px; min-width: 0; }
.search-summary { margin: 0 0 14px; color: var(--muted); overflow-wrap: anywhere; }
.search-summary strong { color: var(--text); }
.search-items { display: grid; margin-top: 14px; }
.search-item { display: grid; grid-template-columns: 28px minmax(0,1fr) minmax(100px,.6fr); align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line-soft); color: var(--text); }
.search-item:hover { background: var(--blue-soft); }
.search-item strong,.search-item small { display: block; overflow-wrap: anywhere; }
.search-item small { color: var(--muted); margin-top: 4px; font-size: 12px; }
.search-item-icon { display: grid; place-items: center; height: 28px; border-radius: 5px; color: var(--primary); background: var(--blue-soft); }
.search-item-context { min-width: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.workspace-card:hover { background: var(--blue-soft); border-color: var(--primary); transform: none; box-shadow: none; }
body :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) { min-width: 0; max-width: 100%; min-height: 36px; padding: 8px 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 5px; font-size: .875rem; }
body :is(input,select,textarea):focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
body :is(input[type=checkbox],input[type=radio]) { accent-color: var(--primary); }
body :is(.btn,td>details>summary,.tag-row>a,.tag-row>details>summary) { min-height: 34px; padding: 7px 12px; border-radius: 5px; font-size: .8rem; font-weight: 500; box-shadow: none; transform: none; }
body .btn { background: var(--primary); border-color: var(--primary); color: #fff; }
body .btn:hover { background: var(--primary-strong); border-color: var(--primary-strong); box-shadow: none; transform: none; }
body :is(.btn.clear,td>details>summary,.tag-row>a,.tag-row>details>summary) { background: var(--surface); color: var(--primary-strong); border: 1px solid var(--line); }
body :is(.btn.clear:hover,td>details>summary:hover,.tag-row>a:hover) { background: var(--blue-soft); border-color: var(--primary); }
body .btn.danger { color: var(--danger); background: var(--surface); border-color: #efb7b7; }
body .btn.danger:hover { color: var(--danger); background: #fff5f5; border-color: var(--danger); }
body .btn:disabled { cursor: not-allowed; opacity: .5; transform: none; box-shadow: none; }
body :is(.row-actions,.hero-actions,.section-title,.history-chart-actions) { flex-wrap: wrap; gap: 8px; }
.formgrid > *, .route-grid > *, .tag-pick > *, .server-cell > *, .route-card > * { min-width: 0; }
body :is(.context-chip,.hierarchy-count,.tag-pick,.route-preview,.smart-tokens button) { color: var(--primary-strong); background: var(--blue-soft); border-color: var(--line); border-radius: 5px; }
body .route-card:hover { border-color: var(--primary); box-shadow: none; }
body details[open] > summary { background: var(--surface-soft); }
body :is(.ok,.quality.good) { color: var(--success); }
body .bad { color: var(--danger); }
body .status-dot { box-shadow: none; }
body .status-pill.is-good { color: var(--success); background: #effaf3; }
body .status-pill.is-good .status-dot { background: var(--success); }
body .status-pill.is-good i { background: var(--success); }
body .opcua-node:has(.node-check:checked) { background: var(--blue-soft); }
body .tag-pick:hover { background: var(--blue-soft); border-color: var(--primary); }
body .history-chart :is(.history-line,.history-point) { stroke: var(--primary); }
body .history-chart :is(.history-area,.history-point:hover,.history-point.active) { fill: var(--primary); }
body .flash { color: var(--primary-strong); background: var(--blue-soft); border-color: var(--line); border-radius: 5px; }
body .flash-error { color: var(--danger); background: #fff5f5; border-color: #efb7b7; }
body .flash-success { color: var(--success); background: #effaf3; border-color: #a8d5bd; }
body .flash-warning { color: #805500; background: #fff8e5; border-color: #e8ce83; }
/* Keep all data tables tabular on mobile, with contained horizontal scrolling. */
body .table-card { overflow: visible; min-width: 0; }
.ui-table-region { width: 100%; min-width: 0; max-width: 100%; overflow: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
body table.ui-data-table { display: table; width: 100%; min-width: var(--table-min-width,560px); max-width: none; table-layout: fixed; border: 0; border-collapse: separate; border-spacing: 0; border-radius: 0; margin: 0; overflow: visible; }
body table.ui-data-table thead { display: table-header-group; }
body table.ui-data-table tbody { display: table-row-group; }
body table.ui-data-table tr { display: table-row; padding: 0; transform: none; }
body table.ui-data-table :is(th,td) { display: table-cell; min-width: 0; padding: 10px 12px; text-align: left; vertical-align: middle; line-height: 1.45; overflow-wrap: anywhere; white-space: normal; border-bottom: 1px solid var(--line-soft); }
body table.ui-data-table th { height: auto; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; line-height: 1.35; color: #475569; background: var(--surface-soft); }
body table.ui-data-table td { font-size: 13px; background: var(--surface); }
body table.ui-data-table td::before { content: none; }
body table.ui-data-table tr[hidden] { display: none !important; }
body table.ui-data-table tr:hover td { background: #f8fafc; }
body table.ui-data-table :is(th,td).ui-actions-cell { position: sticky; right: 0; z-index: 1; width: 184px; box-shadow: -1px 0 var(--line); }
body table.ui-data-table th.ui-actions-cell { z-index: 2; }
body table.ui-data-table :is(.btn,summary) { white-space: normal; text-align: center; max-width: 100%; }
body table.ui-data-table .row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
body table.ui-data-table td.row-actions { display: table-cell; }
body table.ui-data-table td.row-actions > :is(a,form,details) { display: inline-flex; margin: 3px 3px 3px 0; vertical-align: middle; }
body table.ui-data-table .server-actions { display: contents; }
body table.ui-data-table :is(.btn,td>details>summary) { padding: 6px 8px; font-size: 12px; }
body table.ui-data-table code { overflow-wrap: anywhere; white-space: normal; }
body .table-pagination { flex-wrap: wrap; }
body :is(.confirm-modal,.editor-modal) { border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 16px 48px rgb(23 32 44 / 18%); }
body :is(.confirm-modal-content,.editor-modal-content) { padding: 22px; }
body :is(.confirm-modal,.editor-modal)::backdrop { background: rgb(23 32 44 / 45%); backdrop-filter: none; }
body :is(.nx,.nx>.card,.nx>.grid>.card,.workspace-card,.server-card,.structure-server,.route-card) { animation: none; }
body .auth-page { background: var(--bg); }
body.auth-page .nx { width: min(420px,calc(100% - 32px)); padding: 0; }
body.auth-page .login { padding: 28px; border-top: 3px solid var(--primary); }
@media (min-width: 901px) and (max-width: 1200px) {
  .topbar-status { display: none; }
  .breadcrumbs > :nth-child(-n+4) { display: none; }
  .workspace-grid,.grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-bar .formgrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  body.app-sidebar-page,body.app-sidebar-page.app-sidebar-collapsed { padding-left: 0; --sidebar: min(304px,calc(100vw - 48px)); }
  body.app-sidebar-page .app-sidebar { display: none; }
  body.app-sidebar-page.sidebar-mobile-open .app-sidebar { display: flex; }
  .sidebar-mobile-open { overflow: hidden; }
  .sidebar-mobile-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 39; background: rgb(23 32 44 / 45%); }
  .mobile-close { display: inline-grid; margin-top: 12px; width: 100%; color: var(--nav-text); background: var(--nav-hover); border-color: var(--nav-line); }
  .topbar { padding: 0 16px; }
  .topbar-inner { justify-content: flex-start; gap: 12px; }
  .breadcrumbs { display: flex; }
  .breadcrumbs > :nth-child(-n+4) { display: none; }
  .topbar-status { display: none; }
  .nx { padding: 20px; }
  .grid,.workspace-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .nx { padding: 18px 14px 32px; }
  body .card { padding: 16px; }
  .grid,.workspace-grid,.filter-bar .formgrid,.formgrid,.settings-layout,.route-grid { grid-template-columns: minmax(0,1fr); }
  .topbar-search { display: none; }
  .page-heading { align-items: flex-start; }
  body table.ui-data-table :is(th,td).ui-actions-cell { width: 140px; }
  .tag-picker-list { grid-template-columns: minmax(0,1fr); }
  .search-item { grid-template-columns: 28px minmax(0,1fr); }
  .search-item-context { grid-column: 2; }
  .history-chart-actions { width: 100%; }
  .structure-server-title,.structure-group-title { min-width: 0; }
  .opcua-tree { max-width: 100%; overflow: auto; }
  .opcua-node .node-name { overflow-wrap: anywhere; min-width: 0; }
  .explorer-actions { grid-template-columns: minmax(0,1fr); }
  body .editor-modal-content .formgrid { display: grid; grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Shared spacing rhythm across pages, forms and dialogs. */
:root { --nx-section-space: 24px; --nx-panel-space: 20px; --nx-field-space: 16px; --nx-item-space: 8px; }
body .nx { padding: var(--nx-section-space) var(--nx-section-space) 40px; }
body .topbar { padding-inline: var(--nx-section-space); }
body .card { padding: var(--nx-panel-space); margin-bottom: var(--nx-section-space); }
body :is(.grid,.workspace-grid,.settings-layout,.dashboard-status-grid) { gap: var(--nx-field-space); }
body :is(.grid,.settings-layout,.dashboard-status-grid) > .card { margin-bottom: 0; }
body .nx > .card:last-child { margin-bottom: 0; }
body .section-title { margin: 0 0 var(--nx-field-space); }
body .section-title :is(h2,h3) { margin: 0; padding: 0; }
body .section-title > div > .muted { display: block; margin-top: 4px; }
body :is(.formgrid,.route-grid) { gap: var(--nx-field-space); }
body :is(.formgrid,.route-grid) > label { margin: 0; }
body .filter-bar .formgrid { align-items: end; }
body .filter-bar .formgrid > div > br { display: none; }
body .card > .formgrid:has([data-list-search]) { align-items: end; margin-bottom: var(--nx-field-space); }
body :is(.formgrid,.route-grid) label > :is(input,select,textarea) { margin-top: 6px; }
body .payload-editor-heading { margin-bottom: var(--nx-item-space); }
body .tag-picker { padding: var(--nx-field-space); }
body .route-step-label { margin-block: var(--nx-section-space) var(--nx-field-space); }
body .route-step-label:first-of-type { margin-top: 0; }
body :is(.confirm-modal-content,.editor-modal-content) { padding: var(--nx-panel-space); }
body .editor-modal-content > .route-builder { padding: 0; margin: 0; border: 0; }
body .editor-modal-content > .route-builder > .section-title { margin-bottom: var(--nx-field-space); }
body .editor-modal-content :is(.formgrid,.route-grid) > div > br { display: none; }
body .editor-modal-content .formgrid { align-items: end; }
body .confirm-modal-content p { margin-block: var(--nx-field-space); }
body .table-pagination { padding-top: var(--nx-field-space); gap: var(--nx-item-space); }
body .flash-stack:empty { display: none; }
body .flash { margin-bottom: var(--nx-field-space); padding: 12px var(--nx-field-space); }
body #system-summary { margin-block: var(--nx-field-space); }
body #system-summary dd { margin: 4px 0 0; }
body.auth-page { padding-block: var(--nx-section-space); }
body.auth-page .nx { padding: 0; }
body.auth-page .login { margin: 0; padding: var(--nx-section-space); }
body.auth-page .login h1 { margin: 0 0 var(--nx-section-space); }
body.auth-page .login form { display: grid; gap: var(--nx-field-space); }
body.auth-page .login label { margin: 0; }
body.auth-page .login input { margin-top: 6px; }
@media (max-width: 900px) {
  :root { --nx-section-space: 20px; }
}
@media (max-width: 600px) {
  :root { --nx-section-space: 16px; --nx-panel-space: 16px; --nx-field-space: 12px; }
  body .nx { padding-bottom: 32px; }
  body .editor-modal-content > .route-builder .tag-picker { padding: 12px; }
}

/* Keep dense trends continuous and legible when the SVG is scaled on mobile. */
body .history-chart .history-line { stroke-dasharray: none; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; stroke-width: 3px; }

/* Shared usability: readable feedback, keyboard focus and touch controls. */
body .flash { overflow-wrap: anywhere; }
body .ui-table-region:focus-visible { outline-offset: -3px; }
body .table-pagination > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body :is(.page-heading,.section-title) > div { min-width: 0; }
body :is(.page-heading,.section-title) :is(h1,h2,h3) { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  body table.ui-data-table :is(th,td).ui-actions-cell { position: static; box-shadow: none; }
  body :is(.page-heading,.section-title) { flex-wrap: wrap; gap: 12px; }
  body .table-pagination { align-items: flex-start; gap: 12px; }
}
@media (pointer: coarse) {
  body :is(.btn,.shell-toggle,.app-sidebar-link,summary) { min-height: 44px; }
  body :is(.nx,dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) { min-height: 44px; font-size: 16px; }
  body table.ui-data-table :is(.btn,summary) { min-height: 44px; }
}

/* Personal views and exports share the application's existing controls. */
body #open-saved-views { flex: 0 0 auto; white-space: nowrap; }
body .saved-view-create { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
body .saved-view-create label { flex: 1 1 220px; margin: 0; }
body .saved-views-list { list-style: none; padding: 0; margin: 16px 0 0; }
body .saved-views-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
body .saved-views-list a { flex: 1; min-width: 0; overflow-wrap: anywhere; }
body .saved-views-list small { display: block; color: var(--muted); margin-top: 4px; }
body .table-export-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
body .table-export-tools span { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
@media(max-width:700px) {
  body .topbar-inner .breadcrumbs { display: none; }
  body #open-saved-views { margin-left: auto; }
  body .table-export-tools { justify-content: flex-start; }
}

body #open-quick-search { flex: 0 0 auto; white-space: nowrap; }
body #open-quick-search kbd { margin-left: 8px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 4px; font-size: .75rem; }
body .quick-search-results { list-style: none; padding: 0; margin: 0; }
body .quick-search-results a { display: block; padding: 12px; border-radius: 6px; overflow-wrap: anywhere; }
body .quick-search-results a:hover, body .quick-search-results a:focus-visible { background: var(--blue-soft); }
body .quick-search-results small { display: block; color: var(--muted); margin-top: 3px; }
body .quick-search-kind { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 3px; }
body .ui-data-table tr:target td { background: var(--blue-soft); }
@media(max-width:700px) { body #open-quick-search kbd { display: none; } }

/* Simulator design language across every inherited page and modal. */
:root{--nx-section-space:24px;--nx-panel-space:24px;--nx-field-space:16px;--console-shadow:0 3px 8px #18334b03}
html,body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;font-size:14px;color:var(--text);background:var(--bg);font-synthesis:none}
body .app-sidebar{padding:28px 18px 16px;border-right:0}
body .app-sidebar-brand{padding:0 6px 24px;border:0}
body .app-sidebar-logo{gap:10px}
body .app-sidebar-logo-mark{width:28px;flex-basis:28px;background:transparent;color:#70d3cb;font-size:30px;border-radius:0}
body .app-sidebar-logo-copy strong{font-size:23px;font-weight:750;letter-spacing:-.7px;color:#fff}
body .app-sidebar-logo-copy small{font-size:8px;letter-spacing:1.7px;color:#83d4ce;margin-top:6px}
.console-nav-caption{font-size:9px;letter-spacing:1.4px;color:#93adbe;margin:12px 10px 6px}
body .app-sidebar-nav{padding-top:8px;gap:5px}
body .app-sidebar-label{font-size:9px;letter-spacing:1.6px;color:#91adbe;padding-top:20px}
body .app-sidebar-link{min-height:43px;padding:11px 10px;border-radius:7px;font-size:12px}
body .app-sidebar-link.active{background:#214457;box-shadow:inset 3px 0 #62cec5;color:#fff}
body .app-sidebar-icon{color:#9bbdcf}
body .app-sidebar-link.active .app-sidebar-icon{color:#91e1d9}
body .nav-count,body .app-sidebar-link.active .nav-count{background:#ffffff0b;border:1px solid #ffffff12;border-radius:5px;color:#c3d4df;font-size:10px}
body .app-sidebar-footer{padding-top:18px;border-top:1px solid #294557}
body .app-sidebar-user-avatar{background:#234b5a;color:#8ee0d5;border-radius:8px}
body .app-sidebar-user-copy strong{font-size:12px;font-weight:600}
body .app-sidebar-user-copy small{font-size:10px;margin-top:3px;color:#aac0ce}
body.app-sidebar-collapsed .console-nav-caption{display:none}
body.app-sidebar-collapsed .app-sidebar-brand{padding-inline:4px}
body .topbar{height:68px;padding:0 38px;border-color:var(--line)}
body .breadcrumbs{font-size:11px;gap:10px;color:var(--muted)}
body .breadcrumbs strong{font-weight:500;color:#526b81}
body .topbar-status{margin-left:auto;font-size:11px}
body .shell-toggle{border-color:transparent;background:transparent;border-radius:6px}
body .topbar .btn.clear{background:transparent;border-color:var(--line);font-size:11px;min-height:34px}
body .nx{padding:34px 38px 48px;max-width:1600px}
body .page-heading{margin-bottom:28px;align-items:center;gap:20px}
body :is(.page-heading h1,.hero-panel h1){font-size:32px;line-height:1.25;letter-spacing:-1.1px;font-weight:750;margin:8px 0}
body .page-heading p{margin:8px 0 0;font-size:13px;line-height:1.6}
body .eyebrow,body .section-title .eyebrow{font-size:10px;letter-spacing:1.6px;font-weight:750;color:var(--primary)}
body h2{font-size:19px;letter-spacing:-.4px;font-weight:700;padding-bottom:0;border-bottom:0;line-height:1.4}
body h3{font-size:14px;line-height:1.4}
body :is(.section-title h2,.section-title h3){margin:7px 0 0}
body .muted{color:var(--muted);line-height:1.6}
body :is(.card,.workspace-card,.hero-panel,.server-card,.structure-server,.hierarchy-server,.route-editor-panel,.route-card,.payload-editor,.tag-picker,.structure-toolbar,.tree-server){border-radius:12px;border-color:var(--line);box-shadow:var(--console-shadow)}
body .card{background:#fff;padding:24px;margin-bottom:22px}
body :is(.grid,.workspace-grid,.dashboard-status-grid){gap:20px}
body .dashboard-metrics>.card{padding:24px;min-height:148px}
body .dashboard-metrics .muted{font-size:10px;font-weight:700;letter-spacing:1px;color:#61748b}
body .metric{font-size:32px;letter-spacing:-1px;margin:14px 0 8px;font-weight:750;color:var(--text)}
body .dashboard-metrics small{font-size:11px;color:var(--muted);line-height:1.5}
body #overview-updated{font-size:11px;margin:10px 0 22px}
body .section-title{margin-bottom:20px}
body :is(.workspace-card,.dashboard-shortcut):hover{transform:none;background:#f2f9f9;border-color:#8bc4c6;box-shadow:none}
body .dashboard-shortcut{padding:20px;border:1px solid var(--line);border-radius:9px;background:#fbfdfe}
body .dashboard-shortcut strong{font-size:13px;color:var(--text)}
body .dashboard-shortcut>span{color:var(--muted);line-height:1.7;font-size:12px}
body :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){min-height:42px;padding:10px 12px;border:1px solid #d8e2ec;border-radius:6px;background:#fcfdff;color:#203953;font-size:13px}
body :is(input,select,textarea):focus{border-color:#429da4;box-shadow:0 0 0 3px #087e8b16}
body label{font-size:12px;font-weight:600;color:#526b81}
body :is(.field-help,label small){font-size:11px;line-height:1.65;color:var(--muted);font-weight:400}
body .btn{min-height:39px;padding:10px 14px;border-radius:6px;font-size:12px;font-weight:600;box-shadow:none}
body .btn.clear{background:#f4f7fa;border-color:#dfe7ee;color:#456079}
body .btn.clear:hover{background:#eaf5f5;border-color:#abd1d4;color:#066774}
body .btn.danger{background:#fff4f2;color:#a43c2c;border-color:#efd4ce}
body :is(.btn:focus-visible,summary:focus-visible){outline:2px solid var(--primary);outline-offset:3px}
body :is(.btn,summary){transition:background .15s,border-color .15s}
body .ui-table-region{border:1px solid var(--line);border-radius:9px}
body table.ui-data-table :is(th,td){padding:14px 15px;border-color:#edf2f7;line-height:1.6}
body table.ui-data-table th{background:#f7f9fc;color:#60758c;text-transform:uppercase;letter-spacing:.9px;font-size:10px;font-weight:700}
body table.ui-data-table td{font-size:12px;color:#253d55}
body table.ui-data-table td small{font-size:11px;color:var(--muted);margin-top:4px}
body table.ui-data-table tbody tr:hover td{background:#f4fafa}
body table.ui-data-table :is(.btn,td>details>summary){min-height:33px;font-size:11px;border-radius:6px}
body .table-pagination{font-size:11px;color:var(--muted);padding-top:16px}
body :is(.context-chip,.hierarchy-count,.route-preview,.smart-tokens button){border-color:#d6e7e9;border-radius:6px;background:#eef7f7;color:#22606a}
body :is(.structure-server-header,.hierarchy-server-header,.server-card-header){padding:20px;background:#fff}
body :is(.hierarchy-group-header,.structure-group-header){background:#f7f9fc;border-color:var(--line)}
body :is(.structure-group,.hierarchy-group,.node-children){border-color:var(--line)}
body :is(.tree-empty,.empty-state,.alarm-empty){color:var(--muted);line-height:1.7}
body .health-pill{border-radius:6px;padding:8px 11px;font-size:11px}
body :is(.health-pill.ok,.status-pill.is-good){background:#e6f5ef;color:#17634e;border-color:#c7e7d9}
body :is(.health-pill.error,.alarm-row.critical){background:#fff3f1;color:#a13228;border-color:#f1d4ce}
body :is(.health-pill.pending,.health-pill.warning){background:#fff4df;color:#815915;border-color:#eedeba}
body :is(.health-details,.alarm-row,.diagnostic-steps li){border-radius:7px}
body .host-resource .metric{font-size:27px}
body .host-disk{border-color:var(--line);border-radius:9px;background:#fcfdff}
body .host-resource progress::-webkit-progress-value,body .host-disk progress::-webkit-progress-value{background:var(--primary)}
body .host-resource progress::-moz-progress-bar,body .host-disk progress::-moz-progress-bar{background:var(--primary)}
body :is(.confirm-modal,.editor-modal){border-radius:12px;border:1px solid var(--line);box-shadow:0 24px 80px #10283b33}
body :is(.confirm-modal-content,.editor-modal-content){padding:28px}
body :is(.confirm-modal,.editor-modal)::backdrop{background:#10283b70;backdrop-filter:blur(3px)}
body .flash{padding:14px 18px;border-radius:8px;line-height:1.6}
body .flash:not(.flash-error):not(.flash-warning):not(.flash-success){background:#eaf5f5;color:#225b64;border-color:#cee5e7}
body code{color:#385870;font-size:12px}
body :is(pre,.route-preview){border-radius:8px;border-color:var(--line)}
body .settings-note{background:#f3f9f9;border-color:#d6e8e9}
body .auth-brand{display:flex;justify-content:center;align-items:center;gap:12px;margin-bottom:32px;color:#fff;font-size:30px;font-weight:750;letter-spacing:-.8px}
body .auth-brand>span{color:#83d4ce;font-size:40px}
body .auth-brand small{display:block;font-size:9px;letter-spacing:2px;color:#a1dcd7;margin-top:4px}
body.auth-page{background:#10283b;padding:44px 0}
body.auth-page .nx{width:min(440px,calc(100% - 32px));padding:0}
body.auth-page .login{padding:32px;border:1px solid #dfe7ee;border-radius:14px;box-shadow:0 20px 70px #06162230}
body.auth-page .login h1{font-size:25px;letter-spacing:-.7px;margin:10px 0 12px}
body .login-description{color:var(--muted);font-size:13px;line-height:1.7;margin:0 0 24px}
body .auth-caption{text-align:center;color:#a8c0cf;font-size:11px;margin-top:24px}
@media(min-width:901px) and (max-width:1200px){:root{--sidebar:252px}body .nx{padding:28px 24px}body .topbar{padding-inline:24px}body .app-sidebar{padding-inline:14px}body .dashboard-metrics>.card{min-height:134px}}
@media(max-width:900px){body .nx{padding:26px 22px}body .topbar{padding-inline:18px}body .app-sidebar{padding:24px 18px}body .topbar-inner{gap:10px}body .console-nav-caption{display:block}}
@media(max-width:600px){body .nx{padding:24px 16px 36px}body .card{padding:19px;border-radius:10px}body .topbar{height:60px;padding-inline:12px}body .topbar .btn.clear{font-size:11px;padding:8px 10px}body :is(.page-heading h1,.hero-panel h1){font-size:27px}body .page-heading{margin-bottom:22px}body .dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}body .dashboard-metrics>.card{padding:16px;min-height:138px}body .dashboard-metrics .metric{font-size:27px}body .dashboard-metrics .muted{font-size:9px;letter-spacing:.7px}body .dashboard-metrics small{font-size:10px}body .realtime-metrics .dashboard-metrics{grid-template-columns:1fr}body :is(.confirm-modal-content,.editor-modal-content){padding:20px}body .auth-brand{margin-bottom:26px}body.auth-page .login{padding:24px}body .app-sidebar-logo-copy strong{font-size:23px}}
@media(pointer:coarse){body :is(.btn,.shell-toggle,.app-sidebar-link,summary){min-height:44px}body :is(.nx,dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){min-height:44px;font-size:16px}body table.ui-data-table :is(.btn,summary){min-height:44px}}
/* Warning thresholds retain their semantic colour in both browser engines. */
body .host-metrics progress.high{accent-color:#b45309}
body .host-metrics progress.high::-webkit-progress-value{background:#b45309}
body .host-metrics progress.high::-moz-progress-bar{background:#b45309}

/* Sidebar sections: only the current page's section starts expanded. */
body .sidebar-section { flex-shrink: 0; margin: 0; padding: 0; border: 0; }
body .sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 10px 9px; color: #91adbe; cursor: pointer; font-size: 10px; letter-spacing: 1.4px; list-style: none; }
body .sidebar-section-heading::-webkit-details-marker { display: none; }
body .sidebar-section-heading::after { content: '›'; font-size: 18px; line-height: 1; }
body .sidebar-section[open] > summary::after { transform: rotate(90deg); }
body .sidebar-section-links { display: flex; flex-direction: column; gap: 5px; }
body .sidebar-create-route { align-self: flex-end; padding: 4px 10px; color: var(--nav-text); font-size: 11px; }
body.app-sidebar-collapsed .sidebar-section-heading { justify-content: center; padding: 12px 0; font-size: 9px; letter-spacing: 0; }
body.app-sidebar-collapsed .sidebar-section-heading::before { content: attr(data-short); }
body.app-sidebar-collapsed .sidebar-section-heading::after,
body.app-sidebar-collapsed .sidebar-section-heading span,
body.app-sidebar-collapsed .sidebar-create-route { display: none; }
