/* =======================================================
  JUEZ IA PRE — Design System
  Paleta: Verde oscuro forestal + Dorado ANCCE
   Tipografía: Cinzel (títulos) + Lato (cuerpo)
   ======================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Lato:wght@300;400;700&display=swap');

/* ---------- Critical Rendering Optimizations ---------- */
/* font-display:swap is already set via Google Fonts URL parameter (&display=swap) */
/* No @font-face needed — fonts loaded via @import */

/* Contain property helps with layout thrashing */
.navbar, .card, .score-card, .horse-card {
  contain: layout style;
}

/* content-visibility: auto removed from img — causes CLS without intrinsic size */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Backgrounds */
  --bg-base:        #080f08;
  --bg-primary:     #0b160b;
  --bg-secondary:   #0f1f0f;
  --bg-card:        #141f14;
  --bg-card-alt:    #1a2a1a;
  --bg-input:       #101e10;

  /* Gold */
  --gold:           #C9A84C;
  --gold-light:     #D9BE73;
  --gold-dark:      #A8893A;
  --gold-dim:       rgba(201, 168, 76, 0.12);
  --gold-border:    rgba(201, 168, 76, 0.25);

  /* Text */
  --text-primary:   #f4f4f0;
  --text-secondary: #a8bfa8;
  --text-muted:     #6a846a;
  --text-gold:      #C9A84C;

  /* Score / status */
  --green-bright:   #4ade80;
  --green-mid:      #22c55e;
  --green-dim:      rgba(74, 222, 128, 0.15);

  /* Badges */
  --badge-hembra:   #7c3aed;
  --badge-macho:    #1e40af;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.06);
  --border-gold:    rgba(201, 168, 76, 0.3);

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Nav */
  --nav-h: 65px;

  /* Transitions */
  --t: 0.25s ease;
  --t-slow: 0.45s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; }

/* ---------- Typography ---------- */
.font-serif    { font-family: 'Cinzel', serif; }
h1, h2, h3, .heading { font-family: 'Cinzel', serif; }

.page-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text-primary);
}

.page-title span { color: var(--gold); }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: rgba(8, 15, 8, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.navbar-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.navbar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}

.navbar-brand-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.navbar-brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  list-style: none;
}

.navbar-nav a {
  padding: 7px 16px;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: var(--t);
  white-space: nowrap;
}

.navbar-nav a:hover { color: var(--text-primary); background: var(--gold-dim); }
.navbar-nav a.active {
  background: var(--gold);
  color: #000;
  font-weight: 700;
}

.navbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.navbar-mobile-panel {
  display: none;
  width: 100%;
}

.navbar-mobile-links {
  list-style: none;
}

.navbar-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.credits-display-mobile {
  width: fit-content;
}

.credits-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--r-md);
  font-size: 0.8rem;
}

.credits-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.credits-display .plan-badge {
  display: inline-block;
  padding: 0;
  border-radius: 0;
  border: none;
  background: none;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

.btn-nav-auth {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--gold-border);
  border-radius: var(--r-md);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: var(--t);
}

.btn-nav-auth:hover {
  background: var(--gold);
  color: #000;
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-base);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 48% at 50% 56%, rgba(12, 30, 12, 0.28) 0%, transparent 72%),
    linear-gradient(180deg, rgba(8,15,8,0.56) 0%, rgba(8,15,8,0.18) 42%, rgba(8,15,8,0.68) 100%);
  z-index: 1;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0.42;
  filter: saturate(0.92) brightness(0.82) blur(0.4px);
  transform: scale(1.03);
  z-index: 0;
}

/* Fallback gradient when no image */
.hero-bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(26, 63, 26, 0.68) 0%, rgba(10, 26, 10, 0.42) 55%, rgba(6, 14, 6, 0.78) 100%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(2rem, 6vw, 4rem) 1rem;
  max-width: 780px;
  width: 100%;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

.hero-title .accent { color: var(--gold); }

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.hero-eyebrow,
.section-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.hero-actions-center {
  margin-top: 0;
}

