:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  --sidebar: #293e52;
  --sidebar-deep: #223547;
  --sidebar-hover: #334d63;
  --sidebar-text: #c9d5df;
  --canvas: #f5f6f8;
  --panel: #ffffff;
  --line: #e2e6eb;
  --line-strong: #d4d9df;
  --text: #34404d;
  --muted: #7d8793;
  --subtle: #a1a9b2;
  --blue: #2196e5;
  --blue-dark: #1584d0;
  --green: #27c98a;
  --green-dark: #1eae76;
  --yellow: #f2b927;
  --red: #ef5b5b;
  --cyan: #21a6cf;
  --sidebar-width: 188px;
  --topbar-height: 56px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
}

body {
  min-width: 320px;
  font-size: 13px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

button,
input,
select,
dialog {
  border-radius: 3px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(33, 150, 229, 0.28);
  outline-offset: 1px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.app-shell.is-locked {
  filter: grayscale(0.12);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar);
  color: var(--sidebar-text);
  transition: width 160ms ease;
}

.sidebar-brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--sidebar-deep);
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #27b984;
  color: #ffffff;
}

.brand-mark svg {
  width: 17px;
  height: 17px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.brand-copy span {
  margin-top: 1px;
  color: #91a5b6;
  font-size: 10px;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 13px 0;
}

.sidebar-section-label {
  display: block;
  padding: 14px 19px 0;
  overflow: hidden;
  color: #8298aa;
  font-size: 10px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 19px;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--sidebar-text);
  cursor: pointer;
  text-align: left;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  border-left-color: #39d39a;
  background: #31495e;
  color: #ffffff;
}

.nav-item > svg:first-child {
  width: 17px;
  height: 17px;
  color: #aebfcd;
}

.nav-item.active > svg:first-child,
.nav-item:hover > svg:first-child {
  color: #ffffff;
}

.nav-item span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item .nav-chevron {
  width: 13px;
  height: 13px;
  color: #71889b;
}

.sidebar-footer {
  padding: 14px 16px 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(21, 36, 49, 0.16);
}

.sidebar-footer p {
  margin: 7px 0 0;
  overflow: hidden;
  color: #839aab;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #c6d2dc;
  font-size: 11px;
  white-space: nowrap;
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #91a0ad;
}

.service-state.is-online .state-dot {
  background: #42d49e;
  box-shadow: 0 0 0 3px rgba(66, 212, 158, 0.13);
}

.service-state.is-offline .state-dot {
  background: #f36b6b;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left 160ms ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 16px 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.topbar-left,
.header-actions,
.command-actions,
.input-actions,
.pagination-actions,
.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-left {
  min-width: 0;
  gap: 12px;
}

.topbar-icon {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex: 0 0 32px;
  border: 1px solid transparent;
  background: transparent;
  color: #5b6672;
  cursor: pointer;
}

.topbar-icon:hover {
  border-color: var(--line);
  background: #f7f8fa;
  color: var(--blue);
}

.breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: #7d8793;
  font-size: 12px;
}

.breadcrumb svg {
  width: 13px;
  height: 13px;
  color: #a7afb8;
}

.breadcrumb strong {
  overflow: hidden;
  color: #4c5864;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-control {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  color: #7b8590;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.toggle-control input {
  appearance: none;
  position: relative;
  width: 30px;
  height: 16px;
  margin: 0;
  border: 1px solid #bcc5cd;
  border-radius: 9px;
  background: #cbd2d8;
  cursor: pointer;
}

.toggle-control input::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
  transition: transform 140ms ease;
}

.toggle-control input:checked {
  border-color: var(--green);
  background: var(--green);
}

.toggle-control input:checked::after {
  transform: translateX(14px);
}

.admin-identity {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-left: 1px solid var(--line);
  color: #69747f;
  font-size: 11px;
  white-space: nowrap;
}

.admin-identity svg {
  width: 19px;
  height: 19px;
  color: #7d6aa8;
}

.main-content {
  width: 100%;
  min-height: calc(100vh - var(--topbar-height));
  padding: 14px 18px 28px;
  background: #ffffff;
}

.view[hidden] {
  display: none;
}

.view-statusbar {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: #4d5965;
}

.view-statusbar strong {
  font-size: 14px;
  font-weight: 600;
}

.node-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
}

.node-overview-item {
  display: flex;
  min-width: 0;
  min-height: 66px;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-right: 1px solid var(--line);
}

