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

body {
  background: #0f0f0f;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
}

h1, h2, h3, h4, .bebas {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.03em;
}

a { color: #f5a623; }
a:hover { color: #e09518; }

/* ── Layout ───────────────────────────────────────────────────── */
.page-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ── Flash messages ───────────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 90%;
  max-width: 500px;
  pointer-events: none;
}

.flash {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  pointer-events: auto;
}

.flash-success {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid #4ade80;
  color: #4ade80;
}

.flash-danger {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid #f87171;
  color: #f87171;
}

/* ── Colour helpers ───────────────────────────────────────────── */
.credit-text  { color: #4ade80; }
.debit-text   { color: #f87171; }
.amber-text   { color: #f5a623; }
.muted-text   { color: #888; }

/* ── Cards ────────────────────────────────────────────────────── */
.du-card {
  background: #1c1c1e;
  border: 1px solid #2a2a2d;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

/* ── Balance card ─────────────────────────────────────────────── */
.balance-hero {
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.balance-credit {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid #4ade80;
}

.balance-debit {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid #f87171;
}

.balance-zero {
  background: rgba(255,255,255,0.04);
  border: 1px solid #333;
}

.balance-amount {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 4px;
}

.balance-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-amber {
  display: block;
  width: 100%;
  background: #f5a623;
  color: #000 !important;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-amber:hover { background: #e09518; }

.btn-outline-danger-sm {
  background: transparent;
  border: 1px solid #f87171;
  color: #f87171;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-outline-danger-sm:hover { background: rgba(248,113,113,0.12); }

.btn-outline-amber-sm {
  background: transparent;
  border: 1px solid #f5a623;
  color: #f5a623;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-outline-amber-sm:hover { background: rgba(245,166,35,0.1); }

.btn-outline-success-sm {
  background: transparent;
  border: 1px solid #4ade80;
  color: #4ade80;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-outline-success-sm:hover { background: rgba(74,222,128,0.1); }

/* ── App header ───────────────────────────────────────────────── */
.occasion-tag {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: #f5a623;
  margin-bottom: 2px;
}

.greeting {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.6rem;
  line-height: 1;
  margin: 0 0 20px;
}

.section-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ── Entry cards ──────────────────────────────────────────────── */
.entry-desc {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.entry-meta {
  font-size: 0.83rem;
  color: #888;
  margin-bottom: 2px;
}

.entry-net {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 6px;
}

/* ── Back link ────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #f5a623;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.back-link:hover { color: #e09518; }

/* ── Form inputs ──────────────────────────────────────────────── */
.du-input {
  background: #1c1c1e;
  border: 1px solid #3a3a3d;
  color: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  width: 100%;
  display: block;
}

.du-input:focus {
  outline: none;
  border-color: #f5a623;
  box-shadow: 0 0 0 2px rgba(245,166,35,0.2);
}

.du-input::placeholder { color: #555; }

.amount-input {
  font-size: 2rem;
  font-weight: 700;
}

.form-label-du {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: #aaa;
  margin-bottom: 8px;
  display: block;
}

/* ── Beneficiary checkboxes ───────────────────────────────────── */
.cb-list {
  background: #1c1c1e;
  border: 1px solid #2a2a2d;
  border-radius: 10px;
  overflow: hidden;
}

.cb-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #2a2a2d;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.1s;
}

.cb-row:last-child { border-bottom: none; }
.cb-row:hover { background: #252528; }

.cb-row input[type=checkbox] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  accent-color: #f5a623;
  flex-shrink: 0;
  cursor: pointer;
}

.cb-name {
  flex: 1;
  font-size: 0.95rem;
}

.cb-you {
  font-size: 0.75rem;
  color: #f5a623;
  margin-left: 6px;
}

.cb-amt {
  font-size: 0.9rem;
  color: #f5a623;
  font-weight: 600;
  min-width: 64px;
  text-align: right;
}

/* ── Live summary box ─────────────────────────────────────────── */
.summary-box {
  background: #1c1c1e;
  border: 1px solid #2a2a2d;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
  font-size: 0.92rem;
  line-height: 2;
}

.summary-box span { font-weight: 700; color: #f5a623; }

/* ── Admin nav ────────────────────────────────────────────────── */
.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid #2a2a2d;
  margin-bottom: 28px;
}

.admin-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: #f5a623;
  margin: 0;
  line-height: 1;
}

/* ── Balance grid (admin) ─────────────────────────────────────── */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}

.person-bal-card {
  background: #1c1c1e;
  border: 1px solid #2a2a2d;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}

.person-bal-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.person-bal-net {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ── Dark table (admin) ───────────────────────────────────────── */
.dark-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.dark-table th {
  background: #1c1c1e;
  color: #888;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #2a2a2d;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
}

.dark-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1c1c1e;
  vertical-align: top;
  color: #ddd;
}

.dark-table tr:hover td { background: #1a1a1c; }

.total-row {
  background: #0f0f0f;
  font-size: 0.85rem;
  color: #888;
}

/* ── Admin login ──────────────────────────────────────────────── */
.login-box {
  max-width: 380px;
  margin: 80px auto 0;
  padding: 0 16px;
}

/* ── Breakdown panels (public summary) ───────────────────────── */
.breakdown-panel {
  border-radius: 10px;
  overflow: hidden;
}

.breakdown-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  background: #1c1c1e;
  border: 1px solid #2a2a2d;
  border-radius: 10px;
  color: #fff;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  min-height: 52px;
  transition: background 0.15s;
  gap: 0;
}

.breakdown-toggle:hover,
.breakdown-toggle-open {
  background: #252528;
  border-color: #f5a623;
}

.breakdown-toggle-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  flex: 1;
}

.breakdown-toggle-net {
  font-size: 1rem;
  font-weight: 700;
  margin-right: 12px;
}

.breakdown-chevron {
  font-size: 1.1rem;
  color: #666;
  transition: transform 0.2s;
  line-height: 1;
  flex-shrink: 0;
}

.breakdown-body {
  background: #161618;
  border: 1px solid #2a2a2d;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 14px 16px;
}

.breakdown-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.breakdown-row {
  padding: 8px 0;
  border-bottom: 1px solid #222;
}

.breakdown-row:last-child { border-bottom: none; }

.breakdown-row-desc {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 3px;
}

.breakdown-row-meta {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.5;
}

.breakdown-summary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #2a2a2d;
  font-size: 0.85rem;
  line-height: 1.9;
  color: #aaa;
}

/* ── Landing page ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #0f0f0f 0%, #1a1408 60%, #0f0f0f 100%);
  padding: 60px 16px 80px;
  text-align: center;
}

.hero-inner {
  max-width: 560px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: #f5a623;
  margin-bottom: 12px;
}

.hero-headline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 10vw, 5.5rem);
  line-height: 0.95;
  color: #fff;
  margin: 0 0 24px;
  letter-spacing: 0.02em;
}

.hero-sub {
  font-size: 1.05rem;
  color: #aaa;
  line-height: 1.6;
  max-width: 440px;
  margin: 0 auto 36px;
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 340px;
  margin: 0 auto;
}

.hero-cta-primary {
  font-size: 1.15rem;
  padding: 16px 24px;
}

.btn-outline-hero {
  display: block;
  width: 100%;
  background: transparent;
  border: 2px solid #3a3a3d;
  color: #aaa;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  padding: 14px 24px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-outline-hero:hover {
  border-color: #f5a623;
  color: #f5a623;
}

/* ── How It Works ─────────────────────────────────────────────────── */
.how-it-works {
  padding: 60px 16px;
  border-top: 1px solid #1a1a1d;
}

.section-container {
  max-width: 680px;
  margin: 0 auto;
}

.section-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  text-align: center;
  color: #fff;
  margin-bottom: 36px;
  letter-spacing: 0.04em;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.step-card {
  background: #1c1c1e;
  border: 1px solid #2a2a2d;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}

.step-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.step-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: #f5a623;
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.step-desc {
  font-size: 0.88rem;
  color: #888;
  line-height: 1.5;
  margin: 0;
}

/* ── Features grid ────────────────────────────────────────────────── */
.features-section {
  padding: 60px 16px;
  border-top: 1px solid #1a1a1d;
  background: #0a0a0a;
}

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

@media (min-width: 480px) {
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feature-item {
  background: #1c1c1e;
  border: 1px solid #2a2a2d;
  border-radius: 12px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.feature-icon {
  font-size: 1.6rem;
}

.feature-text {
  font-size: 0.8rem;
  color: #ccc;
  font-weight: 600;
}

/* ── Pricing card ─────────────────────────────────────────────────── */
.pricing-section {
  padding: 60px 16px;
  border-top: 1px solid #1a1a1d;
}

.pricing-card {
  background: #1c1c1e;
  border: 2px solid #f5a623;
  border-radius: 20px;
  padding: 36px 28px;
  max-width: 360px;
  margin: 0 auto;
  text-align: center;
}

.pricing-amount {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 5rem;
  color: #f5a623;
  line-height: 1;
  margin-bottom: 4px;
}

.pricing-per {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pricing-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-size: 0.92rem;
  color: #ccc;
  line-height: 2.2;
}

.pricing-list li { color: #ccc; }

/* ── Landing footer ───────────────────────────────────────────────── */
.landing-footer {
  background: #0a0a0a;
  border-top: 1px solid #1a1a1d;
  padding: 24px 16px;
}

.footer-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  font-size: 0.82rem;
  color: #555;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  font-size: 0.82rem;
  color: #888;
  text-decoration: none;
}

.footer-links a:hover { color: #f5a623; }

/* ── Subscriber nav ───────────────────────────────────────────────── */
.sub-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.sub-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid #2a2a2d;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 10px;
}

.sub-nav-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: #f5a623;
  letter-spacing: 0.08em;
}

.sub-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Occasion cards (subscriber dashboard) ────────────────────────── */
.occ-card {
  background: #1c1c1e;
  border: 1px solid #2a2a2d;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}

.occ-card:hover { border-color: #3a3a3d; }

.occ-card-frozen {
  border-color: rgba(248, 113, 113, 0.3);
}

.occ-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}

.occ-card-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: #fff;
  line-height: 1.1;
}

.occ-card-tagline {
  font-size: 0.82rem;
  color: #f5a623;
  margin-top: 2px;
}

.occ-card-desc {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 10px;
}

.occ-card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

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

.badge-frozen {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #f87171;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 20px;
}

.badge-unpaid {
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.4);
  color: #f5a623;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── Auth pages ───────────────────────────────────────────────────── */
.auth-box {
  max-width: 400px;
  margin: 40px auto 0;
}

.auth-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  color: #f5a623;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: 0.88rem;
  color: #888;
}

.auth-links a { color: #f5a623; }

/* ── Token management ─────────────────────────────────────────────── */
.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #1c1c1e;
  border: 1px solid #2a2a2d;
  border-radius: 10px;
  margin-bottom: 8px;
  gap: 10px;
}

.token-row-left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.inline-edit {
  background: transparent;
  border: none;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
  width: 100%;
  min-width: 0;
  transition: border 0.15s, background 0.15s;
}

.inline-edit:focus {
  outline: none;
  background: #252528;
  border: 1px solid #f5a623;
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.15);
}

.inline-edit:not(:focus) {
  cursor: pointer;
}

.token-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #2a2a2d;
}

/* ── mb-4 utility (missing from base) ────────────────────────────── */
.mb-4 { margin-bottom: 1.5rem; }
