:root {
  --bg-0: #f6f9ff;
  --bg-1: #e9f1ff;
  --bg-2: #dbe7fb;
  --ink: #12243d;
  --ink-soft: #5a6d87;
  --line: #cad7ec;
  --panel: #ffffff;
  --brand: #0a4fb4;
  --brand-2: #1e73d9;
  --brand-dark: #0f2747;
  --side-0: #081d3a;
  --side-1: #0f2c53;
  --side-2: #18487a;
  --side-accent: rgba(96, 160, 242, 0.24);
  --side-line: #2a5f93;
  --side-text: #e7f1ff;
  --side-sub: #b8cde8;
  --ok: #0f8f61;
  --warn: #b57608;
  --bad: #b53939;
  --radius: 14px;
  --shadow: 0 14px 32px rgba(13, 34, 66, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  background:
    radial-gradient(1000px 420px at 0% -12%, #ffffff 0%, transparent 55%),
    linear-gradient(162deg, var(--bg-0), var(--bg-1) 55%, var(--bg-2));
}

body.no-scroll {
  overflow: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image: radial-gradient(rgba(15, 33, 61, 0.08) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
}

code {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d5e2f8;
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 12px;
  background: #eef5ff;
  color: #1a406f;
}

.side-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -9999px;
}

.side-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  background: rgba(8, 20, 40, 0.44);
  transition: opacity 160ms ease;
}

.app-layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
  position: relative;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px;
  overflow-y: auto;
  border-right: 1px solid var(--side-line);
  background:
    radial-gradient(circle at 100% 0%, var(--side-accent), transparent 45%),
    linear-gradient(182deg, var(--side-0), var(--side-1) 52%, var(--side-2));
  color: var(--side-text);
  z-index: 40;
}

.side-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border-radius: 9px;
  border: 1px solid rgba(205, 225, 255, 0.3);
  color: #d5e5ff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-block;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px;
  flex: 0 0 auto;
}

.brand-mark.small {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  padding: 2px;
  background: rgba(18, 65, 125, 0.1);
}

.brand-wordmark {
  display: inline-block;
  line-height: 1;
}

.sidebar-brand a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #fff;
  font-size: 29px;
  line-height: 1;
  letter-spacing: 0.3px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.sidebar-brand > span {
  display: block;
  margin-top: 6px;
  color: var(--side-sub);
  font-size: 12px;
}

.sidebar-nav {
  display: grid;
  gap: 7px;
}

.sidebar-nav a {
  text-decoration: none;
  color: var(--side-text);
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 130ms ease, transform 130ms ease, border-color 130ms ease;
  position: relative;
  z-index: 1;
}

.sidebar-nav a:hover {
  transform: translateX(1px);
  border-color: rgba(133, 188, 255, 0.55);
  background: rgba(98, 158, 233, 0.25);
}