.node-overview-item:last-child {
  border-right: 0;
}

.node-overview-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex: 0 0 32px;
  background: #edf8f4;
  color: var(--green-dark);
}

.node-overview-icon svg {
  width: 15px;
  height: 15px;
}

.tone-offline .node-overview-icon {
  background: #fff1f1;
  color: var(--red);
}

.tone-process .node-overview-icon {
  background: #eef7fd;
  color: var(--blue);
}

.node-overview-copy {
  min-width: 0;
}

.node-overview-copy small,
.node-overview-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-overview-copy small {
  color: #89939d;
  font-size: 10px;
}

.node-overview-copy strong {
  margin-top: 2px;
  color: #42505c;
  font-size: 17px;
  font-weight: 600;
}

.timestamp {
  color: var(--subtle);
  font-size: 11px;
  white-space: nowrap;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

.metric-strip article {
  min-width: 0;
  min-height: 78px;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}

.metric-strip article:last-child {
  border-right: 0;
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #7d8791;
  font-size: 11px;
}

.metric-label svg {
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.metric-strip article:nth-child(2) .metric-label svg {
  color: var(--green);
}

.metric-strip article:nth-child(3) .metric-label svg {
  color: var(--red);
}

.metric-strip article:nth-child(4) .metric-label svg {
  color: var(--cyan);
}

.metric-strip strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #34414d;
  font-size: 24px;
  font-weight: 600;
  text-overflow: ellipsis;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.panel,
.query-panel,
.table-section,
.settings-section {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #ffffff;
}

.panel-heading {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfc;
}

.panel-heading h2,
.settings-section h2 {
  margin: 0;
  color: #48535e;
  font-size: 13px;
  font-weight: 600;
}

.panel-heading > span {
  color: #9aa3ac;
  font-size: 10px;
}

.text-action {
  min-height: 28px;
  padding: 0 5px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
}

.queue-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 5px 12px 12px;
}

.queue-row {
  min-width: 0;
  padding: 11px 12px 7px 0;
}

.queue-row:nth-child(even) {
  padding-right: 0;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.queue-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: #7d8791;
  font-size: 11px;
}

.queue-label strong {
  color: #49545f;
  font-size: 12px;
}

.progress-track {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 7px;
  border-radius: 4px;
  background: #edf0f4;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms ease;
}

.queue-row:nth-child(2) .progress-track span {
  background: var(--green);
}

.queue-row:nth-child(3) .progress-track span {
  background: var(--yellow);
}

.queue-row:nth-child(4) .progress-track span {
  background: var(--cyan);
}

.activity-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.log-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.single-log-panel { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 760px) {
  .log-panels { grid-template-columns: 1fr; }
}

.activity-item {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.activity-item:nth-child(even) {
  border-right: 0;
}

.activity-item:nth-last-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item-top,
.activity-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.activity-item-top strong {
  min-width: 0;
  overflow: hidden;
  color: #49545f;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item-meta {
  margin: 6px 0 0;
  color: #89929b;
  font-size: 10px;
}

.query-panel {
  margin-bottom: 10px;
  background: #ffffff;
}

.filter-bar {
  display: grid;
  gap: 12px 16px;
  padding: 16px 14px;
}

.simple-filter-bar {
  grid-template-columns: minmax(320px, 620px);
}

.filter-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #56616c;
  font-size: 11px;
  white-space: nowrap;
}

.filter-field input,
.filter-field select,
.settings-form input,
.login-dialog input {
  min-width: 0;
  height: 32px;
  border: 1px solid #d9dde2;
  background: #ffffff;
  color: #46515c;
}

.filter-field input,
.settings-form input,
.login-dialog input {
  padding: 0 10px;
}

.filter-field select {
  padding: 0 28px 0 9px;
}

input::placeholder {
  color: #adb4bc;
}

.filter-actions {
  align-self: center;
}

.command-bar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.node-command-bar {
  min-height: 46px;
  margin-bottom: 0;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  background: #ffffff;
}

.command-actions {
  flex-wrap: wrap;
}

.table-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8a939c;
  font-size: 11px;
  white-space: nowrap;
}

