:root {
  color-scheme: light;
  --ink: #0a2540;
  --muted: #64748b;
  --line: #e6ebf1;
  --soft: #f6f9fc;
  --blue: #635bff;
  --blue-dark: #4f46e5;
  --teal: #00a6a6;
  --green: #0e9f6e;
  --white: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(99, 91, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #f7faff 0%, #ffffff 42%, #f6f9fc 100%);
}

button,
input,
a {
  font: inherit;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.env-banner {
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  font-weight: 650;
  padding: 10px 24px;
  text-align: center;
}

.env-banner a {
  color: #7c2d12;
  font-weight: 800;
}

.brand {
  align-items: center;
  display: flex;
  font-size: 15px;
  font-weight: 760;
  gap: 9px;
}

.brand-mark,
.cover-pill div {
  align-items: center;
  background: #e6f7f4;
  border: 1px solid #c8f0eb;
  color: var(--teal);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.icon-button {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.auth-layout,
.connect-layout,
.dashboard,
.console {
  margin: 0 auto;
  max-width: 1120px;
  padding: 32px 24px;
}

.preview-gate {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.preview-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(10, 37, 64, 0.12);
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 460px;
  padding: 28px;
  width: 100%;
}

.preview-brand {
  justify-content: flex-start;
}

.preview-panel h1 {
  font-size: 34px;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 6px 0 0;
}

.preview-panel p {
  color: var(--muted);
  line-height: 1.55;
  margin: 10px 0 0;
}

.preview-form {
  display: grid;
  gap: 12px;
}

.console {
  display: grid;
  gap: 18px;
  max-width: 1240px;
}

.merchant-detail-page {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 1180px;
  padding: 32px 24px;
}

.merchant-hero,
.merchant-chart-panel,
.merchant-history {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(10, 37, 64, 0.06);
}

.merchant-hero {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px;
}

.merchant-identity {
  align-items: center;
  display: flex;
  gap: 16px;
}

.merchant-identity h1 {
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: 0;
  line-height: 1.02;
  margin: 4px 0;
}

.merchant-identity p {
  color: var(--muted);
  margin: 0;
}

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

.merchant-chart-panel,
.merchant-history {
  padding: 18px;
}

.console-head {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.console-head h1 {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: 0;
  line-height: 1.08;
  margin: 8px 0 0;
  max-width: 760px;
}

.console-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.console-metrics article {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 14px;
}

.console-metrics span,
.detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.console-metrics strong,
.detail-grid strong {
  font-size: 22px;
}

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

.processor-panel,
.recent-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(10, 37, 64, 0.06);
}

.processor-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.processor-panel-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.processor-panel h2,
.recent-section h2,
.modal h2 {
  font-size: 19px;
  letter-spacing: 0;
  margin: 0;
}

.processor-panel p,
.recent-section p,
.modal p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 4px 0 0;
}

.merchant-chips {
  align-content: start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
}

.merchant-chip,
.provider-cell {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.merchant-chip {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 34px;
  padding: 0 11px;
}

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

.recent-section {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.customer-row {
  cursor: pointer;
}

.customer-row:hover td {
  background: #f8fbff;
}

td strong,
td small {
  display: block;
}

td small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.auth-layout {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.7fr);
}

.intro-panel {
  background: linear-gradient(135deg, #0a2540 0%, #263b80 58%, #00a6a6 130%);
  color: white;
  min-height: 520px;
  overflow: hidden;
  padding: 48px;
  position: relative;
}

.intro-panel::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  content: "";
  height: 160%;
  position: absolute;
  right: 14%;
  top: -30%;
  transform: rotate(18deg);
  width: 70px;
}

.intro-panel h1,
.connect-main h1,
.dashboard-head h1 {
  font-size: clamp(31px, 4vw, 48px);
  letter-spacing: 0;
  line-height: 1.05;
  margin: 8px 0 16px;
  max-width: 760px;
}

.intro-panel p,
.connect-main p {
  color: #d5dde9;
  font-size: 17px;
  line-height: 1.55;
  max-width: 620px;
}

.connect-main p {
  color: var(--muted);
}

.eyebrow {
  color: var(--teal);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.assurance-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.assurance-row span,
.notice,
.cover-pill {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  gap: 10px;
  padding: 9px 11px;
}

.auth-form,
.provider-card,
.chart-section,
.sync-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(10, 37, 64, 0.06);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  justify-content: center;
  padding: 30px;
}

.auth-form h2,
.provider-card h2,
.chart-section h2,
.coverage-band h2 {
  font-size: 19px;
  letter-spacing: 0;
  margin: 5px 0 0;
}

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

input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

.primary,
.secondary,
.link-button {
  align-items: center;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 760;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  text-decoration: none;
}

.primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 18px rgba(99, 91, 255, 0.2);
}

.primary:hover {
  background: var(--blue-dark);
}

.secondary {
  background: #f4f7fb;
  border: 1px solid #dde5ef;
  color: var(--ink);
}

.secondary:disabled {
  color: #8a96a8;
  cursor: not-allowed;
}

.small {
  min-height: 34px;
  padding: 0 11px;
}

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

.error,
.fatal {
  color: #b91c1c;
  font-weight: 700;
}

.connect-layout {
  display: grid;
  gap: 22px;
}

.notice {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #14532d;
  border-radius: 8px;
  margin-top: 8px;
}

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

.provider-card {
  align-items: center;
  display: grid;
  gap: 13px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  padding: 14px;
}

.provider-logo {
  align-items: center;
  background: #111827;
  color: white;
  display: flex;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.provider-logo.tiny {
  border-radius: 5px;
  font-size: 10px;
  height: 24px;
  width: 24px;
}

.provider-logo.large {
  border-radius: 12px;
  font-size: 20px;
  height: 68px;
  width: 68px;
}

.provider-logo.adyen {
  background: #0abf53;
}

.provider-logo.square {
  background: #111111;
}

.provider-logo.paypal {
  background: #003087;
}

.provider-logo.global-payments {
  background: #0057a8;
}

.provider-logo.worldpay {
  background: #5b2d90;
}

.provider-logo.sumup {
  background: #14b8a6;
}

.provider-card p,
.chart-section p,
.coverage-band p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 4px 0 0;
}

.provider-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.status {
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 760;
  padding: 5px 8px;
  text-transform: uppercase;
}

.status.ready {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: var(--green);
}

.status.setup_required {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.env-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 7px;
  text-transform: uppercase;
  vertical-align: middle;
}

.env-pill.production {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.env-pill.sandbox {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.dashboard {
  display: grid;
  gap: 14px;
  max-width: 1080px;
  padding-top: 26px;
}

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

.dashboard-head h1 {
  font-size: clamp(30px, 3.3vw, 40px);
  line-height: 1.08;
  max-width: 660px;
}

.cover-pill {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #14532d;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics article {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  min-height: 88px;
  padding: 13px;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metrics strong {
  align-self: end;
  font-size: 20px;
  letter-spacing: 0;
}

.metrics small {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.chart-section {
  padding: 16px;
}

.sync-section {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.sync-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.sync-form input {
  min-height: 34px;
  width: 150px;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.sync-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.sync-summary span {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 9px;
}

.sync-summary strong {
  color: var(--ink);
}

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

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

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

th {
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

canvas {
  display: block;
  height: auto;
  margin-top: 14px;
  max-width: 100%;
  width: 100%;
}

.empty-state {
  background: #f8fbff;
  border: 1px dashed #cbd8e8;
  border-radius: 8px;
  margin-top: 14px;
  padding: 24px;
}

.empty-state h3 {
  font-size: 16px;
  letter-spacing: 0;
  margin: 0 0 6px;
}

.empty-state p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
  max-width: 680px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(10, 37, 64, 0.38);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 20;
}

.modal {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(10, 37, 64, 0.24);
  max-width: 560px;
  padding: 22px;
  width: min(560px, 100%);
}

.modal-head {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-grid article {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.refreshing-modal {
  align-items: center;
  display: grid;
  justify-items: center;
  padding: 18px 10px;
  text-align: center;
}

.refreshing-modal h2 {
  margin-top: 16px;
}

.coverage-band {
  align-items: center;
  background: linear-gradient(135deg, #0a2540, #263b80);
  border-radius: 8px;
  color: white;
  display: grid;
  gap: 14px;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 18px;
}

.coverage-band p {
  color: #cfdae8;
}

@media (max-width: 840px) {
  .topbar {
    padding: 0 16px;
  }

  .auth-layout,
  .provider-grid,
  .processor-grid,
  .metrics,
  .console-metrics,
  .detail-metrics,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .console-head,
  .merchant-hero,
  .connect-form {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .console-head,
  .merchant-hero,
  .merchant-identity {
    flex-direction: column;
  }

  .intro-panel {
    min-height: auto;
    padding: 32px 24px;
  }

  .provider-card,
  .dashboard-head,
  .section-head {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .provider-actions,
  .dashboard-head,
  .section-head {
    flex-direction: column;
  }

  .cover-pill {
    white-space: normal;
  }
}
