:root {
  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --radius: 18px;
  --radius-sm: 12px;
  --content-width: 1200px;
  --transition: 180ms ease;
  --bg: #091017;
  --bg-alt: #0f1820;
  --bg-soft: #15212b;
  --bg-elevated: #182632;
  --line: #29404f;
  --ink: #eef5fa;
  --muted: #b4c3cf;
  --accent: #5fc6df;
  --accent-strong: #8ddff0;
  --accent-soft: rgba(95, 198, 223, 0.12);
  --ok: #6be091;
  --bad: #ff8b8b;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, var(--accent-soft), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  transition: background-color var(--transition), color var(--transition);
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: var(--font-mono);
  color: #d8e7f1;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 6px;
}

.shell-width {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}

.brand-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-mark {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-subtle {
  color: var(--muted);
  font-size: 0.9rem;
}

.header-nav,
.header-tools,
.toolbar-row,
.inline-metrics,
.login-form {
  display: flex;
}

.header-nav {
  gap: 10px;
  justify-content: center;
}

.nav-link-shell,
.logout-link,
.user-chip {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
}

.nav-link-shell {
  color: var(--muted);
  transition: all var(--transition);
}

.nav-link-shell.active,
.nav-link-shell:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.header-tools {
  gap: 10px;
  align-items: center;
}

.user-chip {
  color: var(--muted);
}

.logout-link {
  cursor: pointer;
}

.main-shell {
  padding: 36px 0 48px;
}

.page-intro {
  display: grid;
  grid-template-columns: 1.3fr auto;
  gap: 24px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

h2 {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.page-copy,
.table-shell-head p {
  margin-top: 12px;
  color: var(--muted);
  max-width: 60ch;
}

.inline-metrics {
  gap: 28px;
  align-items: flex-end;
}

.inline-metrics.compact {
  gap: 22px;
}

.inline-metrics span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
  font-weight: 700;
}

.inline-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.toolbar-row {
  gap: 18px;
  align-items: center;
}

.btn-shell {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-alt) 92%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 18px;
}

.metric-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.metric-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}

.metric-panel-head span {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
}

.metric-foot {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.metric-stack {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.metric-row strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.empty-inline {
  justify-content: flex-start;
}

.progress-track {
  width: 100%;
  height: 12px;
  margin-top: 18px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  min-width: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.table-shell-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.text-link-action {
  color: var(--accent);
  font-weight: 700;
}

.fleet-table {
  color: var(--ink);
  margin: 0;
}

.fleet-table tbody {
  color: #d7e3ea;
}

.fleet-table th,
.fleet-table td {
  padding: 15px 22px;
  vertical-align: middle;
  border-color: var(--line);
  background: transparent;
}

.fleet-table thead th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  border-bottom-width: 1px;
}

.fleet-table tbody tr {
  transition: background-color var(--transition);
}

.fleet-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.fleet-table td {
  color: #d7e3ea;
}

.fleet-table td:first-child {
  color: #dfeaf1;
}

.table-link {
  color: var(--ink);
  font-weight: 700;
}

.table-link:hover {
  color: var(--accent-strong);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 10px;
  vertical-align: middle;
}

.status-online {
  background: var(--ok);
}

.status-offline {
  background: var(--bad);
}

.status-unknown {
  background: var(--muted);
}

.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 28px 22px !important;
}

.login-shell {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(100%, 460px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: color-mix(in srgb, var(--bg-alt) 94%, transparent);
  box-shadow: var(--shadow);
}

.login-form {
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.field-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-shell span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.field-shell input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

.field-shell input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.auth-error {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 25%, var(--line));
}

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-alt) 92%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.detail-meta {
  display: flex;
  gap: 16px;
  color: var(--muted);
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .header-row,
  .page-intro,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .header-nav {
    justify-content: start;
  }

  .header-tools,
  .toolbar-row,
  .inline-metrics {
    flex-wrap: wrap;
  }

  .table-shell-head {
    align-items: start;
    flex-direction: column;
  }

  .detail-block-head {
    align-items: start;
    flex-direction: column;
  }
}
