:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #101010;
  --surface-strong: #171717;
  --ink: #f5f5f5;
  --muted: #a8a8a8;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #ffffff;
  --primary-dark: #dcdcdc;
  --blue: #f5f5f5;
  --amber: #f5f5f5;
  --red: #d0d0d0;
  --green-soft: rgba(255, 255, 255, 0.1);
  --blue-soft: rgba(255, 255, 255, 0.1);
  --amber-soft: rgba(255, 255, 255, 0.14);
  --red-soft: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@property --upload-x {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 20%;
}

@property --upload-y {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 30%;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #121212 0, #050505 320px),
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 3vw, 24px);
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-block > div,
.customer-hero > div:first-child,
.admin-header > div:first-child,
.section-heading,
.receipt-card-header > div,
.review-card-header > div,
.qr-card-header > div {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  overflow: hidden;
  background: transparent;
  padding: 0;
  border-radius: var(--radius);
  transform: translateY(3px);
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-block h1,
.admin-header h2,
.section-heading h2 {
  margin: 0;
  line-height: 1.1;
}

.brand-block h1 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  overflow-wrap: anywhere;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
  text-align: center;
}

.portal-badge.admin {
  background: #ffffff;
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 5px;
  color: #2f2f2f;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

p,
h1,
h2,
h3,
strong,
span,
a,
code {
  overflow-wrap: anywhere;
}

.primary-button,
.ghost-button {
  border-radius: var(--radius);
  min-height: 42px;
  padding: 0 16px;
  font-weight: 750;
  max-width: 100%;
}

.primary-button {
  border: 0;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

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

.ghost-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.page-grid,
.dashboard-grid {
  display: grid;
  gap: 18px;
}

.onboarding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(min(100%, 500px), 0.72fr);
  gap: clamp(22px, 4vw, 52px);
  align-items: center;
  min-height: 62vh;
}

.onboarding-copy {
  display: grid;
  gap: 22px;
  padding: 24px 0;
}

.onboarding-copy h2 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.96;
}

.onboarding-copy p:not(.eyebrow) {
  max-width: 560px;
  font-size: 1.08rem;
  line-height: 1.6;
}

.onboarding-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
}

.onboarding-points div {
  display: grid;
  gap: 10px;
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.onboarding-points strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 0.95rem;
}

.onboarding-points span {
  align-self: end;
  font-weight: 850;
}

.onboarding-panel {
  padding: clamp(18px, 4vw, 28px);
}

.disclaimer-box {
  display: grid;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.disclaimer-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.consent-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  line-height: 1.45;
}

.consent-check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 3px;
  padding: 0;
  accent-color: #ffffff;
}

.customer-dashboard {
  display: grid;
  gap: 18px;
}

.customer-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.upload-panel {
  display: grid;
  align-content: start;
}

.customer-hero h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

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

.customer-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
}

.score-card {
  min-width: 0;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.score-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.score-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.55rem, 3.3vw, 2.5rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.primary-score {
  background: var(--ink);
  color: white;
}

.primary-score span {
  color: rgba(255, 255, 255, 0.68);
}

.customer-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(min(100%, 330px), 0.65fr);
  align-items: start;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading p:not(.eyebrow) {
  margin: 8px 0 0;
}

.row-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  flex-wrap: wrap;
}

.stacked-form,
.pin-form,
.shop-form {
  display: grid;
  gap: 18px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 12px;
  font-weight: 850;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}

label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.file-picker {
  margin-top: 14px;
  min-width: 0;
  display: block;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 16px;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-picker span {
  display: grid;
  gap: 4px;
}

.file-picker small {
  color: var(--muted);
  font-weight: 650;
}

.receipt-dropzone {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 190px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 54%),
    #101010;
}

.receipt-dropzone::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.18) 45%, transparent 72%);
  opacity: 0;
  transform: translateX(-120%);
  pointer-events: none;
}

.receipt-dropzone::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 90px;
  height: 90px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 68%);
  opacity: 0.72;
  transform: translate3d(0, 0, 0);
  animation: upload-orbit 5.6s ease-in-out infinite;
  pointer-events: none;
}

.receipt-dropzone:hover {
  border-color: var(--primary);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 54%),
    #101010;
}

.receipt-dropzone:hover::before,
.receipt-dropzone:focus-within::before {
  animation: upload-scan 1.35s ease-out;
  opacity: 1;
}

.receipt-dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: var(--primary);
  color: #050505;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  transition: transform 180ms ease, box-shadow 180ms ease;
  animation: upload-pulse 2.4s ease-in-out infinite;
}

.dropzone-mark::before,
.dropzone-mark::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.8);
  animation: upload-ripple 2.6s ease-out infinite;
}

.dropzone-mark::after {
  animation-delay: 1.3s;
}

.receipt-dropzone:hover .dropzone-mark,
.receipt-dropzone:focus-within .dropzone-mark {
  transform: scale(1.05);
  box-shadow: 0 14px 34px rgba(255, 255, 255, 0.14);
}

.upload-form.is-processing .receipt-dropzone {
  cursor: wait;
  opacity: 0.92;
  transform: translateY(-1px);
}

.upload-form.is-processing .receipt-dropzone input {
  cursor: wait;
}

.upload-form.is-processing .dropzone-mark {
  color: transparent;
  animation: processing-float 1.7s ease-in-out infinite;
}

.upload-form.is-processing .dropzone-mark::before {
  inset: 9px;
  border: 3px solid rgba(5, 5, 5, 0.22);
  border-top-color: #050505;
  opacity: 1;
  transform: none;
  animation: processing-spin 0.8s linear infinite;
}

.upload-form.is-processing .dropzone-mark::after {
  inset: -10px;
  border-color: rgba(255, 255, 255, 0.45);
  opacity: 1;
  animation: processing-ring 1.25s ease-in-out infinite;
}

.upload-form.is-processing .receipt-dropzone strong::after {
  content: "Scanning receipt";
  display: block;
  margin-top: 8px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.receipt-dropzone strong {
  position: relative;
  z-index: 1;
  display: block;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.receipt-dropzone small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.scan-result {
  display: none;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101010;
}

.scan-result.is-visible {
  display: grid;
}

.scan-result > .status-pill {
  width: fit-content;
}

.scan-loader {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}

.scan-loader span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ffffff;
  animation: scan-dot 0.9s ease-in-out infinite;
}

.scan-loader span:nth-child(2) {
  animation-delay: 0.14s;
}

.scan-loader span:nth-child(3) {
  animation-delay: 0.28s;
}

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

.scan-fields div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.scan-fields span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scan-fields strong {
  font-size: 0.98rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.form-message {
  flex: 1 1 180px;
  margin: 0;
  min-height: 22px;
  color: var(--muted);
  font-weight: 700;
}

.form-message.error {
  color: var(--red);
}

.account-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.summary-row strong {
  font-size: 1.2rem;
  text-align: right;
}

.receipt-list,
.receipt-review-list,
.qr-grid {
  display: grid;
  gap: 12px;
}

.receipt-card,
.review-card,
.qr-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101010;
  padding: 14px;
}

.receipt-card-header,
.review-card-header,
.qr-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 10px;
}

.receipt-card h3,
.review-card h3,
.qr-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.meta-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.amount {
  font-weight: 850;
}

.scan-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
  flex: 0 0 auto;
}

.status-pill.pending {
  background: var(--amber-soft);
  color: #ffffff;
}

.status-pill.approved {
  background: #ffffff;
  color: #050505;
}

.status-pill.rejected {
  background: var(--red-soft);
  color: #cfcfcf;
}

.status-pill.neutral {
  background: var(--blue-soft);
  color: #eeeeee;
}

.admin-lock {
  max-width: 520px;
  margin: 0 auto;
}

.admin-dashboard {
  display: grid;
  gap: 18px;
}

