:root {
  --color-primary: #3c96ca;
  --color-primary-strong: #2f86bd;
  --color-primary-soft: #e8f3fa;
  --color-primary-faint: #f3f8fb;
  --color-text: #1b1c1d;
  --color-text-secondary: #565b60;
  --color-text-muted: #6b7074;
  --color-surface: #ffffff;
  --color-surface-alt: #fafafa;
  --color-border: #e4e7ea;
  --color-border-strong: #cdd2d7;
  --color-success: #118b58;
  --color-success-soft: #e9f7f0;
  --color-warning: #9a6500;
  --color-warning-soft: #fff6dd;
  --color-danger: #d43838;
  --color-danger-soft: #fff0f0;
  --color-code: #1f2022;
  --color-code-text: #8fddd9;
  --topbar-height: 50px;
  --sidebar-width: 235px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-menu: 0 12px 28px rgba(0, 0, 0, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --z-base: 0;
  --z-sidebar: 20;
  --z-sticky: 30;
  --z-menu: 40;
  --z-toast: 60;
  font-family: Outfit, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--color-text);
  background: var(--color-surface);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--color-surface);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--color-text);
  background: var(--color-surface);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  touch-action: manipulation;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

.icon-xl {
  width: 32px;
  height: 32px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: var(--z-toast);
  padding: 8px 12px;
  color: #ffffff;
  background: var(--color-primary-strong);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
  transition: transform 180ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(60, 150, 202, 0.42);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  height: var(--topbar-height);
  padding: 0 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.icon-button,
.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0;
  color: var(--color-text);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

.icon-button:hover,
.topbar-link:hover {
  background: #f3f5f6;
}

.icon-button:active,
.topbar-link:active {
  background: #e9edef;
}

.menu-button {
  margin-right: 10px;
}

.brand,
.login-brand {
  display: inline-flex;
  align-items: center;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.logo-block {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 4px;
  color: #ffffff;
  background: #3b79be;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.logo-word {
  margin-left: 2px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.version {
  margin: 4px 0 0 10px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 400;
}

.topbar-spacer {
  flex: 1 1 auto;
}

.top-status,
.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text);
  font-size: 14px;
}

.top-status {
  margin-right: 18px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--color-success-soft);
}

.topbar-link {
  width: auto;
  padding: 0 9px;
  border-radius: var(--radius-md);
}

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 16px;
  overflow-y: auto;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  transition: transform 220ms var(--ease);
}

.sidebar nav {
  flex: 0 0 auto;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 4px 12px;
  gap: 14px;
  color: var(--color-text);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 24px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

.nav-item:hover {
  background: #f4f5f6;
}

.nav-item.active {
  color: #276f99;
  background: var(--color-primary-soft);
}

.nav-icon {
  width: 23px;
  height: 23px;
  color: #71767a;
}

.nav-item.active .nav-icon {
  color: var(--color-primary);
}

.nav-count {
  min-width: 22px;
  margin-left: auto;
  padding: 0 6px;
  color: #246f9a;
  background: #d9edf8;
  border-radius: 999px;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

.sidebar-section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

.sidebar-section-label {
  margin: 0 12px 10px;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.mode-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border-radius: var(--radius-md);
  background: var(--color-primary-faint);
}

.mode-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  border-radius: var(--radius-md);
}

.mode-summary strong,
.mode-summary small {
  display: block;
}

.mode-summary strong {
  font-size: 14px;
  font-weight: 600;
}

.mode-summary small {
  margin-top: 1px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
}

.logout-button {
  color: var(--color-text-secondary);
}

.drawer-scrim {
  position: fixed;
  inset: var(--topbar-height) 0 0;
  z-index: 15;
  display: none;
  width: 100%;
  height: calc(100dvh - var(--topbar-height));
  padding: 0;
  background: rgba(0, 0, 0, 0.44);
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease);
}

.user-menu {
  position: fixed;
  top: 46px;
  right: 12px;
  z-index: var(--z-menu);
  width: min(268px, calc(100vw - 24px));
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-menu);
}

.user-menu-title {
  font-size: 14px;
  font-weight: 650;
}

.user-menu-note {
  margin: 3px 0 10px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.user-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  gap: 8px;
  padding: 8px;
  color: var(--color-danger);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.user-menu button:hover {
  background: var(--color-danger-soft);
}

.main {
  min-height: 100vh;
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 30px) 32px 64px;
  background: var(--color-surface);
}

.page {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-title-wrap {
  min-width: 0;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 2px;
  color: var(--color-text);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.page-title .icon {
  width: 31px;
  height: 31px;
}

.page-subtitle {
  margin: 0;
  max-width: 72ch;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.6;
  text-wrap: pretty;
}

.page-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding-top: 7px;
}

.primary-button,
.tonal-button,
.outlined-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), opacity 180ms var(--ease);
}

.primary-button {
  color: #ffffff;
  background: #2777a7;
  border: 1px solid #2777a7;
}

.primary-button:hover {
  background: #21688f;
  border-color: #21688f;
}

.tonal-button {
  color: #276f99;
  background: var(--color-primary-soft);
  border: 1px solid transparent;
}