.hero-note {
  max-width: 700px;
  margin: 1.2rem auto 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.hero-access-note {
  max-width: 720px;
  margin: 1rem auto 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.hero-pre-note {
  max-width: 720px;
  margin: 1rem auto 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

.hero-pre-note strong {
  color: var(--gold-light);
  font-weight: 700;
}

.hero-trustbar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.trust-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(8, 15, 8, 0.45);
  border: 1px solid var(--gold-border);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.hero-search {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  background: rgba(15, 25, 15, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-lg);
  overflow: hidden;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero-search input {
  flex: 1;
  padding: 14px 20px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Lato', sans-serif;
  min-width: 0;
}

.hero-search input::placeholder { color: var(--text-muted); }

.hero-search .btn-search {
  padding: 12px 28px;
  background: var(--gold);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  border: none;
  transition: var(--t);
  flex-shrink: 0;
}

.hero-search .btn-search:hover { background: var(--gold-light); }

/* ---------- Sections ---------- */
.section {
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 5vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
}

.section-full {
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 5vw, 3rem);
  background: var(--bg-secondary);
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--text-primary);
}

.section-title .accent { color: var(--gold); }

.home-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.premium-section {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.premium-section-header {
  max-width: 760px;
}

.premium-grid,
.signal-grid,
.pricing-intro-grid,
.legal-grid,
.auth-shell {
  display: grid;
  gap: 18px;
}

.premium-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.premium-card,
.signal-card,
.pricing-intro-panel,
.auth-aside,
.legal-card,
.legal-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

.premium-card {
  padding: 1.4rem;
  transition: var(--t-slow);
}

.premium-card:hover {
  border-color: var(--gold-border);
  transform: translateY(-3px);
  background: var(--bg-card-alt);
}

.premium-card-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.7rem;
}

.premium-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.08rem;
  margin-bottom: 0.75rem;
}

.premium-card-copy,
.pricing-intro-copy,
.legal-hero-copy,
.legal-card p,
.auth-helper-text,
.auth-aside-list,
.auth-aside-stat span {
  color: var(--text-secondary);
}

.signal-section-inner {
  padding: 0;
}

.signal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.signal-card {
  padding: 1.4rem;
  text-align: center;
}

.signal-value {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.signal-label {
  color: var(--text-secondary);
}

.privacy-band {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(8, 15, 8, 0));
  border: 1px solid var(--gold-border);
  border-radius: var(--r-xl);
}

.privacy-band-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.privacy-band-copy {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.home-cta-wrap {
  padding: clamp(3rem,6vw,5rem) clamp(1rem,5vw,3rem);
}

/* ---------- Feature Cards (¿Cómo funciona?) ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--t-slow);
}

.feature-card:hover {
  border-color: var(--gold-border);
  transform: translateY(-4px);
  background: var(--bg-card-alt);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--gold);
  font-size: 1.4rem;
}

.feature-title {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---------- CTA Section ---------- */
.cta-section {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(2.5rem, 5vw, 4rem) 2rem;
  text-align: center;
}

.cta-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.cta-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto 2rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  transition: var(--t);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--gold);
  color: #000;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--gold-border);
  color: var(--gold);
}
.btn-outline:hover { background: var(--gold-dim); }

.btn-google {
  background: #fff;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-google:hover { background: #f8f9fa; transform: translateY(-1px); }

.btn-lg {
  padding: 14px 36px;
  font-size: 1rem;
}

.btn-block { display: flex; width: 100%; justify-content: center; }

/* ---------- Horse Cards ---------- */
.horses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.horse-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--t-slow);
  text-decoration: none;
  color: var(--text-primary);
}

.horse-card:hover {
  border-color: var(--gold-border);
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.horse-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-secondary);
  position: relative;
}

.horse-card-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1a2f1a 0%, #0f1e0f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
}

.horse-card-body {
  padding: 1rem 1.1rem 1.2rem;
}

.horse-card-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.horse-card-registro {
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}

