:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #181a20;
  --panel-2: #20232b;
  --panel-3: #242832;
  --text: #f5f1e8;
  --muted: #a9acb6;
  --line: #2f333d;
  --pink: #ff6f9f;
  --mint: #52d6a3;
  --amber: #f5ba4f;
  --blue: #6db7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
.button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 72px;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
}

.brand,
.topbar nav,
.actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand {
  font-weight: 800;
}

.brand-mark,
.server-icon,
.server-badge {
  align-items: center;
  background: var(--pink);
  border-radius: 8px;
  color: #160910;
  display: inline-flex;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.topbar nav a,
.topbar nav button {
  background: transparent;
  color: var(--muted);
  padding: 9px 10px;
}

.shell {
  margin: 0 auto;
  max-width: 1240px;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 56px);
}

.shell:has(.app-layout) {
  max-width: none;
  padding: 0;
}

.hero {
  align-items: stretch;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  min-height: calc(100vh - 176px);
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  color: var(--mint);
  font-size: 0.8rem;
  font-weight: 800;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 6.5rem);
  line-height: 0.95;
  margin: 0;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 640px;
}

.button {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  min-height: 44px;
  padding: 0 16px;
}

.button.primary {
  background: var(--pink);
  color: #190811;
}

.button.ghost {
  background: var(--panel-2);
  color: var(--text);
}

.live-panel,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.live-panel {
  align-self: center;
}

.panel-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-header strong,
.module-tile b {
  color: var(--mint);
}

.module-grid,
.server-grid,
.settings-grid,
.metrics {
  display: grid;
  gap: 14px;
}

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

.module-tile,
.server-card,
.setting-card,
.metrics div {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.module-tile {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px;
}

.page-head {
  margin-bottom: 28px;
}

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

.server-card {
  align-items: center;
  display: flex;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
}

.server-card h2,
.setting-card h2,
.empty-state h2 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.server-card p,
.setting-card p,
.empty-state p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.workspace,
.app-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 260px minmax(0, 1fr);
}

.app-layout {
  gap: 0;
  min-height: calc(100vh - 72px);
}

.sidebar {
  border-right: 1px solid var(--line);
  min-height: calc(100vh - 176px);
  padding-right: 20px;
}

.app-sidebar {
  background: #15181e;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
}

.server-summary {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  min-width: 0;
}

.server-summary .eyebrow {
  margin-bottom: 4px;
}

.server-summary h1 {
  font-size: 1.08rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.module-nav {
  display: grid;
  gap: 8px;
}

.module-nav a {
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
}

.module-nav a.active {
  background: var(--panel-2);
  border-color: var(--line);
}

.module-nav span {
  font-size: 0.92rem;
  font-weight: 800;
}

.module-nav small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.app-main {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 24px;
}

.command-bar {
  align-items: center;
  background: #14171c;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px;
}

.command-bar h2 {
  font-size: 1.65rem;
  margin: 0 0 6px;
}

.command-bar p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

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

.sidebar h1 {
  font-size: 1.35rem;
  line-height: 1.1;
  margin: 14px 0 24px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav a {
  border-radius: 8px;
  color: var(--muted);
  padding: 10px 12px;
}

.sidebar nav a.active {
  background: var(--panel-2);
  color: var(--text);
}

.workspace-main {
  display: grid;
  gap: 18px;
}

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

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

.metrics div {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.metrics span {
  color: var(--muted);
  font-size: 0.9rem;
}

.metrics strong {
  font-size: 1.8rem;
}

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

.setting-card {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 132px;
  padding: 18px;
}

.dashboard-split,
.settings-dashboard {
  align-items: start;
  display: grid;
  gap: 18px;
}

.dashboard-split {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.settings-dashboard {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

.data-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

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

.data-panel-head h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.data-panel-head p {
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.search-box {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  min-width: 210px;
  padding: 8px 10px;
}

.search-box span,
.select-box span,
.settings-form label > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input,
.input-action input,
.select-box select,
.settings-form select {
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  outline: 0;
  width: 100%;
}

.select-box {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
}

.select-box select {
  min-width: 64px;
}

.settings-form {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.settings-form label {
  display: grid;
  gap: 8px;
}

.settings-form select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 12px;
}

.input-action {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
}

.input-action input {
  min-height: 44px;
  padding: 0 12px;
}

.input-action button {
  background: var(--pink);
  border-left: 1px solid var(--line);
  color: #190811;
  font-weight: 900;
  min-width: 82px;
  padding: 0 14px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  align-items: center;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  font-weight: 900;
  min-height: 34px;
  padding: 0 12px;
}

.setup-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.setup-list div {
  align-items: center;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 12px;
}

.setup-list div:last-child {
  border-bottom: 0;
}

.setup-list span {
  color: var(--muted);
}

.setup-list strong {
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

.activity-table {
  min-width: 640px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.admin-table td {
  color: #f8f3ec;
  line-height: 1.45;
}

.admin-table code {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  padding: 3px 6px;
}

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

.admin-table td:first-child {
  min-width: 190px;
}

.admin-table td:first-child strong,
.admin-table td:first-child span {
  display: block;
}

.admin-table td:first-child span {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 4px;
}

.pill,
.status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 26px;
  padding: 0 10px;
  white-space: nowrap;
}

.pill {
  background: rgba(109, 183, 255, 0.14);
  color: var(--blue);
}

.status {
  background: rgba(245, 186, 79, 0.12);
  color: var(--amber);
}

.status.live {
  background: rgba(82, 214, 163, 0.12);
  color: var(--mint);
}

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

.row-actions button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 34px;
  padding: 0 10px;
}

.row-actions button:first-child {
  border-color: rgba(255, 111, 159, 0.55);
  color: var(--pink);
}

.health-list {
  display: grid;
}

.health-list form {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 16px;
}

.health-list form:last-child,
.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.switch {
  background: #2b533f;
  height: 30px;
  padding: 3px;
  width: 54px;
}

.switch span {
  background: var(--mint);
  border-radius: 50%;
  display: block;
  height: 24px;
  margin-left: auto;
  width: 24px;
}

.switch.off {
  background: #3a252e;
}

.switch.off span {
  background: var(--muted);
  margin-left: 0;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 840px) {
  .hero,
  .workspace,
  .app-layout,
  .dashboard-split,
  .settings-dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .app-sidebar {
    border-right: 0;
    min-height: 0;
    padding-right: 0;
  }

  .metrics,
  .metrics.compact {
    grid-template-columns: 1fr;
  }

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

  .command-bar,
  .data-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box,
  .select-box {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding-bottom: 14px;
    padding-top: 14px;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .actions,
  .command-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .app-main {
    padding: 16px;
  }

  .module-nav {
    grid-template-columns: 1fr;
  }
}