.admin-dashboard.is-hidden,
.is-hidden {
  display: none;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.kpi {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  font-weight: 680;
}

.receipt-link {
  color: var(--primary-dark);
  font-weight: 850;
  text-decoration: none;
}

.receipt-link:hover {
  text-decoration: underline;
}

.review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.review-actions input {
  flex: 1 1 140px;
  max-width: 180px;
}

.compact-field {
  flex: 1 1 170px;
  max-width: 240px;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compact-field input,
.compact-field select {
  min-height: 38px;
  max-width: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.danger-button,
.approve-button {
  min-height: 38px;
  border-radius: var(--radius);
  border: 0;
  padding: 0 12px;
  font-weight: 850;
}

.approve-button {
  background: var(--primary);
  color: #050505;
}

.danger-button {
  background: #050505;
  color: #f5f5f5;
  border: 1px solid var(--line);
}

.shop-form {
  grid-template-columns: minmax(180px, 1.2fr) minmax(110px, 0.5fr) minmax(150px, 0.8fr) auto;
  align-items: end;
  margin-bottom: 18px;
}

.qr-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.qr-card svg {
  width: min(132px, 100%);
  height: auto;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
}

.qr-card code {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.qr-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 1000px) {
  .customer-grid,
  .dashboard-grid,
  .onboarding-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 700px) {
  .app-shell {
    padding: clamp(12px, 4vw, 16px);
  }

  .portal-header,
  .admin-header,
  .customer-hero,
  .row-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-header {
    gap: 14px;
    margin-bottom: 18px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
  }

  .brand-block h1 {
    font-size: 1.25rem;
    line-height: 1.15;
  }

  .portal-badge {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }

  .onboarding-layout {
    gap: 16px;
    min-height: auto;
  }

  .onboarding-copy {
    padding: 4px 0 0;
  }

  .onboarding-copy h2 {
    font-size: clamp(2rem, 12vw, 3.4rem);
    line-height: 1;
  }

  .onboarding-copy p:not(.eyebrow) {
    font-size: 1rem;
    line-height: 1.5;
  }

  .onboarding-points,
  .scan-fields {
    grid-template-columns: 1fr;
  }

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

  .customer-dashboard,
  .admin-dashboard,
  .page-grid,
  .dashboard-grid {
    gap: 14px;
  }

  .customer-hero {
    padding: 18px;
  }

  .customer-hero h2 {
    font-size: clamp(1.65rem, 9vw, 2.4rem);
    line-height: 1.08;
  }

  .score-card {
    min-height: 104px;
    padding: 15px;
  }

  .panel {
    padding: 16px;
  }

  .form-actions,
  .admin-actions,
  .hero-actions,
  .profile-actions {
    align-items: stretch;
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

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

  .form-message {
    flex-basis: 100%;
  }

  .receipt-card-header,
  .review-card-header,
  .qr-card-header,
  .summary-row {
    flex-direction: column;
  }

  .receipt-dropzone {
    grid-template-columns: 1fr;
    min-height: 170px;
  }

  .summary-row strong {
    text-align: left;
  }

  .review-actions input {
    max-width: none;
  }

  .compact-field {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .table-wrap {
    overflow-x: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #101010;
  }

  td {
    display: grid;
    grid-template-columns: minmax(88px, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }

  td + td {
    border-top: 1px solid var(--line);
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }

  td[colspan] {
    display: block;
    text-align: left;
  }

  td[colspan]::before {
    content: none;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 10px;
  }

  .brand-block {
    gap: 10px;
  }

  .customer-score-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .score-card strong,
  .kpi strong {
    font-size: 1.45rem;
    line-height: 1.12;
  }

  .primary-button,
  .ghost-button,
  input,
  select {
    min-height: 44px;
  }
}

/* Mobile-first client journey and dashboard refresh */
.client-page.onboarding-mode {
  background:
    linear-gradient(180deg, #121212 0, #050505 260px, #000 520px);
}

.journey-onboarding {
  display: block;
  width: min(760px, 100%);
  min-height: auto;
  margin: 0 auto;
}

.journey-panel {
  display: grid;
  gap: 16px;
}

.journey-intro {
  display: grid;
  gap: 8px;
  padding: 4px 2px 0;
}

.journey-intro h2 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(2rem, 8vw, 4.2rem);
  line-height: 0.96;
}

.journey-intro p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.journey-stack {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.journey-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: clamp(14px, 4vw, 20px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.journey-step {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 0.84rem;
  font-weight: 900;
}

.journey-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.journey-card p {
  margin: 5px 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

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

.journey-card-action .primary-button {
  width: 100%;
}

.dashboard-mode {
  color-scheme: dark;
  background:
    linear-gradient(180deg, #121212 0, #050505 340px),
    #000;
  color: #f5f5f5;
}

.dashboard-mode .portal-header {
  margin-bottom: 14px;
}

.dashboard-mode .brand-mark {
  background: transparent;
  color: #050505;
}

.dashboard-mode .brand-block h1,
.dashboard-mode .customer-hero h2,
.dashboard-mode .section-heading h2 {
  color: #ffffff;
}

.dashboard-mode .eyebrow {
  color: #d8d8d8;
}

.dashboard-mode .portal-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.dashboard-mode .muted,
.dashboard-mode .meta-line,
.dashboard-mode .form-message,
.dashboard-mode .scan-note {
  color: #a8a8a8;
}

.dashboard-mode .customer-dashboard {
  gap: 14px;
}

.dashboard-mode .customer-hero,
.dashboard-mode .panel,
.dashboard-mode .score-focus-card,
.dashboard-mode .score-mini-card,
.dashboard-mode .receipt-card,
.dashboard-mode .scan-result {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(16, 16, 16, 0.94);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
}

.dashboard-mode .customer-hero {
  padding: clamp(18px, 5vw, 28px);
}

.dashboard-mode .customer-hero > div {
  width: 100%;
}

.dashboard-mode .customer-hero h2 {
  font-size: clamp(1.7rem, 8vw, 3rem);
  line-height: 1.05;
}

.dashboard-mode .ghost-button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f5;
}

.dashboard-mode .primary-button,
.dashboard-mode .approve-button {
  background: #ffffff;
  color: #050505;
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.12);
}

.dashboard-mode .primary-button:hover,
.dashboard-mode .approve-button:hover {
  background: #dcdcdc;
}

.dashboard-mode .customer-score-grid {
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(130px, 0.55fr));
}

.hero-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.score-focus-card,
.score-mini-card {
  min-width: 0;
  border-radius: var(--radius);
  padding: 16px;
}

.score-focus-card {
  min-height: 144px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    rgba(16, 16, 16, 0.94);
}

.score-focus-card span,
.score-mini-card span {
  display: block;
  color: #a8a8a8;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.score-focus-card strong {
  display: block;
  margin-top: 10px;
  color: #ffffff;
  font-size: clamp(2.35rem, 9vw, 4.2rem);
  line-height: 0.95;
}

.score-focus-card p {
  margin: 12px 0 0;
  color: #d4d4d4;
  font-weight: 750;
}

.score-mini-card {
  display: grid;
  align-content: space-between;
  min-height: 144px;
}

.score-mini-card strong {
  color: #ffffff;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}

.hero-score-card {
  min-height: 88px;
  padding: 12px;
  align-content: center;
}

.hero-score-card.score-focus-card strong {
  font-size: clamp(1.65rem, 6vw, 2.5rem);
}

.hero-score-card.score-focus-card p {
  margin-top: 7px;
  font-size: 0.86rem;
}

.hero-score-card.score-mini-card strong {
  font-size: clamp(1.55rem, 5vw, 2.2rem);
}

.dashboard-tabs {
  display: flex;
  gap: 4px;
  overflow: hidden;
  margin-top: 16px;
  padding: 3px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.tab-button {
  flex: 1 0 0;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a8a8a8;
  padding: 0 16px;
  font-weight: 850;
}

.tab-button.is-active {
  background: #ffffff;
  color: #050505;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

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

.pwa-install-card[hidden] {
  display: none;
}

.pwa-install-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #050505;
}

.pwa-install-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pwa-install-copy {
  min-width: 0;
}

.pwa-install-copy h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.15;
}

.pwa-install-copy p:not(.eyebrow) {
  margin: 4px 0 0;
  line-height: 1.4;
}

.pwa-install-actions {
  display: flex;
  justify-content: end;
}

.pwa-install-actions .primary-button {
  white-space: nowrap;
}

.primary-button:disabled,
.approve-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.dashboard-mode .receipt-dropzone {
  min-height: 180px;
  border-color: rgba(255, 255, 255, 0.28);
  background:
    radial-gradient(circle at var(--upload-x, 20%) var(--upload-y, 30%), rgba(255, 255, 255, 0.12), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 55%),
    #101010;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  animation: upload-border-glow 3.4s ease-in-out infinite, upload-bg-drift 7s ease-in-out infinite;
}

.dashboard-mode .receipt-dropzone:hover,
.dashboard-mode .receipt-dropzone:focus-within {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 46px rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.16), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 58%),
    #101010;
}

.dashboard-mode .dropzone-mark {
  background: #ffffff;
  color: #050505;
}

.dashboard-mode .receipt-dropzone strong {
  color: #ffffff;
}

.dashboard-mode .receipt-dropzone small {
  color: #b8b8b8;
}

@keyframes upload-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.22);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
  }
}

@keyframes upload-border-glow {
  0%,
  100% {
    border-color: rgba(255, 255, 255, 0.26);
  }
  50% {
    border-color: rgba(255, 255, 255, 0.56);
  }
}

@keyframes upload-bg-drift {
  0%,
  100% {
    --upload-x: 16%;
    --upload-y: 26%;
  }
  45% {
    --upload-x: 82%;
    --upload-y: 72%;
  }
  70% {
    --upload-x: 46%;
    --upload-y: 44%;
  }
}

@keyframes upload-ripple {
  0% {
    opacity: 0.6;
    transform: scale(0.75);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes upload-orbit {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  35% {
    transform: translate3d(-18px, -12px, 0) scale(1.12);
  }
  70% {
    transform: translate3d(12px, -24px, 0) scale(0.92);
  }
}

@keyframes upload-scan {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

@keyframes processing-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes processing-ring {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.42;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.9;
  }
}

@keyframes processing-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes scan-dot {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.42;
  }
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .receipt-dropzone,
  .receipt-dropzone::before,
  .receipt-dropzone::after,
  .dropzone-mark::before,
  .dropzone-mark::after,
  .dropzone-mark,
  .scan-loader span {
    animation: none;
    transition: none;
  }
}

.dashboard-mode input,
.dashboard-mode select {
  border-color: rgba(255, 255, 255, 0.13);
  background: #0d0d0d;
  color: #f5f5f5;
}

.dashboard-mode .scan-fields div,
.dashboard-mode .summary-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-mode .receipt-link {
  color: #ffffff;
}

.dashboard-mode .status-pill.neutral {
  background: rgba(255, 255, 255, 0.13);
  color: #eeeeee;
}

.dashboard-mode .status-pill.pending {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.dashboard-mode .status-pill.approved {
  background: #ffffff;
  color: #050505;
}

.dashboard-mode .status-pill.rejected {
  background: rgba(255, 255, 255, 0.08);
  color: #cfcfcf;
}

/* One-question onboarding journey */
.client-page.onboarding-mode {
  color-scheme: dark;
  min-height: 100vh;
  background: #000;
  background-image: linear-gradient(180deg, #121212 0, #050505 260px, #000 520px);
  background-repeat: no-repeat;
  color: #f5f5f5;
}

.client-page.onboarding-mode .portal-header {
  display: grid;
  grid-template-columns: 1fr;
  width: min(760px, 100%);
  margin-inline: auto;
  margin-bottom: 18px;
  align-items: start;
  gap: 8px;
}

.client-page.onboarding-mode .portal-header .brand-block {
  width: 100%;
}

.client-page.onboarding-mode .portal-header .portal-badge {
  justify-self: end;
  margin-top: 10px;
}

.onboarding-mode .brand-block h1,
.onboarding-mode .journey-intro h2,
.onboarding-mode .journey-question-copy h3 {
  color: #ffffff;
}

.onboarding-mode .eyebrow {
  color: #d8d8d8;
}

.onboarding-mode .portal-badge {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.onboarding-mode .muted,
.onboarding-mode .form-message,
.onboarding-mode .journey-intro p:not(.eyebrow),
.onboarding-mode .journey-question-copy p:not(.eyebrow) {
  color: #a8a8a8;
}

.onboarding-mode label {
  color: #f5f5f5;
}

.journey-flow {
  gap: 12px;
}

.journey-flow .journey-intro h2 {
  max-width: 560px;
  font-size: clamp(2rem, 6.6vw, 3.8rem);
  letter-spacing: 0;
}

.journey-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 2px;
}

.journey-progress span {
  position: relative;
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.journey-progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms ease;
}

.journey-progress span.is-active::after,
.journey-progress span.is-complete::after {
  transform: scaleX(1);
}

.journey-question-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  min-height: 270px;
  padding: clamp(14px, 4vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.07), transparent 44%),
    rgba(16, 16, 16, 0.94);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
}

.journey-count {
  margin: 0;
  color: #a8a8a8;
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.journey-question {
  display: none;
  gap: 12px;
}

.journey-question.is-active {
  display: grid;
  animation: journey-step-in 220ms ease both;
}

.journey-question .journey-step {
  width: 34px;
  height: 34px;
  background: #ffffff;
  color: #050505;
}

.journey-question-copy {
  display: grid;
  gap: 7px;
}

.journey-question-copy h3 {
  margin: 0;
  font-size: clamp(1.55rem, 4.6vw, 2.35rem);
  line-height: 1.02;
}

.journey-question-copy p:not(.eyebrow) {
  margin: 0;
  max-width: 500px;
  line-height: 1.45;
}

.journey-question label:not(.consent-check) {
  margin-top: 2px;
}

.journey-question input {
  min-height: 48px;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: #0d0d0d;
  color: #f5f5f5;
  font-size: 1rem;
}

.journey-question input::placeholder {
  color: #777777;
}

.journey-consent {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f5;
}

.journey-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  align-self: end;
}

.journey-actions button[hidden] {
  display: none;
}

.journey-actions .primary-button,
.journey-actions .ghost-button {
  min-height: 46px;
  border-radius: 12px;
}

.journey-actions .primary-button {
  background: #ffffff;
  color: #050505;
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.12);
}

.journey-actions .ghost-button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f5;
}

.journey-actions .ghost-button[hidden] + .primary-button,
.journey-actions .primary-button:not([hidden]):only-child {
  grid-column: 1 / -1;
}

.journey-question-card .form-message {
  min-height: 22px;
}

@keyframes journey-step-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Black and white admin surface */
.admin-page {
  --bg: #000;
  --surface: #101010;
  --surface-strong: #171717;
  --ink: #f5f5f5;
  --muted: #a8a8a8;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #ffffff;
  --primary-dark: #dcdcdc;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
  background:
    linear-gradient(180deg, #121212 0, #050505 340px),
    #000;
  color: var(--ink);
}

.admin-page .portal-header {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
}

.admin-page .brand-mark {
  background: transparent;
  color: #050505;
}

.journey-onboarding.is-hidden,
.customer-dashboard.is-hidden {
  display: none;
}

.admin-page .eyebrow {
  color: #d8d8d8;
}

.admin-page .portal-badge.admin {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.admin-dashboard {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 16, 16, 0.94);
  box-shadow: var(--shadow);
}

.admin-sidebar-title {
  display: grid;
  gap: 4px;
}

.admin-sidebar-title span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-sidebar-title strong {
  color: #fff;
  font-size: 1.2rem;
}

.admin-side-nav {
  display: grid;
  gap: 6px;
}

.admin-side-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #a8a8a8;
  padding: 0 12px;
  font-weight: 850;
  text-align: left;
}

.admin-side-nav button:hover,
.admin-side-nav button.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  background: #ffffff;
  color: #050505;
}

.admin-side-nav button strong {
  display: inline-grid;
  min-width: 26px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 0.78rem;
}

.admin-side-nav button.is-active strong,
.admin-side-nav button:hover strong {
  background: rgba(0, 0, 0, 0.12);
}

.admin-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
}

