:root {
  --blue: #1e5ea8;
  --blue-dark: #143f72;
  --blue-soft: #e8f0fb;
  --text: #1a1f2b;
  --muted: #5c677d;
  --border: #d7dfea;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(20, 63, 114, 0.08);
  --maxw: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.5;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.shell {
  width: min(100% - 1.25rem, var(--maxw));
  margin-inline: auto;
}

.topbar {
  background: linear-gradient(90deg, var(--blue-dark), var(--blue));
  color: #fff;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand a {
  color: #fff;
  text-decoration: none;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.nav-actions a {
  color: rgba(255, 255, 255, 0.95);
}

.chip-user {
  background: rgba(255, 255, 255, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 180px;
}

.chip-user-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-user-icon {
  display: none;
  line-height: 0;
}

@media (max-width: 640px) {
  .chip-user {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
  }

  .chip-user-text {
    display: none;
  }

  .chip-user-icon {
    display: inline-flex;
  }
}

main {
  flex: 1;
  padding: 1rem 0 2.5rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0 1.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

@media (min-width: 640px) {
  .panel {
    padding: 1.35rem;
  }
}

.hero {
  background: radial-gradient(circle at 20% 20%, rgba(30, 94, 168, 0.12), transparent 45%), var(--blue-soft);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.35rem, 4vw, 2.75rem);
  border: 1px solid rgba(30, 94, 168, 0.15);
}

.hero h1 {
  margin-top: 0;
  letter-spacing: -0.03em;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

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

.grid-cards {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

.card-link {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.card-thumb {
  aspect-ratio: 16/10;
  background: linear-gradient(180deg, rgba(232, 240, 251, 0.95), rgba(232, 240, 251, 0.25));
}

.card-body {
  padding: 0.85rem 1rem 1rem;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

a.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.88;
  transform: none;
}

.btn-primary {
  background: linear-gradient(90deg, var(--blue-dark), var(--blue));
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue-soft);
}

.btn-block {
  width: 100%;
}

.btn-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

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

.forms label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.forms input:not([type='checkbox']),
.forms select,
.forms textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.85rem;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}

.forms select {
  -webkit-appearance: menulist;
  appearance: menulist;
}

.forms select option {
  color: #111827;
  background: #ffffff;
}

.flash {
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin: 1rem auto;
}

.flash-success {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.flash-danger {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.35);
}

.flash-warning {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem;
  vertical-align: top;
  font-size: 0.93rem;
}

th {
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

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

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
}

.split.dashboard-hero {
  align-items: flex-start;
  gap: 1rem 1.25rem;
}

.balance-pop-card {
  flex: 0 1 auto;
  min-width: min(100%, 11.5rem);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(155deg, #fff 0%, var(--blue-soft) 55%, #eef5fd 100%);
  border: 1px solid rgba(30, 94, 168, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 32px rgba(20, 63, 114, 0.14),
    0 4px 12px rgba(20, 63, 114, 0.08);
  transform: translateY(-2px);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: right;
}

.balance-pop-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.balance-pop-amount {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--blue-dark);
  line-height: 1.15;
}

.balance-pop-currency {
  font-size: 0.82em;
  font-weight: 700;
  color: var(--blue);
}

@media (max-width: 560px) {
  .split.dashboard-hero {
    flex-direction: column;
  }

  .balance-pop-card {
    width: 100%;
    text-align: left;
  }
}

hr.soft {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* --- Home landing page --- */

.home-page {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.home-badge {
  display: inline-flex;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(30, 94, 168, 0.2);
  border-radius: 999px;
}

.home-hero {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: center;
}

@media (min-width: 900px) {
  .home-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  }
}

.home-hero-lead {
  max-width: 38rem;
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  line-height: 1.6;
}

.home-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 1.35rem 0 1rem;
}

@media (max-width: 420px) {
  .home-hero-stats {
    grid-template-columns: 1fr;
  }
}

.home-stat {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(30, 94, 168, 0.14);
}

.home-stat strong {
  display: block;
  font-size: 0.92rem;
  color: var(--blue-dark);
}

.home-stat span {
  font-size: 0.78rem;
  color: var(--muted);
}

.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1rem;
}

.home-cta-row--end {
  margin-top: 0;
}

.home-microcopy {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Hero abstract cards */
.home-hero-visual {
  position: relative;
  width: 100%;
  min-width: 260px;
  min-height: clamp(220px, 42vw, 320px);
  max-width: 420px;
  margin-inline: auto;
  justify-self: stretch;
}

@media (min-width: 900px) {
  .home-hero-visual {
    margin-inline: 0 auto;
  }
}

.home-visual-card {
  position: absolute;
  border-radius: 16px;
  border: 1px solid rgba(30, 94, 168, 0.2);
}

.home-visual-card--back {
  width: 88%;
  height: 72%;
  right: 0;
  top: 8%;
  z-index: 1;
  background: linear-gradient(145deg, rgba(30, 94, 168, 0.18), rgba(232, 240, 251, 0.5));
}

.home-visual-card--front {
  width: 88%;
  left: 0;
  bottom: 0;
  height: 76%;
  z-index: 2;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 50px rgba(20, 63, 114, 0.15);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.home-visual-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.home-visual-row {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue-soft), rgba(30, 94, 168, 0.25));
  width: 100%;
}

.home-visual-row--short {
  width: 62%;
}

.home-visual-bullets {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.home-visual-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--blue);
  display: inline-block;
}

.home-visual-chip {
  margin-top: auto;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--blue-dark);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--blue-soft);
  align-self: flex-start;
}

@media (max-width: 560px) {
  .home-hero-visual {
    max-width: 100%;
    min-width: 0;
    min-height: 230px;
  }

  .home-visual-card--back,
  .home-visual-card--front {
    width: 94%;
  }
}

.home-pay-strip {
  text-align: center;
}

.home-section-heading {
  margin: 0 0 0.35rem;
  font-size: clamp(1.2rem, 2.8vw, 1.45rem);
  letter-spacing: -0.02em;
}

.home-section-intro {
  margin: 0 0 1rem;
  max-width: 46rem;
}

.home-pay-strip .home-section-intro {
  margin-left: auto;
  margin-right: auto;
}

.home-pay-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin: 1rem 0;
}

