:root {
  --ink: #17212b;
  --muted: #65717f;
  --line: #d9e0e7;
  --paper: #f7f8fa;
  --white: #ffffff;
  --green: #14845f;
  --red: #b83232;
  --amber: #9a6700;
  --blue: #0d62a8;
  --navy: #18304b;
  --pepsi: #d31f36;
  --goodday: #f4c430;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a { color: inherit; }
button, input, textarea, select {
  font: inherit;
}

.campaign-shell {
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(13, 98, 168, .92), rgba(20, 132, 95, .84)),
    radial-gradient(circle at 85% 15%, rgba(244, 196, 48, .55), transparent 28%),
    #0d62a8;
}

.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 40px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px;
  color: var(--white);
}

.brand-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-pill {
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  font-weight: 800;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(42px, 8vw, 88px);
  line-height: .96;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  font-size: 20px;
  line-height: 1.5;
  margin: 24px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
}

.btn.secondary {
  background: var(--white);
  color: var(--ink);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.compact {
  min-height: 34px;
  padding: 8px 10px;
}

.btn.approve {
  background: var(--green);
}

.btn.danger {
  background: var(--red);
}

.receipt-board {
  background: rgba(255,255,255,.95);
  color: var(--ink);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
}

.receipt-board h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

.journey {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.journey b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
}

.below-fold {
  background: var(--white);
  padding: 28px 24px 56px;
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

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

.info-card, .panel, .entry-row {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.info-card h3, .panel h2 {
  margin: 0 0 8px;
}

.admin-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: var(--white);
  padding: 22px;
}

.sidebar h1 {
  font-size: 18px;
  margin: 0 0 24px;
}

.sidebar a {
  display: block;
  padding: 10px 0;
  color: rgba(255,255,255,.86);
  text-decoration: none;
}

.sidebar a.active {
  color: var(--white);
  font-weight: 900;
}

.admin-menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
  padding: 10px;
  cursor: pointer;
}

.admin-menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
  border-radius: 999px;
}

.admin-main {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

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

.metric {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.metric b {
  display: block;
  font-size: 26px;
  margin-top: 6px;
}

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

.chart-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.chart-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.chart-card h2 {
  margin: 0;
  font-size: 18px;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
}

.bar-row__label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row__track {
  height: 10px;
  border-radius: 999px;
  background: var(--paper);
  overflow: hidden;
}

.bar-row__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.bar-row__value {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.pie-wrap {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.pie-donut {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.pie-donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: inherit;
  background: var(--white);
}

.pie-donut span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.pie-legend {
  display: grid;
  gap: 9px;
}

.pie-legend__row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.pie-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.pie-legend__row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pie-legend__row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, .8fr);
  gap: 16px;
}

.panel {
  margin-bottom: 16px;
}

.table-panel {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}

.table-panel table {
  width: max-content;
  min-width: 100%;
  background: var(--white);
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 1;
}

td strong {
  display: block;
  line-height: 1.3;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

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

tbody tr:hover td {
  background: #fbfcfd;
}

.entry-table-row {
  cursor: pointer;
}

.entry-table-row:focus-visible td {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.pagination-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-page {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

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

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

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--white);
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.full { grid-column: 1 / -1; }

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check-row input {
  width: auto;
}

.entry-list {
  display: grid;
  gap: 10px;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status.approved { background: #dff5ec; color: var(--green); }
.status.rejected { background: #ffe3e3; color: var(--red); }
.status.pending_review { background: #fff0c2; color: var(--amber); }
.status.pending { background: #e8eef5; color: var(--navy); }

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

.entry-actions {
  margin-top: 10px;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.review-actions .btn {
  min-width: 112px;
}

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

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.detail-item:last-child {
  border-bottom: 0;
}

.detail-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.full-span {
  grid-column: 1 / -1;
}

.ocr-block {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  max-height: 280px;
  overflow: auto;
}

.qr-box {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: center;
  padding: 12px;
}

.qr-box img {
  max-width: 190px;
}

.test-form {
  display: grid;
  gap: 10px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(24, 48, 75, .96), rgba(13, 98, 168, .86)),
    var(--navy);
}

.login-panel {
  width: min(440px, 100%);
  background: var(--white);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0,0,0,.26);
}

.login-panel h1 {
  margin: 6px 0 8px;
}

.login-kicker {
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}

.receipt-dialog {
  border: 0;
  border-radius: 8px;
  width: min(900px, calc(100vw - 32px));
  padding: 16px;
}

.receipt-dialog::backdrop {
  background: rgba(0,0,0,.55);
}

.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.receipt-dialog img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #f1f4f7;
  border-radius: 8px;
}

.terms-page {
  min-height: 100vh;
  padding: 32px 20px;
  background: var(--paper);
}

.terms-panel {
  max-width: 840px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.terms-panel h1 {
  margin: 12px 0 22px;
}

.terms-panel h2 {
  margin-top: 22px;
}

.terms-panel p {
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .hero,
  .dashboard-grid,
  .grid-3,
  .metrics,
  .chart-grid,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 28px;
  }

  .admin-body {
    display: block;
  }

  .admin-menu-toggle {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 35;
    width: min(280px, 82vw);
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 18px 0 44px rgba(0,0,0,.2);
  }

  .menu-open .sidebar {
    transform: translateX(0);
  }

  .admin-main {
    padding: 72px 16px 16px;
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions > * {
    flex: 1 1 auto;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .table-panel {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .entries-table {
    min-width: 0;
    width: 100%;
  }

  .entries-table thead {
    display: none;
  }

  .entries-table,
  .entries-table tbody,
  .entries-table tr,
  .entries-table td {
    display: block;
  }

  .entries-table tr {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px 12px;
  }

  .entries-table td {
    border-bottom: 0;
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 10px;
    padding: 7px 0;
  }

  .entries-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .detail-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .chart-card__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 82px minmax(0, 1fr) 30px;
  }

  .pie-wrap {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .pie-donut {
    width: 104px;
  }

  .pie-donut::after {
    inset: 22px;
  }
}
