@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;
}

.login-success {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
  text-align: left;
  line-height: 1.5;
}

.login-card p a { font-weight: 600; }

/* ── 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;
}

/* Grid children default to min-width:auto, which lets a wide table stretch the whole page. */
.adm-detail-layout > * { min-width: 0; }

.pg-editor-layout { grid-template-columns: 1fr; }
.pg-editor-layout .adm-detail-left { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.pg-editor-layout .adm-detail-right { position: static; }
@media (max-width: 1100px) { .pg-editor-layout .adm-detail-left { grid-template-columns: 1fr; } }

.pg-strain-add { display: inline-flex; gap: 0.3rem; align-items: center; }
.pg-strain-add input { padding: 0.35rem 0.6rem; font-size: 0.8rem; width: 170px; }
.pg-table tr.pg-new-row td[contenteditable] { background: rgba(201, 169, 110, 0.16); }
.pg-row-ins { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.95rem; padding: 0.2rem 0.3rem; opacity: 0.5; }
.pg-row-ins:hover { color: var(--gold); opacity: 1; }
.pg-table tr:hover .pg-row-ins { opacity: 1; }

.zip-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 0.9rem; margin-bottom: 0.75rem;
  border: 1px dashed var(--border); border-radius: var(--radius);
  font-size: 0.8rem; color: var(--text-muted);
}
.zip-bar.active { border-style: solid; border-color: var(--border-gold); color: var(--text-primary); background: rgba(201, 169, 110, 0.06); }
.zip-bar-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.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);
}

/* ── User Management ─────────────────────────────── */

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.users-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 1rem;
}

.perm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.perm-chip {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.55rem;
  border-radius: 30px;
  background: rgba(201, 169, 110, 0.12);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.perm-chip.admin-all {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.3);
}

.perm-chip.none {
  background: rgba(102, 102, 102, 0.12);
  color: var(--text-muted);
  border-color: var(--border);
}

.permission-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

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

.permission-toggle-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
}

.permission-toggle-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: var(--transition);
}

.switch .slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.switch input:checked + .slider {
  background: rgba(201, 169, 110, 0.25);
  border-color: var(--gold);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: var(--gold);
}

/* ── AZ Package Builder ──────────────────────────── */

.az-package-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(201, 169, 110, 0.06);
  border: 1px dashed var(--border-gold);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.az-package-line .az-step {
  padding: 0.2rem 0.55rem;
  border-radius: 30px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.72rem;
}

.az-package-line .az-step.missing {
  color: var(--text-muted);
  border-style: dashed;
  font-weight: 500;
}

.az-package-line .az-step.generated {
  border-color: var(--gold);
  color: var(--gold);
}

.az-package-line .az-arrow { color: var(--text-muted); }

.az-group-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.75rem;
}

.az-warn {
  font-size: 0.75rem;
  color: var(--warning);
  margin-top: 0.5rem;
}

.az-info {
  font-size: 0.75rem;
  color: var(--info);
  margin-top: 0.5rem;
}

/* Cover letter editor */
.cover-modal { max-width: 1280px; width: 96vw; }

.cover-editor-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.25rem;
  max-height: 72vh;
  overflow: hidden;
}

.cover-editor-form {
  overflow-y: auto;
  padding-right: 0.5rem;
  min-width: 0;
}

.cover-editor-form .form-section-title { margin-top: 1.25rem; }
.cover-editor-form .form-section-title:first-child { margin-top: 0; }

.cover-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  margin-left: 0.4rem;
}

.cover-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 0.75rem;
}

.cover-layout-select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  font-family: inherit;
}

.cover-inputs-head,
.cover-input-row {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 0.8fr 1.6fr 28px;
  gap: 0.4rem;
  align-items: center;
}

.cover-inputs-head {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 0 0.3rem;
}

.cover-input-row { margin-bottom: 0.4rem; }

.cover-input-row input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
}

.cover-input-row input:focus { outline: none; border-color: var(--gold); }

.cover-row-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: var(--transition);
}

.cover-row-remove:hover { color: var(--danger); border-color: var(--danger); }

.cover-bulk-tools {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cover-bulk-tools input {
  flex: 1;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
}

.cover-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.cover-check input { accent-color: var(--gold); }

.cover-editor-preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a1a1a;
}

.cover-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
}

.cover-preview-frame {
  flex: 1;
  width: 100%;
  border: 0;
  min-height: 420px;
  background: #fff;
}

@media (max-width: 1000px) {
  .cover-editor-body { grid-template-columns: 1fr; max-height: none; overflow: visible; }
  .cover-editor-preview { min-height: 480px; }
  .cover-inputs-head { display: none; }
  .cover-input-row { grid-template-columns: 1fr 1fr; }
  .cover-input-row .cover-row-remove { grid-column: span 2; width: 100%; border-radius: var(--radius); }
}

/* ── Compliance pages (public) ───────────────────── */

.page-intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0.5rem 0 0.25rem;
  max-width: 720px;
}

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

.page-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1.5rem 0 1rem;
}

.page-search {
  flex: 1;
  min-width: 220px;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.page-search:focus { outline: none; border-color: var(--gold); }

.page-toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.page-table-wrap { overflow-x: auto; }

.page-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.page-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-gold);
  white-space: nowrap;
}

.page-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.page-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.page-table tr.row-hit td { background: rgba(201, 169, 110, 0.08); color: var(--text-primary); }
.page-table mark { background: rgba(201, 169, 110, 0.35); color: var(--text-primary); border-radius: 2px; padding: 0 2px; }
.page-table .page-nomatch, .page-nomatch { text-align: center; color: var(--text-muted); padding: 2rem; }