.tonal-button:hover {
  background: #d9edf8;
}

.outlined-button {
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
}

.outlined-button:hover {
  color: var(--color-primary-strong);
  border-color: #9bc8df;
  background: var(--color-primary-faint);
}

.text-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--color-primary-strong);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
}

.text-button:hover {
  background: var(--color-primary-faint);
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.is-loading .icon {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card,
.panel,
.adapter-card,
.summary-band {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.metric-card {
  min-height: 170px;
  padding: 20px;
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  color: var(--color-primary);
  background: var(--color-primary-faint);
  border-radius: var(--radius-md);
}

.metric-icon .icon {
  width: 19px;
  height: 19px;
}

.metric-label {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.metric-value {
  margin-top: 6px;
  color: #111214;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.metric-note {
  margin-top: 7px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.metric-card .skeleton.metric-label {
  width: 58%;
}

.metric-card .skeleton.metric-value {
  width: 48%;
}

.metric-card .skeleton.metric-note {
  width: 72%;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 12px;
}

.section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.section-note {
  margin: 1px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.panel {
  min-width: 0;
  padding: 20px 22px;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
}

.panel-subtitle {
  margin: 3px 0 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.panel-total {
  text-align: right;
}

.panel-total span,
.panel-total strong {
  display: block;
}

.panel-total span {
  color: var(--color-text-muted);
  font-size: 12px;
}

.panel-total strong {
  margin-top: 2px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.chart-wrap {
  position: relative;
  min-height: 250px;
}

.chart {
  display: block;
  width: 100%;
  height: 250px;
  overflow: visible;
}

.chart-grid-line {
  stroke: #edf0f2;
  stroke-width: 1;
}

.chart-area {
  fill: rgba(60, 150, 202, 0.11);
}

.chart-line {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-axis-label {
  fill: var(--color-text-muted);
  font-family: inherit;
  font-size: 11px;
}

.adapter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adapter-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 3px;
  border-bottom: 1px solid #eef0f2;
}

.adapter-row:last-child {
  border-bottom: 0;
}

.adapter-indicator {
  width: 8px;
  height: 8px;
  background: var(--color-text-muted);
  border-radius: 50%;
}

.adapter-indicator.connected {
  background: var(--color-success);
}

.adapter-row-main {
  min-width: 0;
}

.adapter-row-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adapter-row-meta {
  color: var(--color-text-muted);
  font-size: 12px;
}

.adapter-row-value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toolbar-field.search-field {
  flex: 1 1 260px;
}

.toolbar label,
.field-label {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.input-shell {
  position: relative;
}

.input-shell .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid #b9bec3;
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

input::placeholder {
  color: #62676b;
}

input:hover,
select:hover {
  border-color: #8e959a;
}

input:focus,
select:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(60, 150, 202, 0.2);
}

.input-shell input {
  width: 100%;
  padding-left: 40px;
}

select {
  min-width: 155px;
  padding-right: 34px;
}

.table-panel {
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.events-table th:nth-child(1),
.events-table td:nth-child(1) { width: 154px; }
.events-table th:nth-child(2),
.events-table td:nth-child(2) { width: 130px; }
.events-table th:nth-child(3),
.events-table td:nth-child(3) { width: 20%; }
.events-table th:nth-child(4),
.events-table td:nth-child(4) { width: 18%; }
.events-table th:nth-child(5),
.events-table td:nth-child(5) { width: 18%; }
.events-table th:nth-child(6),
.events-table td:nth-child(6) { width: 16%; }

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--color-text-secondary);
  background: #fbfbfc;
  font-size: 12px;
  font-weight: 600;
}

.data-table td {
  color: var(--color-text);
  font-size: 13px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background-color 160ms var(--ease);
}

.data-table tbody tr:hover {
  background: #f8fbfd;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.sort-button .icon {
  width: 14px;
  height: 14px;
}

.mono {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
  font-variant-numeric: tabular-nums;
}

.truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  gap: 5px;
  padding: 2px 9px;
  color: var(--color-text-secondary);
  background: #f1f2f3;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge .icon {
  width: 14px;
  height: 14px;
}

.badge.success {
  color: #0e754a;
  background: var(--color-success-soft);
}

.badge.warning {
  color: #815700;
  background: var(--color-warning-soft);
}

.badge.danger {
  color: #b72c2c;
  background: var(--color-danger-soft);
}

.badge.info {
  color: #276f99;
  background: var(--color-primary-soft);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 55px;
  padding: 8px 14px;
  color: var(--color-text-secondary);
  background: #fbfbfc;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
}

.pagination {
  display: flex;
  gap: 8px;
}

.pagination button {
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.pagination button:hover:not(:disabled) {
  color: var(--color-primary-strong);
  border-color: #9bc8df;
}

.adapters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.full-span {
  width: 100%;
}

.adapter-card {
  flex: 0 1 464px;
  min-width: 300px;
  min-height: 220px;
  padding: 24px;
}

.adapter-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.adapter-card-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.adapter-card-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-primary-strong);
  background: var(--color-primary-faint);
  border-radius: 50%;
}

.adapter-card-title h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 20px;
  font-weight: 650;
}

.adapter-card-title p {
  margin: 1px 0 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.switch-indicator {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
  background: #9ca2a6;
  border-radius: 999px;
}

.switch-indicator::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  content: "";
  background: #ffffff;
  border-radius: 50%;
  transition: transform 180ms var(--ease);
}

.switch-indicator.on {
  background: #65aed6;
}

.switch-indicator.on::after {
  transform: translateX(18px);
}

.adapter-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin: 24px 0 18px;
}

.detail-item span,
.detail-item strong {
  display: block;
}

.detail-item span {
  color: var(--color-text-muted);
  font-size: 12px;
}

.detail-item strong {
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 550;
}

.capability-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-band {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 17px 20px;
  background: #fbfcfd;
}

.summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  border-radius: 50%;
}

.summary-band strong,
.summary-band span {
  display: block;
}

.summary-band strong {
  font-size: 15px;
}

.summary-band span {
  margin-top: 2px;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.summary-stats {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.summary-stat {
  text-align: right;
}

.summary-stat b,
.summary-stat small {
  display: block;
}

.summary-stat b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.summary-stat small {
  color: var(--color-text-muted);
  font-size: 12px;
}

.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 34px 20px;
  text-align: center;
}

.empty-state .state-icon,
.error-state .state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  color: var(--color-primary-strong);
  background: var(--color-primary-faint);
  border-radius: 50%;
}

.error-state .state-icon {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.empty-state h2,
.error-state h2 {
  margin: 0;
  font-size: 18px;
}

.empty-state p,
.error-state p {
  max-width: 54ch;
  margin: 7px 0 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: #eef0f2 !important;
  border-radius: 5px;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.78), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.25s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.login-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 20px;
  background: #ffffff;
}

.login-brand {
  margin-bottom: 22px;
}

.login-panel {
  width: min(416px, 100%);
  padding: 30px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  border-radius: 50%;
}

.login-panel h1 {
  margin: 16px 0 3px;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.login-panel > p {
  margin: 0 0 22px;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.login-panel .field-label {
  display: block;
  margin-bottom: 6px;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  min-height: 46px;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
}

.field-help,
.field-error {
  margin-top: 6px;
  font-size: 12px;
}

.field-help {
  color: var(--color-text-secondary);
}

.field-help code {
  padding: 1px 4px;
  color: #4e5458;
  background: #f1f2f3;
  border-radius: 4px;
}

.field-error {
  min-height: 18px;
  color: var(--color-danger);
}

.login-submit {
  width: 100%;
  margin-top: 10px;
  border-radius: var(--radius-md);
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  max-width: min(420px, calc(100vw - 36px));
  min-height: 44px;
  gap: 9px;
  padding: 9px 14px;
  color: #ffffff;
  background: #2c3033;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-menu);
  font-size: 13px;
  animation: toast-in 180ms var(--ease);
}

.toast.error {
  background: #9f2f2f;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1260px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

  .metric-card {
    min-height: 150px;
  }
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }

  body.drawer-open .sidebar {
    transform: translateX(0);
  }

  .drawer-scrim {
    display: block;
  }

  body.drawer-open .drawer-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    margin-left: 0;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .topbar {
    padding: 0 12px;
  }

  .version,
  .top-status {
    display: none;
  }

  .logo-block {
    height: 30px;
    font-size: 20px;
  }

  .logo-word {
    font-size: 19px;
  }

  .main {
    padding: calc(var(--topbar-height) + 20px) 16px 44px;
  }

  .page-head {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .page-title {
    font-size: 27px;
  }

  .page-actions {
    width: 100%;
    padding-top: 0;
  }

  .page-actions > * {
    flex: 1 1 auto;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    min-height: 138px;
    padding: 15px;
  }

  .metric-icon {
    margin-bottom: 7px;
  }

  .metric-value {
    font-size: 25px;
  }

  .panel {
    padding: 17px 16px;
  }

  .toolbar {
    align-items: stretch;
    padding: 12px;
  }

  .toolbar-field,
  .toolbar-field.search-field {
    flex: 1 1 100%;
  }

  .toolbar select,
  .toolbar input {
    width: 100%;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .data-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .data-table tr:last-child {
    border-bottom: 0;
  }

  .data-table td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 6px 14px;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .events-table th,
  .events-table td {
    width: 100% !important;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 600;
  }

  .data-table .truncate {
    white-space: normal;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .pagination {
    width: 100%;
  }

  .pagination button {
    flex: 1 1 0;
    min-height: 44px;
  }

  .adapter-card {
    flex-basis: 100%;
    min-width: 0;
    padding: 19px;
  }

  .summary-band {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .summary-stats {
    width: 100%;
    margin-left: 58px;
  }

  .summary-stat {
    text-align: left;
  }

  .topbar-link span {
    display: none;
  }

  .topbar-link {
    min-width: 42px;
    padding: 0;
  }

  .login-panel {
    padding: 24px 20px;
  }
}

@media (max-width: 420px) {
  .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-card {
    min-height: 126px;
  }

  .adapter-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-stats {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