.horse-card-tags {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.horse-card-ganaderia {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.horse-card-img-placeholder-hidden {
  display: none;
}

.search-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.search-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.search-empty-text {
  margin-bottom: 1rem;
}

.search-empty-cta {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  text-decoration: none;
}

.result-empty-state {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
}

.result-empty-link {
  color: var(--gold);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-hembra { background: var(--badge-hembra); color: #fff; }
.badge-macho  { background: var(--badge-macho);  color: #fff; }

.badge-capa {
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ---------- Search Bar ---------- */
.search-bar {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  max-width: 700px;
}

.search-bar input {
  flex: 1;
  padding: 13px 18px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Lato', sans-serif;
  min-width: 0;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar-icon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--text-muted);
  font-size: 1rem;
}

.search-bar .btn-search {
  padding: 12px 24px;
  background: var(--gold);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  transition: var(--t);
  flex-shrink: 0;
}

.search-bar .btn-search:hover { background: var(--gold-light); }

.results-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.search-page-content {
  padding-top: 2rem;
}

.search-page-title {
  margin-bottom: 1.5rem;
}

.search-bar-spaced {
  margin-bottom: 1.8rem;
}

.search-actions {
  margin: 0 0 1rem 0;
  display: flex;
  justify-content: flex-end;
}

.search-new-horse-btn {
  text-decoration: none;
}

/* ---------- Detail Page ---------- */
.detail-page-content {
  padding-top: 1.5rem;
}

.detail-breadcrumb {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 1.4rem;
}

.detail-back-link {
  color: var(--gold);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.detail-horse-img {
  width: 100%;
  border-radius: var(--r-lg);
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-card-alt);
}

.detail-horse-img-placeholder {
  width: 100%;
  border-radius: var(--r-lg);
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1a2f1a, #0a160a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 4rem;
}

.detail-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-top: 18px;
}

.detail-info-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.detail-horse-name {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-badge-wrap {
  margin-bottom: 1rem;
}

.detail-horse-registro {
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

.detail-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.detail-field span {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.detail-field-full {
  grid-column: 1 / -1;
}

.detail-desc {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Upload Zone ---------- */
.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
}

.upload-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  line-height: 1.55;
}

.upload-zone {
  border: 2px dashed var(--border-gold);
  border-radius: var(--r-md);
  padding: 2.5rem 1rem;
  min-height: 220px;
  text-align: center;
  cursor: pointer;
  transition: var(--t);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: manipulation;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 10px;
}

.upload-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-actions-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.upload-cta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--gold);
  color: #000;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.upload-mobile-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-formats {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-preview {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--r-sm);
}

.upload-preview.visible { display: block; }

.detail-tip-card {
  margin-top: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 1.2rem;
}

.detail-tip-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.detail-tip-label {
  color: var(--gold);
}

.btn-evaluate {
  width: 100%;
  margin-top: 1rem;
  padding: 15px;
  background: var(--gold-dark);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #000;
  border-radius: var(--r-md);
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
  transition: var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-evaluate:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-evaluate:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Horse Form ---------- */
.horse-form-shell {
  width: min(100%, 920px);
}

.horse-form-header {
  margin-bottom: 1.15rem;
}

.horse-form-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.horse-form-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.45rem, 4.8vw, 2rem);
  line-height: 1.15;
  margin: 0.9rem 0 0.35rem;
}

.horse-form-subtitle {
  max-width: 58ch;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.horse-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1rem, 2.3vw, 1.5rem);
}

.horse-form-section {
  border: 1px solid var(--border);
  background: rgba(20, 31, 20, 0.45);
  border-radius: var(--r-md);
  padding: clamp(0.82rem, 2vw, 1rem);
}

.horse-form-section + .horse-form-section {
  margin-top: 0.82rem;
}

.horse-form-section-head {
  margin-bottom: 0.72rem;
}

.horse-form-section-title {
  margin: 0;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 1.02rem;
  line-height: 1.24;
  padding-bottom: 0.42rem;
  border-bottom: 1px solid var(--border);
}

.horse-form-section-subtitle {
  margin: 0.48rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.horse-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem 1rem;
}

.horse-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.horse-form-field.contact-field {
  gap: 0.45rem;
}

.horse-form-field-full {
  grid-column: 1 / -1;
}

.horse-form-label {
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-primary);
}

.horse-form-field.contact-field .horse-form-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.horse-form-control {
  width: 100%;
  min-height: 46px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Lato', sans-serif;
  padding: 0.86rem 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.horse-form-control::placeholder {
  color: var(--text-muted);
}

.horse-form-control:focus {
  outline: none;
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.horse-form-field.contact-field .horse-form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.horse-form-textarea {
  min-height: 120px;
  resize: vertical;
}

.horse-form-hint {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.horse-form-upload-divider {
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
}

.horse-form-upload-zone {
  margin-top: 0.35rem;
  padding: 1.6rem 0.9rem;
}

.horse-form-image-preview-wrap {
  margin-top: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  overflow: hidden;
}

.horse-form-image-preview {
  width: 100%;
  max-height: 210px;
  object-fit: cover;
  display: block;
}

.horse-form-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.horse-form-actions .btn {
  min-width: 168px;
  min-height: 46px;
}

.horse-form-cancel {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 760px) {
  .horse-form-shell {
    width: 100%;
  }

  .horse-form-card {
    padding: 0.85rem;
  }

  .horse-form-section {
    padding: 0.72rem;
  }

  .horse-form-grid {
    grid-template-columns: 1fr;
    gap: 0.78rem;
  }

  .horse-form-field-full {
    grid-column: auto;
  }

  .horse-form-control {
    font-size: 16px;
  }

  .horse-form-actions {
    flex-direction: column;
    margin-top: 0.9rem;
  }

  .horse-form-actions .btn,
  .horse-form-cancel {
    width: 100%;
  }
}

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Results Page ---------- */
.result-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.result-title {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.result-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.result-beta-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.22rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-score-block {
  text-align: right;
}

.result-score-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.result-rating {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-bright);
  display: block;
}

.result-score-num {
  font-size: 1rem;
  color: var(--green-bright);
}

.result-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.result-page-content {
  padding-top: 1.5rem;
}

@media (max-width: 900px) { .result-layout { grid-template-columns: 1fr; } }

.result-photo-card {
  margin-bottom: 12px;
}

.result-photo-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card-alt);
  image-rendering: auto;
  filter: saturate(0.92) contrast(0.95);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.2rem;
}

.chart-card-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.chart-container {
  position: relative;
  aspect-ratio: 1;
  max-width: 280px;
  margin: 0 auto;
}

.result-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.result-horse-name-heading {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.result-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.history-page-content {
  padding-top: 2rem;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.history-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

.history-filters input {
  min-width: 260px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
}

.history-filter-buttons {
  display: flex;
  gap: 8px;
}

.history-filter-buttons .btn.active {
  border-color: var(--gold-border);
  color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
}

/* ---------- Score Cards ---------- */
.score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.3rem;
  margin-bottom: 12px;
  transition: var(--t);
}

.score-card:hover { border-color: var(--border-gold); }

.score-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.score-card-label {
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.score-card-value {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-bright);
}

.score-bar {
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 1s ease;
}

.score-card-comment {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---------- History ---------- */
.history-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.history-empty-icon { font-size: 3rem; margin-bottom: 1rem; }

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--t);
  text-decoration: none;
  color: var(--text-primary);
}

.history-card:hover {
  border-color: var(--gold-border);
  background: var(--bg-card-alt);
}

.history-card-img {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.history-card-img-placeholder {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.history-card-body { flex: 1; min-width: 0; }

.history-card-name {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.history-card-registro {
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 5px;
}

.history-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-card-meta {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.badge-provider,
.badge-tokens,
.badge-duration {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-provider {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
}

.badge-tokens {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green-bright);
}

.badge-duration {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

.history-card-score {
  text-align: right;
  flex-shrink: 0;
}

.history-score-num {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-bright);
  display: block;
}

.history-score-num.score-good { color: var(--green-bright); }
.history-score-num.score-mid { color: #fbbf24; }
.history-score-num.score-low { color: #ef4444; }

.history-score-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  padding: 1.8rem clamp(1rem, 5vw, 3rem);
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-main {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-disclaimer {
  font-size: 0.77rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.footer-legal-links {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-legal-links a {
  color: var(--text-secondary);
  transition: var(--t);
}

.footer-legal-links a:hover {
  color: var(--gold);
}

/* footer-atoms removed */

/* ---------- Page Wrapper ---------- */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Account Page ---------- */
.account-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.account-header {
  text-align: center;
  margin-bottom: 2rem;
}

.account-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.account-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

.account-section-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.account-section-title svg {
  width: 20px;
  height: 20px;
}

.account-section-danger {
  border-color: rgba(239, 68, 68, 0.3);
}

.account-section-title-danger {
  color: #ef4444;
}

/* ===== NOTIFICATION PREFERENCES ===== */
.notification-prefs-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.notification-pref-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 110px;
  min-width: 110px;
  border-bottom: 1px solid var(--border);
}

.notification-pref-row:last-child {
  border-bottom: none;

.account-status-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.45;
}

}

.notification-pref-info {
  display: flex;
  flex-direction: column;

.account-status-banner.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fecaca;
}

.account-status-banner.info {
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #bfdbfe;
}
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.notification-pref-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-pref-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Toggle switch */
.toggle-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background 0.2s;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-track {
  background: var(--gold);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

.notification-threshold-row {
  align-items: center;
}

.notification-threshold-input {
  width: 80px;
  text-align: center;
  flex-shrink: 0;
}



.account-status-banner.success {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--green-bright);
}

.account-status-banner.warning {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.verification-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: var(--r-md);
  font-size: 0.9rem;
}

.verification-badge.verified {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--green-bright);
}

.verification-badge.unverified {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.plan-display {
  text-align: center;
  padding: 1rem 0;
}

.plan-badge {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: var(--r-lg);
  border: 2px solid;
}

.plan-badge.plan-free {
  border-color: var(--gold-border);
  background: var(--gold-dim);
}

.plan-badge-title {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.plan-badge-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.plan-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

.account-balance-card {
  margin: 1.2rem auto 0;
  max-width: 420px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-card-alt);
  padding: 14px;
}

.account-balance-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--text-secondary);
}

.account-balance-head strong {
  color: var(--gold);
  font-size: 1.4rem;
}

.account-balance-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0;
  overflow: hidden;
}

.account-balance-progress span {
  display: block;
  width: 0;
  height: 100%;
  transition: width 0.35s ease;
}

.account-balance-note {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin: 0 0 12px;
}

.account-password-submit {
  margin-top: 1rem;
}

.account-ledger-type-positive,
.account-ledger-amount-positive {
  color: var(--green-bright);
}

.account-ledger-type-negative,
.account-ledger-amount-negative {
  color: #ef4444;
}

.account-ledger-summary-cell {
  text-align: center;
  padding: 20px;
}

.danger-zone-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.password-requirements {
  margin-top: 0.8rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.requirement {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.requirement::before {
  content: '○';
  font-size: 0.7rem;
  color: var(--text-muted);
}

.requirement.met {
  color: var(--green-bright);
}

.requirement.met::before {
  content: '●';
  color: var(--green-bright);
}

.form-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ---------- Pricing Page ---------- */
.pricing-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.pricing-header {
  text-align: center;
  margin-bottom: 3rem;
}

.pricing-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.pricing-title .accent { color: var(--gold); }

.pricing-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 2.5rem;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--t-slow);
  position: relative;
}

.pricing-card:hover {
  border-color: var(--gold-border);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.pricing-card-popular {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--bg-card-alt) 0%, var(--bg-card) 100%);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #000;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pricing-card-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.pricing-plan-name {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.pricing-plan-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pricing-card-price {
  text-align: center;
  margin-bottom: 1.5rem;
}

.pricing-price-value {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.pricing-price-period {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pricing-card-features {
  flex: 1;
  margin-bottom: 1.5rem;
}

.pricing-features-list {
  list-style: none;
}

.pricing-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.pricing-feature-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--gold);
  width: 18px;
  height: 18px;
}

.pricing-btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  transition: var(--t);
  cursor: pointer;
}

.pricing-btn-primary {
  background: var(--gold);
  color: #000;
}

.pricing-btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.pricing-btn-outline {
  background: transparent;
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

.pricing-btn-outline:hover {
  background: var(--gold-dim);
}

.pricing-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.pricing-btn-lg {
  padding: 16px 28px;
  font-size: 1rem;
}

.pricing-summary-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem;
  margin-bottom: 2rem;
}

.summary-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.summary-title {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.summary-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.summary-content {
  margin-bottom: 1.5rem;
}

.summary-plan-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.summary-plan-name {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.summary-plan-price {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.summary-features-preview {
  margin-bottom: 1.2rem;
}

.summary-empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 1.5rem;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-top: 2px solid var(--gold-border);
}

.summary-total-label {
  font-size: 1rem;
  font-weight: 700;
}

.summary-total-value {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
}

.summary-actions {
  display: flex;
  gap: 12px;
}

.pricing-legal {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

.legal-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

.legal-text strong {
  color: var(--text-secondary);
}



/* Pricing Responsive */
@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-summary-panel {
    padding: 1.5rem;
  }

  .summary-actions {
    flex-direction: column;
  }

  .summary-plan-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .pricing-price-value {
    font-size: 2.2rem;
  }
}

.page-footer {
  margin-top: auto;
  padding: 1.5rem 1rem;
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-text {
  font-size: 0.83rem;
  color: var(--text-muted);
}

#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
}

.btn-full-width {
  width: 100%;
}

.btn-danger-outline {
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--t);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.hidden {
  display: none !important;
}

.page-content {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 5vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

.contact-page-content {
  padding-top: 2rem;
}

.contact-page-title {
  margin-bottom: 0.8rem;
}

.contact-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 20px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(20, 31, 20, 0.95));
  border: 1px solid var(--gold-border);
  border-radius: var(--r-xl);
  padding: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 1.5rem;
}

.contact-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

.contact-hero-text,
.contact-card-copy,
.contact-legal-note,
.contact-side-note,
.contact-checklist p {
  color: var(--text-secondary);
}

.contact-side-note {
  background: rgba(8, 15, 8, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.2rem;
}

.contact-side-title,
.contact-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.contact-side-list {
  padding-left: 1.1rem;
  color: var(--text-secondary);
}

.contact-side-list li + li {
  margin-top: 0.5rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
}

.contact-card-compact {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.contact-field span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  font-family: 'Lato', sans-serif;
  transition: var(--t);
}

.contact-field textarea {
  resize: vertical;
  min-height: 170px;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.contact-legal-note {
  font-size: 0.83rem;
  line-height: 1.6;
}

.contact-checklist {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-checklist strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.status-panel {
  border-radius: var(--r-md);
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.status-panel-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}

.status-panel-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.24);
  color: #fecaca;
}

.status-panel-info {
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
}

/* ---------- Auth Page ---------- */
.auth-container {
  max-width: 420px;
  margin: 3rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2.5rem 2rem;
}

.auth-shell {
  grid-template-columns: minmax(0, 430px) minmax(280px, 1fr);
  align-items: stretch;
}

.auth-shell-single {
  grid-template-columns: minmax(0, 430px);
  justify-content: center;
}

.auth-panel {
  margin: 0;
}

.auth-brand-mark {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  margin: 0 auto 0.9rem;
}

.auth-helper-text,
.auth-helper-center,
.auth-form-note {
  font-size: 0.86rem;
  line-height: 1.6;
}

.auth-helper-center {
  text-align: center;
  color: var(--text-muted);
}

.auth-inline-link-row {
  text-align: right;
  margin-top: 0.6rem;
}

.auth-inline-link {
  color: var(--gold);
}

.auth-submit-btn {
  margin-top: 1.1rem;
  width: 100%;
  padding: 13px;
}

.auth-status-box {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--r-md);
}

.auth-status-warning {
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.12);
}

.auth-status-success {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
}

.auth-status-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
}

.auth-status-copy {
  margin: 0;
  font-size: 0.92rem;
}

.auth-status-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.auth-callback-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-callback-card {
  text-align: center;
}

.auth-callback-spinner {
  margin: 0 auto 1.5rem;
}

.auth-callback-title {
  font-family: 'Cinzel', serif;
  margin-bottom: 0.5rem;
}

.auth-callback-copy {
  color: var(--text-muted);
}

.checkout-legal-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.checkout-legal-note-spaced {
  margin-top: 1rem;
}

.spin {
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.auth-aside {
  padding: 1.8rem;
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.08), rgba(20, 31, 20, 0.92));
}

.auth-aside-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  margin-bottom: 1rem;
}

.auth-aside-list {
  padding-left: 1.15rem;
  line-height: 1.7;
}

.auth-aside-list li + li {
  margin-top: 0.5rem;
}

.auth-aside-stat {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.auth-aside-stat strong {
  display: block;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.auth-legal-links {
  margin-top: 0.8rem;
}

.pricing-intro-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  margin-bottom: 1.5rem;
}

.pricing-intro-panel {
  padding: 1.4rem;
}

.pricing-intro-panel-accent {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.12), rgba(20, 31, 20, 0.95));
  border-color: var(--gold-border);
}