.admin-section {
  display: none;
}

.admin-section.is-active {
  display: grid;
  gap: 16px;
}

.admin-page .panel,
.admin-page .kpi,
.admin-page .review-card,
.admin-page .qr-card {
  border-color: var(--line);
  background: rgba(16, 16, 16, 0.94);
  box-shadow: var(--shadow);
}

.admin-page input,
.admin-page select {
  border-color: rgba(255, 255, 255, 0.13);
  background: #0d0d0d;
  color: var(--ink);
}

.admin-page .primary-button,
.admin-page .approve-button {
  background: #ffffff;
  color: #050505;
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.12);
}

.admin-page .primary-button:hover,
.admin-page .approve-button:hover {
  background: #dcdcdc;
}

.admin-page .ghost-button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f5;
}

.admin-page .ghost-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.overview-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.overview-hero h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.98;
}

.overview-total {
  min-width: min(100%, 230px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.overview-total span,
.metric-bar span,
.legend-row em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overview-total strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

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

.analytics-card {
  min-height: 270px;
}

.status-analytics {
  display: grid;
  grid-template-columns: 160px minmax(180px, 280px);
  align-items: center;
  justify-content: start;
  gap: 24px;
}

.status-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 160px;
  aspect-ratio: 1;
  border-radius: 999px;
}

.status-donut::after {
  content: "";
  position: absolute;
  inset: 35%;
  border-radius: inherit;
  background: #101010;
}

.status-donut div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  place-items: center;
  text-align: center;
}

.status-donut strong {
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
}

.status-donut span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.analytics-legend,
.pipeline-bars,
.rank-bars {
  display: grid;
  gap: 12px;
}

.analytics-legend {
  align-content: center;
  max-width: 280px;
}

.legend-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(28px, auto);
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legend-row:last-child {
  border-bottom: 0;
}

.legend-row span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dot);
}

.legend-row strong {
  color: #fff;
}

.metric-bar {
  display: grid;
  gap: 8px;
}

.metric-bar > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.metric-bar strong {
  min-width: 0;
  color: #fff;
  font-size: 0.95rem;
}

.metric-bar i {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.metric-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #ffffff;
}

.admin-page .kpi {
  position: relative;
  overflow: hidden;
}

.admin-page .kpi strong {
  color: #ffffff;
}

.admin-page th {
  color: #a8a8a8;
}

.admin-page td {
  color: #f5f5f5;
}

.admin-page .table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-page table {
  min-width: 680px;
}

.admin-page th,
.admin-page td {
  border-bottom-color: var(--line);
}

.admin-page .receipt-link {
  color: #ffffff;
}

.admin-page .status-pill.approved {
  background: #ffffff;
  color: #050505;
}

