:root {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #d9e1e8;
  --text: #18222d;
  --muted: #687789;
  --accent: #176b87;
  --accent-2: #2d8c72;
  --danger: #b42318;
  --warn: #b7791f;
  --shadow: 0 12px 30px rgba(24, 34, 45, 0.08);
}

* {
  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;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

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

button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0 12px;
  font-weight: 720;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  filter: brightness(0.96);
}

button.secondary {
  background: white;
  border-color: var(--line);
  color: var(--text);
}

button.danger {
  background: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 7px 10px;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

code {
  display: block;
  overflow-wrap: anywhere;
  color: #304050;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #10212b;
  color: white;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #2d8c72;
  font-weight: 850;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p {
  color: #b9c5cf;
  font-size: 12px;
}

nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.nav {
  justify-content: start;
  width: 100%;
  background: transparent;
  color: #d7e1e8;
  text-align: left;
  border-color: transparent;
}

.nav.active,
.nav:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.page-head h2,
.page-head p,
.panel h3,
.section-title h3 {
  margin: 0;
}

.page-head h2 {
  font-size: 24px;
}

.page-head p {
  margin-top: 2px;
  color: var(--muted);
}

.pill,
.badge {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 760;
  background: #e5ebf0;
  color: #344253;
}

.pill.good,
.badge.done {
  background: #dff3ea;
  color: #166348;
}

.pill.bad,
.badge.error {
  background: #ffe3e0;
  color: var(--danger);
}

.badge.pending,
.badge.sent {
  background: #fff2d7;
  color: #7a4d00;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat,
.panel,
.control-bar,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  padding: 14px;
}

.stat span {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 820;
}

.stat label,
.field label,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.control-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  margin-bottom: 14px;
}

.host-update-bar {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 340px) auto;
}

.field {
  display: grid;
  gap: 5px;
}

.field.small {
  max-width: 120px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.gpu-name {
  font-weight: 760;
}

.temp {
  font-weight: 760;
}

.temp.ok {
  color: var(--accent-2);
}

.temp.warn {
  color: var(--warn);
}

.temp.hot {
  color: var(--danger);
}

.split {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 14px;
}

.panel {
  padding: 14px;
}

.panel h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

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

.field.wide {
  grid-column: 1 / -1;
}

.list,
.commands {
  display: grid;
  gap: 8px;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.list-item p,
.command p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.command {
  display: grid;
  grid-template-columns: 60px 86px minmax(200px, 1fr) minmax(220px, 1.2fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
  }

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

  .control-bar,
  .split,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .page-head,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  nav,
  .control-bar,
  .split,
  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .command,
  .list-item {
    grid-template-columns: 1fr;
  }
}

.stack {
  display: grid;
  gap: 18px;
}
