:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #66727d;
  --line: #dce3e8;
  --surface: #ffffff;
  --soft: #f4f7f8;
  --nav: #11181d;
  --teal: #1e8f82;
  --blue: #2769d8;
  --amber: #b7791f;
  --red: #b83232;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  background: var(--soft);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.sidebar {
  min-height: 100vh;
  background: var(--nav);
  color: #e8eef1;
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #34b39f;
  color: #061412;
  font-weight: 800;
}

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

.brand span {
  margin-top: 3px;
  color: #9caab2;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 6px;
  margin-top: 22px;
}

nav a {
  color: #bac6cc;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14px;
}

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

main {
  padding: 28px;
  display: grid;
  gap: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

.topbar p {
  margin-top: 8px;
  color: var(--muted);
}

.health {
  min-width: 148px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}

.health span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(30, 143, 130, 0.14);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.metric,
.panel,
.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 20px;
  align-items: start;
}

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

.composer,
.panel {
  padding: 18px;
}

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

.section-title h2 {
  font-size: 16px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

label.wide,
button {
  grid-column: 1 / -1;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

select {
  height: 40px;
  padding: 0 10px;
}

textarea {
  resize: vertical;
  min-height: 118px;
  padding: 11px;
  line-height: 1.45;
}

button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #26343d;
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.account-summary div {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.account-summary span {
  color: var(--muted);
  font-size: 12px;
}

.account-summary strong {
  font-size: 20px;
}

.pay-button {
  grid-column: auto;
}

.payments {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.payment {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: #f5f8fa;
  border: 1px solid var(--line);
}

.payment small,
.empty {
  color: var(--muted);
  font-size: 12px;
}

.ledger {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.ledger h3 {
  margin: 4px 0 0;
  font-size: 13px;
}

.ledger-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfcfd;
}

.ledger-entry small,
.form-status {
  color: var(--muted);
  font-size: 12px;
}

.form-status {
  grid-column: 1 / -1;
  min-height: 16px;
}

.ledger-entry b {
  white-space: nowrap;
}

.ledger-entry.credit b,
.ledger-entry.refund b {
  color: var(--teal);
}

.ledger-entry.debit b {
  color: var(--red);
}

.nodes,
.tasks {
  display: grid;
  gap: 10px;
}

.node,
.task {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.node-head,
.task-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.node strong,
.task strong {
  display: block;
  font-size: 14px;
}

.node small,
.task small {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e8edf0;
  color: #3f4a52;
}

.pill.online,
.pill.done {
  background: #dff3ed;
  color: var(--teal);
}

.pill.busy,
.pill.running {
  background: #e6efff;
  color: var(--blue);
}

.pill.queued {
  background: #fff1d6;
  color: var(--amber);
}

.bar {
  margin-top: 12px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ecef;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--progress);
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.tags,
.logs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag,
.log {
  border-radius: 6px;
  background: #eef3f5;
  color: #52606a;
  padding: 5px 7px;
  font-size: 12px;
}

.task-prompt {
  margin-top: 10px;
  color: #33414a;
  font-size: 14px;
  line-height: 1.45;
}

.task-result {
  margin: 12px 0 0;
  padding: 12px;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: #eef8f5;
  color: #213139;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.earning {
  display: inline-flex;
  margin-top: 10px;
  height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 6px;
  background: #e9f7dc;
  color: #3e741d;
  font-size: 12px;
  font-weight: 800;
}

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

  .sidebar {
    min-height: auto;
  }

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

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

  .topbar {
    display: grid;
  }
}