.admin-page .status-pill.pending {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.admin-page .status-pill.rejected {
  background: rgba(255, 255, 255, 0.08);
  color: #cfcfcf;
}

.admin-page .danger-button {
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
}

.admin-page .danger-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

@media (max-width: 760px) {
  .journey-onboarding {
    width: 100%;
  }

  .journey-intro {
    padding-top: 0;
  }

  .client-page.onboarding-mode .portal-header {
    margin-bottom: 14px;
  }

  .journey-flow .journey-intro h2 {
    font-size: clamp(2.15rem, 12vw, 3.55rem);
  }

  .journey-question-card {
    min-height: 260px;
    padding: 14px;
    border-radius: 14px;
  }

  .journey-question-copy h3 {
    font-size: clamp(1.55rem, 8vw, 2.2rem);
  }

  .journey-card {
    grid-template-columns: 1fr;
  }

  .journey-step {
    width: 34px;
    height: 34px;
  }

  .dashboard-mode .customer-score-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .dashboard-mode .score-focus-card {
    grid-column: 1 / -1;
  }

  .hero-score-grid .score-focus-card {
    grid-column: auto;
  }

  .dashboard-mode .customer-hero,
  .dashboard-mode .panel,
  .dashboard-mode .pwa-install-card {
    padding: 16px;
  }

  .dashboard-tabs {
    margin-right: 0;
    padding-right: 3px;
  }
}

@media (max-width: 700px) {
  .client-page.onboarding-mode .portal-header {
    align-items: start;
  }

  .client-page.onboarding-mode .portal-badge {
    justify-self: end;
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .dashboard-mode tr,
  .admin-page tr {
    background: rgba(255, 255, 255, 0.04);
  }

  .dashboard-mode td,
  .admin-page td {
    color: #f5f5f5;
  }

  .dashboard-mode td::before,
  .admin-page td::before {
    color: #a8a8a8;
  }
}

@media (max-width: 420px) {
  .journey-intro h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .journey-flow {
    gap: 12px;
  }

  .journey-flow .journey-intro p:not(.eyebrow) {
    font-size: 0.95rem;
  }

  .journey-question-card {
    min-height: 245px;
    gap: 12px;
    padding: 13px;
  }

  .journey-question {
    gap: 12px;
  }

  .journey-question .journey-step {
    width: 32px;
    height: 32px;
  }

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

  .journey-actions .ghost-button[hidden] + .primary-button {
    grid-column: auto;
  }

  .dashboard-mode .customer-score-grid {
    grid-template-columns: 1fr;
  }

  .score-focus-card,
  .score-mini-card {
    min-height: 120px;
  }

  .hero-score-card {
    min-height: 84px;
  }

  .tab-button {
    flex-basis: 0;
    padding: 0 12px;
  }

  .pwa-install-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pwa-install-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .pwa-install-actions .primary-button {
    width: 100%;
  }
}

@media (max-width: 1060px) {
  .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .admin-side-nav button {
    flex: 0 0 auto;
    min-width: 132px;
  }
}

@media (max-width: 760px) {
  .admin-page .portal-header,
  .admin-header,
  .overview-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .status-analytics {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .status-donut {
    width: 150px;
  }

  .analytics-legend {
    width: 100%;
    max-width: none;
  }

  .overview-total {
    min-width: 0;
  }
}

/* Light theme correction layer */
body.client-page,
body.client-page.onboarding-mode,
body.dashboard-mode,
body.admin-page {
  color-scheme: light;
  background:
    linear-gradient(180deg, #ffffff 0, #f7f7f7 340px),
    #f6f6f6;
  color: #080808;
}

.admin-page {
  --bg: #f6f6f6;
  --surface: #ffffff;
  --surface-strong: #f2f2f2;
  --ink: #080808;
  --muted: #5f5f5f;
  --line: #dedede;
  --primary: #080808;
  --primary-dark: #242424;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

.client-page .portal-header,
.admin-page .portal-header,
.admin-header,
.customer-hero,
.panel,
.score-focus-card,
.score-mini-card,
.hero-score-card,
.receipt-card,
.review-card,
.qr-card,
.scan-result,
.journey-card,
.journey-question-card,
.journey-consent,
.admin-sidebar,
.analytics-card,
.overview-total,
.kpi,
.table-wrap {
  border-color: #dedede !important;
  background: #ffffff !important;
  color: #080808 !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08) !important;
}

.client-page .portal-header,
.admin-page .portal-header {
  box-shadow: none !important;
}

.brand-block h1,
.admin-header h2,
.section-heading h2,
.customer-hero h2,
.journey-intro h2,
.journey-question-copy h3,
.overview-hero h2,
.admin-sidebar-title strong,
.admin-page h1,
.admin-page h2,
.admin-page h3,
.score-focus-card strong,
.score-mini-card strong,
.overview-total strong,
.status-donut strong,
.legend-row strong,
.metric-bar strong,
.admin-page .kpi strong {
  color: #080808 !important;
}

.eyebrow,
.admin-page .eyebrow,
.dashboard-mode .eyebrow,
.onboarding-mode .eyebrow,
.journey-count,
.overview-total span,
.metric-bar span,
.legend-row em,
.admin-sidebar-title span,
.dashboard-mode .muted,
.dashboard-mode .meta-line,
.dashboard-mode .form-message,
.dashboard-mode .scan-note,
.onboarding-mode .muted,
.onboarding-mode .form-message,
.onboarding-mode .journey-intro p:not(.eyebrow),
.onboarding-mode .journey-question-copy p:not(.eyebrow),
.receipt-dropzone small,
.scan-note,
.meta-line,
.muted {
  color: #5f5f5f !important;
}

.portal-badge,
.portal-badge.admin,
.dashboard-mode .portal-badge,
.onboarding-mode .portal-badge,
.admin-page .portal-badge.admin {
  border: 1px solid #d8d8d8 !important;
  background: #ffffff !important;
  color: #080808 !important;
  box-shadow: none !important;
}

.brand-mark,
.dashboard-mode .brand-mark,
.admin-page .brand-mark {
  background: transparent !important;
  color: #080808 !important;
}

.primary-button,
.approve-button,
.journey-actions .primary-button,
.admin-page .primary-button,
.admin-page .approve-button,
.dashboard-mode .primary-button,
.dashboard-mode .approve-button {
  border: 1px solid #080808 !important;
  background: #080808 !important;
  color: #ffffff !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12) !important;
}

.primary-button:hover,
.approve-button:hover,
.journey-actions .primary-button:hover,
.admin-page .primary-button:hover,
.admin-page .approve-button:hover,
.dashboard-mode .primary-button:hover,
.dashboard-mode .approve-button:hover {
  background: #242424 !important;
}

.ghost-button,
.danger-button,
.journey-actions .ghost-button,
.admin-page .ghost-button,
.admin-page .danger-button,
.dashboard-mode .ghost-button {
  border: 1px solid #d8d8d8 !important;
  background: #ffffff !important;
  color: #080808 !important;
  box-shadow: none !important;
}

.ghost-button:hover,
.danger-button:hover,
.journey-actions .ghost-button:hover,
.admin-page .ghost-button:hover,
.admin-page .danger-button:hover,
.dashboard-mode .ghost-button:hover {
  background: #f1f1f1 !important;
}

input,
select,
textarea,
.journey-question input,
.dashboard-mode input,
.dashboard-mode select,
.admin-page input,
.admin-page select {
  border-color: #d8d8d8 !important;
  background: #ffffff !important;
  color: #080808 !important;
}

input::placeholder,
textarea::placeholder,
.journey-question input::placeholder {
  color: #8a8a8a !important;
}

input:focus,
select:focus,
textarea:focus,
.journey-question input:focus,
.dashboard-mode input:focus,
.dashboard-mode select:focus,
.admin-page input:focus,
.admin-page select:focus {
  border-color: #080808 !important;
  box-shadow: 0 0 0 3px rgba(8, 8, 8, 0.08) !important;
}

.journey-progress span {
  background: #e0e0e0 !important;
}

.journey-progress span::after,
.metric-bar b {
  background: #080808 !important;
}

.journey-step,
.journey-question .journey-step,
.dropzone-mark,
.dashboard-mode .dropzone-mark {
  background: #080808 !important;
  color: #ffffff !important;
}

.consent-check input {
  accent-color: #080808 !important;
}

.file-picker {
  border-color: #cfcfcf !important;
  background: #ffffff !important;
}

.dashboard-tabs {
  border: 1px solid #d8d8d8 !important;
  background: #f2f2f2 !important;
}

.tab-button {
  color: #5f5f5f !important;
}

.tab-button.is-active {
  background: #080808 !important;
  color: #ffffff !important;
}

.receipt-dropzone,
.dashboard-mode .receipt-dropzone {
  border-color: #cfcfcf !important;
  background:
    radial-gradient(circle at var(--upload-x, 20%) var(--upload-y, 30%), rgba(0, 0, 0, 0.06), transparent 24%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.035), transparent 58%),
    #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02) !important;
}

.receipt-dropzone:hover,
.receipt-dropzone:focus-within,
.dashboard-mode .receipt-dropzone:hover,
.dashboard-mode .receipt-dropzone:focus-within {
  border-color: #080808 !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.1) !important;
}

.receipt-dropzone strong,
.dashboard-mode .receipt-dropzone strong {
  color: #080808 !important;
}

.receipt-dropzone::before,
.dashboard-mode .receipt-dropzone::before {
  background: linear-gradient(110deg, transparent 0%, rgba(0, 0, 0, 0.08) 45%, transparent 72%) !important;
}

.receipt-dropzone::after,
.dashboard-mode .receipt-dropzone::after {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.05), transparent 68%) !important;
}

.dropzone-mark::before,
.dropzone-mark::after,
.dashboard-mode .dropzone-mark::before,
.dashboard-mode .dropzone-mark::after {
  border-color: rgba(0, 0, 0, 0.2) !important;
}

.receipt-dropzone:hover .dropzone-mark,
.receipt-dropzone:focus-within .dropzone-mark,
.dashboard-mode .receipt-dropzone:hover .dropzone-mark,
.dashboard-mode .receipt-dropzone:focus-within .dropzone-mark {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14) !important;
}

.upload-form.is-processing .dropzone-mark::before {
  border-color: rgba(255, 255, 255, 0.36) !important;
  border-top-color: #ffffff !important;
}

.upload-form.is-processing .dropzone-mark::after {
  border-color: rgba(0, 0, 0, 0.22) !important;
}

.upload-form.is-processing .receipt-dropzone strong::after {
  color: #080808 !important;
}

.scan-fields div,
.summary-row,
.dashboard-mode .scan-fields div,
.dashboard-mode .summary-row {
  border-color: #dedede !important;
  background: #f5f5f5 !important;
  color: #080808 !important;
}

.scan-loader {
  color: #080808 !important;
}

.scan-loader span {
  background: #080808 !important;
}

.status-pill.neutral,
.dashboard-mode .status-pill.neutral,
.admin-page .status-pill.neutral {
  background: #eeeeee !important;
  color: #080808 !important;
}

.status-pill.pending,
.dashboard-mode .status-pill.pending,
.admin-page .status-pill.pending {
  background: #f2f2f2 !important;
  color: #080808 !important;
}

.status-pill.approved,
.dashboard-mode .status-pill.approved,
.admin-page .status-pill.approved {
  background: #080808 !important;
  color: #ffffff !important;
}

.status-pill.rejected,
.dashboard-mode .status-pill.rejected,
.admin-page .status-pill.rejected {
  background: #e7e7e7 !important;
  color: #333333 !important;
}

.admin-side-nav button {
  background: transparent !important;
  color: #555555 !important;
}

.admin-side-nav button:hover,
.admin-side-nav button.is-active {
  border-color: #080808 !important;
  background: #080808 !important;
  color: #ffffff !important;
}

.admin-side-nav button strong {
  background: #eeeeee !important;
  color: inherit !important;
}

.admin-side-nav button:hover strong,
.admin-side-nav button.is-active strong {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.status-donut::after {
  background: #ffffff !important;
}

.legend-row {
  border-bottom-color: #dedede !important;
}

.metric-bar i {
  background: #eeeeee !important;
}

th,
td,
.admin-page th,
.admin-page td,
.dashboard-mode td {
  color: #080808 !important;
  border-bottom-color: #dedede !important;
}

th,
.admin-page th {
  color: #5f5f5f !important;
}

tr,
.dashboard-mode tr,
.admin-page tr {
  background: #ffffff !important;
}

td::before,
.dashboard-mode td::before,
.admin-page td::before {
  color: #5f5f5f !important;
}

.receipt-link,
.dashboard-mode .receipt-link,
.admin-page .receipt-link {
  color: #080808 !important;
}

/* Black and white dark theme restore */
body.client-page,
body.client-page.onboarding-mode,
body.dashboard-mode,
body.admin-page {
  color-scheme: dark;
  background:
    linear-gradient(180deg, #121212 0, #050505 340px),
    #000000;
  color: #f5f5f5;
}

.admin-page {
  --bg: #000000;
  --surface: #101010;
  --surface-strong: #171717;
  --ink: #f5f5f5;
  --muted: #a8a8a8;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #ffffff;
  --primary-dark: #dcdcdc;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.client-page .portal-header,
.admin-page .portal-header,
.admin-header,
.customer-hero,
.panel,
.score-focus-card,
.score-mini-card,
.hero-score-card,
.receipt-card,
.review-card,
.qr-card,
.scan-result,
.journey-card,
.journey-question-card,
.journey-consent,
.admin-sidebar,
.analytics-card,
.overview-total,
.kpi,
.table-wrap {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(16, 16, 16, 0.94) !important;
  color: #f5f5f5 !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42) !important;
}

.client-page .portal-header,
.admin-page .portal-header {
  box-shadow: none !important;
}

.brand-block h1,
.admin-header h2,
.section-heading h2,
.customer-hero h2,
.journey-intro h2,
.journey-question-copy h3,
.overview-hero h2,
.admin-sidebar-title strong,
.admin-page h1,
.admin-page h2,
.admin-page h3,
.score-focus-card strong,
.score-mini-card strong,
.overview-total strong,
.status-donut strong,
.legend-row strong,
.metric-bar strong,
.admin-page .kpi strong {
  color: #ffffff !important;
}

.eyebrow,
.admin-page .eyebrow,
.dashboard-mode .eyebrow,
.onboarding-mode .eyebrow,
.journey-count,
.overview-total span,
.metric-bar span,
.legend-row em,
.admin-sidebar-title span,
.dashboard-mode .muted,
.dashboard-mode .meta-line,
.dashboard-mode .form-message,
.dashboard-mode .scan-note,
.onboarding-mode .muted,
.onboarding-mode .form-message,
.onboarding-mode .journey-intro p:not(.eyebrow),
.onboarding-mode .journey-question-copy p:not(.eyebrow),
.receipt-dropzone small,
.scan-note,
.meta-line,
.muted {
  color: #a8a8a8 !important;
}

.portal-badge,
.portal-badge.admin,
.dashboard-mode .portal-badge,
.onboarding-mode .portal-badge,
.admin-page .portal-badge.admin {
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.brand-mark,
.dashboard-mode .brand-mark,
.admin-page .brand-mark {
  background: transparent !important;
  color: #050505 !important;
}

.primary-button,
.approve-button,
.journey-actions .primary-button,
.admin-page .primary-button,
.admin-page .approve-button,
.dashboard-mode .primary-button,
.dashboard-mode .approve-button {
  border: 1px solid #ffffff !important;
  background: #ffffff !important;
  color: #050505 !important;
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.12) !important;
}

.primary-button:hover,
.approve-button:hover,
.journey-actions .primary-button:hover,
.admin-page .primary-button:hover,
.admin-page .approve-button:hover,
.dashboard-mode .primary-button:hover,
.dashboard-mode .approve-button:hover {
  background: #dcdcdc !important;
}

.ghost-button,
.danger-button,
.journey-actions .ghost-button,
.admin-page .ghost-button,
.admin-page .danger-button,
.dashboard-mode .ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f5f5f5 !important;
  box-shadow: none !important;
}

.ghost-button:hover,
.danger-button:hover,
.journey-actions .ghost-button:hover,
.admin-page .ghost-button:hover,
.admin-page .danger-button:hover,
.dashboard-mode .ghost-button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

input,
select,
textarea,
.journey-question input,
.dashboard-mode input,
.dashboard-mode select,
.admin-page input,
.admin-page select {
  border-color: rgba(255, 255, 255, 0.13) !important;
  background: #0d0d0d !important;
  color: #f5f5f5 !important;
}

input::placeholder,
textarea::placeholder,
.journey-question input::placeholder {
  color: #777777 !important;
}

input:focus,
select:focus,
textarea:focus,
.journey-question input:focus,
.dashboard-mode input:focus,
.dashboard-mode select:focus,
.admin-page input:focus,
.admin-page select:focus {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12) !important;
}

.journey-progress span {
  background: rgba(255, 255, 255, 0.1) !important;
}

.journey-progress span::after,
.metric-bar b {
  background: #ffffff !important;
}

.journey-step,
.journey-question .journey-step,
.dropzone-mark,
.dashboard-mode .dropzone-mark {
  background: #ffffff !important;
  color: #050505 !important;
}

.consent-check input {
  accent-color: #ffffff !important;
}

.file-picker {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: #101010 !important;
}

.dashboard-tabs {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

.tab-button {
  color: #a8a8a8 !important;
}

.tab-button.is-active {
  background: #ffffff !important;
  color: #050505 !important;
}

.receipt-dropzone,
.dashboard-mode .receipt-dropzone {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background:
    radial-gradient(circle at var(--upload-x, 20%) var(--upload-y, 30%), rgba(255, 255, 255, 0.12), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 55%),
    #101010 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02) !important;
}

.receipt-dropzone:hover,
.receipt-dropzone:focus-within,
.dashboard-mode .receipt-dropzone:hover,
.dashboard-mode .receipt-dropzone:focus-within {
  border-color: rgba(255, 255, 255, 0.62) !important;
  box-shadow: 0 18px 46px rgba(255, 255, 255, 0.08) !important;
}

.receipt-dropzone strong,
.dashboard-mode .receipt-dropzone strong {
  color: #ffffff !important;
}

.receipt-dropzone::before,
.dashboard-mode .receipt-dropzone::before {
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.18) 45%, transparent 72%) !important;
}

.receipt-dropzone::after,
.dashboard-mode .receipt-dropzone::after {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 68%) !important;
}

