/* ─── DESIGN TOKENS ─────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:     #FAFAF7;
  --bg-white:    #FFFFFF;
  --bg-subtle:   #F5F5F2;
  --bg-dark:     #1C1F1A;

  /* Borders */
  --border-light: #EEEEEA;
  --border-mid:   #D4D4CF;
  --border-dark:  #A8A8A2;

  /* Text */
  --text-primary:   #1C1C18;
  --text-secondary: #6B6B63;
  --text-muted:     #A0A09A;
  --text-faint:     #C8C8C2;
  --text-inverse:   #F5F5F2;

  /* Brand — olive */
  --olive-900: #1C2A08;
  --olive-800: #2D3F0F;
  --olive-700: #3D5414;
  --olive-600: #4A5E2A;
  --olive-500: #6B8C3A;
  --olive-400: #8FAE1B;
  --olive-100: #EEF3E6;
  --olive-50:  #F8FAF3;

  /* Brand — gold */
  --gold:      #C9A84C;
  --gold-dark: #A07820;
  --gold-subtle: #F5EDD6;

  /* Semantic */
  --success:   #3D8A3D;
  --warning:   #8A6200;
  --danger:    #9B2020;
  --info:      #1A4D7A;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Spacing — 8px grid */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;

  /* Radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(28,28,24,0.06);
  --shadow-sm: 0 2px 8px rgba(28,28,24,0.06);
  --shadow-md: 0 4px 16px rgba(28,28,24,0.08);
  --shadow-lg: 0 8px 32px rgba(28,28,24,0.10);

  /* Transitions */
  --transition: 150ms ease;
}

