:root {
  --accent: #e14b37;
  --blue: #3498db;
  --blue-strong: #287cbc;
  --text: #2f3a44;
  --muted: #7c8893;
  --border: #e3e7eb;
  --page-bg: #eef1f4;
  --success: #11795d;
  --warning: #b56b00;
  --error: #b43b3b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

body.scanner-open {
  overflow: hidden;
}

.page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 48px;
}

.hero {
  margin-bottom: 18px;
}

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

.brand-shell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: #2c5f8a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.brand-mark__screen {
  width: 24px;
  height: 17px;
  border-radius: 3px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.brand-mark__ring {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #34a085;
}

.brand-mark__bar {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
}

.brand-mark__bar--light {
  height: 6px;
  background: #fff;
}

.brand-mark__bar--green {
  top: 2px;
  height: 5px;
  background: #34a085;
}

.brand-copy__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #2c5f8a;
}

.brand-copy__sub {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #34a085;
}

.hero-context {
  text-align: right;
  color: #8a949e;
  font-size: 0.95rem;
}

.hero-context p {
  margin: 0 0 6px;
}

.hero-context strong {
  color: #5a6672;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 0 22px 24px;
}

.panel-head {
  margin: 0 -22px 18px;
  padding: 14px 22px 12px;
  background: var(--accent);
  color: #fff;
}

.panel-head__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.panel-head__sub {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.panel-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.project-entry-card {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.project-entry-card__header h2 {
  margin: 8px 0 0;
}

.wizard-stepper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 12px 0 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.wizard-stepper__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #9aa4ad;
  font-size: 0.92rem;
  font-weight: 700;
}

.wizard-stepper__item.is-active {
  color: var(--text);
}

.wizard-stepper__item.is-complete {
  color: var(--blue);
}

.wizard-stepper__circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e6eaee;
  color: #9aa4ad;
}

.wizard-stepper__item.is-active .wizard-stepper__circle {
  background: var(--accent);
  color: #fff;
}

.wizard-stepper__item.is-complete .wizard-stepper__circle {
  background: var(--blue);
  color: #fff;
}

.wizard-step.hidden,
.hidden {
  display: none !important;
}

.lookup-form,
.payment-form {
  display: grid;
  gap: 16px;
}

.mode-switch {
  display: inline-flex;
  width: 100%;
  padding: 4px;
  border-radius: 6px;
  background: #eef1f4;
  gap: 4px;
}

.mode-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
}

.mode-btn:hover:not(:disabled),
.mode-btn:focus-visible {
  background: var(--blue);
  color: #fff;
}

.mode-btn.is-active {
  background: var(--blue);
  color: #fff;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
  color: #5a6672;
}

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

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd6dd;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input[readonly] {
  color: rgba(47, 58, 68, 0.84);
  background: #f8fafb;
  cursor: default;
}

input:focus {
  outline: none;
  border-color: var(--blue);
}

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

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

.helper {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

button {
  border: none;
  border-radius: 4px;
  padding: 11px 18px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease, opacity 140ms ease;
}

button:hover:not(:disabled) {
  background: var(--blue-strong);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

button.secondary {
  background: #fff;
  color: #5a6672;
  border: 1px solid #cfd6dd;
}

button.secondary:hover:not(:disabled),
button.secondary:focus-visible {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.pay-btn,
.mp-btn {
  background: var(--blue);
}

.status {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 6px;
  font-weight: 600;
}

.status.hidden {
  display: none;
}

.status.info {
  background: rgba(52, 152, 219, 0.12);
  color: var(--blue-strong);
}

.status.success {
  background: rgba(17, 121, 93, 0.12);
  color: var(--success);
}

.status.warning {
  background: rgba(181, 107, 0, 0.12);
  color: var(--warning);
}

.status.error {
  background: rgba(180, 59, 59, 0.12);
  color: var(--error);
}

.scanner-card,
.checkout-summary-card,
.online-payment-card,
.completion-card,
.payment-form,
.receipt-sheet,
.metric {
  border: 1px solid var(--border);
  background: #fff;
}

.scanner-card {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 0;
  border: 0;
  background: transparent;
}

.scanner-card__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 27, 36, 0.72);
}

.scanner-card__dialog {
  position: relative;
  width: min(100%, 620px);
  max-height: min(100vh - 40px, 760px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
}

.scanner-header,
.result-header,
.online-payment-card__header,
.receipt-actions,
.receipt-sheet__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.scanner-header h3,
.checkout-summary-card__header h3,
.online-payment-card__header h3,
.receipt-actions h3,
.receipt-sheet__header h4 {
  margin: 8px 0 0;
}

.scanner-video {
  width: 100%;
  min-height: 280px;
  border-radius: 6px;
  background: #000;
  overflow: hidden;
}

#scannerVideo video {
  width: 100% !important;
  max-height: 360px;
  object-fit: cover;
}

#scannerVideo__dashboard_section_csr button,
#scannerVideo__dashboard_section_swaplink {
  display: none !important;
}