.table-summary strong {
  color: #4b5661;
  font-size: 13px;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.button {
  padding: 0 13px;
  border: 1px solid transparent;
  color: #ffffff;
  font-size: 11px;
}

.button.primary,
.button.info {
  border-color: var(--blue);
  background: var(--blue);
}

.button.primary:hover,
.button.info:hover {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}

.button.success {
  border-color: var(--green);
  background: var(--green);
}

.button.success:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.button.warning {
  border-color: var(--yellow);
  background: var(--yellow);
}

.button.danger {
  border-color: var(--red);
  background: var(--red);
}

.button.neutral {
  border-color: #d7dce1;
  background: #ffffff;
  color: #626d78;
}

.button.neutral:hover,
.icon-button:hover {
  border-color: #bdc6ce;
  background: #f6f8fa;
  color: var(--blue-dark);
}

.button.wide {
  width: 100%;
}

.icon-button {
  width: 31px;
  height: 31px;
  min-height: 31px;
  padding: 0;
  border: 1px solid #d7dce1;
  background: #ffffff;
  color: #64707b;
}

.icon-button.small {
  width: 27px;
  height: 27px;
  min-height: 27px;
}

.icon-button.small svg {
  width: 13px;
  height: 13px;
}

.is-busy svg {
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.table-section {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background: #ffffff;
  font-size: 11px;
}

.node-table {
  min-width: 800px;
  table-layout: fixed;
}

.node-table th:nth-child(1) { width: 74px; }
.node-table th:nth-child(2) { width: 220px; }
.node-table th:nth-child(3),
.node-table th:nth-child(4) { width: 104px; }
.node-table th:nth-child(5) { width: 154px; }
.node-table th:nth-child(6) { width: 140px; }

.node-table tbody tr {
  height: 58px;
}

.node-table td {
  overflow: hidden;
}

.proxy-table {
  min-width: 700px;
}

.source-table {
  min-width: 1180px;
}

.source-table .source-group-row th {
  position: static;
  height: auto;
  padding: 10px 14px 7px;
  border-top: 1px solid #d8dee8;
  background: #f5f7f9;
  color: #66717c;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-align: left;
}

.source-table .source-group-row:first-child th {
  border-top: 0;
}

.source-table .source-group-row:hover {
  background: transparent;
}

.data-table th,
.data-table td {
  padding: 9px 11px;
  border-right: 1px solid #e8ebee;
  border-bottom: 1px solid #e5e8ec;
  text-align: left;
  vertical-align: middle;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 38px;
  background: #fafafa;
  color: #7b858f;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.data-table td {
  min-height: 54px;
  color: #56616c;
}

.data-table tbody tr:nth-child(even) {
  background: #fdfefe;
}

.data-table tbody tr:hover {
  background: #f2f9fd;
}

.data-table .action-column {
  width: 82px;
  text-align: center;
}

.node-table .action-column {
  width: 120px;
  white-space: nowrap;
}

.cell-muted {
  color: #8e98a2 !important;
  white-space: nowrap;
}

.cell-mono,
.proxy-authority code {
  font-family: Consolas, "SFMono-Regular", monospace;
}

.proxy-authority,
.source-primary,
.node-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.proxy-authority svg,
.source-primary > svg,
.node-name > svg {
  width: 14px;
  height: 14px;
  color: var(--blue);
}

.proxy-authority code {
  color: #416986;
  font-size: 11px;
  white-space: nowrap;
}

.source-primary strong,
.source-primary small,
.node-name strong,
.node-name small {
  display: block;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-primary strong,
.node-name strong {
  color: #4d5863;
  font-size: 11px;
  font-weight: 600;
}

.source-primary small,
.node-name small {
  margin-top: 2px;
  color: #9aa3ac;
  font-size: 9px;
}

.latency,
.status-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 3px;
  white-space: nowrap;
}

.latency {
  min-width: 66px;
  padding: 0 7px;
  background: #eef1f4;
  color: #737e88;
  font-size: 10px;
}

.latency.fast {
  background: #e8f7f1;
  color: #16815c;
}

.latency.medium {
  background: #fff5d8;
  color: #9a6a0c;
}

.latency.slow {
  background: #fff0f0;
  color: #bd4141;
}

.status-badge {
  position: relative;
  min-width: 52px;
  padding: 0 7px 0 17px;
  background: transparent;
  font-size: 10px;
}

.status-badge::before {
  position: absolute;
  left: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-running,
.status-scheduled,
.status-online {
  border-color: #bfe7d7;
  background: #ebf8f3;
  color: #18805d;
}

.status-queued,
.status-cooldown {
  border-color: #efdca5;
  background: #fff7df;
  color: #91640f;
}

.status-error,
.status-offline {
  border-color: #efc5c5;
  background: #fff2f2;
  color: #b84242;
}

.resource-cell {
  min-width: 104px;
}

.resource-value {
  margin-bottom: 4px;
  color: #67727d;
  font-size: 10px;
}

.resource-track {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 12px;
  border-radius: 7px;
  background: #edf0f4;
}

.resource-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms ease;
}

.memory-resource .resource-track span {
  background: var(--green);
}

.tcp-ping-cell strong,
.tcp-ping-cell small {
  display: block;
  white-space: nowrap;
}

.tcp-ping-value {
  font-size: 11px;
  font-weight: 600;
}

.tcp-ping-value.is-reachable {
  color: var(--green-dark);
}

.tcp-ping-value.is-unreachable {
  color: var(--red);
}

.tcp-ping-value.is-pending {
  color: #8e98a2;
}

.tcp-ping-cell small {
  margin-top: 2px;
  color: #919aa3;
  font: 9px/1.4 Consolas, "SFMono-Regular", monospace;
}

.table-action {
  min-height: 26px;
  padding: 0 5px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 10px;
}

.table-action:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

.empty-cell,
.empty-state,
.list-placeholder {
  padding: 28px 14px !important;
  color: #a0a8b0 !important;
  text-align: center !important;
}

.pagination {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 7px 11px;
  border-top: 1px solid var(--line);
  color: #818b95;
  font-size: 11px;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  white-space: nowrap;
}

.page-size-control select {
  width: 64px;
  min-height: 28px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: #59646f;
}

.settings-command-bar {
  justify-content: flex-start;
  color: #4a5661;
  font-size: 13px;
}

.settings-section {
  max-width: 980px;
}

.settings-section h2 {
  min-height: 42px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.settings-form {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px 16px;
  padding: 20px 18px;
}

.settings-form > label {
  align-self: center;
  color: #59646f;
  font-size: 11px;
}

.settings-form .input-actions input {
  flex: 1;
}

.settings-form .form-error {
  grid-column: 2;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 11px;
}

.login-dialog {
  width: min(370px, calc(100% - 30px));
  padding: 0;
  border: 0;
  background: transparent;
}

.login-dialog::backdrop {
  background: rgba(20, 33, 45, 0.58);
}

.login-dialog form {
  display: grid;
  gap: 9px;
  padding: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 16px 46px rgba(12, 24, 35, 0.22);
}

.login-dialog h2 {
  margin: 0 0 8px;
  color: #3f4a55;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.login-dialog label {
  color: #5d6873;
  font-size: 11px;
}

.node-install-dialog,
.node-edit-dialog {
  width: min(860px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  background: transparent;
}

.node-install-dialog::backdrop,
.node-edit-dialog::backdrop {
  background: rgba(20, 33, 45, 0.48);
}

.dialog-shell {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(12, 24, 35, 0.22);
}

.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.node-edit-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 0;
  background: transparent;
}

.node-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.node-edit-grid label:first-child,
.node-edit-grid .form-error {
  grid-column: 1 / -1;
}

.node-edit-grid label {
  display: grid;
  gap: 6px;
  color: #56616c;
  font-size: 11px;
}

.node-edit-grid input {
  width: 100%;
}

.dialog-heading h2,
.dialog-heading p {
  margin: 0;
}

.dialog-heading h2 {
  color: #46515c;
  font-size: 14px;
  font-weight: 600;
}

.dialog-heading p {
  margin-top: 2px;
  color: #8b949e;
  font-size: 10px;
}

.node-install-body {
  padding: 14px;
}

.node-install-body > label {
  display: block;
  margin-bottom: 6px;
  color: #56616c;
  font-size: 11px;
}

.node-install-body > input {
  display: block;
  width: 100%;
  margin-bottom: 5px;
}

.install-hint {
  margin: 0 0 13px;
  color: #8b949e;
  font-size: 10px;
}

#nodeInstallCommand {
  display: block;
  width: 100%;
  min-height: 188px;
  resize: vertical;
  padding: 11px;
  border: 1px solid #d7dce1;
  border-radius: 3px;
  background: #f7f9fb;
  color: #394956;
  font: 10px/1.65 Consolas, "SFMono-Regular", monospace;
  overflow-wrap: anywhere;
}

#nodeInstallCommand:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(33, 150, 229, 0.14);
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.login-mark {
  display: grid;
  width: 40px;
  height: 40px;
  margin: 0 auto 4px;
  place-items: center;
  background: var(--sidebar);
  color: #ffffff;
}

.login-mark svg {
  width: 19px;
  height: 19px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(380px, calc(100% - 36px));
  padding: 9px 12px;
  border: 1px solid #b9dfcf;
  border-radius: 3px;
  background: #f0faf6;
  color: #1c704e;
  box-shadow: 0 8px 24px rgba(21, 40, 58, 0.13);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: #efc3c3;
  background: #fff3f3;
  color: #a93a3a;
}

body.sidebar-collapsed {
  --sidebar-width: 62px;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .nav-chevron,
body.sidebar-collapsed .sidebar-footer p,
body.sidebar-collapsed .service-state span:last-child {
  display: none;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar-footer {
  display: flex;
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
}

@media (max-width: 1320px) {
  .filter-field-wide {
    grid-column: span 2;
  }

  .filter-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 980px) {
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip article:nth-child(even) {
    border-right: 0;
  }

  .metric-strip article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .node-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .node-overview-item:nth-child(2) {
    border-right: 0;
  }

  .node-overview-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  body {
    --sidebar-width: 148px;
  }

  body.sidebar-collapsed {
    --sidebar-width: 52px;
  }

  .sidebar {
    position: fixed;
    width: var(--sidebar-width);
    min-height: 100vh;
  }

  .sidebar-brand {
    min-height: 50px;
    padding: 0 10px;
  }

  .sidebar-section-label {
    padding-right: 12px;
    padding-left: 12px;
  }

  .sidebar-nav {
    flex-direction: column;
    overflow-x: hidden;
    padding: 10px 0;
  }

  .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    flex: 0 0 46px;
    border-left: 3px solid transparent;
    border-bottom: 0;
    padding: 0 10px 0 13px;
  }

  .nav-item.active {
    border-left-color: #39d39a;
  }

  body.sidebar-collapsed .nav-item {
    padding: 0;
  }

  .workspace {
    margin-left: var(--sidebar-width);
  }

  .topbar {
    position: sticky;
    min-height: 50px;
    gap: 6px;
    padding: 0 9px;
  }

  .admin-identity,
  #fullscreenButton,
  .toggle-control span,
  .breadcrumb span {
    display: none;
  }

  .toggle-control {
    min-height: 34px;
    padding: 0 2px;
  }

  .breadcrumb strong {
    max-width: 62px;
  }

  .header-actions {
    gap: 2px;
  }

  .main-content {
    min-height: 0;
    padding: 11px 10px 22px;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip article,
  .metric-strip article:nth-child(3) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .metric-strip article:nth-child(even) {
    border-right: 0;
  }

  .metric-strip article:last-child {
    border-bottom: 0;
  }

  .activity-list,
  .queue-list,
  .simple-filter-bar,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .activity-item,
  .activity-item:nth-child(even),
  .activity-item:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .activity-item:last-child {
    border-bottom: 0;
  }

  .queue-row,
  .queue-row:nth-child(even) {
    padding-right: 0;
    padding-left: 0;
    border-left: 0;
  }

  .filter-field-wide {
    grid-column: auto;
  }

  .filter-field {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .filter-actions {
    justify-content: flex-end;
  }

  .command-bar {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .table-summary {
    width: 100%;
    justify-content: space-between;
  }

  .settings-form .form-error {
    grid-column: 1;
  }

  .input-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .input-actions input {
    flex-basis: 100%;
  }

  .node-install-dialog {
    width: calc(100% - 20px);
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions .button {
    width: 100%;
  }

  .node-edit-grid {
    grid-template-columns: 1fr;
  }

  .node-edit-grid label:first-child,
  .node-edit-grid .form-error {
    grid-column: auto;
  }
}

@media (max-width: 420px) {
  .node-overview {
    grid-template-columns: 1fr;
  }

  .node-overview-item,
  .node-overview-item:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .node-overview-item:last-child {
    border-bottom: 0;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-strip article,
  .metric-strip article:nth-child(even),
  .metric-strip article:nth-child(3) {
    min-height: 68px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-strip article:last-child {
    border-bottom: 0;
  }
}

/* Current control-room visual system. Keep the existing responsive structure,
   but give each view a clearer surface hierarchy and remove the legacy dense
   admin-theme treatment. */
:root {
  --sidebar: #17232f;
  --sidebar-deep: #111b25;
  --sidebar-hover: #253746;
  --sidebar-text: #b8c5cf;
  --canvas: #f3f6f8;
  --panel: #ffffff;
  --line: #e4eaee;
  --line-strong: #d7e0e6;
  --text: #23313d;
  --muted: #748391;
  --subtle: #9aa8b3;
  --blue: #2379c9;
  --blue-dark: #1c65aa;
  --green: #19a974;
  --green-dark: #12865c;
  --yellow: #d99619;
  --red: #d95050;
  --cyan: #188fa8;
  --sidebar-width: 216px;
  --topbar-height: 64px;
}

body {
  background: var(--canvas);
  color: var(--text);
  font-size: 13px;
}

.sidebar {
  background: var(--sidebar);
  box-shadow: 4px 0 22px rgba(20, 37, 51, 0.08);
}

.sidebar-brand {
  min-height: var(--topbar-height);
  padding: 0 20px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: var(--sidebar-deep);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border: 0;
  border-radius: 8px;
  background: #20b784;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}

.brand-copy span {
  color: #8fa4b4;
  font-size: 10px;
}

.sidebar-section-label {
  padding: 22px 20px 8px;
  color: #718899;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  gap: 3px;
  padding: 0 10px 14px;
}

.nav-item {
  min-height: 44px;
  gap: 11px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  color: #afbec9;
}

.nav-item:hover {
  background: var(--sidebar-hover);
}

.nav-item.active {
  border: 0;
  background: #2c4658;
  color: #ffffff;
  box-shadow: inset 3px 0 0 #32cb96;
}

.nav-item > svg:first-child {
  width: 18px;
  height: 18px;
  color: #91a8b8;
}

.nav-item.active > svg:first-child,
.nav-item:hover > svg:first-child {
  color: #ffffff;
}

.sidebar-footer {
  padding: 16px 19px 20px;
  border-top-color: rgba(255, 255, 255, 0.1);
  background: transparent;
}

.workspace {
  background: var(--canvas);
}

.topbar {
  min-height: var(--topbar-height);
  padding: 0 24px 0 18px;
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 10px rgba(25, 43, 57, 0.04);
}

.topbar-icon {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 7px;
}

.topbar-icon:hover {
  border-color: #d7e2e9;
  background: #f1f6f8;
  color: var(--blue);
}

.breadcrumb {
  gap: 9px;
  color: #8a99a5;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.breadcrumb strong {
  color: #263846;
  font-size: 13px;
  letter-spacing: 0;
}

.admin-identity {
  padding: 0 12px;
  border-left-color: var(--line);
  color: #627481;
  font-size: 12px;
}

.admin-identity svg {
  color: #4f8197;
}

.main-content {
  min-height: calc(100vh - var(--topbar-height));
  padding: 24px 28px 40px;
  background: var(--canvas);
}

.view-statusbar {
  min-height: 38px;
  margin-bottom: 16px;
}

.view-statusbar strong {
  color: #213442;
  font-size: 18px;
  font-weight: 650;
}

.timestamp {
  color: #82919d;
  font-size: 11px;
}

.metric-strip {
  gap: 12px;
  margin-bottom: 16px;
  border: 0;
  background: transparent;
}

.metric-strip article {
  min-height: 96px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(35, 56, 69, 0.035);
}

.metric-strip article:last-child {
  border-right: 1px solid var(--line);
}

.metric-label {
  color: #7f909d;
  font-size: 11px;
  font-weight: 500;
}

.metric-label svg {
  width: 16px;
  height: 16px;
}

.metric-strip strong {
  margin-top: 8px;
  color: #1f3442;
  font-size: 28px;
  line-height: 1;
}

.dashboard-grid {
  gap: 16px;
  margin-bottom: 16px;
}

.panel,
.query-panel,
.table-section,
.settings-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(35, 56, 69, 0.03);
}

.panel-heading {
  min-height: 52px;
  padding: 10px 18px;
  background: #ffffff;
}

.panel-heading h2,
.settings-section h2 {
  color: #2d404d;
  font-size: 14px;
}

.panel-heading > span {
  color: #9aa8b3;
  font-size: 11px;
}

.queue-list {
  padding: 8px 18px 16px;
}

.queue-row {
  padding-top: 13px;
}

.queue-label {
  color: #738490;
}

.progress-track {
  height: 8px;
  border-radius: 8px;
  background: #edf2f4;
}

.recent-sources {
  overflow: hidden;
}

.activity-item {
  padding: 14px 18px;
  border-color: var(--line);
}

.activity-item-top strong {
  color: #324854;
  font-size: 12px;
}

.activity-item-meta {
  color: #8595a0;
}

.node-overview {
  gap: 12px;
  margin-bottom: 16px;
  border: 0;
  background: transparent;
}

.node-overview-item {
  min-height: 80px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(35, 56, 69, 0.03);
}

.node-overview-item:last-child {
  border-right: 1px solid var(--line);
}

.node-overview-icon {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 8px;
}

.node-overview-copy small {
  color: #80919d;
  font-size: 11px;
}

.node-overview-copy strong {
  margin-top: 4px;
  color: #28404d;
  font-size: 20px;
}

.node-command-bar {
  min-height: 54px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #ffffff;
}

.query-panel {
  margin-bottom: 14px;
}

.filter-bar {
  padding: 14px 18px;
}

.filter-field {
  color: #526773;
  font-size: 12px;
}

.filter-field input,
.filter-field select,
.settings-form input,
.login-dialog input {
  height: 36px;
  border-color: #d7e1e7;
  border-radius: 6px;
  color: #2d4652;
}

.command-bar {
  min-height: 44px;
  margin-bottom: 14px;
}

.button,
.icon-button {
  border-radius: 6px;
}

.button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
}

.icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.table-section {
  overflow: hidden;
}

.node-table {
  min-width: 800px;
}

.proxy-table {
  min-width: 680px;
}

.source-table {
  min-width: 1120px;
}

.data-table {
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-color: var(--line);
}

.data-table th {
  height: 42px;
  background: #f8fafb;
  color: #71838f;
  font-size: 11px;
  font-weight: 600;
}

.data-table td {
  color: #526874;
}

.data-table tbody tr:nth-child(even) {
  background: #fcfdfd;
}

.data-table tbody tr:hover {
  background: #f2f8fb;
}

.resource-track {
  height: 7px;
  border-radius: 8px;
}

.status-badge,
.latency {
  border-radius: 999px;
}

.status-badge {
  min-height: 22px;
  font-size: 10px;
}

.table-action {
  min-height: 28px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}

.pagination {
  min-height: 50px;
  padding: 9px 14px;
  border-color: var(--line);
}

.settings-command-bar {
  min-height: 44px;
  color: #2d404d;
  font-size: 15px;
}

.settings-section {
  max-width: 900px;
}

.settings-section h2 {
  min-height: 48px;
  padding: 14px 18px;
  background: #ffffff;
}

.settings-form {
  gap: 16px 18px;
  padding: 22px 20px;
}

.settings-form > label {
  color: #556b77;
  font-size: 12px;
  font-weight: 600;
}

.login-dialog form,
.dialog-shell {
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(20, 39, 52, 0.2);
}

.dialog-heading,
.dialog-actions {
  padding: 15px 18px;
  background: #f8fafb;
}

.dialog-heading h2 {
  color: #2d404d;
  font-size: 16px;
}

.dialog-heading p,
.install-hint {
  color: #81929d;
  font-size: 11px;
}

.node-install-body {
  padding: 18px;
}

#nodeInstallCommand {
  min-height: 170px;
  border-color: #d7e1e7;
  border-radius: 6px;
  background: #f6f9fa;
}

@media (max-width: 980px) {
  .main-content {
    padding: 20px 18px 32px;
  }

  .node-overview {
    gap: 10px;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 0 10px;
  }

  .main-content {
    padding: 16px 10px 24px;
  }

  .view-statusbar strong {
    font-size: 16px;
  }

  .metric-strip {
    gap: 8px;
  }

  .metric-strip article {
    min-height: 82px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
  }

  .metric-strip article:last-child {
    border-right: 1px solid var(--line);
  }

  .metric-strip strong {
    font-size: 23px;
  }

  .panel-heading {
    padding-right: 14px;
    padding-left: 14px;
  }

  .node-overview {
    gap: 8px;
  }

  .node-overview-item,
  .node-overview-item:nth-child(2),
  .node-overview-item:last-child {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .node-overview-item:last-child {
    border-bottom: 0;
  }

  .node-command-bar {
    padding: 9px 10px;
  }
}
