*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  --bg:              #202020;
  --bg-elevated:     #2b2b2b;
  --surface:         rgba(44, 44, 44, 0.85);
  --surface-solid:   #2d2d2d;
  --border:          rgba(255, 255, 255, 0.08);
  --border-strong:   rgba(255, 255, 255, 0.14);
  --text:            #f3f3f3;
  --muted:           #a6a6a6;
  --accent:          #0078d4;
  --accent-hover:    #106ebe;
  --accent-pressed:  #005a9e;
  --good:            #6ccb5f;
  --warn:            #f59e0b;
  --bad:             #ff6b6b;
  --blue:            #0078d4;
  --violet:          #8b5cf6;
  --green:           #6ccb5f;
  --cyan:            #60cdff;
  --radius-sm:       4px;
  --radius:          8px;
  --radius-lg:       12px;
  --shadow:          0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-lg:       0 8px 32px rgba(0, 0, 0, 0.45);
  --sidebar-width:   240px;
  --header-height:   48px;
  --font:            'Segoe UI Variable Text', 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.muted {
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ── App shell ───────────────────────────────────────── */

.app-frame {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--header-height);
  padding: 0 1rem;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-title {
  font-size: 0.875rem;
  font-weight: 600;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-meta {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .app-header {
    gap: 0.5rem;
    padding: 0 0.75rem;
  }

  .page-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-right {
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .logout-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.625rem;
  }

  .sidebar-toggle {
    width: 44px;
    height: 44px;
    touch-action: manipulation;
  }

  .sidebar-link {
    touch-action: manipulation;
  }
}

@media (max-width: 480px) {
  .app-header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    height: auto;
    padding: 0.5rem 0.75rem;
    gap: 0.375rem 0.75rem;
    align-items: center;
  }

  .sidebar-toggle {
    grid-row: 1;
    grid-column: 1;
  }

  .page-title {
    grid-row: 1;
    grid-column: 2;
    flex: unset;
  }

  .header-right {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
  }

  .header-meta {
    white-space: normal;
    font-size: 0.75rem;
  }
}

.page-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

/* ── Sidebar ─────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 1.125rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.sidebar-brand-icon {
  color: var(--accent);
  font-size: 1rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.5rem 1rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.12s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.sidebar-icon {
  width: 1.25rem;
  text-align: center;
}

.sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  padding: 6px;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.icon-bar {
  display: block;
  height: 2px;
  width: 18px;
  background: var(--text);
  border-radius: 1px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 30;
}

@media (max-width: 900px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }

  .app-frame.sidebar-open .sidebar {
    transform: translateX(0);
  }
}

/* ── Buttons ─────────────────────────────────────────── */

.btn {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
  border: 1px solid transparent;
  padding: 0.375rem 0.875rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  background: var(--accent-pressed);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-toolbar {
  background: transparent;
  color: var(--text);
  border: none;
  padding: 0.375rem 0.625rem;
}

.btn-toolbar:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.btn-toolbar:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
}

.logout-form {
  margin: 0;
}

/* ── Gauge cards ─────────────────────────────────────── */

.gauges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .gauges { grid-template-columns: repeat(2, 1fr); }

  .dashboard-page .page-content,
  .latency-page .page-content {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .gauges { grid-template-columns: 1fr; }

  .dashboard-page .page-content,
  .latency-page .page-content {
    padding: 0.75rem;
    gap: 1rem;
  }

  .dashboard-page .gauge-card,
  .dashboard-page .chart-card,
  .latency-page .chart-card {
    padding: 1rem;
  }

  .gauge-value {
    font-size: 1.5rem;
  }

  .net-row .gauge-value {
    font-size: 1.25rem;
  }

  .chart-title {
    font-size: 0.75rem;
  }

  .section-title {
    margin-bottom: 0.75rem;
  }
}

.gauge-card,
.chart-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.gauge-label,
.chart-title,
.section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.chart-title {
  line-height: 1.35;
  word-break: break-word;
}

.gauge-value {
  font-size: 2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 0.875rem;
}

.gauge-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  transition: width 0.5s ease, background-color 0.5s ease;
  background: var(--good);
}

