:root {
  --surface: #ffffff;
  --background: #f6f0ff;
  --ink: #1f1f2b;
  --ink-subtle: #5a537f;
  --ink-muted: #8c84ad;
  --brand: #453a94;
  --accent: #f36f1e;
}

html,
body {
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 5% 5%, rgba(255, 255, 255, 0.9), transparent 40%),
    radial-gradient(circle at 95% 0%, rgba(255, 196, 234, 0.6), transparent 50%),
    var(--background);
  color: var(--ink);
  min-height: 100%;
}

a {
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253, 249, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(69, 58, 148, 0.08);
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: #453a94;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-icon {
  width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
}

.brand-icon .logo-box {
  fill: #fff;
  stroke: #f36f1e;
  stroke-width: 2;
}

.brand-icon .logo-lid {
  fill: #fff7ef;
  stroke: #f36f1e;
  stroke-width: 2;
}

.brand-icon .logo-line {
  stroke: #453a94;
  stroke-width: 2;
}

.brand-icon .logo-ribbon {
  fill: none;
  stroke: #453a94;
  stroke-width: 2;
}

.nav-link {
  color: #5a537f;
  font-weight: 600;
}

.nav-link:hover {
  color: #f36f1e;
}

.nav-link--dashboard {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(69, 58, 148, 0.22);
  background: rgba(69, 58, 148, 0.08);
  color: #2f2a63;
}

.nav-link--dashboard:hover {
  color: #2f2a63;
  background: rgba(69, 58, 148, 0.16);
  border-color: rgba(69, 58, 148, 0.34);
}

.auth-user-label {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #f7931a, #f36f1e);
  border: none;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(243, 111, 30, 0.3);
  border-radius: 16px;
  padding: 0.75rem 1.5rem;
}

.btn-outline-primary {
  border-color: #453a94;
  color: #453a94;
  font-weight: 600;
  border-radius: 16px;
  padding: 0.65rem 1.5rem;
}

.site-main {
  padding: 2rem 0 4rem;
}

.hero {
  background: radial-gradient(circle at 0% 50%, rgba(69, 58, 148, 0.08), transparent 60%),
    #fff;
  border-radius: 32px;
  padding: 3rem;
  box-shadow: 0 30px 80px rgba(30, 10, 60, 0.08);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #2f2a63;
}

.hero-subtitle {
  font-size: 1.1rem;
  max-width: 32rem;
  color: #584c7c;
}

.hero-card {
  background: #fff6ef;
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid rgba(243, 111, 30, 0.12);
}

.hero-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hero-benefits li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #594f80;
  font-weight: 600;
}

.hero-benefits__icon {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 111, 30, 0.16);
  color: #f36f1e;
  font-size: 0.75rem;
  font-weight: 800;
}

.stats-tile {
  background: #fff;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(45, 23, 80, 0.08);
}

.merchant-link-tile {
  gap: 1rem;
  align-items: center;
  border: 1px solid rgba(69, 58, 148, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: inherit;
}

.merchant-link-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 45px rgba(45, 23, 80, 0.12);
}

.merchant-link-tile__logo {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #f1ecff;
}

.merchant-link-tile__logo--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #453a94;
  font-size: 1.25rem;
}

.merchant-link-tile__name {
  color: #2f2a63;
}

.merchant-preview-link {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.6rem;
  align-items: start;
  background: #fff;
  border-radius: 24px;
  padding: 1.35rem;
  border: 1px solid rgba(69, 58, 148, 0.1);
  box-shadow: 0 14px 38px rgba(45, 23, 80, 0.08);
  color: inherit;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.merchant-preview-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(45, 23, 80, 0.14);
}

.merchant-preview-link__logo-wrap {
  border-radius: 16px;
  padding: 0;
  background: transparent;
}

.merchant-preview-link__logo {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
}

.merchant-preview-link__logo--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #453a94;
}

.merchant-preview-link__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  font-weight: 800;
  color: #9a90c9;
}

.merchant-preview-link__name {
  color: #2f2a63;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 700;
}

.merchant-preview-link__address {
  color: #5d5388;
  font-size: 1.15rem;
}

.merchant-preview-link__description {
  color: #5a537f;
  line-height: 1.5;
  font-size: 1.05rem;
}

@media (max-width: 768px) {
  .merchant-preview-link {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .merchant-preview-link__logo-wrap {
    max-width: 220px;
  }

  .merchant-preview-link__address {
    font-size: 1rem;
  }
}

.feature-card {
  background: #fff;
  border-radius: 18px;
  padding: 1.25rem;
  border: 1px solid rgba(69, 58, 148, 0.08);
}

.feature-card__icon {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, rgba(69, 58, 148, 0.12), rgba(243, 111, 30, 0.16));
  color: #3d317f;
}

