/* ── Variables ── */
:root {
  --green:       #1a5c2e;
  --green-dark:  #0f3a1c;
  --green-light: #2a7a40;
  --gold:        #c8a951;
  --gold-light:  #e2c46a;
  --cream:       #faf6ed;
  --text:        #1a1a1a;
  --text-muted:  #5a5a5a;
  --border:      #e0d8c8;
  --white:       #ffffff;
  --radius:      8px;
  --shadow:      0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.16);
  --sidebar-w:   228px;
  --topbar-h:    56px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--text); background: var(--cream); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--green-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.nav-brand-icon { font-size: 1.6rem; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-link { color: rgba(255,255,255,0.85); font-size: 0.95rem; font-weight: 500; transition: color 0.2s; }
.nav-link:hover { color: var(--gold-light); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  gap: 0.4rem;
}
.btn-primary {
  background: var(--gold);
  color: var(--green-dark);
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--green-dark); }
.btn-lg { padding: 0.8rem 2rem; font-size: 1.05rem; }
.btn-full { width: 100%; }

/* ── Flash messages ── */
.flash-container { padding: 0.75rem 2rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.flash-error   { background: #fde8e8; color: #9b1c1c; border: 1px solid #f8b4b4; }
.flash-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.flash-info    { background: #e8f0fe; color: #1a3c6e; border: 1px solid #a8c5f8; }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, var(--green-light) 100%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(200,169,81,0.12) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content {
  position: relative;
  max-width: 700px;
  padding: 4rem 2rem;
  margin: 0 auto;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(200,169,81,0.18);
  color: var(--gold-light);
  border: 1px solid rgba(200,169,81,0.35);
  border-radius: 100px;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold);
}
.hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.78);
  max-width: 520px;
  margin: 0 auto 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Track divider ── */
.track-divider {
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0px,
    var(--gold) 40px,
    transparent 40px,
    transparent 60px
  );
  opacity: 0.7;
}

/* ── Features ── */
.features {
  padding: 5rem 2rem;
  background: var(--white);
}
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-label {
  display: inline-block;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--green-dark);
}
.section-header p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0.75rem auto 0;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.feature-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  display: block;
}
.feature-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}
.feature-card p { font-size: 0.92rem; color: var(--text-muted); }

/* ── How it works ── */
.how-it-works {
  padding: 5rem 2rem;
  background: linear-gradient(180deg, var(--cream) 0%, var(--white) 100%);
}
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.step { text-align: center; padding: 1.5rem 1rem; }
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green);
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.step h3 { font-size: 1rem; font-weight: 600; color: var(--green-dark); margin-bottom: 0.4rem; }
.step p { font-size: 0.88rem; color: var(--text-muted); }

/* ── CTA Banner ── */
.cta-banner {
  padding: 5rem 2rem;
  background: var(--green-dark);
  text-align: center;
}
.cta-banner h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--white);
  margin-bottom: 0.75rem;
}
.cta-banner p {
  color: rgba(255,255,255,0.7);
  max-width: 460px;
  margin: 0 auto 2rem;
}

/* ── Footer ── */
.footer {
  padding: 1.5rem 2rem;
  background: var(--green-dark);
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

/* ── Auth pages ── */
.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}
.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-brand-icon { font-size: 2.8rem; display: block; margin-bottom: 0.5rem; }
.auth-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--green-dark);
}
.auth-brand p { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 0.4rem;
}
.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,92,46,0.12);
}
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.87rem;
}
.form-row label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; color: var(--text-muted); }
.form-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.87rem;
  color: var(--text-muted);
}
.form-footer a { color: var(--green); font-weight: 600; }
.form-footer a:hover { color: var(--green-light); }

/* ── Dashboard ── */
.dashboard-page { padding: 2.5rem 2rem; max-width: 1100px; margin: 0 auto; }
.dashboard-header { margin-bottom: 2.5rem; }
.dashboard-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--green-dark);
}
.dashboard-header p { color: var(--text-muted); margin-top: 0.25rem; }
.coming-soon {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}
.coming-soon-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.coming-soon h2 { font-family: 'Playfair Display', serif; color: var(--green-dark); margin-bottom: 0.5rem; }