.pricing-intro-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  margin-bottom: 0.7rem;
}

.pricing-intro-metric {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.pricing-note-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.pricing-note-strip span {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.legal-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.legal-hero {
  padding: 1.8rem;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(20, 31, 20, 0.95));
  border-color: var(--gold-border);
}

.legal-updated {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.legal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legal-card {
  padding: 1.4rem;
}

.legal-card h2 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  margin-bottom: 0.7rem;
}

.legal-card p + p {
  margin-top: 0.7rem;
}

.legal-highlight {
  color: var(--gold-light);
}

.auth-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.8rem;
}

.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Lato', sans-serif;
  outline: none;
  transition: var(--t);
}

.form-input:focus { border-color: var(--gold-border); }
.form-input::placeholder { color: var(--text-muted); }

/* ---------- Toast Notification ---------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  padding: 12px 20px;
  font-size: 0.88rem;
  color: var(--text-primary);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  white-space: nowrap;
}

@keyframes toastIn  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to   { opacity: 0; transform: translateY(10px); } }

/* ---------- Loader Overlay ---------- */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 8, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  gap: 1.2rem;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.loader-overlay.hidden { display: none; }

.loader-ring {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loader-text {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

/* ---------- Divider ---------- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .navbar {
    height: auto;
    min-height: var(--nav-h);
    padding-top: 10px;
    padding-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
  }

  .navbar-nav,
  .navbar-actions { display: none; }

  .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .navbar-brand-sub { display: none; }

  .navbar-mobile-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .navbar[data-mobile-nav-open="true"] .navbar-mobile-panel {
    display: grid;
  }

  .navbar-mobile-links {
    display: grid;
    gap: 8px;
  }

  .navbar-mobile-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-card-alt);
    color: var(--text-secondary);
  }

  .navbar-mobile-links a.active {
    background: var(--gold);
    border-color: var(--gold-border);
    color: #000;
    font-weight: 700;
  }

  .navbar-mobile-actions .btn-nav-auth,
  .navbar-mobile-actions .credits-display {
    width: 100%;
    justify-content: center;
  }

  .btn,
  .btn-secondary,
  .btn-small,
  .btn-nav-auth,
  .admin-tab,
  .navbar-mobile-toggle {
    min-height: 44px;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .detail-layout,
  .result-layout { grid-template-columns: 1fr; }

  .premium-grid,
  .signal-grid,
  .privacy-band,
  .pricing-intro-grid,
  .legal-grid,
  .auth-shell,
  .auth-status-actions { grid-template-columns: 1fr; }

  .hero-actions,
  .hero-trustbar,
  .pricing-note-strip { justify-content: flex-start; }

  .contact-hero-card,
  .contact-layout,
  .contact-form-grid { grid-template-columns: 1fr; }

  .contact-card-compact { position: static; }

  .horses-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

  .result-header { flex-direction: column; align-items: flex-start; }
  .result-score-block { text-align: left; }

  .upload-zone {
    padding: 1.5rem 1rem;
    min-height: 240px;
  }
}

/* ---------- Responsive nav mobile ---------- */
.navbar-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  color: var(--text-secondary);
  padding: 0;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .navbar-mobile-toggle { display: flex; }
}

/* ---------- Animations ---------- */
.fade-in {
  animation: fadeIn 0.5s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger > * { animation: fadeIn 0.4s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.12s; }
.stagger > *:nth-child(3) { animation-delay: 0.19s; }
.stagger > *:nth-child(4) { animation-delay: 0.26s; }
.stagger > *:nth-child(5) { animation-delay: 0.33s; }
.stagger > *:nth-child(6) { animation-delay: 0.40s; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #2a3d2a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ---------- Dashboard Page ---------- */
.page-dashboard {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 5vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

.dashboard-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 2rem;
}

.dashboard-overview .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem 1.8rem;
  text-align: center;
}

.dashboard-overview .card h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.dashboard-overview #dash-credits,
.dashboard-overview #dash-plan,
.dashboard-overview #dash-receipts {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.dashboard-overview .card p {
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dashboard-list li {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.9rem 1.2rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--t);
}

.dashboard-list li:hover {
  border-color: var(--border-gold);
  background: var(--bg-card);
}

/* ---------- Admin Page ---------- */
.admin-tabs {
  position: sticky;
  top: 76px;
  z-index: 40;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: rgba(20, 31, 20, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.admin-tab {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
}

.admin-tab.active {
  border-color: var(--gold-border);
  color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
}

.admin-panel {
  overflow: hidden;
}

.admin-table-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.admin-empty-row {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.admin-page-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.admin-table thead {
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: var(--bg-card-alt);
}

.admin-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-form .form-group input[type="text"],
.admin-form .form-group input[type="checkbox"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px;
}

.admin-form .admin-table-actions {
  margin-bottom: 12px;
}

.admin-empty-row {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

.badge-admin {
  background: #ef4444;
  color: #fff;
}

/* Debug mode toggle (admin config panel) */
.debug-toggle-box {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--gold);
  border-radius: 8px;
}
.debug-toggle-box h3 {
  margin: 0 0 .5rem;
}
.debug-toggle-box p {
  margin: 0 0 .75rem;
  font-size: .9rem;
  opacity: .8;
}
.debug-toggle-box label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-weight: 600;
}

.badge-customer {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.badge-success {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green-bright);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-pending {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.activity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1f2937;
  background: rgba(74, 222, 128, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.5);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .admin-tabs {
    top: 64px;
    padding: 8px;
  }

  .admin-filters,
  .admin-create-user,
  .admin-plan-assignment,
  .admin-credits-adjustment {
    padding: 1rem;
  }

  .admin-filters,
  .admin-table-actions,
  .admin-user-actions,
  .admin-role-editor,
  .admin-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group,
  .filter-group input[type="text"],
  .filter-group select,
  .admin-create-user input[type="email"],
  .admin-create-user input[type="text"],
  .admin-create-user select,
  .admin-plan-assignment input[type="text"],
  .admin-plan-assignment input[type="number"],
  .admin-plan-assignment select,
  .admin-plan-assignment textarea,
  .admin-credits-adjustment input[type="text"],
  .admin-credits-adjustment input[type="number"],
  .admin-credits-adjustment select,
  .admin-credits-adjustment textarea,
  .admin-role-editor select,
  .admin-role-editor .btn-small,
  .admin-table-actions .btn-secondary,
  .admin-table-actions button,
  .admin-pagination .btn-secondary {
    width: 100%;
    min-width: 0;
  }

  .admin-users-summary .badge,
  .admin-users-summary .admin-page-meta {
    width: 100%;
  }

  .admin-page-meta {
    text-align: center;
  }

  .admin-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
  }
}

.admin-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-card-alt);
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group input[type="text"],
.filter-group select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.88rem;
  min-width: 150px;
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--gold-border);
}

