:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #65717f;
  --line: #dde3ea;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #2563eb;
  --warn: #b45309;
  --bad: #b91c1c;
  --good: #047857;
  --shadow: 0 12px 32px rgba(19, 31, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--brand-strong);
}

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

button.secondary:hover {
  background: #eef3f7;
}

[hidden] {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #101820;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  border-radius: 8px;
  background: var(--panel);
  padding: 26px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.login-card .brand-mark {
  margin-bottom: 18px;
  color: #fff;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-card label {
  margin: 14px 0;
}

.login-card button {
  width: 100%;
  margin-top: 6px;
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #101820;
  color: #fff;
  padding: 22px;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  font-weight: 800;
}

.brand small {
  display: block;
  color: #a9b6c5;
  margin-top: 2px;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  color: #c8d3df;
  text-decoration: none;
  border-radius: 6px;
  padding: 10px 12px;
}

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

main {
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  letter-spacing: 0;
}

p {
  color: var(--muted);
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

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

.section,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section {
  margin-bottom: 18px;
  padding: 18px;
}

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

.section-head.compact {
  margin-bottom: 14px;
}

.section-head p {
  margin-bottom: 0;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 18px;
}

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

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

.account-card strong {
  display: block;
  min-height: 42px;
  line-height: 1.25;
}

.account-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.panel {
  padding: 18px;
}

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

label {
  display: grid;
  gap: 6px;
  color: #344253;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  resize: vertical;
}

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

pre {
  min-height: 438px;
  max-height: 520px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111827;
  color: #e5eef9;
  padding: 14px;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.55;
}

#accountSelect {
  max-width: 360px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

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

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  white-space: nowrap;
}

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #e6f4f1;
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
}

.status.paused {
  background: #f2f4f7;
  color: #586474;
}

.recommendations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.plan-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.plan-item h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.plan-item p {
  margin-bottom: 0;
  line-height: 1.45;
}

.plan-meta {
  color: var(--muted);
  font-size: 13px;
}

.note {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.note.high {
  border-left-color: var(--bad);
}

.note.medium {
  border-left-color: var(--warn);
}

.note h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.note p {
  margin-bottom: 0;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

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

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

@media (max-width: 720px) {
  main {
    padding: 18px;
  }

  .topbar,
  .section-head {
    display: grid;
  }

  nav,
  .account-grid,
  .recommendations,
  .metric-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 23px;
  }
}