.dropzone-mark::before,
.dropzone-mark::after,
.dashboard-mode .dropzone-mark::before,
.dashboard-mode .dropzone-mark::after {
  border-color: rgba(255, 255, 255, 0.28) !important;
}

.receipt-dropzone:hover .dropzone-mark,
.receipt-dropzone:focus-within .dropzone-mark,
.dashboard-mode .receipt-dropzone:hover .dropzone-mark,
.dashboard-mode .receipt-dropzone:focus-within .dropzone-mark {
  box-shadow: 0 14px 34px rgba(255, 255, 255, 0.14) !important;
}

.upload-form.is-processing .dropzone-mark::before {
  border-color: rgba(5, 5, 5, 0.22) !important;
  border-top-color: #050505 !important;
}

.upload-form.is-processing .dropzone-mark::after {
  border-color: rgba(255, 255, 255, 0.45) !important;
}

.upload-form.is-processing .receipt-dropzone strong::after {
  color: #ffffff !important;
}

.scan-fields div,
.summary-row,
.dashboard-mode .scan-fields div,
.dashboard-mode .summary-row {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f5f5f5 !important;
}

.scan-loader {
  color: #ffffff !important;
}

.scan-loader span {
  background: #ffffff !important;
}

.status-pill.neutral,
.dashboard-mode .status-pill.neutral,
.admin-page .status-pill.neutral {
  background: rgba(255, 255, 255, 0.13) !important;
  color: #eeeeee !important;
}

.status-pill.pending,
.dashboard-mode .status-pill.pending,
.admin-page .status-pill.pending {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
}

.status-pill.approved,
.dashboard-mode .status-pill.approved,
.admin-page .status-pill.approved {
  background: #ffffff !important;
  color: #050505 !important;
}

.status-pill.rejected,
.dashboard-mode .status-pill.rejected,
.admin-page .status-pill.rejected {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cfcfcf !important;
}

.admin-side-nav button {
  background: transparent !important;
  color: #a8a8a8 !important;
}

.admin-side-nav button:hover,
.admin-side-nav button.is-active {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: #ffffff !important;
  color: #050505 !important;
}

.admin-side-nav button strong {
  background: rgba(255, 255, 255, 0.12) !important;
  color: inherit !important;
}

.admin-side-nav button:hover strong,
.admin-side-nav button.is-active strong {
  background: rgba(0, 0, 0, 0.12) !important;
  color: #050505 !important;
}

.status-donut::after {
  background: #101010 !important;
}

