/* ===================================
   Track My Gold — Global Styles
   =================================== */

:root {
  --bg: #0d0d1a;
  --bg-card: #14142a;
  --bg-input: #1a1a30;
  --gold: #d4af37;
  --gold-dim: #a8892c;
  --gold-glow: rgba(212, 175, 55, 0.15);
  --text: #e8e8f0;
  --text-dim: #8888aa;
  --border: rgba(212, 175, 55, 0.15);
  --success: #4caf50;
  --error: #e53935;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius: 8px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #e8c455; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-block { width: 100%; max-width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.1rem; }

.btn-gold {
  background: var(--gold);
  color: #0d0d1a;
}
.btn-gold:hover {
  background: #e8c455;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
}
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover {
  background: var(--gold-glow);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #ef5350; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 13, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) { color: var(--text-dim); font-size: 0.9rem; }
.nav-links a:not(.btn):hover { color: var(--text); }

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 24px 60px;
  max-width: 1140px;
  margin: 0 auto;
  gap: 60px;
}
.hero-content { flex: 1; }
.hero-badge {
  display: inline-block;
  background: var(--gold-glow);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: #fff;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 480px;
  margin-bottom: 36px;
}
.hero-cta { margin-bottom: 12px; }
.hero-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  opacity: 0.7;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
}
.phone-mockup {
  background: #0a0a18;
  border: 2px solid var(--border);
  border-radius: 32px;
  padding: 6px;
  width: 240px;
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.08), var(--shadow);
}
.mockup-screen {
  background: #0d1a0d;
  border-radius: 24px;
  overflow: hidden;
  padding: 16px;
}
.mockup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.mockup-label { font-size: 0.65rem; color: var(--text-dim); font-family: 'Oswald', sans-serif; letter-spacing: 0.05em; }
.mockup-price { font-size: 0.75rem; color: var(--gold); font-weight: 700; }
.mockup-map { border-radius: 8px; overflow: hidden; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.08); }
.mockup-finds { display: flex; flex-direction: column; gap: 6px; }
.mockup-find {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--text-dim);
}
.mf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.mf-dim { background: rgba(212,175,55,0.35); }

/* ---- Sections ---- */
.section-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.features, .pricing, .cta-banner {
  padding: 80px 24px;
  max-width: 1140px;
  margin: 0 auto;
}
.features h2, .pricing h2, .comparison h3 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 40px;
}