.feature-card__icon-svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.feature-card__icon-stroke {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-description {
  color: var(--ink-subtle);
  font-size: 0.95rem;
}

.dashboard-page {
  position: relative;
}

.card-surface {
  background: var(--surface);
  border-radius: 32px;
  padding: 2.5rem;
  box-shadow: 0 35px 90px rgba(53, 20, 88, 0.08);
  border: 1px solid rgba(69, 58, 148, 0.08);
}

.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 229, 255, 0.85));
}

.dashboard-hero__profile {
  flex: 1 1 480px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-hero__aside {
  flex: 0 0 200px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.hero-header {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.hero-logo,
.merchant-info-card__logo--tall {
  height: 96px;
  width: auto;
  max-width: 220px;
  border-radius: 16px;
  object-fit: contain;
  object-position: left center;
  background: #f1ecff;
  box-shadow: 0 15px 40px rgba(33, 21, 70, 0.15);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 700;
  color: #b1a8d8;
  margin-bottom: 0.65rem;
}

.merchant-name {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #2f2a63;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.hero-hint {
  color: #726a95;
  font-size: 0.95rem;
}

.hero-address,
.hero-description {
  color: #5a537f;
  font-size: 0.95rem;
}

.hero-bank {
  color: #5a537f;
  font-weight: 600;
}

.btn-ghost {
  background: rgba(69, 58, 148, 0.08);
  border-radius: 999px;
  color: #2c2369;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
}

.btn-ghost:hover {
  background: rgba(69, 58, 148, 0.15);
  color: #21194a;
}

.hero-link-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid rgba(69, 58, 148, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.hero-link-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.hero-small-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.16em;
}

.copy-input {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.copy-input__field {
  flex: 1;
  border-radius: 18px;
  border: 1px solid rgba(69, 58, 148, 0.12);
  background: #f7f3ff;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  color: #2f2a63;
}

.copy-input__field:focus {
  outline: 2px solid rgba(69, 58, 148, 0.3);
}

.btn-outline-copy {
  border-radius: 18px;
  border: 1px solid var(--brand);
  color: var(--brand);
  font-weight: 700;
  padding: 0.85rem 1.4rem;
  background: transparent;
}

.btn-outline-copy:hover {
  background: var(--brand);
  color: #fff;
}

.slug-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #eee6ff;
  color: #574c8f;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-text {
  color: var(--brand);
  font-weight: 600;
  padding: 0.35rem 0;
}

.btn-text:hover {
  color: #2c2369;
  text-decoration: underline;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  background: #fff6ef;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(243, 111, 30, 0.2);
  color: var(--accent);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: none;
  background: rgba(69, 58, 148, 0.12);
  color: var(--brand);
}

.status-chip--warning {
  background: rgba(243, 111, 30, 0.15);
  color: #d25f00;
}

.status-chip--success {
  background: rgba(52, 199, 142, 0.2);
  color: #1f8a4c;
}

.status-chip--muted {
  background: rgba(136, 130, 170, 0.2);
  color: #6d678f;
}

.voucher-status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.voucher-status-filter__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(69, 58, 148, 0.2);
  background: #f7f3ff;
  color: #4a4187;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.18s ease;
}

.voucher-status-filter__btn:hover {
  background: #ede7ff;
  border-color: rgba(69, 58, 148, 0.34);
  color: #2f2a63;
}

.voucher-status-filter__btn.is-active {
  background: linear-gradient(135deg, #f7931a, #f36f1e);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(243, 111, 30, 0.28);
}

.slim-table table {
  width: 100%;
  color: #3b3566;
}

.slim-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--ink-muted);
  border-bottom: 1px solid rgba(69, 58, 148, 0.12);
}

.table-sort-link {
  color: inherit;
  text-decoration: none;
}

.table-sort-link:hover {
  color: var(--brand);
}

.slim-table tbody td {
  border-bottom: 1px solid rgba(69, 58, 148, 0.08);
}

.voucher-row--ordered td {
  background: rgba(243, 111, 30, 0.06);
}

.voucher-row--active td {
  background: rgba(52, 199, 142, 0.08);
}

.voucher-row--redeemed td {
  background: rgba(136, 130, 170, 0.11);
}

.slim-table tbody tr:last-child td {
  border-bottom: none;
}

.btn-xs {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 999px;
}

.voucher-history-row td {
  background: #f9f7ff;
}

.voucher-history-list {
  margin: 0;
  padding-left: 1rem;
}

.voucher-history-list li + li {
  margin-top: 0.45rem;
}

.qr-scan-panel {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 22px;
  border: 1px solid rgba(69, 58, 148, 0.14);
  background: #faf7ff;
}

.qr-scan-stage {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
}

.qr-scan-video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-scan-video.is-active {
  display: block;
}

.qr-scan-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d8d3ef;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12), transparent 45%), #171327;
}

.order-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-card__subtitle {
  color: #5a537f;
  font-size: 1rem;
  line-height: 1.5;
}

