:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #667085;
  --line: #d9dee8;
  --line-soft: #edf1f7;
  --blue: #1f5fbf;
  --blue-dark: #174c99;
  --blue-soft: #e9f1ff;
  --green: #17803d;
  --red: #b42318;
  --amber: #a15c07;
  --shadow: 0 12px 30px rgba(31, 44, 71, .07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: #101828;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
  display: flex;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 190px;
}

.brand {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.brand-block span {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 600;
}

.topbar nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.topbar nav a {
  border-radius: 6px;
  color: #d8e2f0;
  font-size: 14px;
  font-weight: 650;
  padding: 8px 10px;
}

.topbar nav a:hover,
.topbar nav a.active {
  background: rgba(255,255,255,.10);
  color: #fff;
  text-decoration: none;
}

.container {
  margin: 28px auto;
  max-width: 1180px;
  padding: 0 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel h1,
.panel h2 {
  margin-top: 0;
}

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

.page-title h1 {
  font-size: 26px;
  margin: 0 0 4px;
}

.page-title p {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  font-size: 28px;
  margin-bottom: 4px;
}

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

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

form.inline {
  display: inline;
}

label {
  color: #344054;
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #cfd6e2;
  border-radius: 6px;
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 95, 191, .14);
  outline: none;
}

textarea {
  min-height: 90px;
}

.field {
  margin-bottom: 16px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

button,
.button {
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 650;
  padding: 10px 14px;
}

button.secondary,
.button.secondary {
  background: #475467;
}

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

.button.link-muted {
  background: transparent;
  color: var(--blue);
  padding-left: 0;
  padding-right: 0;
}

button:hover,
.button:hover {
  background: var(--blue-dark);
  text-decoration: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #475467;
  font-size: 13px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdff;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.badge.active {
  background: #dcfae6;
  color: var(--green);
}

.badge.suspended,
.badge.expired,
.badge.released {
  background: #fee4e2;
  color: var(--red);
}

.badge.inactive {
  background: #fef0c7;
  color: var(--amber);
}

.flash {
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.flash.success {
  background: #dcfae6;
  color: var(--green);
}

.flash.error {
  background: #fee4e2;
  color: var(--red);
}

.login-box {
  margin: 8vh auto;
  max-width: 420px;
}

.code {
  background: #f2f4f7;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 2px 6px;
}

.empty-state {
  background: #fbfdff;
  border: 1px dashed #cfd6e2;
  border-radius: 8px;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.help-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 270px minmax(0, 1fr);
}

.help-nav {
  align-self: start;
  position: sticky;
  top: 20px;
}

.help-nav a {
  border-radius: 6px;
  color: #344054;
  display: block;
  font-weight: 650;
  padding: 8px 10px;
}

.help-nav a:hover {
  background: var(--blue-soft);
  text-decoration: none;
}

.help-section {
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
}

.help-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.help-section h2 {
  margin-bottom: 8px;
}

.steps {
  counter-reset: step;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.steps li {
  border-left: 2px solid var(--blue-soft);
  margin: 0 0 12px 10px;
  padding: 0 0 2px 18px;
  position: relative;
}

.steps li::before {
  align-items: center;
  background: var(--blue);
  border-radius: 999px;
  color: #fff;
  content: counter(step);
  counter-increment: step;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  left: -12px;
  position: absolute;
  top: 0;
  width: 22px;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
  }

  .topbar nav {
    flex-wrap: wrap;
    margin-left: 0;
  }

  .grid.cols-2,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .page-title {
    display: block;
  }

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

  .help-nav {
    position: static;
  }
}
