:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #ffffff;
  color: #09090b;
  --bg: #ffffff;
  --bg-secondary: #f4f4f5;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --text: #09090b;
  --text-secondary: #71717a;
  --muted: #a1a1aa;
  --line: #e4e4e7;
  --line-hover: #d4d4d8;
  --primary: #000000;
  --primary-hover: #18181b;
  --primary-light: #fafafa;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --yellow: #eab308;
  --yellow-bg: #fefce8;
  --orange: #f97316;
  --orange-bg: #fff7ed;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
}

.shell, .hero, .page {
  margin: 0 auto;
  max-width: 1400px;
  padding-inline: 24px;
}

.nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 600;
  gap: 10px;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 15px;
}

.brand.compact {
  margin-bottom: 24px;
}

.brand-mark {
  align-items: center;
  background: var(--primary);
  border-radius: var(--radius);
  color: #fff;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
  font-weight: 600;
  font-size: 14px;
}

.nav-link, .link-button {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 16px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover, .link-button:hover {
  background: var(--bg-secondary);
  border-color: var(--line-hover);
}

.hero {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 1.2fr) minmax(400px, 0.8fr);
  min-height: calc(100vh - 80px);
  padding-block: 48px 64px;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0 0 16px;
  text-transform: uppercase;
}

h1 {
  color: var(--text);
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 20px;
  font-weight: 700;
}

h2 {
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 600;
  font-size: 24px;
}

.lead {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 540px;
}