.legend-row {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.metric-bar i {
  background: rgba(255, 255, 255, 0.09) !important;
}

th,
td,
.admin-page th,
.admin-page td,
.dashboard-mode td {
  color: #f5f5f5 !important;
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

th,
.admin-page th {
  color: #a8a8a8 !important;
}

tr,
.dashboard-mode tr,
.admin-page tr {
  background: rgba(255, 255, 255, 0.04) !important;
}

td::before,
.dashboard-mode td::before,
.admin-page td::before {
  color: #a8a8a8 !important;
}

.receipt-link,
.dashboard-mode .receipt-link,
.admin-page .receipt-link {
  color: #ffffff !important;
}

/* Event palette layer */
body[data-theme] {
  --theme-bg: #000000;
  --theme-grad-top: #121212;
  --theme-grad-bottom: #050505;
  --theme-surface: rgba(16, 16, 16, 0.94);
  --theme-surface-strong: #171717;
  --theme-ink: #f5f5f5;
  --theme-muted: #a8a8a8;
  --theme-line: rgba(255, 255, 255, 0.12);
  --theme-primary: #ffffff;
  --theme-primary-hover: #dcdcdc;
  --theme-primary-text: #050505;
  --theme-soft: rgba(255, 255, 255, 0.08);
  --theme-soft-strong: rgba(255, 255, 255, 0.14);
  --theme-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --theme-chart-approved: #ffffff;
  --theme-chart-pending: #9b9b9b;
  --theme-chart-rejected: #343434;
}

body[data-theme="arcade-teal"] {
  --theme-bg: #010807;
  --theme-grad-top: #10241f;
  --theme-grad-bottom: #020908;
  --theme-surface: rgba(6, 20, 17, 0.96);
  --theme-surface-strong: #0b201c;
  --theme-line: rgba(95, 242, 207, 0.22);
  --theme-primary: #5ff2cf;
  --theme-primary-hover: #a0ffe9;
  --theme-primary-text: #01100d;
  --theme-soft: rgba(95, 242, 207, 0.1);
  --theme-soft-strong: rgba(95, 242, 207, 0.18);
  --theme-chart-approved: #5ff2cf;
  --theme-chart-pending: #d8d8d8;
  --theme-chart-rejected: #28544b;
}

body[data-theme="champion-gold"] {
  --theme-bg: #050403;
  --theme-grad-top: #211a0d;
  --theme-grad-bottom: #050403;
  --theme-surface: rgba(18, 14, 8, 0.96);
  --theme-surface-strong: #1f170b;
  --theme-line: rgba(240, 193, 90, 0.24);
  --theme-primary: #f0c15a;
  --theme-primary-hover: #ffe09a;
  --theme-primary-text: #120d04;
  --theme-soft: rgba(240, 193, 90, 0.1);
  --theme-soft-strong: rgba(240, 193, 90, 0.18);
  --theme-chart-approved: #f0c15a;
  --theme-chart-pending: #f5f5f5;
  --theme-chart-rejected: #5d4720;
}

body[data-theme="matchday-rust"] {
  --theme-bg: #080403;
  --theme-grad-top: #25110b;
  --theme-grad-bottom: #080403;
  --theme-surface: rgba(22, 9, 5, 0.96);
  --theme-surface-strong: #241008;
  --theme-line: rgba(226, 109, 61, 0.24);
  --theme-primary: #e26d3d;
  --theme-primary-hover: #ff9b72;
  --theme-primary-text: #160602;
  --theme-soft: rgba(226, 109, 61, 0.11);
  --theme-soft-strong: rgba(226, 109, 61, 0.2);
  --theme-chart-approved: #e26d3d;
  --theme-chart-pending: #f5f5f5;
  --theme-chart-rejected: #5c2a17;
}

body.client-page[data-theme],
body.client-page.onboarding-mode[data-theme],
body.dashboard-mode[data-theme],
body.admin-page[data-theme] {
  background:
    linear-gradient(180deg, var(--theme-grad-top) 0, var(--theme-grad-bottom) 340px),
    var(--theme-bg) !important;
  color: var(--theme-ink) !important;
}

body[data-theme] .portal-header,
body[data-theme] .admin-header,
body[data-theme] .customer-hero,
body[data-theme] .panel,
body[data-theme] .score-focus-card,
body[data-theme] .score-mini-card,
body[data-theme] .hero-score-card,
body[data-theme] .pwa-install-card,
body[data-theme] .receipt-card,
body[data-theme] .review-card,
body[data-theme] .qr-card,
body[data-theme] .scan-result,
body[data-theme] .journey-card,
body[data-theme] .journey-question-card,
body[data-theme] .journey-consent,
body[data-theme] .admin-sidebar,
body[data-theme] .analytics-card,
body[data-theme] .overview-total,
body[data-theme] .kpi,
body[data-theme] .table-wrap,
body[data-theme] .theme-option-card {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow) !important;
}

body[data-theme] .brand-block h1,
body[data-theme] .admin-header h2,
body[data-theme] .section-heading h2,
body[data-theme] .customer-hero h2,
body[data-theme] .journey-intro h2,
body[data-theme] .journey-question-copy h3,
body[data-theme] .overview-hero h2,
body[data-theme] .admin-sidebar-title strong,
body[data-theme] h1,
body[data-theme] h2,
body[data-theme] h3,
body[data-theme] .score-focus-card strong,
body[data-theme] .score-mini-card strong,
body[data-theme] .overview-total strong,
body[data-theme] .status-donut strong,
body[data-theme] .legend-row strong,
body[data-theme] .metric-bar strong,
body[data-theme] .kpi strong {
  color: var(--theme-ink) !important;
}

body[data-theme] .eyebrow,
body[data-theme] .journey-count,
body[data-theme] .overview-total span,
body[data-theme] .metric-bar span,
body[data-theme] .legend-row em,
body[data-theme] .admin-sidebar-title span,
body[data-theme] .muted,
body[data-theme] .meta-line,
body[data-theme] .form-message,
body[data-theme] .scan-note,
body[data-theme] .receipt-dropzone small,
body[data-theme] .theme-option-card small {
  color: var(--theme-muted) !important;
}

body[data-theme] .portal-badge,
body[data-theme] .portal-badge.admin {
  border-color: color-mix(in srgb, var(--theme-primary) 35%, transparent) !important;
  background: color-mix(in srgb, var(--theme-primary) 12%, transparent) !important;
  color: var(--theme-ink) !important;
}

body[data-theme] .primary-button,
body[data-theme] .approve-button,
body[data-theme] .journey-actions .primary-button {
  border-color: var(--theme-primary) !important;
  background: var(--theme-primary) !important;
  color: var(--theme-primary-text) !important;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--theme-primary) 18%, transparent) !important;
}

body[data-theme] .primary-button:hover,
body[data-theme] .approve-button:hover,
body[data-theme] .journey-actions .primary-button:hover {
  background: var(--theme-primary-hover) !important;
}

body[data-theme] .ghost-button,
body[data-theme] .danger-button,
body[data-theme] .journey-actions .ghost-button {
  border-color: var(--theme-line) !important;
  background: var(--theme-soft) !important;
  color: var(--theme-ink) !important;
}

body[data-theme] .ghost-button:hover,
body[data-theme] .danger-button:hover,
body[data-theme] .journey-actions .ghost-button:hover {
  background: var(--theme-soft-strong) !important;
}

body[data-theme] input,
body[data-theme] select,
body[data-theme] textarea {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-strong) !important;
  color: var(--theme-ink) !important;
}

body[data-theme] input:focus,
body[data-theme] select:focus,
body[data-theme] textarea:focus {
  border-color: var(--theme-primary) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 18%, transparent) !important;
}

body[data-theme] .journey-progress span {
  background: var(--theme-soft-strong) !important;
}

body[data-theme] .journey-progress span::after,
body[data-theme] .metric-bar b {
  background: var(--theme-primary) !important;
}

body[data-theme] .journey-step,
body[data-theme] .journey-question .journey-step,
body[data-theme] .dropzone-mark {
  background: var(--theme-primary) !important;
  color: var(--theme-primary-text) !important;
}

body[data-theme] .dashboard-tabs {
  border-color: var(--theme-line) !important;
  background: var(--theme-soft) !important;
}

body[data-theme] .tab-button {
  color: var(--theme-muted) !important;
}

body[data-theme] .tab-button.is-active,
body[data-theme] .admin-side-nav button:hover,
body[data-theme] .admin-side-nav button.is-active {
  border-color: var(--theme-primary) !important;
  background: var(--theme-primary) !important;
  color: var(--theme-primary-text) !important;
}

body[data-theme] .receipt-dropzone {
  border-color: color-mix(in srgb, var(--theme-primary) 38%, transparent) !important;
  background:
    radial-gradient(circle at var(--upload-x, 20%) var(--upload-y, 30%), color-mix(in srgb, var(--theme-primary) 14%, transparent), transparent 22%),
    linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 10%, transparent), transparent 55%),
    var(--theme-surface-strong) !important;
}

body[data-theme] .receipt-dropzone:hover,
body[data-theme] .receipt-dropzone:focus-within {
  border-color: color-mix(in srgb, var(--theme-primary) 68%, transparent) !important;
  box-shadow: 0 18px 46px color-mix(in srgb, var(--theme-primary) 10%, transparent) !important;
}

body[data-theme] .receipt-dropzone strong,
body[data-theme] .receipt-link {
  color: var(--theme-primary) !important;
}

body[data-theme] .pwa-install-logo {
  border-color: var(--theme-line) !important;
  background: var(--theme-bg) !important;
}

body[data-theme] .scan-fields div,
body[data-theme] .summary-row {
  border-color: var(--theme-line) !important;
  background: var(--theme-soft) !important;
  color: var(--theme-ink) !important;
}

body[data-theme] .status-pill.approved {
  background: var(--theme-primary) !important;
  color: var(--theme-primary-text) !important;
}

body[data-theme] .status-pill.pending,
body[data-theme] .status-pill.neutral {
  background: var(--theme-soft-strong) !important;
  color: var(--theme-ink) !important;
}

body[data-theme] .status-pill.rejected {
  background: var(--theme-soft) !important;
  color: var(--theme-muted) !important;
}