/* ---- Features ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover {
  border-color: rgba(212,175,55,0.4);
  transform: translateY(-2px);
}
.feature-icon { margin-bottom: 16px; }
.feature-card h3 { font-family: 'Oswald', sans-serif; font-size: 1.1rem; margin-bottom: 8px; color: #fff; }
.feature-card p { font-size: 0.9rem; color: var(--text-dim); }

/* ---- Pricing ---- */
.pricing-sub { color: var(--text-dim); margin-top: -32px; margin-bottom: 40px; font-size: 1.05rem; }
.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}
.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  position: relative;
}
.price-card-pro {
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(212,175,55,0.12);
}
.pc-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #0d0d1a;
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.pc-header { margin-bottom: 24px; }
.pc-tier {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pc-price { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.pc-amount { font-size: 2.4rem; font-weight: 700; color: #fff; font-family: 'Oswald', sans-serif; }
.pc-period { font-size: 0.9rem; color: var(--text-dim); }
.pc-annual { font-size: 0.8rem; color: var(--text-dim); margin-left: 6px; }
.pc-features {
  list-style: none;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pc-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text);
}
.pc-features li svg { flex-shrink: 0; }
.pc-locked { color: var(--text-dim) !important; opacity: 0.5; }
.pc-locked::before { content: '—  '; }

/* ---- Comparison Table ---- */
.comparison { margin-top: 40px; }
.comp-table-wrap { overflow-x: auto; }
.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.comp-table th, .comp-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--text-dim);
}
.comp-table th:first-child, .comp-table td:first-child { text-align: left; color: var(--text); font-weight: 600; }
.comp-table thead th {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.ct-highlight { color: var(--gold) !important; }
.ct-logo { color: var(--gold); }

/* ---- CTA Banner ---- */
.cta-banner { text-align: center; border-top: 1px solid var(--border); }
.cta-inner { padding: 60px 0; }
.cta-inner h2 { font-size: 2rem; color: #fff; margin-bottom: 12px; }
.cta-inner p { color: var(--text-dim); margin-bottom: 28px; }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}
.footer-inner { max-width: 1140px; margin: 0 auto; text-align: center; }
.footer-brand {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.footer-note { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 6px; }
.footer-legal { font-size: 0.78rem; color: rgba(136,136,170,0.5); }

/* ---- Dashboard (app shell) ---- */
.dashboard-wrapper {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* Auth screen */
.auth-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.auth-card h2 { font-size: 1.6rem; margin-bottom: 6px; color: #fff; }
.auth-card p { color: var(--text-dim); margin-bottom: 28px; font-size: 0.9rem; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 28px; background: var(--bg); border-radius: var(--radius); padding: 4px; }
.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: none;
  transition: all 0.2s;
}
.auth-tab.active { background: var(--gold); color: #0d0d1a; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; font-family: 'Oswald', sans-serif; letter-spacing: 0.05em; text-transform: uppercase; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--gold);
}
.form-group input::placeholder { color: var(--text-dim); }
.form-error { background: rgba(229,57,53,0.1); border: 1px solid var(--error); color: var(--error); padding: 10px 14px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 16px; }
.form-success { background: rgba(76,175,80,0.1); border: 1px solid var(--success); color: var(--success); padding: 10px 14px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 16px; }

/* Dashboard app bar */
.dash-header {
  background: rgba(13,13,26,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.dash-header-left { display: flex; align-items: center; gap: 16px; }
.dash-logo {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-spot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
}
.dash-spot-label { color: var(--text-dim); font-family: 'Oswald', sans-serif; font-size: 0.7rem; letter-spacing: 0.05em; }
.dash-spot-price { color: var(--gold); font-weight: 700; font-family: 'Oswald', sans-serif; }
.dash-header-right { display: flex; align-items: center; gap: 12px; }
.dash-tier-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.06em;
}
.tier-free { background: rgba(255,255,255,0.08); color: var(--text-dim); }
.tier-pro { background: var(--gold); color: #0d0d1a; }

/* Dashboard body */
.dash-body {
  flex: 1;
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-label { font-family: 'Oswald', sans-serif; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--text-dim); text-transform: uppercase; margin-bottom: 6px; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: #fff; font-family: 'Oswald', sans-serif; }
.stat-unit { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }

/* Sections */
.dash-section { margin-bottom: 32px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-header h3 { font-family: 'Oswald', sans-serif; font-size: 1rem; letter-spacing: 0.05em; color: var(--text-dim); text-transform: uppercase; }

/* Location cards */
.locations-list { display: flex; flex-direction: column; gap: 10px; }
.loc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.loc-card:hover, .loc-card.active { border-color: var(--gold); }
.loc-pin {
  width: 36px;
  height: 36px;
  background: var(--gold-glow);
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
  font-size: 0.85rem;
}
.loc-info { flex: 1; min-width: 0; }
.loc-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.loc-meta { font-size: 0.78rem; color: var(--text-dim); }
.loc-actions { display: flex; gap: 6px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.4; }
.empty-state h4 { font-family: 'Oswald', sans-serif; font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 0.88rem; }

/* Map */
#map { height: 300px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 20px; }
.leaflet-popup-content-wrapper { background: #14142a; color: #e8e8f0; border: 1px solid var(--border); border-radius: 8px; }
.leaflet-popup-tip { background: #14142a; }

/* Find list */
.finds-list { display: flex; flex-direction: column; gap: 8px; }
.find-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.find-gold-icon { font-size: 1.1rem; }
.find-info { flex: 1; min-width: 0; }
.find-weight { font-weight: 700; font-family: 'Oswald', sans-serif; font-size: 1rem; }
.find-meta { font-size: 0.78rem; color: var(--text-dim); }
.find-notes { font-size: 0.82rem; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.find-actions { display: flex; gap: 6px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  display: none;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 460px;
  position: relative;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: 'Oswald', sans-serif; font-size: 1.3rem; color: #fff; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* Location detail panel (map pin tap) */
.location-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}
.location-panel-overlay.hidden { display: none; }

.location-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 90vw;
  background: var(--bg-base);
  border-left: 1px solid var(--border);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 20px 24px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
}
.location-panel.open {
  transform: translateX(0);
}
.location-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.location-panel-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideIn 0.3s ease;
  max-width: 320px;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--error); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-dim); }
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
  .hero { flex-direction: column; padding-top: 80px; min-height: auto; }
  .hero-visual { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .comp-table th, .comp-table td { font-size: 0.75rem; padding: 8px 8px; }
  .dash-body { padding: 16px; }
  .nav-links .btn-outline { display: none; }
}

@media (max-width: 480px) {
  .pricing-cards { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
}

/* Map overrides */
.leaflet-container { background: #0d1a0d; }

/* ---- Tab bar ---- */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
}
.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--gold); color: #0d0d1a; }
.tab-btn svg { flex-shrink: 0; }

/* ---- Find Log ---- */
.findlog-count {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.findlog-list { display: flex; flex-direction: column; gap: 10px; }
.findlog-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color 0.2s;
}
.findlog-item:hover { border-color: rgba(212,175,55,0.3); }
.findlog-left { flex: 1; min-width: 0; }
.findlog-weight { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.findlog-g { font-family: 'Oswald', sans-serif; font-size: 1.15rem; font-weight: 700; color: #fff; }
.findlog-ozt { font-size: 0.75rem; color: var(--text-dim); font-weight: 400; }
.findlog-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.findlog-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.findlog-notes { font-style: italic; opacity: 0.75; }
.findlog-rates { display: flex; gap: 10px; }
.findlog-rate { font-size: 0.72rem; color: var(--text-dim); font-family: 'Oswald', sans-serif; letter-spacing: 0.03em; }
.findlog-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.findlog-usd {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #d4af37;
}
.findlog-date { font-size: 0.72rem; color: var(--text-dim); }
.findlog-actions { display: flex; gap: 4px; margin-top: 4px; }
.findlog-action-btn { padding: 5px 7px; }
.findlog-action-btn svg { display: block; }

/* ---- Weight conversions ---- */
.weight-conversions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.03em;
}

/* ---- Time worked toggle ---- */
.time-worked-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 6px;
  padding: 3px;
  margin-bottom: 4px;
}
.time-toggle-btn {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.time-toggle-btn.active { background: var(--gold); color: #0d0d1a; }

/* ---- Share card ---- */
.share-card-inner { width: 100%; }

/* ---- Section title ---- */
.section-title { font-family: 'Oswald', sans-serif; font-size: 1rem; letter-spacing: 0.05em; color: var(--text-dim); text-transform: uppercase; }

/* ---- Color dot selected state ---- */
.color-dot-btn.selected, .edit-color-btn.selected { border: 2px solid white !important; }

/* ---- Spots list ---- */
.spots-list { display: flex; flex-direction: column; }

/* ---- Location color square (used in Categories list) ---- */
.loc-color-square { flex-shrink: 0; }

/* ---- Detail page back button ---- */
.detail-back { margin-bottom: 12px; display: inline-flex; align-items: center; gap: 6px; }

/* ---- Map Page ---- */
.map-page-container { display: flex; flex-direction: column; gap: 0; }

.map-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.map-page-counter {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.map-page-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Basemap toggle (Street / Satellite) */
.map-basemap-toggle {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
}
.map-toggle-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.map-toggle-btn.active { background: var(--gold); color: #0d0d1a; }
.map-toggle-btn:hover:not(.active) { color: var(--text); }

/* Overlays dropdown */
.overlays-dropdown { position: relative; }

.overlays-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.overlays-toggle-btn:hover, .overlays-toggle-btn.open {
  border-color: var(--gold);
  color: var(--text);
}

.overlays-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  min-width: 240px;
  z-index: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.overlay-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.15s;
  user-select: none;
}
.overlay-item:hover { background: rgba(255,255,255,0.04); }

.overlay-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

.overlay-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
}
.blm-swatch { background: #c8a879; }
.usfs-swatch { background: #2d8a4e; }

.overlay-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 1px;
  line-height: 1.3;
}

.overlays-footer {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Map wrap */
.map-wrap {
  position: relative;
}

/* z-index fix: map container must not overflow */
#map { position: relative; z-index: 1; }

/* Force Leaflet containers inside #map to stay bounded */
.leaflet-container { z-index: 1 !important; }
.leaflet-pane { z-index: 2 !important; }
.leaflet-control-container { z-index: 400 !important; }
.leaflet-popup { z-index: 600 !important; }
.leaflet-tooltip { z-index: 700 !important; }

/* Map legend */
.map-legend {
  position: absolute;
  bottom: 20px;
  left: 12px;
  background: rgba(20, 20, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  z-index: 300;
  backdrop-filter: blur(8px);
  min-width: 180px;
}

.legend-section { margin-bottom: 10px; }
.legend-section:last-child { margin-bottom: 0; }

.legend-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text);
  margin-bottom: 4px;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.blm-swatch-sm { background: #c8a879; }
.usfs-swatch-sm { background: #2d8a4e; }

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-name { font-size: 0.78rem; color: var(--text); }

/* ===================================
   Persistent Sidebar Nav
   =================================== */

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

/* Sidebar */
.sb-nav {
  width: 220px;
  min-width: 220px;
  background: #0d0d1a;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sb-logo {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.sb-logo:hover { color: var(--gold); }

.sb-section-label {
  padding: 16px 20px 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}

.sb-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border: 1px solid transparent;
}

.sb-link:hover {
  background: rgba(212,175,55,0.07);
  color: var(--text);
  border-color: rgba(212,175,55,0.15);
}

.sb-link.active {
  background: var(--gold-glow);
  color: var(--gold);
  border-color: rgba(212,175,55,0.25);
}

.sb-link svg { flex-shrink: 0; }

.sb-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 20px;
}

.sb-bottom {
  margin-top: auto;
  padding: 16px 10px;
  border-top: 1px solid var(--border);
}

.sb-close-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}

.sb-close-btn:hover { background: rgba(229,57,53,0.1); color: #e53935; }

/* Main content area */
.sb-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sb-topbar {
  background: rgba(13,13,26,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.sb-topbar-left { display: flex; align-items: center; gap: 16px; }
.sb-topbar-logo {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.sb-topbar-logo:hover { color: var(--gold); }

.sb-spot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
}
.sb-spot-label { color: var(--text-dim); font-family: 'Oswald', sans-serif; font-size: 0.7rem; letter-spacing: 0.05em; }
.sb-spot-price { color: var(--gold); font-weight: 700; font-family: 'Oswald', sans-serif; }

.sb-topbar-right { display: flex; align-items: center; gap: 12px; }
.sb-tier-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.06em;
}

.sb-content {
  flex: 1;
  padding: 24px;
}

/* Mobile sidebar overlay */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

.sb-hamburger {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 8px;
  color: var(--text-dim);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.sb-hamburger:hover { border-color: var(--gold); color: var(--gold); }

/* ===================================
   Dashboard Hero Card
   =================================== */

.hero-card {
  background: linear-gradient(135deg, #1a1520 0%, #14142a 100%);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(212,175,55,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.hero-card-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.hero-card-link {
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: color 0.15s;
}
.hero-card-link:hover { color: #e8c455; }

.hero-card-value-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 4px;
}

.hero-card-main-value {
  font-family: 'Oswald', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.hero-card-weight {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  color: var(--text-dim);
  font-weight: 400;
}

.hero-card-prices {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.hero-price-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-price-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hero-price-value {
  font-family: 'Oswald', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
}

.hero-price-value.gold-price { color: var(--gold); }
.hero-price-value.silver-price { color: #c0c0d8; }

/* ===================================
   Dashboard Stats Row (4 cards)
   =================================== */

.stats-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card-4 {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}

.stat-card-4 .stat-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.stat-card-4 .stat-value {
  font-family: 'Oswald', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.stat-card-4 .stat-unit {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ===================================
   Dashboard Recent Finds
   =================================== */

.dash-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dash-recent-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}

.dash-find-list { display: flex; flex-direction: column; gap: 8px; }

.dash-find-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s;
}
.dash-find-item:hover { border-color: rgba(212,175,55,0.3); }

.dash-find-weight {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  min-width: 80px;
  line-height: 1.2;
}
.dash-find-weight small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 400;
}

.dash-find-meta {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-find-meta strong { color: var(--text); font-weight: 600; }

.dash-find-usd {
  font-family: 'Oswald', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}

.dash-find-date {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ===================================
   Analytics Page
   =================================== */

.analytics-page { padding-bottom: 40px; }

.analytics-stats-row {
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  margin-bottom: 24px;
}

.analytics-hero-card {
  text-align: left;
  padding: 20px 22px;
}

.analytics-section-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 6px;
}

.analytics-hero-value {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}

.analytics-hero-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.analytics-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.analytics-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.analytics-section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.analytics-section-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.chart-container {
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  gap: 8px;
  padding: 40px;
  text-align: center;
}

.chart-live-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-row-4 { grid-template-columns: 1fr 1fr; }
  .analytics-stats-row { grid-template-columns: 1fr 1fr; }
  .hero-card { padding: 18px 20px; }
  .hero-card-main-value { font-size: 1.7rem; }
  .chart-container { height: 220px; }
}

@media (max-width: 480px) {
  .stats-row-4 { grid-template-columns: 1fr 1fr; }
  .analytics-stats-row { grid-template-columns: 1fr; }
  .hero-card-prices { gap: 12px; }
  .dash-find-weight { min-width: 60px; font-size: 0.9rem; }
}

/* ====== Mobile sidebar ====== */
@media (max-width: 900px) {
  .sb-nav {
    position: fixed;
    left: -240px;
    top: 0;
    width: 240px;
    min-width: 240px;
    z-index: 100;
    transition: left 0.25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sb-nav.open { left: 0; }
  .sb-overlay { display: block; }
  .sb-overlay.hidden { display: none; }
  .sb-hamburger { display: flex; }
  .sb-close-btn { display: flex; }
}