.admin-create-user {
  padding: 1.5rem;
  background: var(--bg-card-alt);
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
}

.admin-create-user h3 {
  margin: 0 0 1rem 0;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.admin-create-user .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.admin-create-user label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-create-user input[type="email"],
.admin-create-user input[type="text"],
.admin-create-user select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.admin-create-user input[type="email"]:focus,
.admin-create-user input[type="text"]:focus,
.admin-create-user select:focus {
  outline: none;
  border-color: var(--gold-border);
}

.admin-plan-assignment {
  margin-top: 1.5rem;
}

.admin-plan-assignment h3 {
  margin-bottom: 1rem;
  font-family: var(--font-serif);
  color: var(--text-primary);
  font-size: 1.3rem;
}

.admin-plan-assignment .form-group {
  margin-bottom: 1rem;
}

.admin-plan-assignment label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-plan-assignment input[type="text"],
.admin-plan-assignment input[type="number"],
.admin-plan-assignment select,
.admin-plan-assignment textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

.admin-plan-assignment input[type="text"]:focus,
.admin-plan-assignment input[type="number"]:focus,
.admin-plan-assignment select:focus,
.admin-plan-assignment textarea:focus {
  outline: none;
  border-color: var(--gold-border);
}

.admin-plan-assignment textarea {
  resize: vertical;
  min-height: 80px;
}

.admin-plan-assignment small {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.plan-assignment-summary {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
  margin-top: 0.5rem;
}

.plan-assignment-summary.summary-valid {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--gold-border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row span {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.summary-row strong {
  color: var(--text-primary);
  font-weight: 700;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-users-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.admin-role-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.admin-role-editor select {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card-alt);
  color: var(--text-primary);
  padding: 5px 8px;
  font-size: 0.82rem;
}

.btn-secondary {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--t);
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--border-gold);
  color: var(--text-primary);
}

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: var(--t);
  cursor: pointer;
  border: none;
}

.btn-success {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green-bright);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.btn-success:hover {
  background: rgba(74, 222, 128, 0.25);
  border-color: var(--green-bright);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.action-result {
  padding: 1rem;
  border-radius: var(--r-md);
  margin-top: 1rem;
  font-size: 0.9rem;
}

.action-result.success-message {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--green-bright);
}

.action-result.error-message {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.admin-credits-adjustment {
  margin-bottom: 1.5rem;
}

.admin-credits-adjustment--section {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.admin-credits-adjustment p.hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.admin-credits-adjustment .form-group--inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-credits-adjustment .form-group--inline label {
  margin: 0;
}

.admin-credits-adjustment h3 {
  font-family: 'Cinzel', serif;
  color: var(--text-primary);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.admin-credits-adjustment .form-group {
  margin-bottom: 1rem;
}

.admin-credits-adjustment label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-credits-adjustment input[type="text"],
.admin-credits-adjustment input[type="number"],
.admin-credits-adjustment select,
.admin-credits-adjustment textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

.admin-credits-adjustment input[type="text"]:focus,
.admin-credits-adjustment input[type="number"]:focus,
.admin-credits-adjustment select:focus,
.admin-credits-adjustment textarea:focus {
  outline: none;
  border-color: var(--gold-border);
}

.admin-credits-adjustment textarea {
  resize: vertical;
  min-height: 80px;
}

.admin-credits-adjustment small {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.admin-credits-adjustment input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

.credits-adjustment-summary {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
  margin-top: 0.5rem;
}

.credits-adjustment-summary.summary-valid {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--gold-border);
}

.ledger-search {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ledger-search input {
  flex: 1;
}

.ledger-info {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.ledger-info p {
  margin: 0.4rem 0;
  color: var(--text-secondary);
}

.ledger-info strong {
  color: var(--text-primary);
}

.ledger-info span {
  color: var(--gold);
  font-weight: 600;
}

.error-message {
  color: #ef4444;
  font-size: 0.85rem;
  padding: 0.8rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--r-md);
}

.dashboard-list li:first-child {
  border-top-left-radius: var(--r-md);
  border-top-right-radius: var(--r-md);
}

.dashboard-list li:last-child {
  border-bottom-left-radius: var(--r-md);
  border-bottom-right-radius: var(--r-md);
}

.dashboard-list-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.dashboard-list-item-content {
  flex: 1;
  min-width: 0;
}

.dashboard-list-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.dashboard-list-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dashboard-list-item-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green-bright);
  flex-shrink: 0;
}

.dashboard-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* ===== ADMIN METRICS DASHBOARD ===== */
.metrics-date-filter {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-card-alt);
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
  align-items: flex-end;
}

.metrics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metrics-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.metrics-card:hover {
  border-color: var(--gold-border);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.1);
}

.metrics-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  color: var(--gold);
}

