:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #17211d;
  --muted: #65716b;
  --line: #d9ded7;
  --panel: #ffffff;
  --accent: #1f7a54;
  --accent-dark: #155d40;
  --selection: #3f6472;
  --selection-dark: #314f5a;
  --selection-bg: #e8eef0;
  --warn: #a2382a;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Satoshi", "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

a { color: inherit; }
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 2;
}
.skip-link:focus { top: 12px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px min(6vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 244, .92);
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
}
.brand, .nav, .app-nav, .topbar-actions { display: flex; align-items: center; gap: 14px; }
.brand { font-weight: 800; text-decoration: none; letter-spacing: 0; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: white;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
}
.nav a, .app-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 650;
}
.nav a:hover, .app-nav a:hover { color: var(--ink); }
.topbar-actions {
  justify-content: flex-end;
  gap: 10px;
}
.account-menu {
  position: relative;
  z-index: 5;
}
.account-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .78);
  cursor: pointer;
  list-style: none;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
}
.account-copy {
  display: grid;
  gap: 0;
  min-width: 0;
  text-align: left;
}
.account-copy strong,
.account-copy small {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-copy strong {
  font-size: 13px;
  line-height: 1.15;
}
.account-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 238px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 18px 45px rgba(23, 33, 29, .14);
}
.account-meta {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.account-meta span,
.account-meta small {
  color: var(--muted);
  font-size: 12px;
}
.account-meta strong {
  font-size: 15px;
}
.account-dropdown a {
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 720;
}
.account-dropdown a:hover {
  background: #eef2ed;
}
.account-dropdown a:last-child {
  color: var(--warn);
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}
.lang-switch button {
  appearance: none;
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}

main { padding: 0 min(6vw, 72px) 72px; }
.hero {
  min-height: calc(100dvh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 42px;
  align-items: center;
}
.hero h1, .page-head h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 84px);
  line-height: .94;
  letter-spacing: 0;
  max-width: 860px;
}
.lead {
  font-size: 19px;
  color: var(--muted);
  max-width: 680px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 34px 0 18px;
}
.list-head h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1;
}
.list-head p {
  margin: 8px 0 0;
  color: var(--muted);
}
.list-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}
.list-filter label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}
.list-filter input,
.list-filter select {
  max-width: none;
  color: var(--ink);
}
.list-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-self: end;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.pagination-status {
  color: var(--muted);
  font-weight: 750;
}
.btn.disabled {
  color: var(--muted);
  background: #eef2ed;
  cursor: default;
  pointer-events: none;
}
.reports-page {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  min-width: 0;
}
.report-builder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 10px 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}
.report-builder label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}
.report-builder input,
.report-builder select {
  max-width: none;
  min-width: 0;
}
.report-builder .form-actions,
.report-builder .report-check {
  align-self: end;
}
.report-status-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(238, 244, 237, .58);
}
.report-status-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.report-status-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.status-chip {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 7px !important;
  width: auto;
  min-width: 0 !important;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink) !important;
  font-size: 13px !important;
  font-weight: 800;
  white-space: nowrap;
}
.status-chip input {
  width: 14px;
  min-height: 14px;
}
.report-builder .form-actions .btn {
  width: 100%;
}
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.report-metrics {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 12px;
}
.report-metrics article {
  min-width: 0;
  padding: 14px 16px;
  box-shadow: 0 14px 30px -26px rgba(23, 33, 29, .34);
}
.report-metrics span {
  font-size: 13px;
}
.report-metrics strong {
  margin-top: 4px;
  font-size: clamp(22px, 2.2vw, 26px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.report-section {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-width: 0;
}
.report-section .crud-table-wrap {
  width: 100%;
  max-width: 100%;
}
.report-email-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.btn, button.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { border-color: #9ca9a1; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { background: #78281f; color: white; border-color: #78281f; }
.btn.secondary { background: white; }
.big-cta {
  min-height: 54px;
  padding-inline: 22px;
  font-size: 17px;
}

.product-panel, .auth-card, .side-form, .price-card, .metrics article, .workflow article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 44px -30px rgba(23, 33, 29, .35);
}
.product-panel { padding: 22px; }
.product-panel.small { align-self: start; }
.panel-head, .flow-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.panel-head strong, .flow-row strong, .metrics strong, td:nth-child(3), td:nth-child(5) {
  font-family: var(--mono);
}
.status-line { margin-top: 16px; color: var(--accent-dark); font-weight: 750; }

.band { padding: 42px 0; }
.workflow, .pricing-grid, .metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.compact-cards { margin-bottom: 32px; }
.workflow article, .price-card, .metrics article { padding: 20px; }
.workflow span { font-family: var(--mono); color: var(--accent-dark); }
.price-card strong, .metrics strong { display: block; font-size: 30px; }
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}
.price-card.highlight {
  border-color: var(--accent);
  box-shadow: 0 24px 54px -30px rgba(49, 125, 83, .55);
}
.price-card p { margin: 0; color: var(--muted); }
.price-card small { color: var(--muted); font-weight: 700; }
.price-card .btn { margin-top: auto; align-self: flex-start; }
.plan-badge {
  align-self: flex-start;
  padding: 5px 9px;
  border-radius: 999px;
  background: #def1e6;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
}
.muted-badge {
  background: #eef2ed;
  color: var(--muted);
}
.plan-features {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}
.plan-features li {
  position: relative;
  padding-left: 18px;
  color: var(--ink);
  font-size: 15px;
}
.plan-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.plan-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border: 0;
}
.plan-choice-grid legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  font-weight: 850;
}
.plan-choice {
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  cursor: pointer;
}
.plan-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.plan-choice:has(input:checked) {
  border-color: var(--selection);
  background: var(--selection-bg);
  box-shadow: inset 0 0 0 1px var(--selection);
}
.plan-choice-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}
.plan-choice-head em {
  font-style: normal;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
}
.plan-choice-price {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 900;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
  gap: 22px;
  align-items: stretch;
  padding: 42px 0 22px;
}
.dashboard-hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: .98;
}
.dashboard-hero .lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 20px;
}
.dashboard-focus-card {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 44px -30px rgba(23, 33, 29, .35);
}
.dashboard-focus-card span,
.metrics span,
.panel-head span {
  color: var(--muted);
  font-weight: 850;
}
.dashboard-focus-card strong {
  font-family: var(--mono);
  font-size: 54px;
  line-height: 1;
}
.progress-track,
.bar-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e2e8e2;
}
.progress-track i,
.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.dashboard-chart {
  grid-column: span 2;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, .9fr) minmax(120px, 1.4fr) minmax(110px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.bar-row:last-child { border-bottom: 0; }
.bar-row strong {
  font-family: var(--mono);
  text-align: right;
}
.task-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.task-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.task-list li::before {
  content: "";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
}
.task-list li.done::before {
  content: "✓";
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 900;
}
.task-list a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.dashboard-last-run h2 {
  margin: 18px 0 8px;
  font-size: 28px;
}
.muted { color: var(--muted); }

.page-head { padding: 64px 0 28px; }
.page-head.compact { padding: 34px 0 20px; }
.app-nav {
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.app-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 7px;
}
.app-nav a:hover { background: #e9eee8; }
.nav-chip {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--warn);
  color: white;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.auth-card {
  max-width: 520px;
  margin: 72px auto;
  padding: 28px;
}
form { display: grid; gap: 10px; }
label { font-weight: 760; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}
textarea { font-family: var(--mono); }
input:focus, select:focus, textarea:focus, button:focus, a:focus {
  outline: 3px solid rgba(31, 122, 84, .28);
  outline-offset: 2px;
}
.notice { background: #e6f2ec; border: 1px solid #b5d7c5; padding: 12px; border-radius: 8px; }
.error { background: #f8e9e6; border: 1px solid #e3b4ad; color: var(--warn); padding: 12px; border-radius: 8px; }
.field-help {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 14px;
}
.form-field {
  display: grid;
  gap: 6px;
}
.form-row {
  display: grid;
  gap: 12px;
}
.form-row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-field.is-missing input,
.form-field.is-missing select,
.form-field.is-missing textarea {
  border-color: #c94f42;
  background: #fff8f7;
  box-shadow: 0 0 0 3px rgba(201, 79, 66, .1);
}
.field-error {
  color: #9f352b;
  font-size: 13px;
  font-weight: 760;
}
.register-row.is-disabled {
  opacity: .72;
}
.register-row.is-disabled input[readonly] {
  background: #f4f6f3;
  color: var(--muted);
}
.readonly-field {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}
.readonly-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}
.readonly-field strong {
  font-family: var(--mono);
  font-size: 14px;
}
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.provider-help {
  margin: 18px 0;
}
.provider-help h2 {
  margin: 0 0 10px;
  font-size: 22px;
}
.provider-help p {
  margin: 10px 0 0;
  color: var(--muted);
}
.qr-box {
  display: grid;
  place-items: center;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px;
  margin: 12px 0 18px;
  background: #f3fbf6;
  overflow-wrap: anywhere;
}
.qr-img {
  display: block;
  width: min(256px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 18px 0 0;
}
.dashboard, section { max-width: 1420px; margin: 0 auto; }
.page-grid, .split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 22px;
  align-items: start;
  padding-top: 28px;
}
.side-form { padding: 20px; position: sticky; top: 98px; }
.side-form.wide { max-width: 680px; }
.crud-form-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  max-width: 1160px;
  margin: 0 auto;
  padding-top: 34px;
}
.crud-form-page .crud-copy {
  display: grid;
  gap: 12px;
  max-width: 820px;
}
.crud-form-page .crud-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
}
.crud-form-page .crud-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}
.crud-form-page .crud-copy .btn {
  justify-self: start;
}
.crud-form-card {
  position: static;
  top: auto;
  width: 100%;
  max-width: 920px;
}
.crud-form-card.wide {
  max-width: 1120px;
}
.crud-table-wrap {
  min-width: 0;
  overflow-x: auto;
}
.crud-table-wrap th,
.crud-table-wrap td {
  white-space: nowrap;
}
.crud-table-wrap .action-col {
  position: sticky;
  left: 0;
  z-index: 1;
  background: white;
  box-shadow: 1px 0 0 var(--line);
}
.crud-table-wrap th.action-col {
  background: #eef2ed;
  z-index: 2;
}
.crud-table-wrap .status-col {
  min-width: 220px;
}
.crud-table-wrap .row-actions .btn,
.crud-table-wrap .row-actions button.btn {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  color: var(--ink);
  vertical-align: middle;
}
.status-chip.large {
  min-height: 48px;
  padding: 9px 12px;
}
.status-chip-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(23, 33, 29, .08);
  font-weight: 900;
  line-height: 1;
}
.status-chip-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.status-chip strong {
  font-size: 13px;
  line-height: 1.1;
}
.status-chip small {
  color: inherit;
  font-size: 11px;
  line-height: 1.25;
  opacity: .82;
  white-space: normal;
}
.status-chip--success {
  border-color: #acd2bd;
  background: #e8f4ed;
  color: #195b3f;
}
.status-chip--ready,
.status-chip--running {
  border-color: #b6cde4;
  background: #ebf3fa;
  color: #1f577e;
}
.status-chip--warning {
  border-color: #e5cf96;
  background: #fbf5df;
  color: #7a5618;
}
.status-chip--approval {
  border-color: #d6c1e7;
  background: #f3edf8;
  color: #674383;
}
.status-chip--danger {
  border-color: #e2aea7;
  background: #f9eae7;
  color: #98362b;
}
.status-chip--sandbox,
.status-chip--neutral {
  border-color: #ccd4cf;
  background: #eef2f0;
  color: #46524d;
}
.payout-detail-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}
.mapping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8faf7;
}
.mapping-grid legend {
  padding: 0 6px;
  font-weight: 800;
}
.mapping-grid p {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
}
.hidden-field {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.upload-mode-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.upload-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--selection-bg);
}
.upload-mode-tabs label {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  font-weight: 820;
  line-height: 1.15;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.upload-mode-tabs label:active { transform: translateY(1px); }
#upload_mode_file:checked ~ .upload-mode-tabs label[for="upload_mode_file"],
#upload_mode_paste:checked ~ .upload-mode-tabs label[for="upload_mode_paste"] {
  background: var(--selection);
  color: white;
}
#upload_mode_file:checked ~ .upload-mode-tabs label[for="upload_mode_file"]:hover,
#upload_mode_paste:checked ~ .upload-mode-tabs label[for="upload_mode_paste"]:hover {
  background: var(--selection-dark);
}
.upload-source-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}
#upload_mode_file:checked ~ .upload-paste-panel,
#upload_mode_paste:checked ~ .upload-file-panel {
  display: none;
}
.import-preview-page {
  max-width: 1320px;
}
.mapping-save-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
}
.mapping-save-row label:first-child {
  grid-column: 1 / -1;
}
.mapping-preview-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mapping-preview-table {
  border: 0;
  border-radius: 0;
}
.mapping-preview-table th {
  min-width: 220px;
  white-space: normal;
}
.mapping-preview-table th span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}
.mapping-preview-table td {
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 14px 0;
}
.inline-form label { flex-basis: 100%; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; min-height: auto; }
.stack { display: grid; gap: 16px; }
.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  max-width: 1600px;
  padding-top: 28px;
  align-items: start;
}
.admin-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.admin-sidebar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}
.tenant-switcher {
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.admin-nav {
  display: grid;
  gap: 6px;
}
.admin-nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 760;
  text-decoration: none;
}
.admin-nav a:hover,
.admin-nav a.active {
  background: #e9eee8;
  color: var(--ink);
}
.admin-workspace {
  min-width: 0;
  display: grid;
  gap: 18px;
}
.admin-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.admin-breadcrumb a {
  color: var(--accent-dark);
  text-decoration: none;
}
.admin-breadcrumb a:hover { text-decoration: underline; }
.admin-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.admin-toolbar-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-search {
  display: grid;
  gap: 4px;
  min-width: min(280px, 100%);
}
.admin-search span {
  color: var(--muted);
  font-size: 13px;
}
.admin-toolbar h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}
.admin-form-page {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 1160px;
  justify-items: start;
}
.admin-form-page .form-page-head,
.admin-form-page .crud-form-card {
  width: min(100%, 920px);
}
.form-page-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}
.form-page-head h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}
.form-page-head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 680px;
}
.form-columns {
  position: static;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 860px;
}
.form-columns .form-actions {
  grid-column: 1 / -1;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.admin-table-wrap {
  min-width: 0;
  overflow-x: auto;
}
.admin-table-wrap .action-col,
.crud-table-wrap .action-col {
  width: 1%;
}
.admin-table-wrap th,
.admin-table-wrap td {
  white-space: nowrap;
}
.admin-table-wrap .action-col {
  position: sticky;
  left: 0;
  z-index: 1;
  background: white;
  box-shadow: 1px 0 0 var(--line);
}
.admin-table-wrap th.action-col {
  background: #eef2ed;
  z-index: 2;
}
.admin-editor {
  position: static;
  top: auto;
}
.admin-editor h3 {
  margin: 0 0 4px;
}
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-table-wrap .row-actions {
  gap: 6px;
}
.admin-table-wrap .row-actions .btn {
  min-height: 38px;
  padding: 0;
  border-radius: 9px;
}
.row-actions .btn {
  white-space: nowrap;
}
.row-actions.compact {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
}
.row-actions.compact .btn,
.action-col > form .icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  width: 38px;
  min-height: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
}
.icon-btn {
  gap: 0;
}
.icon-btn::before {
  content: attr(data-icon);
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}
.icon-btn:hover {
  border-color: var(--accent);
  background: #eef7f1;
}
.icon-btn[data-icon="×"] {
  color: #78281f;
}
.action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.row-actions form {
  display: inline-flex;
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  background: #eef2ed;
}
tr:last-child td { border-bottom: 0; }
.task-list { padding-left: 20px; color: var(--muted); }
code {
  font-family: var(--mono);
  background: #e9eee8;
  padding: 2px 5px;
  border-radius: 5px;
}
.code-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}
.code-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  overflow: hidden;
}
.endpoint-card {
  border-top: 1px solid var(--line);
  padding: 24px 0 8px;
}
.endpoint-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.endpoint-heading span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-dark);
}
.endpoint-heading h2 {
  margin: 0;
  font-size: 22px;
}
.endpoint-heading small {
  color: var(--muted);
}
pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
pre code {
  display: block;
  background: #111915;
  color: #e9f5ee;
  padding: 12px;
}