body[data-theme] .status-donut::after {
  background: var(--theme-surface) !important;
}

body[data-theme] .legend-row,
body[data-theme] th,
body[data-theme] td {
  border-bottom-color: var(--theme-line) !important;
}

body[data-theme] .metric-bar i {
  background: var(--theme-soft-strong) !important;
}

body[data-theme] th,
body[data-theme] td {
  color: var(--theme-ink) !important;
}

body[data-theme] th,
body[data-theme] td::before {
  color: var(--theme-muted) !important;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.theme-fieldset {
  display: grid;
  gap: 12px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 10px;
}

.theme-option {
  position: relative;
  display: block;
  min-width: 0;
}

.theme-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.theme-option-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius);
  cursor: pointer;
}

.theme-option input:checked + .theme-option-card {
  border-color: var(--theme-primary) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--theme-primary) 24%, transparent),
    var(--theme-shadow) !important;
}

.theme-swatches {
  display: flex;
  gap: 6px;
}

.theme-swatches span {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

/* Admin mobile responsiveness */
.admin-page {
  min-width: 320px;
}

.admin-page .app-shell {
  max-width: 1440px;
}

.admin-page .admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.admin-page .qr-grid {
  align-items: stretch;
}

.admin-page .qr-card code {
  max-width: 100%;
  white-space: normal;
  word-break: break-all;
}

@media (max-width: 1180px) {
  .admin-page .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-inline: calc(clamp(14px, 3vw, 24px) * -1);
    padding: 10px clamp(14px, 3vw, 24px);
    border-inline: 0 !important;
    border-radius: 0 !important;
    backdrop-filter: blur(14px);
  }

  .admin-page .admin-sidebar-title {
    display: none;
  }

  .admin-page .admin-side-nav {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 4px;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
    pointer-events: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .admin-page .admin-side-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-page .admin-side-nav button {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 40px;
    scroll-snap-align: center;
    touch-action: manipulation;
    pointer-events: auto;
    user-select: none;
    white-space: nowrap;
  }

  .admin-page .analytics-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .admin-page .portal-header,
  .admin-page .admin-header,
  .admin-page .overview-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-page .portal-header {
    gap: 12px;
    padding: 12px !important;
  }

  .admin-page .portal-badge.admin {
    align-self: flex-end;
  }

  .admin-page .brand-block {
    gap: 10px;
  }

  .admin-page .brand-mark {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
  }

  .admin-page .brand-block h1,
  .admin-page .admin-header h2 {
    font-size: clamp(1.2rem, 6vw, 1.75rem);
    line-height: 1.12;
  }

  .admin-page .admin-header,
  .admin-page .panel,
  .admin-page .review-card,
  .admin-page .qr-card,
  .admin-page .kpi {
    padding: 14px !important;
  }

  .admin-page .admin-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .admin-page .admin-actions .ghost-button {
    width: 100%;
  }

  .admin-page .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .admin-page .kpi {
    min-height: 104px;
  }

  .admin-page .kpi strong {
    font-size: clamp(1.1rem, 6vw, 1.75rem);
    line-height: 1.05;
  }

  .admin-page .overview-total {
    min-width: 0;
    width: 100%;
  }

  .admin-page .analytics-card {
    min-height: 0;
  }

  .admin-page .status-analytics {
    grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
    gap: 16px;
  }

  .admin-page .status-donut {
    width: min(150px, 38vw);
  }

  .admin-page .legend-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .admin-page .metric-bar > div {
    align-items: start;
    flex-direction: column;
    gap: 3px;
  }

  .admin-page .form-grid,
  .admin-page .shop-form {
    grid-template-columns: 1fr;
  }

  .admin-page .theme-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-page .theme-option-card {
    min-height: 118px;
  }

  .admin-page .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-page .form-actions .primary-button {
    width: 100%;
  }

  .admin-page .review-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .admin-page .review-actions .compact-field {
    grid-column: 1 / -1;
    max-width: none;
  }

  .admin-page .review-actions input,
  .admin-page .review-actions select,
  .admin-page .review-actions button {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .admin-page .app-shell {
    padding: 10px;
  }

  .admin-page .portal-header {
    margin-bottom: 12px;
  }

  .admin-page .brand-block {
    align-items: center;
  }

  .admin-page .brand-mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .admin-page .portal-badge.admin {
    min-height: 30px;
    padding-inline: 10px;
    font-size: 0.82rem;
  }

  .admin-page .admin-dashboard,
  .admin-page .admin-main,
  .admin-page .admin-section {
    gap: 12px;
  }

  .admin-page .admin-sidebar {
    margin-inline: -10px;
    padding: 8px 10px;
  }

  .admin-page .admin-side-nav button {
    min-height: 38px;
    padding-inline: 11px;
    font-size: 0.9rem;
  }

  .admin-page .admin-side-nav button strong {
    min-width: 24px;
    height: 22px;
  }

  .admin-page .section-heading {
    margin-bottom: 14px;
  }

  .admin-page .section-heading h2,
  .admin-page .overview-hero h2 {
    font-size: clamp(1.45rem, 8vw, 2.1rem);
    line-height: 1.05;
  }

  .admin-page .status-analytics {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .admin-page .analytics-legend {
    width: 100%;
    max-width: none;
  }

  .admin-page .status-donut {
    width: min(156px, 52vw);
  }

  .admin-page .table-wrap {
    overflow-x: visible;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .admin-page table,
  .admin-page thead,
  .admin-page tbody,
  .admin-page tr,
  .admin-page td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .admin-page thead {
    display: none;
  }

  .admin-page tbody {
    display: grid;
    gap: 10px;
  }

  .admin-page tr {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--theme-line, var(--line));
    border-radius: var(--radius);
    background: var(--theme-surface, rgba(16, 16, 16, 0.94)) !important;
  }

  .admin-page td {
    display: grid;
    grid-template-columns: minmax(90px, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border: 0 !important;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .admin-page td + td {
    border-top: 1px solid var(--theme-line, var(--line)) !important;
  }

  .admin-page td::before {
    content: attr(data-label);
    color: var(--theme-muted, var(--muted));
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
  }

  .admin-page td[colspan] {
    display: block;
    text-align: left;
  }

  .admin-page td[colspan]::before {
    content: "";
    display: none;
  }

  .admin-page .qr-grid,
  .admin-page .theme-options {
    grid-template-columns: 1fr;
  }

  .admin-page .qr-card svg {
    width: min(180px, 72vw);
    justify-self: center;
  }
}

@media (max-width: 430px) {
  .admin-page .app-shell {
    padding: 8px;
  }

  .admin-page .portal-header,
  .admin-page .admin-header,
  .admin-page .panel,
  .admin-page .review-card,
  .admin-page .qr-card,
  .admin-page .kpi {
    border-radius: 8px !important;
  }

  .admin-page .admin-sidebar {
    margin-inline: -8px;
    padding-inline: 8px;
  }

  .admin-page .admin-actions,
  .admin-page .kpi-grid,
  .admin-page .review-actions {
    grid-template-columns: 1fr;
  }

  .admin-page .kpi {
    min-height: 88px;
  }

  .admin-page .overview-total strong {
    font-size: clamp(1.55rem, 11vw, 2.25rem);
  }

  .admin-page td {
    grid-template-columns: 1fr;
    gap: 4px;
    text-align: left;
  }
}

/* Keep every admin section reachable on phones. */
@media (max-width: 860px) {
  .admin-page .admin-sidebar {
    position: static;
    margin-inline: 0;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  .admin-page .admin-side-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
    touch-action: manipulation;
  }

  .admin-page .admin-side-nav button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px;
    justify-content: center;
    padding-inline: 10px;
    scroll-snap-align: none;
    text-align: center;
    white-space: normal;
  }

  .admin-page .admin-side-nav button span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  .admin-page .admin-side-nav {
    grid-template-columns: 1fr;
  }
}

.appearance-fieldset {
  display: grid;
  gap: 12px;
}

.appearance-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--theme-line, var(--line));
  border-radius: var(--radius);
  background: var(--theme-surface, var(--surface));
  color: var(--theme-ink, var(--ink));
  cursor: pointer;
}

.appearance-toggle span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.appearance-toggle strong {
  color: inherit;
}

.appearance-toggle small {
  color: var(--theme-muted, var(--muted));
}

.appearance-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.appearance-toggle i {
  position: relative;
  flex: 0 0 52px;
  width: 52px;
  height: 30px;
  border: 1px solid var(--theme-line, var(--line));
  border-radius: 999px;
  background: var(--theme-soft-strong, rgba(255, 255, 255, 0.14));
}

.appearance-toggle i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--theme-ink, #ffffff);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.appearance-toggle input:checked + i {
  border-color: var(--theme-primary, #ffffff);
  background: var(--theme-primary, #ffffff);
}

.appearance-toggle input:checked + i::after {
  transform: translateX(22px);
  background: var(--theme-primary-text, #050505);
}

/* Saved light mode keeps the chosen event palette as the accent. */
body[data-theme][data-appearance="light"] {
  color-scheme: light;
  --theme-bg: #f6f6f6;
  --theme-grad-top: #ffffff;
  --theme-grad-bottom: #f7f7f7;
  --theme-surface: #ffffff;
  --theme-surface-strong: #f2f2f2;
  --theme-ink: #080808;
  --theme-muted: #606060;
  --theme-line: rgba(0, 0, 0, 0.13);
  --theme-primary: #080808;
  --theme-primary-hover: #242424;
  --theme-primary-text: #ffffff;
  --theme-soft: rgba(0, 0, 0, 0.055);
  --theme-soft-strong: rgba(0, 0, 0, 0.1);
  --theme-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
  --theme-chart-approved: #080808;
  --theme-chart-pending: #8d8d8d;
  --theme-chart-rejected: #d8d8d8;
  --bg: var(--theme-bg);
  --surface: var(--theme-surface);
  --surface-strong: var(--theme-surface-strong);
  --ink: var(--theme-ink);
  --muted: var(--theme-muted);
  --line: var(--theme-line);
  --primary: var(--theme-primary);
  --primary-dark: var(--theme-primary-hover);
  --shadow: var(--theme-shadow);
}

body[data-theme="arcade-teal"][data-appearance="light"] {
  --theme-grad-bottom: #effffb;
  --theme-line: rgba(0, 127, 109, 0.18);
  --theme-primary: #007f6d;
  --theme-primary-hover: #006354;
  --theme-primary-text: #ffffff;
  --theme-soft: rgba(0, 127, 109, 0.08);
  --theme-soft-strong: rgba(0, 127, 109, 0.13);
  --theme-chart-approved: #007f6d;
  --theme-chart-pending: #7f8e8b;
  --theme-chart-rejected: #d7ebe7;
}

body[data-theme="champion-gold"][data-appearance="light"] {
  --theme-grad-bottom: #fff8e8;
  --theme-line: rgba(156, 107, 0, 0.2);
  --theme-primary: #9c6b00;
  --theme-primary-hover: #7a5200;
  --theme-primary-text: #ffffff;
  --theme-soft: rgba(156, 107, 0, 0.08);
  --theme-soft-strong: rgba(156, 107, 0, 0.14);
  --theme-chart-approved: #9c6b00;
  --theme-chart-pending: #8f8573;
  --theme-chart-rejected: #eadfca;
}

body[data-theme="matchday-rust"][data-appearance="light"] {
  --theme-grad-bottom: #fff2ed;
  --theme-line: rgba(183, 68, 31, 0.2);
  --theme-primary: #b7441f;
  --theme-primary-hover: #913417;
  --theme-primary-text: #ffffff;
  --theme-soft: rgba(183, 68, 31, 0.08);
  --theme-soft-strong: rgba(183, 68, 31, 0.14);
  --theme-chart-approved: #b7441f;
  --theme-chart-pending: #8f7f79;
  --theme-chart-rejected: #edd8cf;
}

body.client-page[data-theme][data-appearance="light"],
body.client-page.onboarding-mode[data-theme][data-appearance="light"],
body.dashboard-mode[data-theme][data-appearance="light"],
body.admin-page[data-theme][data-appearance="light"] {
  background:
    linear-gradient(180deg, var(--theme-grad-top) 0, var(--theme-grad-bottom) 340px),
    var(--theme-bg) !important;
  color: var(--theme-ink) !important;
}

body[data-theme][data-appearance="light"] .portal-header,
body[data-theme][data-appearance="light"] .admin-header,
body[data-theme][data-appearance="light"] .customer-hero,
body[data-theme][data-appearance="light"] .panel,
body[data-theme][data-appearance="light"] .score-focus-card,
body[data-theme][data-appearance="light"] .score-mini-card,
body[data-theme][data-appearance="light"] .hero-score-card,
body[data-theme][data-appearance="light"] .pwa-install-card,
body[data-theme][data-appearance="light"] .receipt-card,
body[data-theme][data-appearance="light"] .review-card,
body[data-theme][data-appearance="light"] .qr-card,
body[data-theme][data-appearance="light"] .scan-result,
body[data-theme][data-appearance="light"] .journey-card,
body[data-theme][data-appearance="light"] .journey-question-card,
body[data-theme][data-appearance="light"] .journey-consent,
body[data-theme][data-appearance="light"] .admin-sidebar,
body[data-theme][data-appearance="light"] .analytics-card,
body[data-theme][data-appearance="light"] .overview-total,
body[data-theme][data-appearance="light"] .kpi,
body[data-theme][data-appearance="light"] .table-wrap,
body[data-theme][data-appearance="light"] .theme-option-card,
body[data-theme][data-appearance="light"] .appearance-toggle {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow) !important;
}

body[data-theme][data-appearance="light"] tr,
body[data-theme][data-appearance="light"].dashboard-mode tr,
body[data-theme][data-appearance="light"].admin-page tr {
  background: var(--theme-surface) !important;
}

body[data-theme][data-appearance="light"] input::placeholder,
body[data-theme][data-appearance="light"] textarea::placeholder,
body[data-theme][data-appearance="light"] .journey-question input::placeholder {
  color: #8a8a8a !important;
}

body.client-page.onboarding-mode[data-theme][data-appearance="light"] .journey-question label {
  color: var(--theme-muted) !important;
}

body.client-page.onboarding-mode[data-theme][data-appearance="light"] .journey-question label.journey-consent {
  color: var(--theme-ink) !important;
}

body[data-theme][data-appearance="light"] .file-picker {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
}

body[data-theme][data-appearance="light"] .consent-check input {
  accent-color: var(--theme-primary) !important;
}

body[data-theme][data-appearance="light"] .receipt-dropzone::before,
body[data-theme][data-appearance="light"].dashboard-mode .receipt-dropzone::before {
  background: linear-gradient(110deg, transparent 0%, color-mix(in srgb, var(--theme-primary) 10%, transparent) 45%, transparent 72%) !important;
}

body[data-theme][data-appearance="light"] .receipt-dropzone::after,
body[data-theme][data-appearance="light"].dashboard-mode .receipt-dropzone::after {
  background: radial-gradient(circle, color-mix(in srgb, var(--theme-primary) 8%, transparent), transparent 68%) !important;
}

body[data-theme][data-appearance="light"] .dropzone-mark::before,
body[data-theme][data-appearance="light"] .dropzone-mark::after,
body[data-theme][data-appearance="light"].dashboard-mode .dropzone-mark::before,
body[data-theme][data-appearance="light"].dashboard-mode .dropzone-mark::after {
  border-color: color-mix(in srgb, var(--theme-primary) 25%, transparent) !important;
}

body[data-theme][data-appearance="light"] .scan-loader {
  color: var(--theme-ink) !important;
}

body[data-theme][data-appearance="light"] .scan-loader span {
  background: var(--theme-ink) !important;
}

body[data-theme][data-appearance="light"] .upload-form.is-processing .dropzone-mark::before {
  border-color: rgba(255, 255, 255, 0.36) !important;
  border-top-color: #ffffff !important;
}

body[data-theme][data-appearance="light"] .upload-form.is-processing .dropzone-mark::after {
  border-color: rgba(0, 0, 0, 0.22) !important;
}

body[data-theme][data-appearance="light"] .upload-form.is-processing .receipt-dropzone strong::after {
  color: var(--theme-ink) !important;
}

body[data-theme][data-appearance="light"] .theme-swatches span {
  border-color: rgba(0, 0, 0, 0.16);
}

body[data-theme][data-appearance="light"] .status-donut::after {
  background: var(--theme-surface) !important;
}

/* Let the logo/title header blend into the current page background. */
.client-page .portal-header,
.admin-page .portal-header,
body[data-theme] .portal-header,
body[data-theme][data-appearance="light"] .portal-header {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 620px) {
  .appearance-toggle {
    align-items: flex-start;
    min-height: 0;
  }
}

.admin-mobile-nav-trigger,
.admin-nav-modal {
  display: none;
}

@media (max-width: 860px) {
  body.admin-page.admin-nav-open {
    overflow: hidden;
  }

  .admin-page .admin-sidebar {
    position: static;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  .admin-page .admin-side-nav-desktop {
    display: none !important;
  }

  .admin-page .admin-mobile-nav-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid var(--theme-line, var(--line));
    border-radius: var(--radius);
    background: var(--theme-surface, var(--surface));
    color: var(--theme-ink, var(--ink));
    box-shadow: var(--theme-shadow, var(--shadow));
    text-align: left;
  }

  .admin-page .admin-mobile-nav-trigger span {
    color: var(--theme-muted, var(--muted));
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .admin-page .admin-mobile-nav-trigger strong {
    color: var(--theme-ink, var(--ink));
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .admin-page .admin-nav-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    align-items: end;
    padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition:
      opacity 180ms ease,
      visibility 180ms ease;
  }

  body.admin-page.admin-nav-open .admin-nav-modal {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .admin-page .admin-nav-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.66);
  }

  .admin-page .admin-nav-sheet {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    width: min(100%, 520px);
    max-height: min(82dvh, 620px);
    margin: 0 auto;
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--theme-line, var(--line));
    border-radius: 16px 16px 10px 10px;
    background: var(--theme-surface, var(--surface));
    color: var(--theme-ink, var(--ink));
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.48);
    transform: translateY(105%);
    transition: transform 220ms ease;
  }

  body.admin-page.admin-nav-open .admin-nav-sheet {
    transform: translateY(0);
  }

  .admin-page .admin-nav-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .admin-page .admin-nav-sheet-header h2 {
    margin: 0;
    color: var(--theme-ink, var(--ink));
    font-size: 1.2rem;
    line-height: 1.05;
  }

  .admin-page .admin-nav-close {
    min-height: 36px;
    padding-inline: 14px;
  }

  .admin-page .admin-nav-modal .admin-side-nav {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
    touch-action: manipulation;
  }

  .admin-page .admin-nav-modal .admin-side-nav button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px;
    justify-content: space-between;
    padding: 0 14px;
    border-color: var(--theme-line, var(--line));
    background: var(--theme-soft, rgba(255, 255, 255, 0.08));
    color: var(--theme-ink, var(--ink));
    scroll-snap-align: none;
    text-align: left;
    white-space: normal;
  }

  .admin-page .admin-nav-modal .admin-side-nav button span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