.gauge-abs {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.4rem;
  font-variant-numeric: tabular-nums;
}

.net-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.net-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.net-arrow {
  font-size: 0.9rem;
  font-weight: 700;
}

.net-arrow.up   { color: var(--green); }
.net-arrow.down { color: var(--cyan); }

.net-row .gauge-value {
  font-size: 1.5rem;
  margin-bottom: 0;
}

.net-unit {
  font-size: 0.75rem;
}

.charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .charts { grid-template-columns: 1fr; }
}

.chart-wrap {
  position: relative;
  height: 220px;
}

@media (max-width: 900px) {
  .chart-wrap { height: 200px; }
}

@media (max-width: 480px) {
  .chart-wrap { height: 180px; }
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
  background: var(--muted);
}

.status-dot.up   { background: var(--good); box-shadow: 0 0 6px var(--good); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.status-dot.down { background: var(--bad);  box-shadow: 0 0 6px var(--bad); }

/* ── Processes (Task Manager) ────────────────────────── */

.dashboard-page .page-content {
  padding: 1.25rem;
  gap: 1.25rem;
  min-height: calc(100vh - var(--header-height));
}

.dashboard-metrics-charts {
  margin-bottom: 0;
}

.processes-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
}

.process-search {
  width: min(280px, 40vw);
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
}

.process-search::placeholder {
  color: var(--muted);
}

.process-search:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.process-table-wrap {
  flex: 1;
  overflow: auto;
}

.process-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.process-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-elevated);
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}

.process-table thead th[data-sort] {
  cursor: pointer;
}

.process-table thead th[data-sort]:hover {
  background: rgba(255, 255, 255, 0.06);
}

.process-col-name,
.process-col-status {
  text-align: left;
}

.process-col-metric {
  text-align: right;
  min-width: 7rem;
}

.process-col-metric .metric-header,
.process-col-metric .metric-aggregate {
  display: block;
}

.process-col-metric .metric-header {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.process-col-metric .metric-aggregate {
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 0.125rem;
}

.process-table thead th.process-col-metric {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.process-table thead th.process-col-metric.active {
  background: rgba(0, 120, 212, 0.18);
  border-color: rgba(0, 120, 212, 0.55);
}

.process-table tbody td.process-col-metric.active {
  background: rgba(0, 120, 212, 0.08);
}

.process-table td {
  padding: 0.4375rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.process-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.process-table td.process-col-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 12rem;
}

.process-icon {
  color: var(--muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.process-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.process-col-status {
  color: var(--muted);
  text-transform: capitalize;
}

.process-empty td {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0.75rem;
}

@media (max-width: 900px) {
  .process-search {
    width: min(200px, 35vw);
  }

  .process-col-metric {
    min-width: 5.5rem;
  }

  .process-col-metric .metric-aggregate {
    font-size: 0.9375rem;
  }
}

@media (max-width: 640px) {
  .process-col-status,
  .process-table thead th.process-col-status {
    display: none;
  }

  .process-table tbody td.process-col-status {
    display: none;
  }
}

/* ── File explorer ───────────────────────────────────── */

.files-page .page-content {
  padding: 0;
  gap: 0;
}

.explorer {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.125rem;
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-solid);
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
  margin: 0 0.25rem;
}

.explorer-address {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.address-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
  min-height: 32px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.crumb {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
}

.crumb:hover {
  background: rgba(255, 255, 255, 0.08);
}

.crumb-sep {
  color: var(--muted);
  font-size: 0.75rem;
}

.address-input {
  flex: 1;
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
}

.explorer-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.explorer-nav {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-solid);
  padding: 0.75rem 0.5rem;
  overflow-y: auto;
}

.explorer-nav-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.25rem 0.5rem 0.5rem;
}

.explorer-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0.4375rem 0.625rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.explorer-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.explorer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.explorer-main.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}

.file-table-wrap {
  flex: 1;
  overflow: auto;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.file-table th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  text-align: left;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.file-table th:hover {
  background: rgba(255, 255, 255, 0.06);
}

.file-table td {
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.file-table tbody tr {
  cursor: default;
}

.file-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.file-table tbody tr.selected {
  background: rgba(0, 120, 212, 0.25);
}

.file-icon {
  margin-right: 0.5rem;
}

.explorer-status {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface-solid);
}

/* ── Context menu ────────────────────────────────────── */

.context-menu {
  position: fixed;
  z-index: 100;
  min-width: 180px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.25rem;
}

.context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0.4375rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.context-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.context-menu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}

/* ── Modal ───────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.modal-body {
  padding: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.modal-label {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.modal-input {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  outline: none;
}

.modal-input:focus {
  border-color: var(--accent);
}

.modal-error {
  color: var(--bad);
}

.modal-warning {
  color: var(--warn);
  word-break: break-all;
}

.props-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.375rem 1rem;
  font-size: 0.8125rem;
}

.props-list dt {
  color: var(--muted);
}

.props-list dd {
  word-break: break-all;
}

/* ── Login page ──────────────────────────────────────── */

body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-header {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 1.25rem;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.login-header h1 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 1.5rem;
}

.login-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.25rem;
  width: 100%;
  max-width: 380px;
}