/* ── Admin ── */
.admin-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 2rem;
  overflow: hidden;
}
.admin-section-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}
.admin-section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.user-table-wrap { overflow-x: auto; }
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.user-table th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.user-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: var(--cream); }
.muted { color: var(--text-muted); }
.note-cell { max-width: 260px; color: var(--text-muted); font-size: 0.85rem; }
.empty-state { padding: 1.5rem; color: var(--text-muted); font-size: 0.9rem; text-align: center; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-active   { background: #d1e7dd; color: #0a3622; }
.badge-rejected { background: #f8d7da; color: #842029; }

/* Role badges */
.role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.role-admin   { background: rgba(200,169,81,0.2); color: var(--green-dark); }
.role-analyst { background: rgba(26,92,46,0.1);   color: var(--green); }

/* Small buttons */
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.82rem; }
.btn-approve { background: var(--green); color: var(--white); border-radius: var(--radius); border: none; cursor: pointer; font-weight: 600; transition: background 0.2s; }
.btn-approve:hover { background: var(--green-light); }
.btn-reject  { background: transparent; color: #842029; border: 1.5px solid #f1aeb5; border-radius: var(--radius); cursor: pointer; font-weight: 600; transition: all 0.2s; }
.btn-reject:hover  { background: #f8d7da; }

/* Nav avatar / profile link */
.nav-profile {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: rgba(255,255,255,0.85);
  font-size: .9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-profile:hover { color: var(--gold-light); }
.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(200,169,81,0.6);
  display: block;
}

/* Nav admin link */
.nav-link-admin {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(200,169,81,0.4);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.nav-link-admin:hover { background: rgba(200,169,81,0.15); }

/* ── Profile ── */
.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  flex-shrink: 0;
}
.profile-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.profile-avatar-hint {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 140px;
  line-height: 1.4;
}
.profile-avatar-hint a { color: var(--green); }
.profile-meta { display: flex; flex-direction: column; gap: .35rem; justify-content: center; }
.profile-name  { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--green-dark); font-weight: 700; }
.profile-email { font-size: .9rem; color: var(--text-muted); }
.profile-badges { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; flex-wrap: wrap; }
.profile-joined { font-size: .78rem; color: var(--text-muted); }

.profile-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.profile-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--green-dark);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 520px) {
  .profile-card { flex-direction: column; align-items: center; text-align: center; }
  .profile-badges { justify-content: center; }
}

/* ───────────────────────────────────────────
   APP SHELL (sidebar layout — logged-in pages)
   ─────────────────────────────────────────── */
.app-layout { background: #f2ede3; min-height: 100vh; }

/* Top bar */
.app-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--green-dark);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.app-topbar-brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  margin-right: auto;
}
.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar-link {
  color: rgba(255,255,255,0.78);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}
.topbar-link:hover { color: var(--gold-light); }
.topbar-admin {
  color: var(--gold);
  border: 1px solid rgba(200,169,81,.35);
  padding: .2rem .6rem;
  border-radius: var(--radius);
  font-size: .8rem;
}
.topbar-profile {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: rgba(255,255,255,.85);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}
.topbar-profile:hover { color: var(--gold-light); }
.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 1.2rem;
  cursor: pointer;
  padding: .25rem .4rem;
  display: none;
}

/* Body split */
.app-body {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-inner { padding: 1.25rem .75rem; }
.sidebar-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .9rem .5rem .35rem;
}
.sidebar-section-label:first-child { padding-top: .25rem; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.sidebar-link:hover { background: var(--cream); color: var(--green); }
.sidebar-link.active { background: var(--green); color: var(--white); font-weight: 600; }
.sidebar-link.active .sidebar-icon { filter: brightness(10); }
.sidebar-icon { font-size: 1rem; width: 1.2rem; text-align: center; }

/* Main content */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem;
  min-width: 0;
}