.metrics-card-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metrics-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metrics-total {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.1;
}

.metrics-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.metrics-change {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0.4rem 0;
}

.metrics-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green-bright);
}

.metrics-period {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metrics-growth {
  font-size: 0.85rem;
  color: var(--green-bright);
  margin: 0;
}

.metrics-expired {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.metrics-balance {
  font-size: 0.85rem;
  color: var(--gold);
  margin: 0;
}

.metrics-aov {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.metrics-section {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.metrics-section h3 {
  margin: 0 0 1rem 0;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.metrics-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  align-items: center;
}

.metrics-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.metrics-detail-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.1;
}

.metrics-detail-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.metrics-provider-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.provider-badge {
  padding: 0.3rem 0.7rem;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.provider-badge strong {
  color: var(--gold);
  font-weight: 700;
}

.metrics-revenue-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.revenue-method-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.revenue-method-row:last-child {
  border-bottom: none;
}

.revenue-method-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.revenue-method-amount {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-bright);
}

@media (max-width: 768px) {
  .metrics-cards {
    grid-template-columns: 1fr;
  }

  .metrics-detail {
    grid-template-columns: 1fr;
  }

  .metrics-date-filter {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== ADMIN METRICS DASHBOARD ===== */
.metrics-date-filter {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-card-alt);
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
  align-items: flex-end;
}

.metrics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metrics-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.metrics-card:hover {
  border-color: var(--gold-border);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.1);
}

.metrics-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  color: var(--gold);
}

.metrics-card-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metrics-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metrics-total {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.1;
}

.metrics-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.metrics-change {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0.4rem 0;
}

.metrics-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green-bright);
}