.muted {
  color: var(--text-secondary);
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  background: var(--primary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #fff;
  display: inline-flex;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  justify-content: center;
  padding: 10px 20px;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.button:hover {
  background: var(--primary-hover);
  border-color: var(--line-hover);
}

.button.secondary {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
}

.button.secondary:hover {
  background: var(--bg-secondary);
}

.button.danger {
  background: var(--red-bg);
  border: 1px solid var(--red);
  color: var(--red);
}

.button.danger:hover {
  background: var(--red);
  color: #fff;
}

.button.compact {
  border-radius: var(--radius-sm);
  font-size: 13px;
  padding: 6px 12px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-pills span, .badge {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
}

.hero-visual {
  position: relative;
}

.mock-window, .floating-card, .auth-card, .login-side, .card, .dashboard-hero, .sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.mock-window {
  border-radius: var(--radius-lg);
  min-height: 400px;
  padding: 24px;
  transform: rotate(1deg);
}

.mock-header {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.mock-header span {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  height: 10px;
  width: 10px;
}

.mock-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.mock-grid div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.mock-grid small, .floating-card small {
  color: var(--text-secondary);
  display: block;
  font-size: 13px;
}

.mock-grid strong {
  display: block;
  font-size: 36px;
  letter-spacing: -0.04em;
  margin-top: 8px;
  font-weight: 600;
}

.mock-line {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  height: 12px;
  margin-top: 16px;
  width: 70%;
}

.mock-line.wide {
  margin-top: 24px;
  width: 100%;
}

.mock-line.short {
  width: 50%;
}

.floating-card {
  align-items: center;
  border-radius: var(--radius-md);
  display: grid;
  gap: 4px;
  padding: 16px 20px 16px 44px;
  position: absolute;
  right: -16px;
  top: -20px;
  z-index: 2;
}

.status-dot {
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--green-bg);
  display: inline-block;
  height: 8px;
  width: 8px;
}

.status-card .status-dot {
  left: 18px;
  position: absolute;
  top: 20px;
}

.aurora {
  background:
    radial-gradient(circle, rgba(59, 130, 246, 0.08), transparent 60%),
    radial-gradient(circle, rgba(124, 58, 237, 0.06), transparent 55%);
  filter: blur(40px);
  height: 400px;
  left: 50%;
  pointer-events: none;
  position: fixed;
  top: 10%;
  transform: translateX(-50%);
  width: 600px;
}

.auth-page {
  align-items: center;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(320px, 400px) minmax(320px, 480px);
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
  position: relative;
}

.auth-card, .login-side {
  border-radius: var(--radius-lg);
  padding: 32px;
}

.auth-card h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.login-side {
  min-height: 380px;
  padding: 40px;
}

.login-side h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  margin-bottom: 16px;
}

label {
  color: var(--text);
  display: grid;
  font-weight: 500;
  gap: 8px;
  margin: 16px 0;
  font-size: 14px;
}

input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  outline: none;
  padding: 10px 12px;
  font-size: 14px;
  transition: all 0.15s ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.alert {
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  margin: 16px 0;
  padding: 12px;
  font-size: 14px;
}

.app-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  padding: 16px;
}

.sidebar {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-nav a {
  align-items: center;
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 9px;
  padding: 9px 12px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.side-nav a svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.side-nav a.active,
.side-nav a:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.side-nav a.active {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.side-nav a.active svg {
  opacity: 1;
  stroke: var(--accent);
}

.sidebar-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 16px;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.sidebar-user {
  align-items: center;
  display: flex;
  gap: 10px;
}

.sidebar-user div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sidebar-user strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user small {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: capitalize;
}

.sidebar-logout {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 5px 10px;
  transition: all 0.15s ease;
  width: 100%;
}

.sidebar-logout:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.nav-badge,
.nav-badge-alert {
  background: var(--bg-secondary);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
  min-width: 18px;
  padding: 2px 6px;
  text-align: center;
}

.nav-badge-alert {
  background: var(--red-bg);
  color: var(--red);
}

.page {
  max-width: none;
  padding: 0;
}

.page-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 2px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

.page-header-right {
  flex-shrink: 0;
}

.auto-refresh-status {
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 12px;
  gap: 5px;
  padding: 5px 10px;
}

.dashboard-hero {
  align-items: flex-start;
  border-radius: var(--radius-lg);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 24px;
}

.dashboard-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.topbar {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  padding: 8px 12px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0 0 20px;
}

.card {
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  padding: 20px;
}

.metric-card {
  min-height: 140px;
}

.metric-card span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.metric-card.accent .metric, .metric-card.accent span, .metric-card.accent small {
  color: #fff;
}

.metric {
  color: var(--text);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 12px 0 4px;
}

.metric-card small {
  color: var(--text-secondary);
  font-size: 13px;
}

.section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title h2 {
  font-size: 18px;
  font-weight: 600;
}

.filters-card {
  margin-bottom: 20px;
}

.filters-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  padding: 14px 16px;
}

.filters-bar .filters {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.filters {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.filters label {
  margin: 0;
  font-size: 13px;
}

.filters select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  outline: none;
  padding: 10px 12px;
  font-size: 14px;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.filter-actions .button {
  margin: 0;
  white-space: nowrap;
}

table {
  border-collapse: collapse;
  width: 100%;
}

td, th {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
}

th {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 14px;
}

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

.badge.failure {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

.badge.danger {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
  font-weight: 600;
}

.table-note {
  color: var(--red);
  font-size: 13px;
  margin-top: 6px;
  max-width: 320px;
}

.inline-form {
  margin: 0;
}

.attacker-list {
  display: grid;
  gap: 4px;
}

.attacker-row {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: inherit;
  display: grid;
  gap: 12px;
  grid-template-columns: 160px minmax(200px, 1fr) 200px;
  padding: 8px 10px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.attacker-row:hover {
  background: var(--bg-secondary);
  border-color: var(--line);
}

.attacker-row.attacker-hot {
  border-color: var(--red);
  background: var(--red-bg);
}

.attacker-row.attacker-hot:hover {
  background: var(--red-bg);
  border-color: var(--red);
}

.attacker-ip {
  color: var(--text);
  font-family: "SF Mono", "Monaco", "Cascadia Code", monospace;
  font-size: 14px;
  font-weight: 600;
}

.attacker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attacker-time {
  color: var(--text-secondary);
  font-family: "SF Mono", "Monaco", "Cascadia Code", monospace;
  font-size: 12px;
  justify-self: end;
}

.clean-hero {
  background: var(--bg);
  border: 1px solid var(--line);
}

.command-center {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  margin-bottom: 16px;
}

.hero-metric {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 20px;
  transition: all 0.15s ease;
}

.hero-metric:hover {
  border-color: var(--line-hover);
}

.hero-metric span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-metric strong {
  color: var(--text);
  font-size: 36px;
  letter-spacing: -0.04em;
  line-height: 1;
  font-weight: 700;
}

.hero-metric small {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 13px;
}

.hero-metric.needs-attention {
  background: var(--orange-bg);
  border-color: var(--orange);
}

.hero-metric.needs-attention strong {
  color: var(--orange);
}

.hero-metric.blocked {
  background: var(--green-bg);
  border-color: var(--green);
}

.hero-metric.blocked strong {
  color: var(--green);
}

.hero-metric.quiet {
  background: var(--bg-secondary);
}

.tabs-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  padding: 6px;
}

.dashboard-tabs {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
}

.dashboard-tabs a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 10px 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.dashboard-tabs a.active,
.dashboard-tabs a:hover {
  background: var(--bg);
  border-color: var(--line);
  color: var(--text);
}

.dashboard-tabs strong {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  color: var(--text);
  min-width: 28px;
  padding: 4px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
}

.compact-filters {
  padding: 16px;
}

.compact-filters .filters {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

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

.panel {
  background: var(--bg);
}

.section-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}

.signal-list {
  display: grid;
  gap: 8px;
}

.signal-list.large {
  gap: 10px;
}

.signal-row {
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  grid-template-columns: 80px 160px minmax(200px, 1fr);
  padding: 12px;
}

.signal-row span {
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  text-align: center;
  text-transform: uppercase;
}

.signal-row strong {
  color: var(--text);
  font-weight: 600;
}

.signal-row small {
  color: var(--text-secondary);
  font-size: 13px;
}

.signal-row.warning {
  background: var(--yellow-bg);
  border-color: var(--yellow);
}

.signal-row.danger {
  background: var(--red-bg);
  border-color: var(--red);
}

.signal-row.danger span {
  background: var(--red);
  color: #fff;
}

.ip-stack,
.ban-list,
.agent-grid {
  display: grid;
  gap: 10px;
}

.ip-chip {
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.ip-chip:hover {
  border-color: var(--line-hover);
}

.ip-chip strong,
.ban-card strong,
.agent-card strong {
  color: var(--text);
  font-weight: 600;
}

.ban-table .ban-reason-cell {
  color: var(--text-secondary);
  font-size: 13px;
  max-width: 320px;
}

.ban-time-label {
  color: var(--text-secondary);
  display: block;
  font-size: 11px;
  text-transform: uppercase;
}

.ip-chip span,
.ban-card small,
.agent-card small,
.agent-card footer span {
  color: var(--text-secondary);
  font-size: 13px;
}

.agent-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.agent-card,
.ban-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
  padding: 16px;
  transition: all 0.15s ease;
}

.agent-card:hover,
.ban-card:hover {
  border-color: var(--line-hover);
}

.agent-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-card footer {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 4px;
}

.wu-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  padding: 12px;
}

.wu-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.wu-head > span:first-child {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.wu-summary,
.wu-pending {
  color: var(--text-secondary);
  font-size: 12px;
}

.wu-details,
.wu-last-installed {
  display: grid;
  gap: 6px;
}

.wu-details-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}

.wu-details-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wu-details-item {
  background: var(--bg-secondary);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
}

.wu-details-name {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.wu-details-meta {
  color: var(--text-secondary);
  font-size: 11px;
}

.wu-error {
  color: var(--red);
  font-size: 12px;
}

.badge.wu-up_to_date,
.badge.wu-installed {
  background: var(--green-bg);
  color: var(--green);
}

.badge.wu-available {
  background: var(--bg-secondary);
  color: var(--accent);
}

.badge.wu-installing,
.badge.wu-unknown {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.badge.wu-reboot_required {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge.wu-failed {
  background: var(--red-bg);
  color: var(--red);
}

.button.compact {
  font-size: 13px;
  padding: 6px 12px;
}

.ban-list {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.ban-card {
  align-content: start;
}

.clean-table td,
.clean-table th {
  padding-block: 10px;
}

.empty-state {
  background: var(--bg-secondary);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  padding: 20px;
  font-size: 14px;
  text-align: center;
}

.mono {
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 13px;
}

.pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 4px;
  padding: 16px;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 13px;
}

.legend-row,
.signal-legend,
.attacker-legend {
  align-items: center;
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.legend-item {
  align-items: center;
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
}

.legend-item::before {
  border-radius: 3px;
  content: "";
  display: inline-block;
  height: 10px;
  width: 10px;
}

.legend-item.danger::before {
  background: var(--red);
}

.legend-item.warning::before {
  background: var(--yellow);
}

.legend-dot {
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.legend-dot.red {
  background: var(--red);
}

.attacker-legend {
  color: var(--text-secondary);
  font-size: 12px;
  gap: 6px;
}

.signal-kind {
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.signal-row.danger .signal-kind {
  background: var(--red);
  color: #fff;
}

.event-kind-tabs {
  display: flex;
  gap: 4px;
}

.btn-tab {
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  text-decoration: none;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.btn-tab:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

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

.inspector-head-meta {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.inspector-badge {
  background: var(--yellow-bg);
  border-radius: var(--radius-sm);
  color: var(--yellow);
  display: block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}

body.monitoring-tab .command-center,
body.monitoring-tab .tabs-card {
  display: none;
}

body.monitoring-tab .dashboard-hero {
  margin-bottom: 0;
  padding-bottom: 12px;
}

body.monitoring-tab .dashboard-hero .lead {
  display: none;
}

body.monitoring-tab .page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 24px);
}

.monitor-console {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.monitor-shell {
  display: grid;
  gap: 14px;
}

.monitor-toolbar {
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  padding: 16px 18px;
}

.monitor-toolbar-title h2 {
  font-size: 20px;
  margin: 0 0 4px;
}

.monitor-toolbar-title p {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

.monitor-toolbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.monitor-search {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  min-width: 240px;
  padding: 8px 12px;
}

.monitor-search:focus {
  border-color: var(--accent);
  outline: none;
}

.monitor-filter-tabs {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.monitor-filter-tabs a {
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  text-decoration: none;
}

.monitor-filter-tabs a.active,
.monitor-filter-tabs a:hover {
  background: var(--bg);
  color: var(--text);
}

.monitor-stats-inline {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

.compact-toolbar {
  flex-shrink: 0;
}

.monitor-layout {
  display: grid;
  flex: 1;
  gap: 10px;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  min-height: 0;
}

.monitor-list-hint {
  border-top: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 11px;
  margin: 0;
  padding: 6px 8px;
}

.tree-legend {
  margin-right: 10px;
}

.tree-legend.online::before {
  background: var(--green);
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 7px;
  margin-right: 4px;
  vertical-align: middle;
  width: 7px;
}

.tree-legend.problem::before {
  background: var(--yellow);
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 7px;
  margin-right: 4px;
  vertical-align: middle;
  width: 7px;
}

.tree-legend.total {
  color: var(--muted);
}

.monitor-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.monitor-detail-panel .server-panel-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.monitor-detail-panel .server-panel-wrap[hidden] {
  display: none !important;
}

.monitor-detail-panel .fleet-inspector {
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.monitor-detail-panel .monitor-detail-empty {
  flex: 1;
}

.fleet-row {
  border: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}

.fleet-group-head.is-hidden {
  display: none;
}

.monitor-tree-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.monitor-tree-head {
  align-items: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  justify-content: space-between;
  padding: 6px 8px;
}

.monitor-tree-head-title {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.monitor-tree-head-title strong {
  color: var(--text);
}

.monitor-tree-head-actions {
  display: flex;
  gap: 4px;
}

.tree-head-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  height: 22px;
  line-height: 1;
  padding: 0;
  width: 22px;
}

.tree-head-btn:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.monitor-tree-search-wrap {
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  padding: 6px 8px;
}

.monitor-tree-search {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 12px;
  padding: 5px 8px;
  width: 100%;
}

.monitor-tree-search:focus {
  border-color: var(--accent);
  outline: none;
}

.monitor-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 0;
}

.monitor-tree-dense .tree-branch {
  border: none;
  border-radius: 0;
  margin: 0;
  overflow: visible;
}

.tree-branch {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.tree-branch[open] > .tree-branch-head .tree-branch-icon {
  transform: rotate(90deg);
}

.tree-branch.is-hidden {
  display: none;
}

.monitor-tree-dense .tree-branch-head {
  background: transparent;
  min-height: 24px;
  padding: 2px 8px;
}

.tree-branch-head {
  align-items: center;
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 10px 12px;
  user-select: none;
}

.tree-branch-head::-webkit-details-marker {
  display: none;
}

.tree-branch-icon {
  color: var(--text-secondary);
  display: inline-block;
  font-size: 12px;
  transition: transform 0.15s ease;
  width: 12px;
}

.monitor-tree-dense .tree-branch-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tree-branch-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-branch-meta {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.monitor-tree-dense .tree-count,
.monitor-tree-dense .tree-stat {
  font-size: 10px;
  padding: 1px 5px;
}

.tree-count {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}

.tree-stat {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}

.tree-stat.online {
  background: #ecfdf3;
  color: var(--green);
}

.tree-stat.problem {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.monitor-tree-dense .tree-children {
  margin: 0;
  padding: 0;
}

.tree-children {
  list-style: none;
  margin: 0;
  padding: 6px;
}

.tree-leaf {
  margin: 0;
}

.tree-leaf.is-hidden {
  display: none;
}

.monitor-tree-dense .tree-item {
  border: none;
  border-radius: 0;
  font: inherit;
  gap: 4px;
  grid-template-columns: 7px minmax(0, 1fr) auto auto auto;
  margin: 0;
  min-height: 22px;
  padding: 2px 8px 2px 18px;
  text-align: left;
  width: 100%;
}

.tree-item {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  margin-bottom: 2px;
  padding: 8px 10px;
  text-decoration: none;
  transition: background 0.1s ease;
}

.tree-item:hover {
  background: var(--bg-secondary);
}

.monitor-tree-dense .tree-item:hover {
  background: #f4f4f5;
}

.tree-item.active {
  background: #e8f1ff;
}

.monitor-tree-dense .tree-item.active {
  background: #dbeafe;
  box-shadow: inset 3px 0 0 var(--accent);
}

.tree-item.is-hidden {
  display: none;
}

.monitor-tree-dense .tree-status {
  height: 7px;
  width: 7px;
}

.tree-status {
  background: var(--green);
  border-radius: 999px;
  flex-shrink: 0;
  height: 10px;
  width: 10px;
}

.tree-item.health-warning .tree-status {
  background: var(--yellow);
}

.tree-item.health-danger .tree-status {
  background: var(--red);
}

.tree-item.health-offline .tree-status {
  background: var(--muted);
}

.tree-item-title {
  font-size: 12px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-item-ip {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tree-item-port {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tree-item-port.custom,
.rdp-port-custom {
  color: var(--orange);
  font-weight: 600;
}

.tree-item-ver {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tree-badge {
  background: var(--yellow-bg);
  border-radius: 3px;
  color: var(--yellow);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  padding: 1px 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tree-item.health-danger .tree-badge {
  background: var(--red-bg);
  color: var(--red);
}

.monitor-tree-dense .tree-health-label {
  display: none;
}

.monitor-detail {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 18px;
  max-height: 72vh;
  overflow: auto;
  padding: 18px;
}

.monitor-detail-empty {
  align-items: center;
  display: flex;
  justify-content: center;
}

.monitor-detail-empty .empty-state {
  max-width: 420px;
  text-align: center;
}

.monitor-empty {
  padding: 24px;
}

.fleet-shell .section-title {
  align-items: flex-start;
  gap: 16px;
}

.fleet-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.fleet-search {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  min-width: 220px;
  padding: 8px 12px;
}

.fleet-search:focus {
  border-color: var(--accent);
  outline: none;
}

.fleet-filter-tabs {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.fleet-filter-tabs a {
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  text-decoration: none;
}

.fleet-filter-tabs a.active,
.fleet-filter-tabs a:hover {
  background: var(--bg);
  color: var(--text);
}

.fleet-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  min-height: 520px;
}

.fleet-list {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px;
  max-height: 72vh;
  overflow: auto;
  padding: 10px;
}

.fleet-group-head {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  font-size: 12px;
  font-weight: 600;
  justify-content: space-between;
  letter-spacing: 0.04em;
  padding: 8px 10px 4px;
  text-transform: uppercase;
}

.fleet-row {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  display: grid;
  gap: 10px;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  padding: 10px 12px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.fleet-row:hover,
.fleet-row.active {
  border-color: var(--line-hover);
  box-shadow: var(--shadow-sm);
}

.fleet-row.active {
  border-color: var(--accent);
  background: #f8fbff;
}

.fleet-row.is-hidden {
  display: none;
}

.fleet-status {
  background: var(--green);
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.fleet-status.large {
  height: 14px;
  width: 14px;
}

.health-warning .fleet-status,
.fleet-row.health-warning .fleet-status {
  background: var(--yellow);
}

.health-danger .fleet-status,
.fleet-row.health-danger .fleet-status {
  background: var(--red);
}

.health-offline .fleet-status,
.fleet-row.health-offline .fleet-status {
  background: var(--muted);
}

.fleet-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.fleet-row-main strong,
.inspector-head h2 {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-row-main small,
.fleet-row-meta small,
.inspector-copy.muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.fleet-row-meta {
  align-items: end;
  display: grid;
  gap: 4px;
  justify-items: end;
}

.fleet-pill {
  background: var(--yellow-bg);
  border-radius: 999px;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  white-space: nowrap;
}

.fleet-row.health-danger .fleet-pill {
  background: var(--red-bg);
  color: var(--red);
}

.fleet-inspector {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 18px;
  max-height: 72vh;
  overflow: auto;
  padding: 18px;
}

.inspector-head,
.inspector-section-head,
.inspector-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.inspector-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.inspector-head h2 {
  font-size: 22px;
  margin: 4px 0;
  white-space: normal;
}

.inspector-status {
  align-items: center;
  display: flex;
  gap: 10px;
}

.inspector-status strong {
  display: block;
  font-size: 14px;
}

.inspector-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inspector-metrics article {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  padding: 12px;
}

.inspector-metrics span {
  color: var(--text-secondary);
  font-size: 12px;
}

.inspector-metrics strong {
  font-size: 16px;
}

.inspector-section {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.inspector-section.danger-box {
  background: var(--red-bg);
  border-color: #fecaca;
}

.inspector-section h3 {
  font-size: 15px;
  margin: 0;
}

.inspector-copy {
  color: var(--text);
  font-size: 14px;
  margin: 0;
}

.compact-table td,
.compact-table th {
  font-size: 13px;
  padding-block: 8px;
}

@media (max-width: 760px) {
  .attacker-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .attacker-time {
    justify-self: start;
  }
}

@media (max-width: 980px) {
  .hero, .auth-page, .app-layout {
    grid-template-columns: 1fr;
  }

  .command-center,
  .dashboard-tabs,
  .compact-filters .filters,
  .dashboard-grid.two-columns {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    order: -1;
  }

  .sidebar {
    height: auto;
    position: static;
  }

  .dashboard-hero {
    flex-direction: column;
  }

  .signal-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .fleet-layout,
  .monitor-layout {
    grid-template-columns: 1fr;
  }

  .fleet-list,
  .fleet-inspector,
  .monitor-tree-panel {
    max-height: 40vh;
  }

  .monitor-detail-panel .fleet-inspector {
    max-height: none;
  }

  .monitor-toolbar {
    flex-direction: column;
  }

  .monitor-toolbar-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .monitor-search {
    flex: 1;
    min-width: 0;
  }

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

@media (max-width: 640px) {
  .hero, .shell {
    padding-inline: 16px;
  }

  .hero {
    padding-block: 32px 48px;
  }

  .auth-page, .app-layout {
    padding: 12px;
  }

  .mock-window {
    min-height: 320px;
  }

  .topbar {
    align-items: flex-start;
    border-radius: var(--radius);
    flex-direction: column;
  }
}

.subsection-title {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  color: var(--text-muted, #8b95a8);
}

.muted-panel {
  background: rgba(255, 255, 255, 0.02);
}

.muted-panel code {
  font-size: 0.85em;
}

.sync-meta {
  display: block;
  color: var(--text-muted, #8b95a8);
  font-size: 0.8rem;
  margin-right: 0.75rem;
}

.alert-raw {
  max-height: 320px;
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius, 8px);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

tr.health-offline td,
tr.health-stale td {
  opacity: 0.92;
}

.notice-banner {
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding: 10px 14px;
}

.notice-banner.success {
  background: var(--green-bg);
  border: 1px solid var(--green);
  color: var(--green);
}

.notice-banner.danger {
  background: var(--orange-bg);
  border: 1px solid var(--orange);
  color: var(--orange);
}

.mgmt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mgmt-form {
  display: grid;
  gap: 12px;
}

.mgmt-form label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  margin: 0;
}

.mgmt-form input[type="text"],
.mgmt-form input[type="password"],
.mgmt-form input[type="number"],
.mgmt-form input:not([type]) {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: text;
  padding: 8px 10px;
  pointer-events: auto;
}

.agent-config-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-config-service {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.mgmt-form input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.mgmt-form input:-webkit-autofill,
.mgmt-form input:-webkit-autofill:hover,
.mgmt-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg-secondary) inset;
  transition: background-color 99999s ease-out 0s;
}

.mgmt-autofill-trap {
  height: 0;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 0;
}

.checkbox-row {
  align-items: center;
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
}

.mgmt-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

.mgmt-lead {
  line-height: 1.6;
  margin: 0;
}

.help-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-block;
  font-size: 0.8rem;
  margin: 0 4px;
  padding: 2px 10px;
}

.help-pill.windows {
  background: var(--green-bg);
  border-color: var(--green);
}

.agent-config-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
}

.agent-config-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.agent-config-head small {
  color: var(--text-secondary);
  display: block;
}

.agent-config-sources {
  display: grid;
  gap: 8px;
}

.mgmt-subtitle {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.source-chip {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.source-chip small {
  color: var(--text-secondary);
}

.agent-config-form,
.agent-apply-form {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.history-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 12px;
}

.history-stats div {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.history-stats dt {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.history-stats dd {
  margin: 0;
}

.empty-state.compact {
  padding: 8px 0;
}

.mgmt-shell {
  display: grid;
  gap: 16px;
}

.mgmt-subnav {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
}

.mgmt-subnav a {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mgmt-subnav a.active,
.mgmt-subnav a:hover {
  background: var(--bg-secondary);
  border-color: var(--line);
  color: var(--text);
}

.mgmt-page-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.mgmt-page-head h2 {
  font-size: 1.35rem;
  margin: 4px 0 8px;
}

.badge.lg {
  font-size: 0.85rem;
  padding: 6px 12px;
}

.badge.compact {
  font-size: 0.7rem;
  padding: 2px 8px;
}

.mgmt-overview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mgmt-overview-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: inherit;
  display: grid;
  gap: 8px;
  padding: 20px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mgmt-overview-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.mgmt-overview-card h3 {
  margin: 0;
}

.mgmt-overview-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
}

.mgmt-overview-card small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.mgmt-overview-stat {
  color: var(--text);
  font-size: 1.25rem;
}

.mgmt-overview-stat.ok {
  color: var(--green);
}

.mgmt-overview-icon {
  font-size: 1.5rem;
}

.mgmt-overview-card.hub {
  border-top: 3px solid var(--accent);
}

.mgmt-overview-card.windows {
  border-top: 3px solid var(--green);
}

.mgmt-overview-card.storage {
  border-top: 3px solid #7c6fe0;
}

.mgmt-overview-card.install {
  border-top: 3px solid #e8a317;
}

.install-steps-list {
  color: var(--text-secondary);
  display: grid;
  gap: 8px;
  line-height: 1.5;
  margin: 0;
  padding-left: 1.2rem;
}

.mgmt-architecture .subsection-title {
  margin-bottom: 16px;
}

.mgmt-flow {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr auto 1fr;
}

.mgmt-flow-step {
  align-items: flex-start;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  padding: 14px;
}

.mgmt-flow-step p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 4px 0 0;
}

.mgmt-flow-num {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  min-width: 28px;
}

.mgmt-flow-arrow {
  color: var(--text-secondary);
  font-size: 1.25rem;
  font-weight: 700;
}

.settings-group-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.settings-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px 16px 16px;
}

.settings-fieldset legend {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 6px;
  text-transform: uppercase;
}

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

.mgmt-split {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 280px minmax(0, 1fr);
}

.mgmt-split-list {
  position: sticky;
  top: 16px;
}

.mgmt-agent-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mgmt-agent-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: inherit;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mgmt-agent-item:hover,
.mgmt-agent-item.active {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

.mgmt-agent-item-title {
  font-weight: 700;
}

.mgmt-agent-item-ip {
  color: var(--text-secondary);
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
}

.mgmt-split-detail {
  display: grid;
  gap: 16px;
}

@media (max-width: 1100px) {
  .mgmt-overview-grid,
  .mgmt-flow {
    grid-template-columns: 1fr;
  }

  .mgmt-flow-arrow {
    display: none;
  }

  .mgmt-split {
    grid-template-columns: 1fr;
  }

  .mgmt-split-list {
    position: static;
  }

  .mgmt-form-grid.two {
    grid-template-columns: 1fr;
  }
}