.home-pay-pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--blue-soft);
  border: 1px solid rgba(30, 94, 168, 0.15);
  font-size: 0.9rem;
}

.home-pay-pill strong {
  color: var(--blue-dark);
  margin-right: 0.25rem;
}

.home-section {
  margin: 0;
}

.home-feature-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 600px) {
  .home-feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.home-feature-card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.15rem;
  background: #fff;
  box-shadow: 0 4px 20px rgba(20, 63, 114, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-feature-card:hover {
  border-color: rgba(30, 94, 168, 0.35);
  box-shadow: 0 8px 28px rgba(20, 63, 114, 0.1);
}

.home-feature-card h3 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.05rem;
}

.home-feature-card p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.5;
}

.home-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 12px;
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.home-how .home-section-intro {
  margin-bottom: 1.25rem;
}

.home-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .home-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.home-steps li {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), #fff);
}

.home-step-num {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  border-radius: 999px;
}

.home-steps strong {
  display: block;
  margin-bottom: 0.35rem;
}

.home-quote {
  border-left: 4px solid var(--blue);
  background: linear-gradient(90deg, var(--blue-soft), #fff);
}

.home-quote-text {
  margin: 0 0 0.5rem;
  font-size: clamp(1.05rem, 2.5vw, 1.22rem);
  line-height: 1.55;
  font-style: italic;
  color: var(--text);
}

.home-quote footer {
  font-style: normal;
  font-size: 0.9rem;
}

.home-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 42rem;
}

.home-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 1rem;
  background: #fff;
}

.home-faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.65rem 0;
  list-style: none;
}

.home-faq-item summary::-webkit-details-marker {
  display: none;
}

.home-faq-item summary::after {
  content: '+';
  float: right;
  color: var(--blue);
  font-weight: 700;
}

.home-faq-item[open] summary::after {
  content: '−';
}

.home-faq-item p {
  margin: 0 0 1rem;
}

.home-final-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.25rem, 3vw, 1.85rem);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(120deg, var(--blue-dark), var(--blue));
  color: #fff;
  box-shadow: 0 14px 40px rgba(20, 63, 114, 0.35);
}

.home-final-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.home-final-lead {
  margin: 0;
  opacity: 0.92;
  max-width: 36rem;
  line-height: 1.5;
}

.home-final-cta .btn-secondary {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.home-final-cta .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.home-final-cta .btn-primary {
  background: #fff;
  color: var(--blue-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.home-final-cta .btn-primary:hover {
  filter: brightness(1.06);
}

.home-final-cta a {
  text-decoration: none;
}

/* --- Admin dashboard --- */

.admin-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .admin-layout {
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
  }
}

.admin-side-nav {
  position: sticky;
  top: 1rem;
}

.admin-side-nav nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.admin-nav-link {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  background: #fff;
}

.admin-nav-link:hover {
  text-decoration: none;
  border-color: rgba(30, 94, 168, 0.35);
  background: var(--blue-soft);
}

.admin-main-content .grid-cards {
  margin-top: 0.7rem;
}

/* Admin products: category filter — select + actions on one row */
.admin-products-filter.forms label {
  margin-bottom: 0.4rem;
}

.admin-products-filter__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.admin-products-filter.forms .admin-products-filter__row select.admin-products-filter__select {
  flex: 1 1 220px;
  min-width: min(100%, 200px);
  max-width: 32rem;
  width: auto;
  margin-bottom: 0;
}

.admin-products-filter__actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* Shop: purchase confirmation modal */
.purchase-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.purchase-confirm-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.purchase-confirm-card {
  width: min(100%, 420px);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.15rem 1.25rem 1.25rem;
}

.purchase-confirm-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  color: var(--blue-dark);
}

.purchase-confirm-debit {
  margin: 0.75rem 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid rgba(234, 179, 8, 0.45);
  font-size: 0.9rem;
  color: #854d0e;
}

.purchase-confirm-rows {
  margin: 0.5rem 0 0;
  font-size: 0.93rem;
  line-height: 1.55;
}

.purchase-confirm-rows dt {
  color: var(--muted);
  font-weight: 600;
  margin-top: 0.45rem;
}

.purchase-confirm-rows dd {
  margin: 0.15rem 0 0;
}

.purchase-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
  justify-content: flex-end;
}
