:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f0f3f6;
  --text: #17202a;
  --muted: #667085;
  --border: #d9dee7;
  --primary: #176b87;
  --primary-hover: #14566d;
  --danger: #b42318;
  --danger-hover: #8f1d14;
  --success-bg: #ecfdf3;
  --success-text: #067647;
  --error-bg: #fef3f2;
  --error-text: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { max-width: 1120px; margin: 0 auto; padding: 0 20px 40px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}
.brand { color: var(--text); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.content { padding: 16px 0; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 30px; }
h2 { font-size: 20px; margin-bottom: 16px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-title-row h2 { margin-bottom: 0; }
.pagination-summary { margin: 0; font-size: 14px; text-align: right; }

.panel, .auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.auth-card { max-width: 440px; margin: 72px auto 0; }
.narrow { max-width: 640px; }

.form-stack { display: grid; gap: 16px; }
label span { display: block; margin-bottom: 6px; font-weight: 600; }
.form-hint { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
input:focus {
  outline: 3px solid rgba(23, 107, 135, .18);
  border-color: var(--primary);
}

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  min-height: 40px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { text-decoration: none; }
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { background: var(--surface-soft); color: var(--text); border-color: var(--border); }
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover { background: var(--danger-hover); }
.link-button {
  color: var(--primary);
  background: transparent;
  border: 0;
  padding: 0;
  min-height: auto;
}
.inline-form { margin: 0; }

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-top: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; font-weight: 700; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.pagination-status { color: var(--muted); font-size: 14px; }
.pagination-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pagination-link { min-height: 36px; padding: 7px 12px; }
.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--text);
  background: #fff;
  font-weight: 650;
}
.pagination-page:hover { text-decoration: none; border-color: var(--primary); }
.pagination-page.is-current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .58;
}
.spaced { margin-top: 20px; }
.empty-state {
  text-align: center;
  padding: 36px 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fbfcfd;
}
.step-note, .account-summary {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.mt-compact { margin-top: 12px; }

@media (max-width: 720px) {
  .topbar, .page-head, .section-title-row, .pagination { align-items: stretch; flex-direction: column; }
  .auth-card { margin-top: 24px; }
  h1 { font-size: 25px; }
  .actions { display: grid; }
  .pagination-summary { text-align: left; }
  .pagination-links { justify-content: flex-start; }
  .button, button { width: 100%; }
  .pagination-page { flex: 1 0 36px; }
}