.result-card {
  margin-top: 0;
}

.result-header {
  margin-top: 12px;
}

.result-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-header h2 {
  margin: 8px 0 0;
  font-size: 2.1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.badge.success {
  background: rgba(17, 121, 93, 0.14);
  color: var(--success);
}

.badge.warning {
  background: rgba(181, 107, 0, 0.14);
  color: var(--warning);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ticket-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.ticket-facts p {
  margin: 0;
  color: var(--muted);
}

.ticket-facts strong {
  color: var(--text);
}

.metric {
  padding: 18px;
  border-radius: 6px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
}

.detail-list {
  margin: 26px 0 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.detail-list p {
  margin: 0;
}

.detail-list strong {
  color: var(--text);
}

.payment-form,
.checkout-summary-card,
.online-payment-card,
.receipt-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 6px;
}

.checkout-summary-grid,
.receipt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin-top: 18px;
}

.checkout-summary-grid p,
.receipt-meta p,
.receipt-grid p,
.receipt-block p,
.receipt-sheet__footer p {
  margin: 0;
}

.online-payment-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.completion-card {
  text-align: center;
  margin-bottom: 22px;
  padding: 24px;
  border-radius: 6px;
}

.completion-card__icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 121, 93, 0.16);
  color: var(--success);
  font-size: 1.8rem;
  font-weight: 800;
}

.completion-card h2 {
  margin: 0;
  font-size: 1.9rem;
}

.completion-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.receipt-card {
  padding: 0;
  border: none;
  background: transparent;
}

.receipt-sheet {
  padding: 24px;
  border-radius: 6px;
}

.receipt-sheet__header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.receipt-meta {
  display: grid;
  gap: 8px;
  text-align: right;
}

.receipt-block {
  margin-top: 18px;
  display: grid;
  gap: 6px;
}

.receipt-sheet__footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-weight: 700;
}

@media print {
  body {
    background: #fff;
  }

  .hero,
  .panel-head,
  .panel-toolbar,
  .wizard-stepper,
  .lookup-form,
  .scanner-card,
  .status,
  .checkout-summary-card,
  .online-payment-card,
  .completion-card,
  .receipt-actions button {
    display: none !important;
  }

  .page,
  .panel,
  .receipt-card,
  .receipt-sheet {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .receipt-card {
    display: block !important;
  }
}

@media (max-width: 860px) {
  .page {
    width: min(100%, calc(100% - 24px));
    padding: 12px 0 40px;
  }

  .hero--header {
    flex-direction: column;
  }

  .hero-context {
    text-align: left;
  }

  .field-row,
  .ticket-facts,
  .result-grid,
  .receipt-grid,
  .checkout-summary-grid {
    grid-template-columns: 1fr;
  }

  .lookup-input-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 0 18px 22px;
  }

  .panel-head {
    margin: 0 -18px 18px;
    padding: 14px 18px 12px;
  }

  .result-header,
  .scanner-header,
  .online-payment-card__header,
  .receipt-actions,
  .receipt-sheet__header {
    flex-direction: column;
  }

  .scanner-card {
    padding: 12px;
    align-items: flex-end;
  }

  .scanner-card__dialog {
    width: 100%;
    max-height: min(100vh - 24px, 100%);
    padding: 16px;
    border-radius: 14px 14px 10px 10px;
  }

  .scanner-video {
    min-height: 320px;
  }

  .receipt-meta {
    text-align: left;
  }
}