/* ─── RESET & BASE ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.75;
}

/* Selection */
::selection { background: #D4E4B8; color: var(--text-primary); }

/* ─── TYPOGRAPHY ────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.3; }

/* ─── BUTTONS ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 500;
  border: none; cursor: pointer; transition: var(--transition);
  text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.btn-primary {
  background: var(--olive-700); color: var(--text-inverse);
}
.btn-primary:hover { background: var(--olive-800); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-gold {
  background: var(--gold); color: var(--bg-white);
}
.btn-gold:hover { background: var(--gold-dark); transform: translateY(-1px); }
.btn-outline {
  background: var(--bg-white); border: 1px solid var(--border-mid); color: var(--text-primary);
}
.btn-outline:hover { background: var(--bg-subtle); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); }
.btn-danger {
  background: var(--bg-white); border: 1px solid #C8A8A8; color: var(--danger);
}
.btn-danger:hover { background: #FDF8F8; }
.btn-sm { padding: 7px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 13px 28px; font-size: 0.9375rem; }

/* ─── CARDS ─────────────────────────────────────── */
.card {
  background: var(--bg-white); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: var(--space-lg);
}
.card-hover { transition: var(--transition); }
.card-hover:hover { box-shadow: var(--shadow-sm); }

/* ─── FORMS ─────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-xs); margin-bottom: var(--space-md); }
.form-label { font-size: 0.8125rem; font-weight: 500; color: #4A4A44; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input {
  padding: 10px 12px; border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm); font-family: var(--font-body);
  font-size: 0.9375rem; color: var(--text-primary); background: var(--bg-white);
  transition: var(--transition); width: 100%;
}
.form-input:focus { outline: none; border-color: var(--olive-600); border-width: 1.5px; }
.form-input.error { border-color: var(--danger); }
.form-help { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.form-error { font-size: 0.75rem; color: var(--danger); }

/* ─── BADGES ────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.02em;
}
.badge-green  { background: #EEF5EE; color: var(--success); }
.badge-gold   { background: var(--gold-subtle); color: var(--gold-dark); }
.badge-gray   { background: transparent; color: var(--text-muted); border: 1px solid var(--border-light); }
.badge-red    { background: #FDE8E8; color: var(--danger); }

/* ─── ALERTS ────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.8125rem; border-left: 3px solid;
}
.alert-success { background: #F5FAF5; border-color: var(--success); color: var(--success); }
.alert-danger  { background: #FDF5F5; border-color: var(--danger); color: var(--danger); }
.alert-warning { background: #FDF8E8; border-color: var(--warning); color: var(--warning); }

/* ─── TABLES ────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left; padding: 8px 12px;
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}
.table td {
  padding: 12px; border-bottom: 1px solid #F0F0EC;
  vertical-align: middle; color: var(--text-secondary);
}
.table tr:hover td { background: var(--bg-base); }
.table tr:last-child td { border-bottom: none; }

/* ─── PROGRESS ──────────────────────────────────── */
.progress { height: 3px; background: var(--border-light); border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.progress-excellent { background: var(--olive-500); }
.progress-good      { background: var(--gold); }
.progress-standard  { background: var(--border-dark); }

/* ─── TABS ──────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border-light); gap: 0; margin-bottom: var(--space-lg); }
.tab-btn {
  padding: 10px 16px; font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted); border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--text-primary); border-bottom-color: var(--olive-600); }

/* ─── UPLOAD ZONE ───────────────────────────────── */
.upload-zone {
  border: 1px dashed var(--border-mid); border-radius: var(--radius-md);
  padding: var(--space-xl); text-align: center; cursor: pointer;
  transition: var(--transition); background: var(--bg-base);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--olive-600); background: var(--olive-50);
}

/* ─── STATUS DOTS ───────────────────────────────── */
.status-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.status-dot-green { background: var(--success); }
.status-dot-gray  { background: var(--text-muted); }

/* ─── TEXT LINKS ────────────────────────────────── */
.text-link {
  color: var(--text-muted); text-decoration: none; font-size: 0.8125rem;
  transition: var(--transition);
}
.text-link:hover { color: var(--text-primary); }
.text-link-primary { color: var(--olive-600); }
.text-link-primary:hover { color: var(--olive-800); }

/* ─── SECTION LABEL ─────────────────────────────── */
.section-heading {
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 16px;
}

/* ─── SPINNER ───────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border-light);
  border-top-color: var(--olive-600); border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── GLOBAL MOBILE ─────────────────────────────── */
html, body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

/* ─── RESPONSIVE ────────────────────────────────── */
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }

  /* Sidebar: hidden by default, slides in */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: 200 !important;
  }
  .sidebar.open { transform: translateX(0); }

  /* Main: no left margin */
  .main-content { margin-left: 0 !important; }

  /* Top bar */
  .topbar { padding-left: 16px !important; padding-right: 16px !important; }

  /* Layout stacking */
  .detail-grid { grid-template-columns: 1fr !important; }
  .stats-grid  { grid-template-columns: 1fr !important; }
  .features-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .pricing-grid { grid-template-columns: 1fr !important; }
  .lab-grid { grid-template-columns: 1fr !important; }
  .timeline-grid { grid-template-columns: 1fr 1fr !important; }
  .name-grid { grid-template-columns: 1fr !important; }

  /* Typography */
  .hero-title { font-size: 1.75rem !important; }
  h1 { font-size: 1.5rem !important; }

  /* Navbar: hide desktop nav, show hamburger */
  .desktop-nav { display: none !important; }
  .mobile-menu-btn { display: flex !important; }

  /* Buttons */
  .btn-mobile-full { width: 100%; justify-content: center; }
  .btn-lg { padding: 14px 20px; width: 100%; justify-content: center; }

  /* Help panel */
  #help-panel {
    width: calc(100vw - 48px) !important;
    left: 24px !important;
    right: 24px !important;
  }

  /* Tables: tighter */
  .table th, .table td { padding: 8px 6px; font-size: 0.8125rem; }

  /* Forms */
  .form-input { font-size: 16px !important; } /* prevents iOS zoom */

  /* Cards: less padding */
  .card { padding: 16px; }

  /* Landing sections */
  .landing-hero { padding: 60px 20px 64px !important; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
}