.login-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.login-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid var(--bad);
  color: var(--bad);
  font-size: 0.8125rem;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.login-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
  outline: none;
  transition: border-color 0.12s;
}

.login-input:focus {
  border-color: var(--accent);
}

.login-btn {
  margin-top: 0.5rem;
}

/* ── File Explorer Authenticator step-up ─────────────── */

.mfa-wrap {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.mfa-card {
  max-width: 420px;
}

.mfa-help {
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 0 0 1rem;
}

.mfa-qr {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.mfa-qr svg {
  border-radius: var(--radius);
}

.mfa-key {
  display: block;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  word-break: break-all;
}

/* ── Server logs page ────────────────────────────────── */

.logs-page-shell .page-content {
  padding: 0;
  gap: 0;
}

.logs-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  padding: 1rem 1.25rem 1.25rem;
  gap: 0.75rem;
}

.logs-header {
  flex-shrink: 0;
}

.logs-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.logs-subtitle {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.logs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.logs-toolbar-group {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.logs-toggle {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  background: transparent;
  color: var(--muted);
  border: none;
  cursor: pointer;
  min-height: 32px;
}

.logs-toggle:not(:last-child) {
  border-right: 1px solid var(--border-strong);
}

.logs-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.logs-toggle--active {
  background: var(--accent);
  color: #fff;
}

.logs-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.logs-select {
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0.3125rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
}

.logs-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  min-width: 160px;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.logs-search-icon {
  color: var(--muted);
  font-size: 0.875rem;
}

.logs-search {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  outline: none;
}

.logs-auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.logs-auto-icon {
  font-size: 0.875rem;
}

.logs-action-btn {
  min-height: 32px;
}

.logs-banner {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--warn);
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.logs-banner--info {
  background: rgba(0, 120, 212, 0.12);
  border-color: rgba(0, 120, 212, 0.35);
  color: var(--cyan);
}

.logs-error {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid var(--bad);
  color: var(--bad);
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.logs-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.logs-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  color: var(--muted);
  flex: 1;
  min-height: 0;
}

.logs-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: logs-spin 0.8s linear infinite;
}

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

.logs-viewer {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.logs-line {
  padding: 0.0625rem 0;
}

.logs-line--error {
  color: #ffb4b4;
}

.logs-highlight {
  background: rgba(255, 214, 10, 0.35);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.logs-empty {
  color: var(--muted);
}