.metrics-period {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metrics-growth {
  font-size: 0.85rem;
  color: var(--green-bright);
  margin: 0;
}

.metrics-expired {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.metrics-balance {
  font-size: 0.85rem;
  color: var(--gold);
  margin: 0;
}

.metrics-aov {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.metrics-section {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.metrics-section h3 {
  margin: 0 0 1rem 0;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.metrics-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  align-items: center;
}

.metrics-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.metrics-detail-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.1;
}

.metrics-detail-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.metrics-provider-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.provider-badge {
  padding: 0.3rem 0.7rem;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.provider-badge strong {
  color: var(--gold);
  font-weight: 700;
}

.metrics-revenue-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.revenue-method-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.revenue-method-row:last-child {
  border-bottom: none;
}

.revenue-method-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.revenue-method-amount {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-bright);
}

@media (max-width: 768px) {
  .metrics-cards {
    grid-template-columns: 1fr;
  }

  .metrics-detail {
    grid-template-columns: 1fr;
  }

  .metrics-date-filter {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== PRIVACY MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 12px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.modal-title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.modal-description {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal-form-group {
  margin-top: 1rem;
}

.modal-hint {
  margin-top: 0.75rem;
}

.modal-confirmation-input {
  margin-top: 0.5rem;
}

.modal-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.privacy-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-icon-inline {
  vertical-align: middle;
  margin-right: 6px;
}

/* ===== ADMIN PRIVACY SECTION ===== */
.privacy-filter-bar {
  margin-bottom: 1rem;
}

.privacy-select {
  max-width: 160px;
}

/* ===== CHECKOUT RESULT PAGES ===== */
.checkout-result-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h) - 5rem);
  padding: 2rem 1rem;
}

.checkout-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(2rem, 5vw, 3.5rem);
  max-width: 520px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.checkout-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkout-icon-success {
  background: rgba(74, 222, 128, 0.12);
  color: var(--green-bright);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.checkout-icon-error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.checkout-icon-cancel {
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.checkout-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.checkout-subtitle {
  font-size: 0.97rem;
  color: var(--text-secondary);
  max-width: 380px;
  margin: 0;
}

.checkout-details-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkout-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.checkout-detail-label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.checkout-detail-value {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

.checkout-credits-value {
  color: var(--green-bright);
  font-size: 1rem;
}

.checkout-session-ref {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  word-break: break-all;
}

.checkout-email-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 480px) {
  .checkout-actions {
    flex-direction: row;
    justify-content: center;
  }
}

.checkout-cancel-reasons {
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  width: 100%;
  text-align: left;
}

.checkout-cancel-reasons-title {
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.checkout-cancel-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.checkout-cancel-list li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding-left: 1.25rem;
  position: relative;
}

.checkout-cancel-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

/* Spinner for loading state */
.checkout-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