.page-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.page-tabs:empty { display: none; }
.page-tab {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.page-tab:hover { border-color: var(--border-gold); color: var(--text-primary); }
.page-tab.active { background: var(--gold); border-color: var(--gold); color: #111; font-weight: 600; }

.page-group-title {
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 1.5rem 0 0.5rem;
}
.page-group-title:first-child { margin-top: 0; }
.page-group-title span { color: var(--text-muted); font-weight: 400; margin-left: 0.3rem; }

.pg-sections { margin-bottom: 0.6rem; }
.pg-section-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.pg-section-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}
.pg-section-tab.active { background: var(--gold); border-color: var(--gold); color: #111; font-weight: 600; }
.pg-section-tab.hidden-section:not(.active) { opacity: 0.6; border-style: dashed; }
.pg-section-count { opacity: 0.7; font-size: 0.7rem; }
.pg-section-flag { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; }
.pg-section-tools { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.page-empty { color: var(--text-muted); text-align: center; padding: 2rem 0; }
.page-count { color: var(--text-muted); font-size: 0.75rem; margin: 0.75rem 0 0; text-align: right; }

.page-embed {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.page-siblings { margin-top: 2.5rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.page-siblings h3 { font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin: 0 0.5rem 0 0; }

/* Links from a COA to compliance pages */
.compliance-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.compliance-link {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  text-decoration: none;
  background: rgba(201, 169, 110, 0.05);
  transition: background 0.15s, border-color 0.15s;
}

.compliance-link:hover { background: rgba(201, 169, 110, 0.12); border-color: var(--gold); }
.compliance-link strong { display: block; color: var(--gold); font-size: 0.95rem; margin-bottom: 0.25rem; }
.compliance-link span { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.4; }

/* ── Compliance pages (admin) ────────────────────── */

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

.pages-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.pages-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.pages-card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.pages-card-head strong { color: var(--text-primary); font-size: 1rem; }
.pages-card p { color: var(--text-secondary); font-size: 0.8rem; margin: 0 0 0.75rem; line-height: 1.45; min-height: 2.3em; }
.pages-card-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.pages-card-url { margin-top: 0.6rem; font-size: 0.72rem; color: var(--gold); font-family: ui-monospace, Menlo, monospace; }

.pg-table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius); }

.pg-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.pg-table th, .pg-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0; }
.pg-table th { position: sticky; top: 0; background: var(--bg-secondary, #141414); color: var(--gold); font-size: 0.68rem; letter-spacing: 0.8px; text-transform: uppercase; text-align: left; z-index: 1; }
.pg-table th span { display: inline-block; padding: 0.55rem 0.6rem; min-width: 60px; outline: none; }
.pg-table th span:focus { background: rgba(201, 169, 110, 0.12); }
.pg-table td[contenteditable] { padding: 0.45rem 0.6rem; color: var(--text-secondary); min-width: 90px; outline: none; white-space: nowrap; }
.pg-table td[contenteditable]:focus { background: rgba(201, 169, 110, 0.12); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--gold); }
.pg-table .pg-rownum { color: var(--text-muted); font-size: 0.68rem; text-align: right; padding: 0.45rem 0.5rem; width: 34px; background: rgba(255, 255, 255, 0.02); }
.pg-table .pg-rowact { width: 30px; text-align: center; }
.pg-col-del, .pg-row-del { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.95rem; padding: 0.2rem 0.4rem; opacity: 0.5; }
.pg-col-del:hover, .pg-row-del:hover { color: var(--danger); opacity: 1; }
.pg-table tr:hover .pg-row-del { opacity: 1; }

/* ── Staff preview banner (public COA page) ──────── */

.preview-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ── Public link & QR panel ──────────────────────── */

.link-qr-row {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.link-qr-info { flex: 1; min-width: 0; }

.link-qr-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.link-copy-row {
  display: flex;
  gap: 0.5rem;
}

.link-copy-row input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
}

.link-qr-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.link-qr-preview img {
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border-gold);
  background: #0a0a0a;
}

.doc-toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.doc-list { margin-top: 0.75rem; }

.doc-list-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.doc-list-item .doc-type {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--gold);
  min-width: 120px;
}

.doc-list-item .doc-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.doc-list-item .doc-remove {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 30px;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  cursor: pointer;
}

.doc-list-item .doc-remove:hover { color: var(--danger); border-color: var(--danger); }

.public-link-box {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.public-link-box input {
  width: min(100%, 420px);
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-align: center;
}

/* ── Document Tabs ───────────────────────────────── */

.doc-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.doc-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: none;
}

.doc-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.doc-tab.active {
  background: var(--bg-card);
  color: var(--gold);
  border-color: var(--gold);
  border-bottom: 2px solid var(--bg-card);
  margin-bottom: -1px;
}

/* ── AZ Partner Upload ──────────────────────────── */

.az-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
}

.az-group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.az-group-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.az-group-files {
  padding: 0.75rem 1.25rem;
}

.az-file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(42, 42, 42, 0.3);
}

.az-file-item:last-child {
  border-bottom: none;
}

.az-file-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.6rem;
  border-radius: 30px;
  color: var(--bg-primary);
  flex-shrink: 0;
}

.az-file-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.az-file-method {
  flex-shrink: 0;
}

/* ── 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; }
}
