:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ef;
  --blue: #1166e8;
  --green: #14804a;
  --amber: #a15c00;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--blue);
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: #101828;
  color: #fff;
}

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

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

.brand span,
.sidebar-footer span {
  display: block;
  color: #b8c4d8;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  color: #d6e0ef;
  padding: 11px 12px;
  border-radius: 8px;
}

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

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

main {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
}

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

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.section {
  margin-bottom: 34px;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
}

.metric-grid,
.panel-grid,
.command-grid {
  display: grid;
  gap: 14px;
}

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

.panel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

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

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

.metric {
  min-height: 126px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 20px;
}

.panel,
.command-card {
  padding: 18px;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.ready {
  color: var(--green);
  background: #eaf7ef;
  border-color: #bfe5cc;
}

.link-list,
.form-grid,
.settings-form {
  display: grid;
  gap: 12px;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.copy-row button,
.panel-header button,
.text-button,
.primary-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 700;
}

.primary-button {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.text-button {
  border: 0;
  padding: 0;
  min-height: auto;
  color: var(--blue);
  background: transparent;
}

.module-list,
.check-list {
  display: grid;
  gap: 8px;
}

.module-row,
.check-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.module-row:last-child,
.check-row:last-child {
  border-bottom: 0;
}

.module-row span,
.check-row span {
  color: var(--muted);
  font-size: 13px;
}

pre {
  min-height: 150px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #dce8ff;
  background: #101828;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.5;
}

.result-box {
  min-height: 254px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: #475467;
  background: #f8fafc;
  font-size: 13px;
}

td {
  color: #344054;
}

.notes {
  min-height: 260px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 12px 16px;
  color: #fff;
  background: #101828;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .metric-grid,
  .command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

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

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

  main {
    padding: 20px;
  }

  .metric-grid,
  .panel-grid,
  .command-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }
}
