@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700&display=swap');

:root {
  --gold: #c9a96e;
  --gold-light: #dfc089;
  --gold-dark: #a8894e;
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-input: #151515;
  --border: #2a2a2a;
  --border-gold: rgba(201, 169, 110, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #666666;
  --success: #4ade80;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #60a5fa;
  --coral: #e8927c;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-gold: 0 0 30px rgba(201, 169, 110, 0.1);
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-light); }

/* ── Header ────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
}

.logo-img {
  height: 42px;
  width: auto;
  display: block;
}

.logo span {
  font-weight: 400;
  font-size: 0.65em;
  display: block;
  letter-spacing: 6px;
  color: var(--text-secondary);
  margin-top: -2px;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* ── Hero Section ─────────────────────────────────── */

.hero {
  position: relative;
  text-align: center;
  padding: 5rem 2rem 3rem;
  background:
    linear-gradient(180deg, rgba(10,10,10,0) 0%, rgba(10,10,10,1) 100%),
    linear-gradient(180deg, rgba(40,35,25,0.4) 0%, rgba(10,10,10,0.9) 70%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(201,169,110,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 1rem;
  position: relative;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* ── US Map ───────────────────────────────────────── */

.map-section {
  position: relative;
  background:
    linear-gradient(180deg, var(--bg-primary) 0%, rgba(20,18,14,0.95) 40%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem 2rem;
}

.map-container {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.us-map-svg {
  width: 100%;
  height: auto;
  display: block;
}

.state-path {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(201, 169, 110, 0.15);
  stroke-width: 0.8;
  cursor: pointer;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.state-path.available {
  fill: rgba(201, 169, 110, 0.12);
  stroke: rgba(201, 169, 110, 0.35);
}

.state-path.available:hover {
  fill: rgba(201, 169, 110, 0.28);
  stroke: var(--gold);
  stroke-width: 1.5;
}

.state-path.coming {
  fill: rgba(255, 255, 255, 0.03);
  stroke: rgba(255, 255, 255, 0.08);
}

.state-path.coming:hover {
  fill: rgba(232, 146, 124, 0.12);
  stroke: rgba(232, 146, 124, 0.4);
}

.state-path.selected {
  fill: rgba(201, 169, 110, 0.35) !important;
  stroke: var(--gold) !important;
  stroke-width: 2;
}

.state-borders {
  fill: none;
  stroke: rgba(10, 10, 10, 0.9);
  stroke-width: 1;
  pointer-events: none;
}

.state-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.state-label.label-available {
  fill: var(--gold);
}

.state-label.label-coming {
  fill: var(--coral);
  opacity: 0.7;
}

.state-label.label-selected {
  fill: var(--text-primary);
  font-size: 13px;
}

.map-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.15s ease;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.map-tooltip.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.map-legend {
  display: flex;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 1rem auto 0;
  padding: 0.75rem 1.25rem;
  background: rgba(26, 26, 26, 0.8);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: fit-content;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-available { background: var(--gold); }
.legend-coming { background: var(--coral); }

/* ── Search Section ───────────────────────────────── */

.search-section {
  padding: 2rem 2rem 0;
}

.search-section-inner {
  max-width: 700px;
  margin: 0 auto;
}

.selected-state-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(201, 169, 110, 0.1);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 0.65rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 600;
}

/* ── Search ───────────────────────────────────────── */

.search-container {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.search-bar {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 60px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.search-bar:focus-within {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar button {
  background: var(--gold);
  border: none;
  padding: 1rem 2rem;
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

.search-bar button:hover { background: var(--gold-light); }

/* ── Filters ──────────────────────────────────────── */

.filters-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.filters-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: var(--transition);
  margin-bottom: 1rem;
}

.filters-toggle:hover { border-color: var(--gold); color: var(--gold); }

.filters-panel {
  display: none;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.filters-panel.open { display: flex; }

.filter-group label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.filter-group select,
.filter-group input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  min-width: 160px;
  outline: none;
  transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--gold);
}

/* ── Results ──────────────────────────────────────── */

.results-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

/* ── COA Card ─────────────────────────────────────── */

.coa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.coa-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
  opacity: 0;
  transition: var(--transition);
}

.coa-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.coa-card:hover::before { opacity: 1; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.25rem 0.7rem;
  border-radius: 30px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.badge-passed { background: rgba(74,222,128,0.15); color: var(--success); }
.badge-failed { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-draft { background: rgba(96,165,250,0.15); color: var(--info); }
.badge-published { background: rgba(74,222,128,0.15); color: var(--success); }
.badge-archived { background: rgba(102,102,102,0.15); color: var(--text-muted); }

.card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.meta-value {
  color: var(--text-secondary);
  font-weight: 500;
}

.meta-value.highlight {
  color: var(--gold);
  font-weight: 600;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-link::after {
  content: '→';
  transition: var(--transition);
}

.coa-card:hover .card-link::after { transform: translateX(3px); }

/* ── COA Detail Page ──────────────────────────────── */

.detail-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.detail-back:hover { color: var(--gold); }

.detail-header {
  margin-bottom: 2rem;
}

.detail-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.detail-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.detail-section h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(42,42,42,0.5);
}

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

.detail-row .label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.detail-row .value {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
  text-align: right;
}

.potency-big {
  display: flex;
  gap: 2rem;
  justify-content: center;
  padding: 1rem 0;
}

.potency-item {
  text-align: center;
}

.potency-item .number {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
}

.potency-item .unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
}

.safety-table {
  width: 100%;
}

.safety-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(42,42,42,0.5);
}

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

.safety-test-name { color: var(--text-secondary); font-size: 0.9rem; }

.safety-result {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.safety-pass { color: var(--success); }
.safety-fail { color: var(--danger); }

.pdf-section {
  margin-top: 2rem;
}

.pdf-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pdf-viewer {
  width: 100%;
  height: 800px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

/* ── Terpene Chart ────────────────────────────────── */

.terpene-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
}

.terpene-name {
  flex: 0 0 140px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terpene-bar-wrap {
  flex: 1;
  background: rgba(42, 42, 42, 0.5);
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}

.terpene-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.5s ease;
}

.terpene-pct {
  flex: 0 0 60px;
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── QR Section ──────────────────────────────────── */

.qr-section img {
  image-rendering: pixelated;
}

/* ── Buttons ──────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-gold {
  background: var(--gold);
  color: var(--bg-primary);
}
.btn-gold:hover { background: var(--gold-light); color: var(--bg-primary); }

.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1rem; }

/* ── Empty State ──────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1.5rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-state p { font-size: 0.9rem; }

/* ── Loading ──────────────────────────────────────── */

.loading {
  display: flex;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Pagination ───────────────────────────────────── */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.pagination button:hover { border-color: var(--gold); color: var(--gold); }
.pagination button.active {
  background: var(--gold);
  color: var(--bg-primary);
  border-color: var(--gold);
}
.pagination button:disabled { opacity: 0.3; cursor: default; }

/* ── Footer ───────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  position: relative;
}

.footer-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-brand {
  flex: 0 0 280px;
}

.footer-logo {
  height: 36px;
  width: auto;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.footer-legal {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

.footer-social a {
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-social a:hover {
  color: var(--gold);
}

.footer-links {
  flex: 1;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 120px;
}

.footer-col h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.footer-col a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-think-higher {
  text-align: center;
  padding: 2rem 2rem 1.5rem;
  border-top: 1px solid var(--border);
}

.think-higher-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 2.5rem;
  color: var(--text-primary);
  opacity: 0.9;
  letter-spacing: 1px;
}

.footer-bottom {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 2rem 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-bottom a {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

.footer-bottom a:hover {
  color: var(--text-secondary);
}

/* ── Admin Styles ─────────────────────────────────── */

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

.admin-sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}

.admin-sidebar .logo { margin-bottom: 2rem; }

.admin-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.admin-nav a:hover { background: var(--bg-card); color: var(--text-primary); }
.admin-nav a.active { background: rgba(201,169,110,0.1); color: var(--gold); }

.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  min-width: 0;
  overflow-x: hidden;
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--gold);
  min-width: 0;
}

.admin-page-header .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Admin Table ──────────────────────────────────── */

.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: rgba(42,42,42,0.3);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(42,42,42,0.3);
  vertical-align: middle;
}

.admin-table tr:hover td { background: rgba(42,42,42,0.2); }

.admin-table .product-cell {
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Upload / Form Modal ──────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--gold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ── Drop Zone ────────────────────────────────────── */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--gold);
  background: rgba(201,169,110,0.05);
}

.drop-zone svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.drop-zone.dragover svg { color: var(--gold); }

.drop-zone h3 {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.drop-zone p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.drop-zone .file-info {
  margin-top: 1rem;
  color: var(--gold);
  font-weight: 600;
}

/* ── Form Fields ──────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-section-title {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

/* ── Toast Notification ───────────────────────────── */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Login Page ───────────────────────────────────── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card .logo { margin-bottom: 2rem; }

.login-card h2 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.login-card .form-group {
  text-align: left;
  margin-bottom: 1rem;
}

.login-card .form-group input { width: 100%; }

.login-card .btn { width: 100%; margin-top: 0.5rem; }

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

/* ── Admin Stats ──────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.stat-card .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Admin Alerts ─────────────────────────────────── */

.alert-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.alert-item:last-child { margin-bottom: 0; }

.alert-item strong {
  font-variant-numeric: tabular-nums;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--warning);
}

.alert-info {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: var(--info);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
}

/* ── Admin Detail View ────────────────────────────── */

.adm-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.adm-detail-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.adm-detail-right {
  position: sticky;
  top: 1rem;
}

.admin-pdf-viewer {
  width: 100%;
  height: 700px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

/* ── Analytics View ──────────────────────────────── */

.analytics-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.analytics-card h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.analytics-card-wide {
  grid-column: 1 / -1;
}

.chart-container {
  min-height: 120px;
}

.chart-container-wide {
  min-height: 180px;
}

.chart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.85rem;
}

/* Bar chart rows */
.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3rem 0;
}

.chart-bar-label {
  flex: 0 0 80px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-track {
  flex: 1;
  background: rgba(42, 42, 42, 0.5);
  border-radius: 4px;
  height: 20px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.5s ease;
}

.chart-bar-value {
  flex: 0 0 36px;
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Donut chart */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.donut-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.donut-center {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-total {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}

.donut-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.donut-legend-item strong {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Histogram */
.histogram-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  height: 160px;
  padding-bottom: 2.5rem;
  position: relative;
}

.histogram-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.histogram-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.histogram-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
}

.histogram-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  white-space: nowrap;
}

.histogram-value {
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Trend line */
.trend-svg {
  width: 100%;
  height: auto;
  display: block;
}

.trend-labels {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.5rem 0;
}

.trend-labels span {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 1200px) {
  .adm-detail-layout { grid-template-columns: 1fr; }
  .adm-detail-right { position: static; }
}

@media (max-width: 768px) {
  .hero { padding: 3rem 1.5rem 2rem; }
  .results-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .potency-big { flex-direction: column; gap: 1rem; }
  .pdf-viewer { height: 500px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .donut-wrap { flex-direction: column; align-items: center; }

  .admin-sidebar {
    transform: translateX(-100%);
    transition: var(--transition);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }

  .admin-table-wrap { overflow-x: auto; }
  .admin-table { min-width: 700px; }
  .admin-pdf-viewer { height: 400px; }
}

@media (max-width: 480px) {
  .search-bar { flex-direction: column; border-radius: var(--radius-lg); }
  .search-bar button { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .card-meta { grid-template-columns: 1fr; }
}
