:root {
  color-scheme: dark;
  --bg: #080d09;
  --panel: rgba(20, 31, 22, 0.94);
  --panel-2: rgba(30, 45, 31, 0.9);
  --line: rgba(129, 156, 105, 0.58);
  --text: #ece3cf;
  --muted: #b5ad99;
  --field: #101810;
  --green: #7fa66a;
  --green-bright: #a5c983;
  --beige: #d5c39a;
  --orange: #c79255;
  --red: #b65b4f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 52% 42%, rgba(87, 122, 71, 0.22), transparent 22%),
    radial-gradient(circle at 78% 24%, rgba(141, 126, 83, 0.14), transparent 27%),
    radial-gradient(circle at 20% 74%, rgba(68, 103, 61, 0.18), transparent 25%),
    linear-gradient(180deg, #050805 0%, #10180f 48%, #070c08 100%);
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(circle, rgba(191, 177, 135, 0.55) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(127, 166, 106, 0.42) 0 1px, transparent 1.4px);
  background-size: 120px 112px, 190px 158px;
  opacity: 0.22;
}

body::after {
  background:
    linear-gradient(rgba(129, 156, 105, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 156, 105, 0.12) 1px, transparent 1px);
  background-size: 96px 80px;
  mask-image: linear-gradient(to bottom, transparent 0, black 14%, black 88%, transparent 100%);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  position: relative;
  z-index: 1;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(9, 13, 9, 0.98), rgba(15, 23, 15, 0.94));
  border-right: 1px solid var(--line);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.24);
}

.brand,
.server-link,
.topbar,
.metric-card,
.command-deck,
.connection-strip,
.login-panel,
.notice {
  background: linear-gradient(180deg, var(--panel-2), rgba(3, 16, 29, 0.86));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(236, 227, 207, 0.04), 0 10px 22px rgba(0, 0, 0, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--beige);
  font-weight: 900;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  height: 38px;
  color: #f3ead6;
  background: #172217;
  border: 1px solid var(--beige);
  font-weight: 900;
  text-shadow: none;
}

.server-list {
  display: grid;
  gap: 10px;
}

.server-link {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  color: var(--text);
  text-decoration: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.server-link span {
  font-weight: 900;
  text-transform: uppercase;
}

.server-link strong {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
}

.server-link.active {
  border-color: var(--beige);
  background: linear-gradient(180deg, rgba(53, 73, 44, 0.95), rgba(24, 36, 24, 0.95));
}

.server-link.green.active {
  box-shadow: inset 4px 0 0 var(--green-bright);
}

.server-link.orange.active {
  box-shadow: inset 4px 0 0 var(--orange);
}

.workspace {
  padding: 18px 22px 22px;
  position: relative;
}

.workspace::before {
  content: "";
  position: absolute;
  inset: 120px 30px 160px;
  background:
    linear-gradient(35deg, transparent 12%, rgba(127, 166, 106, 0.5) 12.4%, transparent 13%),
    linear-gradient(145deg, transparent 32%, rgba(127, 166, 106, 0.42) 32.4%, transparent 33%),
    linear-gradient(12deg, transparent 50%, rgba(213, 195, 154, 0.34) 50.3%, transparent 51%);
  filter: drop-shadow(0 0 5px rgba(127, 166, 106, 0.42));
  opacity: 0.55;
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  position: relative;
  z-index: 2;
}

.topbar h1,
.command-deck h2,
.login-panel h1 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(32px, 5vw, 58px);
  font-style: italic;
  font-weight: 900;
  text-shadow: none;
}

.topbar p,
.login-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--beige);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

.status-pill {
  min-width: 112px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  text-align: center;
  text-transform: uppercase;
  font-weight: 900;
  background: rgba(3, 16, 29, 0.82);
}

.status-pill.online {
  color: var(--green);
  border-color: var(--green);
}

.status-pill.offline {
  color: #ff8070;
  border-color: #ff8070;
}

.status-pill.unknown {
  color: var(--orange);
  border-color: var(--orange);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
  position: relative;
  z-index: 2;
}

.metric-card {
  min-height: 82px;
  padding: 13px 14px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 22px;
}

.command-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 150px;
  padding: 14px;
  position: relative;
  z-index: 2;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
}

.ghost-button,
.action-button,
.login-form button {
  width: 100%;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 8px 14px;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 10px, 100% 100%, 0 100%, 0 10px);
  border: 1px solid #168de8;
  border-color: rgba(129, 156, 105, 0.82);
  background: linear-gradient(180deg, rgba(49, 67, 42, 0.96), rgba(21, 32, 21, 0.96));
  color: #f0e7d1;
  box-shadow: inset 0 0 0 1px rgba(236, 227, 207, 0.05), 0 8px 16px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-align: center;
  font-weight: 900;
}

.action-button.restart {
  border-color: var(--beige);
}

.action-button.update {
  border-color: var(--green);
}

.action-button.stop,
.ghost-button {
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(75, 39, 32, 0.96), rgba(31, 22, 18, 0.96));
}

.ghost-button:hover,
.action-button:hover,
.login-form button:hover {
  filter: brightness(1.1);
}

.connection-strip,
.notices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  position: relative;
  z-index: 2;
}

.connection-strip {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.notice {
  padding: 10px 12px;
}

.notice.success {
  border-color: rgba(101, 246, 178, 0.8);
}

.notice.error {
  border-color: rgba(229, 26, 39, 0.85);
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 45%, rgba(87, 122, 71, 0.22), transparent 26%),
    linear-gradient(180deg, #050805, #10180f);
}

.login-panel {
  width: min(430px, 100%);
  padding: 24px;
}

.login-panel .brand-mark {
  margin-bottom: 16px;
}

.login-panel h1 {
  font-style: italic;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.login-form input {
  width: 100%;
  border: 1px solid rgba(84, 178, 255, 0.65);
  border: 1px solid rgba(129, 156, 105, 0.7);
  background: var(--field);
  color: var(--text);
  padding: 12px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--beige);
  box-shadow: 0 0 0 3px rgba(213, 195, 154, 0.12);
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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

  .command-deck {
    margin-top: 220px;
  }
}

@media (max-width: 560px) {
  .workspace,
  .sidebar {
    padding: 14px;
  }

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

  .command-deck {
    margin-top: 160px;
  }
}