@media (max-width: 1320px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-editor {
    position: static;
  }
}

@media (max-width: 860px) {
  .hero, .page-grid, .split, .workflow, .pricing-grid, .metrics, .code-grid, .admin-shell, .admin-grid, .crud-form-page, .dashboard-hero, .dashboard-grid, .plan-choice-grid {
    grid-template-columns: 1fr;
  }
  .form-row.two {
    grid-template-columns: 1fr;
  }
  .mapping-grid {
    grid-template-columns: 1fr;
  }
  main, section, form, .stack, .product-panel, .auth-card, .price-card, .side-form, .code-grid, .code-card, .metrics article, .workflow article, .crud-form-card {
    min-width: 0;
  }
  table {
    display: block;
    width: 100%;
    max-width: calc(100vw - 36px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  th, td {
    min-width: 120px;
  }
  pre, pre code, textarea, input, select {
    max-width: 100%;
  }
  pre code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  main { padding: 0 18px 48px; }
  .topbar { padding: 14px 18px; align-items: flex-start; gap: 12px; flex-direction: column; }
  .topbar-actions { align-items: flex-start; flex-wrap: wrap; justify-content: flex-start; width: 100%; }
  .account-menu { width: min(100%, 320px); }
  .account-menu summary { width: 100%; }
  .account-dropdown { left: 0; right: auto; width: min(86vw, 320px); }
  .hero { min-height: auto; padding: 42px 0; }
  .hero h1, .page-head h1, .dashboard-hero h1 { font-size: 42px; }
  .dashboard-hero { padding-top: 26px; }
  .dashboard-chart { grid-column: auto; }
  .bar-row { grid-template-columns: 1fr; }
  .bar-row strong { text-align: left; }
  .side-form, .admin-sidebar, .admin-editor { position: static; }
  .list-head { align-items: stretch; flex-direction: column; }
  .list-filter { grid-template-columns: 1fr; }
  .report-builder, .report-email-grid, .report-metrics { grid-template-columns: 1fr; }
  .list-filter-actions, .pagination { justify-content: flex-start; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-toolbar-actions { justify-content: flex-start; }
  .form-page-head { flex-direction: column; }
  .form-columns { grid-template-columns: 1fr; }
  .admin-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-actions.compact .btn {
    min-width: 40px;
    width: 40px;
    min-height: 40px;
    height: 40px;
  }
}