/* Page header */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--green-dark);
  margin-bottom: .2rem;
}
.page-header p { color: var(--text-muted); font-size: .95rem; }

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.stat-card-gold { border-color: var(--gold); background: linear-gradient(135deg,#fffbf0,#fff8e8); }
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1;
  margin-bottom: .25rem;
}
.stat-card-gold .stat-value { color: #7a5a10; }
.stat-label { font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: .15rem; }
.stat-sub { font-size: .78rem; color: var(--text-muted); }

/* Dashboard sections */
.dash-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.dash-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}
.dash-section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--green-dark);
}
.dash-section-sub { font-size: .8rem; color: var(--text-muted); }
.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* Horse table */
.horse-table-wrap { overflow-x: auto; }
.horse-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.horse-table th {
  text-align: left;
  padding: .6rem 1rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.horse-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.horse-table tr:last-child td { border-bottom: none; }
.horse-table tr:hover td { background: var(--cream); }
.post-cell {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  width: 40px;
}
.odds-badge {
  display: inline-block;
  padding: .15rem .55rem;
  background: var(--green-dark);
  color: var(--gold);
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.stat-bar-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 90px;
}
.stat-bar-wrap span { font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.stat-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--gold);
  flex: 1;
  max-width: 60px;
}
.stat-bar-green { background: var(--green); }
.stat-bar-blue  { background: #4a90d9; }

/* Coming soon inline */
.coming-soon-inline {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  font-size: .9rem;
  color: var(--text-muted);
}
.coming-soon-inline > span { font-size: 1.8rem; line-height: 1; }
.coming-soon-inline strong { display: block; color: var(--text); margin-bottom: .2rem; }

/* Feature stub pages */
.feature-stub {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  max-width: 640px;
}
.feature-stub-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.feature-stub h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--green-dark);
  margin-bottom: .6rem;
}
.feature-stub > p { color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.6; }

.stub-coming-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  text-align: left;
  margin-top: 1.5rem;
}
.stub-feature-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .88rem;
  color: var(--text-muted);
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .85rem;
}
.stub-feature-item span { font-size: 1rem; flex-shrink: 0; }

/* Upload drop zone */
.stub-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  background: var(--cream);
  color: var(--text-muted);
  font-size: .9rem;
  cursor: not-allowed;
  opacity: .7;
}
.stub-upload-zone span:first-child { font-size: 2.5rem; }
.stub-upload-zone strong { color: var(--text); }
.stub-hint { font-size: .78rem; }

