:root {
  color-scheme: dark;
  background: #000;
  color: #fff;
  --background: #000;
  --foreground: #fff;
  --panel: rgba(0, 0, 0, 0.72);
  --panel-soft: rgba(255, 255, 255, 0.025);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);
  --muted: #a1a1aa;
  --faint: #71717a;
  --dim: #52525b;
  --success-border: rgba(52, 211, 153, 0.25);
  --success-bg: rgba(52, 211, 153, 0.1);
  --success-text: #d1fae5;
  --warn-border: rgba(252, 211, 77, 0.25);
  --warn-bg: rgba(252, 211, 77, 0.1);
  --warn-text: #fef3c7;
  --danger-border: rgba(248, 113, 113, 0.25);
  --danger-bg: rgba(248, 113, 113, 0.1);
  --danger-text: #fee2e2;
  font-synthesis: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #000;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.08), transparent 28rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 20rem),
    #000;
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

::selection {
  background: rgba(255, 255, 255, 0.24);
  color: #000;
}

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

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.status-frame {
  min-height: 100vh;
  color: #fff;
}

.app-sidebar {
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.92);
}

.sidebar-inner {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}

.brand small {
  margin-top: 6px;
  color: var(--faint);
  font-size: 0.75rem;
}

.sidebar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  overflow: visible;
}

.nav-item,
.app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.nav-item {
  min-height: 44px;
  flex: 1 1 calc(50% - 4px);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: #71717a;
  padding: 0 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item:focus-visible {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  outline: none;
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.25);
  background: #fff;
  color: #000;
}

.nav-item svg,
.app-button svg,
.metric-card svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.sidebar-meta {
  display: none;
}

.topbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.86);
  padding: 0 20px;
}

.topbar-title {
  min-width: 0;
}

.topbar-title p {
  margin: 0;
  overflow: hidden;
  color: #d4d4d8;
  font-size: 0.875rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title span {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 0.75rem;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.app-button {
  min-height: 36px;
  padding: 0 12px;
}

.app-button-muted {
  border-color: var(--border-strong);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
}

.app-button-muted:hover,
.app-button-muted:focus-visible {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  outline: none;
}

.page-content {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  margin-top: 8px;
  max-width: 44rem;
  font-size: clamp(2rem, 9vw, 2.75rem);
  font-weight: 650;
  line-height: 1.08;
}

h2 {
  margin-top: 8px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.25;
}

h3 {
  color: #d4d4d8;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.4;
}

.header-copy {
  max-width: 42rem;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.status-badge {
  display: inline-flex;
  min-height: 32px;
  max-width: max-content;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: #d4d4d8;
  padding: 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--faint);
}

.status-operational {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success-text);
}

.status-operational .status-dot {
  background: #34d399;
}

.status-degraded,
.status-manual,
.status-pending {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.status-degraded .status-dot,
.status-manual .status-dot,
.status-pending .status-dot {
  background: #fcd34d;
}

.status-down,
.status-outage {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status-down .status-dot,
.status-outage .status-dot {
  background: #f87171;
}

.metric-grid {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

.metric-card {
  min-height: 120px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 24px 80px rgba(0, 0, 0, 0.2);
}

.metric-card svg {
  color: var(--faint);
}

.metric-card span,
.section-note,
.row-meta,
.activity-time {
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 600;
}

.metric-card span {
  display: block;
  margin-top: 22px;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
}

#last-updated {
  font-size: 1rem;
  line-height: 1.35;
}

.dashboard-grid {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

.app-panel {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 24px 80px rgba(0, 0, 0, 0.2);
}

.panel-section {
  padding: 24px;
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-note {
  white-space: nowrap;
}

.status-row-list,
.activity-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.status-row,
.activity-row {
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-height: 64px;
  padding: 16px;
}

.row-title {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
}

.row-title svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--faint);
}

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

.row-copy p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: var(--faint);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.row-meta {
  color: var(--dim);
}

.activity-row {
  padding: 16px;
}

.activity-row header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.activity-row p {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 0.875rem;
  line-height: 1.65;
}

@media (min-width: 640px) {
  .topbar {
    padding-inline: 32px;
  }

  .page-content {
    padding: 40px 32px 56px;
  }

  .page-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

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

  .status-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

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

@media (min-width: 1024px) {
  .status-frame {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }

  .sidebar-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-item {
    width: 100%;
    justify-content: flex-start;
  }

  .sidebar-meta {
    display: block;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 20px;
  }

  .sidebar-meta p {
    margin: 0;
    color: var(--dim);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
  }

  .sidebar-meta strong {
    display: block;
    margin-top: 12px;
    overflow: hidden;
    color: #d4d4d8;
    font-size: 0.875rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-meta span {
    display: block;
    margin-top: 6px;
    color: var(--dim);
    font-size: 0.75rem;
  }

  .app-main {
    min-width: 0;
  }

  .topbar {
    padding-inline: 40px;
  }

  .page-content {
    padding: 48px 40px 64px;
  }

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

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(20rem, 0.8fr);
  }
}