.order-status {
  border-radius: 18px;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.order-status--demo {
  background: rgba(243, 111, 30, 0.12);
  color: #c4560f;
}

.order-status--active {
  background: rgba(69, 58, 148, 0.12);
  color: #2c2369;
}

.merchant-info-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.merchant-info-card__header {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.merchant-info-card__logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  background: #f1ecff;
}

.merchant-info-card__logo.merchant-info-card__logo--tall {
  height: 96px;
  width: auto;
  max-width: 220px;
  border-radius: 16px;
  object-fit: contain;
  object-position: left center;
  background: #f1ecff;
  box-shadow: 0 15px 40px rgba(33, 21, 70, 0.15);
}

.voucher-bg-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: 18px;
  padding: 0.6rem;
  border: 2px solid transparent;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
  text-align: center;
  font-weight: 600;
  color: #453a94;
  position: relative;
  overflow: hidden;
}

.voucher-bg-card img {
  border-radius: 14px;
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.voucher-bg-card__badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: #f36f1e;
  color: #fff;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.btn-check:checked + .voucher-bg-card {
  border-color: #f36f1e;
  transform: translateY(-4px);
}

.merchant-bg-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.merchant-bg-card {
  border-radius: 18px;
  border: 1px dashed rgba(69, 58, 148, 0.2);
  padding: 0.75rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.merchant-bg-card img {
  border-radius: 14px;
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.merchant-bg-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
  color: var(--ink-subtle);
}

.file-upload-control {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.file-upload-control__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-upload-control__filename {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.merchant-info-card__address {
  color: var(--ink-subtle);
  margin-bottom: 0;
}

.merchant-info-card__description {
  color: var(--ink-subtle);
  margin-bottom: 0;
}

.merchant-info-list {
  margin: 0;
}

.merchant-info-list dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
}

.merchant-info-list dd {
  margin-bottom: 0.75rem;
  font-weight: 600;
}

@media (max-width: 992px) {
  .site-header nav {
    gap: 0.75rem;
  }

  .nav-items {
    gap: 1rem !important;
    min-width: 0;
  }

  .nav-link--dashboard {
    padding: 0.35rem 0.7rem;
  }

  .auth-user-label {
    display: none !important;
  }

  .btn-logout {
    min-width: 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-logout .d-md-inline {
    display: none !important;
  }

  .btn-logout .d-md-none {
    display: inline-flex !important;
  }

  .dashboard-hero {
    flex-direction: column;
  }

  .dashboard-hero__aside {
    width: 100%;
    justify-content: flex-start;
  }

  .copy-input {
    flex-direction: column;
  }

  .btn-outline-copy,
  .copy-input__field {
    width: 100%;
  }
}

.voucher-picker button {
  border-radius: 999px;
  border: 1px solid rgba(69, 58, 148, 0.15);
  padding: 0.6rem 1.5rem;
  background: transparent;
  font-weight: 600;
  color: #453a94;
}

.voucher-picker button.active {
  background: #453a94;
  color: #fff;
  box-shadow: 0 12px 20px rgba(69, 58, 148, 0.3);
}

.voucher-preview-panel {
  background: #fff;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(33, 21, 70, 0.08);
  border: 1px solid rgba(69, 58, 148, 0.05);
}

.voucher-preview {
  width: 100%;
  max-width: 520px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.voucher-preview__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(45, 21, 6, 0.25);
}

.voucher-preview-card-shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.voucher-preview-card-shell > div {
  width: 100%;
}



.site-footer {
  background: #120f2d;
  color: #fff;
  padding: 2rem 0;
}

@media (max-width: 768px) {
  .site-header nav {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .hero-header,
  .merchant-info-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .hero-header > div,
  .merchant-info-card__header > div {
    width: 100%;
  }

  .hero-logo,
  .merchant-info-card__logo.merchant-info-card__logo--tall {
    max-width: min(56vw, 160px);
    max-height: 72px;
    height: auto;
  }

  .brand {
    font-size: 1.1rem;
  }

  .brand-icon {
    width: 2rem;
    height: 2rem;
  }

  .auth-controls {
    margin-left: auto;
    min-width: 0;
  }

  .btn-logout {
    min-width: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .vouchers-card .table-responsive {
    overflow-x: clip;
  }

  .slim-table table {
    table-layout: fixed;
  }

  .slim-table th,
  .slim-table td {
    padding: 0.5rem 0.4rem;
    font-size: 0.84rem;
    vertical-align: middle;
    overflow: hidden;
  }

  .slim-table .voucher-col-code {
    width: 30%;
  }

  .slim-table .voucher-col-amount {
    width: 24%;
  }

  .slim-table .voucher-col-status {
    width: 20%;
  }

  .slim-table .voucher-col-created,
  .slim-table .voucher-col-updated {
    display: none;
  }

  .slim-table .voucher-col-actions {
    width: 6.2rem;
  }

  .slim-table .voucher-cell-code {
    display: block;
    max-width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.01em;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
  }

  .slim-table .voucher-cell-amount,
  .slim-table .voucher-cell-status {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
  }

  .slim-table td.voucher-col-actions .d-inline-flex {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .slim-table .btn-xs {
    width: 100%;
    padding: 0.3rem 0.55rem;
    font-size: 0.74rem;
  }
}