/* AI Chat preview */
.feature-stub-chat { max-width: 680px; }
.stub-chat-preview {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.stub-chat-msg {
  max-width: 80%;
  padding: .65rem .9rem;
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.5;
}
.stub-chat-user {
  background: var(--green);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.stub-chat-ai {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.stub-chat-input-mock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .6rem .9rem;
  font-size: .88rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* ── Huey tone picker ── */
.tone-options {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.tone-option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tone-option:hover { border-color: var(--green-light); background: var(--cream); }
.tone-option.selected { border-color: var(--green); background: rgba(26,92,46,.05); }
.tone-option input[type="radio"] { margin-top: .2rem; accent-color: var(--green); flex-shrink: 0; }
.tone-name { font-weight: 600; font-size: .9rem; color: var(--green-dark); display: block; }
.tone-desc { font-size: .8rem; color: var(--text-muted); display: block; margin-top: .1rem; }

.huey-tone-badge {
  display: inline-block;
  background: rgba(26,92,46,.08);
  border: 1px solid rgba(26,92,46,.2);
  color: var(--green-dark);
  border-radius: 100px;
  padding: .25rem .85rem;
  font-size: .8rem;
  margin-bottom: 1rem;
}
.huey-tone-badge strong { color: var(--green); }

/* ── Topbar bell ── */
.topbar-bell {
  position: relative;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 1.05rem;
  padding: .25rem .35rem;
  transition: color .2s;
}
.topbar-bell:hover { color: var(--gold-light); }
.topbar-bell-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--gold);
  color: var(--green-dark);
  font-size: .65rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 100px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Dashboard horse link ── */
.horse-link { color: var(--green-dark); transition: color .15s; }
.horse-link:hover { color: var(--green); text-decoration: underline; }

/* ── Field grid (horses index) ── */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.field-card {
  display: flex;
  align-items: stretch;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.field-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--gold);
}
.field-card-post {
  width: 56px;
  flex-shrink: 0;
  background: var(--green-dark);
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.field-card-body { padding: .85rem 1rem; flex: 1; min-width: 0; }
.field-card-name {
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field-card-meta { font-size: .78rem; color: var(--text-muted); margin-bottom: .55rem; }
.field-card-stats { display: flex; align-items: center; gap: .5rem; }
.field-card-fig { font-size: .78rem; font-weight: 600; color: var(--green); }

/* ── Horse detail ── */
.back-link {
  display: inline-block;
  font-size: .85rem;
  color: var(--green);
  margin-bottom: .5rem;
  text-decoration: none;
}
.back-link:hover { color: var(--green-light); text-decoration: underline; }

.horse-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .85rem;
  margin-bottom: 2rem;
}
.stat-tile {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.stat-tile-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.stat-tile-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.1;
  margin: .15rem 0 .5rem;
}
.stat-tile-bar { height: 6px; background: var(--cream); border-radius: 3px; overflow: hidden; }
.stat-tile-bar .stat-bar { max-width: none; height: 100%; border-radius: 3px; }
.stat-bar-gold  { background: var(--gold); }

/* ── Comments / debate ── */
.comment-form {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}
.comment-input {
  resize: vertical;
  font-family: inherit;
  background: var(--white);
}
.comment-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .65rem;
  gap: .75rem;
  flex-wrap: wrap;
}
.comment-hint { font-size: .78rem; color: var(--text-muted); }
.comment-hint code {
  background: var(--white);
  border: 1px solid var(--border);
  padding: .05rem .35rem;
  border-radius: 4px;
  font-size: .78rem;
}

.comment-thread { padding: 0; }
.comment {
  display: flex;
  gap: .85rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-deleted { opacity: .6; }
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.comment-avatar-sm { width: 32px; height: 32px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .85rem;
  color: var(--text);
  flex-wrap: wrap;
  margin-bottom: .35rem;
}
.comment-handle { color: var(--text-muted); font-size: .78rem; }
.comment-time { color: var(--text-muted); font-size: .78rem; }
.comment-text {
  font-size: .95rem;
  line-height: 1.55;
  color: var(--text);
  word-wrap: break-word;
}
.comment-actions {
  display: flex;
  gap: 1rem;
  margin-top: .5rem;
}
.comment-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}
.comment-action-btn:hover { color: var(--green); }
.comment-action-danger:hover { color: #842029; }

.comment-replies {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}
.comment-reply { padding: .75rem 0; border-bottom: 1px dashed var(--border); }
.comment-reply:last-child { border-bottom: none; }

/* ── Mentions ── */
.mention-tag {
  display: inline-block;
  color: var(--green);
  background: rgba(26,92,46,.08);
  padding: 0 .25rem;
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
}
.mention-tag:hover { background: rgba(26,92,46,.16); }

/* ── Notifications ── */
.notification-list {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.notification-row {
  display: flex;
  gap: .85rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.notification-row:last-child { border-bottom: none; }
.notification-row:hover { background: var(--cream); }
.notification-row.unread { background: rgba(200,169,81,.08); }
.notification-row.unread::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 8px;
  flex-shrink: 0;
}
.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.notification-body { flex: 1; min-width: 0; }
.notification-text { font-size: .92rem; }
.notification-snippet {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notification-time { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Mention autocomplete dropdown ── */
.mention-autocomplete {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  min-width: 240px;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.mention-autocomplete.open { display: block; }
.mention-suggestion {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.mention-suggestion:last-child { border-bottom: none; }
.mention-suggestion:hover,
.mention-suggestion.active { background: var(--cream); }
.mention-suggestion img { width: 28px; height: 28px; border-radius: 50%; }
.mention-suggestion-name { font-size: .88rem; font-weight: 600; color: var(--text); }
.mention-suggestion-handle { font-size: .75rem; color: var(--text-muted); }

/* ── Race Media (uploads) ── */
.upload-form { padding: 1.5rem; }
.upload-form .form-input[type="file"] { padding: .5rem; background: var(--white); }

.upload-tabs { margin-bottom: 1.75rem; }
.upload-tab-buttons {
  display: flex;
  gap: .5rem;
  margin-bottom: 0;
}
.upload-tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: none;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: .55rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: background .15s, color .15s;
}
.upload-tab-btn:hover { color: var(--green-dark); background: var(--cream); }
.upload-tab-btn.active {
  background: var(--white);
  color: var(--green-dark);
  border-color: var(--border);
  border-bottom: 1px solid var(--white);
  position: relative;
  z-index: 1;
}
.upload-tab-panel { display: none; }
.upload-tab-panel.active { display: block; }
.upload-tab-panel { border-radius: 0 12px 12px 12px; }

.media-list, .job-list { display: flex; flex-direction: column; }
.media-row, .job-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.media-row:last-child, .job-row:last-child { border-bottom: none; }
.media-row:hover, .job-row:hover { background: var(--cream); }

.media-row-icon, .job-row-icon { font-size: 1.6rem; flex-shrink: 0; }
.media-row-body, .job-row-body { flex: 1; min-width: 0; }
.media-row-title, .job-row-title {
  font-weight: 600;
  color: var(--green-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-row-meta, .job-row-meta { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.media-row-status { display: flex; align-items: center; gap: .55rem; flex-shrink: 0; }

.job-row-error {
  font-size: .8rem;
  color: #9b1c1c;
  margin-top: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

/* Status pills */
.status-pill {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-pending    { background: #fff3cd; color: #856404; }
.status-processing { background: #cfe2ff; color: #084298; }
.status-complete   { background: #d1e7dd; color: #0a3622; }
.status-failed     { background: #f8d7da; color: #842029; }

/* Job summary cards */
.job-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.job-summary-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}
.job-summary-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1;
}
.job-summary-label { font-size: .82rem; color: var(--text-muted); margin-top: .25rem; }

/* Transcript */
.transcript-text {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: .95rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  max-height: 480px;
  overflow-y: auto;
}

/* Horse-link cards (media detail) */
.horse-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  padding: 1.25rem 1.5rem;
}
.horse-link-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}
.horse-link-card:hover { border-color: var(--gold); background: var(--white); }
.horse-link-name { font-weight: 700; color: var(--green-dark); display: flex; align-items: center; gap: .4rem; }
.horse-link-count {
  background: var(--gold);
  color: var(--green-dark);
  font-size: .7rem;
  font-weight: 800;
  padding: 0 .4rem;
  border-radius: 100px;
}
.horse-link-snippet {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .35rem;
  font-style: italic;
  line-height: 1.4;
}

/* Field Notes (horse detail) */
.field-notes-list { display: flex; flex-direction: column; }
.field-note-row {
  display: flex;
  gap: .85rem;
  padding: .9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.field-note-row:last-child { border-bottom: none; }
.field-note-row:hover { background: var(--cream); }
.field-note-icon { font-size: 1.4rem; flex-shrink: 0; }
.field-note-body { flex: 1; min-width: 0; }
.field-note-title {
  font-weight: 600;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.field-note-count {
  background: var(--gold);
  color: var(--green-dark);
  font-size: .7rem;
  font-weight: 800;
  padding: 0 .4rem;
  border-radius: 100px;
}
.field-note-meta { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }
.field-note-snippet {
  font-size: .85rem;
  color: var(--text);
  margin-top: .35rem;
  font-style: italic;
  line-height: 1.5;
}

/* Responsive ── */
@media (max-width: 900px) {
  .dash-two-col { grid-template-columns: 1fr; }
  .stub-coming-features { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar-toggle { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .app-main { margin-left: 0; padding: 1.25rem; }
}
@media (max-width: 600px) {
  .nav { padding: 0 1rem; }
  .hero-content { padding: 3rem 1rem; }
  .auth-card { padding: 2rem 1.5rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