.sidebar-nav a.active {
  color: #fff;
  border-color: #7ab4f0;
  background: linear-gradient(135deg, #1f64b4, #3e87dc);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 6px;
  color: var(--side-sub);
  font-size: 12px;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(180px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 250, 255, 0.9);
  backdrop-filter: blur(10px);
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid #b8cceb;
  color: #2d4f7e;
  background: #fff;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.header-title strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  line-height: 1.1;
}

.header-title strong span {
  color: var(--ink);
}

.header-title > span {
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.header-actions a {
  text-decoration: none;
  color: #27476e;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.header-actions::-webkit-scrollbar {
  display: none;
}

.header-actions .user {
  color: var(--ink-soft);
  font-size: 12px;
}

.header-actions .btn-link {
  color: #fff;
  padding: 8px 12px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 250, 255, 0.9);
  backdrop-filter: blur(10px);
}

.public-brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.public-brand a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.public-brand .brand-wordmark {
  color: var(--ink);
}

.public-brand > span {
  color: var(--ink-soft);
  font-size: 12px;
}

.public-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.public-links a {
  text-decoration: none;
  color: #284870;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.public-links::-webkit-scrollbar {
  display: none;
}

.public-links .btn-link {
  color: #fff;
  padding: 8px 12px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.container {
  width: 100%;
  margin: 0 auto;
  max-width: 1400px;
  padding: 18px;
}

.public-container {
  max-width: 1240px;
}

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

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

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

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

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
  animation: rise-in 260ms ease;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1,
h2,
h3 {
  margin: 0 0 10px;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.1px;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

p {
  margin: 0;
}

.muted {
  color: var(--ink-soft);
  font-size: 13px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.55px;
  font-size: 11px;
  font-weight: 700;
  color: #94aacc;
}

label {
  display: block;
  margin: 10px 0 6px;
  color: #2f496f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.34px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b8cbe6;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 76, 176, 0.15);
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.btn.secondary {
  background: linear-gradient(135deg, #2f466d, #4b6288);
}

.btn.warning {
  background: linear-gradient(135deg, #b67609, #d1932b);
}

.btn.success {
  background: linear-gradient(135deg, #0f8f61, #32b286);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.alert {
  margin-bottom: 12px;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 600;
}

.alert.ok {
  border: 1px solid #9fe2c5;
  background: #dff8ec;
  color: #0b774f;
}

.alert.bad {
  border: 1px solid #f0bcbc;
  background: #fce6e6;
  color: #9b2f2f;
}

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

.kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.kpi .label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-soft);
}

.kpi .value {
  margin-top: 5px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.ok {
  background: #daf4e9;
  color: #08724a;
}

.badge.warn {
  background: #fcf0d0;
  color: #926300;
}

.badge.bad {
  background: #f7dfdf;
  color: #9a2d2d;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #d3def0;
  border-radius: 12px;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #1f3a5e;
  background: #f3f8ff;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  font-size: 11px;
}

.empty {
  text-align: center;
  padding: 16px 10px;
  color: var(--ink-soft);
}

.pill-link {
  display: inline-flex;
  text-decoration: none;
  color: #21466f;
  font-weight: 700;
  border: 1px solid #c7d8ef;
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
}

.json {
  overflow: auto;
  white-space: pre-wrap;
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: #cfe1ff;
  background: #101a2b;
}

.auth-shell {
  display: grid;
  gap: 14px;
  align-items: stretch;
  grid-template-columns: 1.15fr 1fr;
}

.auth-hero {
  min-height: 470px;
  border: 1px solid #294f8a;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(11, 39, 79, 0.28);
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(131, 203, 255, 0.4), transparent 35%),
    linear-gradient(145deg, #0d2f64, #1f4f99, #3278db);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.auth-hero h1 {
  color: #fff;
  max-width: 560px;
  margin-top: 8px;
}

.auth-hero p {
  color: #d9e8ff;
  max-width: 560px;
  line-height: 1.65;
  margin-top: 10px;
}

.auth-hero.merchant {
  background:
    radial-gradient(circle at 15% 10%, rgba(114, 249, 204, 0.26), transparent 32%),
    linear-gradient(145deg, #11456e, #2f6db2, #4789de);
}

.auth-meta {
  font-size: 12px;
  color: #ecf3ff;
  opacity: 0.95;
}

.check-list {
  margin: 14px 0 0;
  padding-left: 18px;
  line-height: 1.75;
  color: var(--ink);
}

.auth-hero .check-list {
  color: #dcebff;
}

.check-list li {
  margin-bottom: 2px;
}

.auth-panel {
  min-height: 470px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.docs-hero {
  border: 1px solid #c6d8f2;
  border-radius: 18px;
  padding: 20px;
  background:
    radial-gradient(700px 300px at 88% -20%, rgba(37, 117, 216, 0.13), transparent 60%),
    linear-gradient(170deg, #ffffff, #f2f7ff 62%, #e8f1fe);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.docs-hero p {
  max-width: 760px;
  line-height: 1.6;
  color: #415a7d;
}

.docs-meta {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.docs-meta > div {
  display: grid;
  gap: 4px;
  min-width: 260px;
}

.docs-meta span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: #6f85a7;
}

.docs-table .table-wrap,
.docs-table table {
  width: 100%;
}

.copy-btn {
  border: 1px solid #b9cde9;
  border-radius: 9px;
  background: #fff;
  color: #1f426f;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
}

.copy-btn.done {
  border-color: #92d8bb;
  background: #e3f8ee;
  color: #0d7a4f;
}

.doc-toolbar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.doc-toolbar .muted {
  font-size: 12px;
}

.endpoint-list {
  display: grid;
  gap: 9px;
}

.endpoint-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #d4e1f3;
  border-radius: 11px;
  padding: 9px 10px;
  background: #f7fbff;
}

.endpoint-method {
  text-align: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.endpoint-method.get { background: #2d77d5; }
.endpoint-method.post { background: #0d8a5d; }
.endpoint-method.patch { background: #9f6d00; }

.endpoint-path {
  font-weight: 700;
  color: #18385f;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.endpoint-note {
  margin-top: 4px;
  color: #58708f;
  font-size: 12px;
}

.action-card {
  text-decoration: none;
  color: var(--ink);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: #b4caec;
  box-shadow: 0 18px 38px rgba(11, 33, 64, 0.15);
}

.action-card h3 {
  margin-bottom: 6px;
}

.action-card p {
  line-height: 1.55;
  color: #4f6483;
}

@media (max-width: 1220px) {
  .header-actions .user {
    display: none;
  }

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

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

  .menu-btn {
    display: inline-flex;
  }

  .side-close {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 90;
    width: min(86vw, 312px);
    transform: translateX(-104%);
    transition: transform 180ms ease;
    box-shadow: 10px 0 34px rgba(8, 22, 45, 0.45);
  }

  .side-toggle:checked ~ .side-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .side-toggle:checked ~ .app-layout .sidebar {
    transform: translateX(0);
  }
}

@media (max-width: 980px) {
  .g2,
  .g3,
  .g4,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 14px;
  }

  .app-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .header-actions {
    overflow-x: auto;
  }

  .header-actions a:not(.btn-link):not(:first-child),
  .header-actions .user {
    display: none;
  }

  .public-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .public-links a:not(.btn-link):not(:first-child) {
    display: none;
  }

  .endpoint-row {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .endpoint-row .copy-btn {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .docs-hero {
    grid-template-columns: 1fr;
  }

  .docs-meta {
    justify-items: start;
  }

  .auth-hero,
  .auth-panel {
    min-height: 0;
  }
}






