* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef2f6;
  color: #17202a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
}

.narrow {
  width: min(560px, calc(100% - 32px));
}

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

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

h1,
h2,
h3 {
  margin: 0 0 16px;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 17px;
}

.admin-shell {
  width: min(1440px, calc(100% - 28px));
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  margin: 16px auto;
}

.admin-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  min-height: calc(100vh - 32px);
  background: #111827;
  color: #f9fafb;
  border-radius: 12px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.brand-block h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.brand-block span,
.eyebrow {
  color: #98a2b3;
  font-size: 13px;
  font-weight: 700;
}

.admin-menu {
  display: grid;
  gap: 8px;
  align-content: start;
}

.admin-menu button {
  width: 100%;
  justify-content: flex-start;
  margin: 0;
  background: transparent;
  color: #d1d5db;
  border: 1px solid transparent;
  min-height: 42px;
}

.admin-menu button:hover,
.admin-menu button.active {
  background: #ffffff;
  color: #111827;
}

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

.sidebar-actions button {
  width: 100%;
  margin: 0;
}

.admin-content {
  min-width: 0;
}

.admin-header {
  min-height: 76px;
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.admin-header h2 {
  font-size: 24px;
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 4px;
}

.header-status {
  text-align: right;
  color: #667085;
}

.header-status span,
.header-status strong {
  display: block;
}

.header-status strong {
  margin-top: 4px;
  color: #17202a;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

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

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

.section-head span {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

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

.account-card {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
  min-width: 0;
}

.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.account-card h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.account-card-head span,
.account-meta span {
  color: #667085;
  font-size: 13px;
}

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

.account-meta div {
  min-width: 0;
  border: 1px solid #eef2f6;
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
}

.account-meta strong,
.account-meta code {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.copy-field {
  margin-bottom: 12px;
}

.account-actions {
  display: grid;
  gap: 10px;
}

.compact-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: center;
}

.compact-form:first-child {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-form button {
  margin-right: 0;
  white-space: nowrap;
}

.account-foot {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef2f6;
}

.guide-steps {
  display: grid;
  gap: 14px;
}

.guide-steps article {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
}

.guide-steps h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.guide-steps p {
  margin: 0 0 12px;
  color: #344054;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.checklist span,
.copy-line {
  border: 1px solid #eef2f6;
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
}

.copy-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.copy-line span {
  color: #667085;
  font-weight: 700;
}

.copy-line code {
  overflow-wrap: anywhere;
}

.panel {
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

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

.metric span {
  display: block;
  color: #667085;
  margin-bottom: 8px;
}

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

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

.inline-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.stack-form {
  grid-template-columns: 1fr;
}

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

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 600;
}

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

input,
select {
  height: 42px;
  padding: 0 12px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

textarea {
  min-height: 160px;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: #1f2937;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  margin-right: 8px;
}

.primary {
  background: #0f766e;
}

.secondary {
  background: #475467;
}

.danger {
  border-color: #fecaca;
  background: #fff7f7;
}

.danger-button {
  background: #b42318;
}

.muted {
  color: #667085;
}

.notice {
  border: 1px solid #c7d7fe;
  background: #f5f8ff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: #344054;
}

.notice p {
  margin: 0 0 8px;
}

.notice p:last-child {
  margin-bottom: 0;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f6;
}

.split:last-child {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
}

.pending {
  background: #fff7ed;
  color: #9a3412;
}

.active {
  background: #ecfdf3;
  color: #027a48;
}

.expired {
  background: #f2f4f7;
  color: #475467;
}

.disabled {
  background: #fee4e2;
  color: #b42318;
}

.actions {
  min-width: 280px;
}

.actions form {
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eef2f6;
  vertical-align: top;
}

th {
  color: #667085;
  font-weight: 700;
}

tbody tr:hover {
  background: #f8fafc;
}

code,
pre {
  background: #f2f4f7;
  border-radius: 6px;
  padding: 2px 6px;
}

pre {
  white-space: pre-wrap;
  padding: 12px;
}

@media (max-width: 720px) {
  main,
  .narrow {
    width: min(100% - 20px, 560px);
    margin: 18px auto;
  }

  .admin-shell {
    width: min(100% - 20px, 560px);
    display: block;
    margin: 10px auto;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .admin-menu {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .admin-menu button {
    white-space: nowrap;
    width: auto;
  }

  .sidebar-actions {
    grid-template-columns: 1fr 1fr;
  }

  .admin-header,
  .topbar,
  .section-head,
  .split {
    align-items: stretch;
    flex-direction: column;
  }

  .header-status {
    text-align: left;
  }

  .grid,
  .form-grid,
  .account-meta,
  .compact-form,
  .compact-form:first-child,
  .copy-line {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
