/* ===================================================================
   Bioweave — Shared Styles
   Common design tokens, reset, layout, and components used across
   all console pages (index, board, profile, review, insights).
   =================================================================== */

/* --- Design Tokens --- */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e1e4ed;
  --text-muted: #8b8fa3;
  --accent: #6c8cff;
  --accent-hover: #8aa4ff;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --pink: #f472b6;
  --teal: #2dd4bf;
  --purple: #a78bfa;
  --radius: 8px;

  /* Specialist / agent domain colours */
  --cardio: #f87171;
  --hormonal: #a78bfa;
  --genomics: #6c8cff;
  --neuro: #fbbf24;
  --gut: #2dd4bf;
  --fitness: #34d399;
  --mental: #f472b6;
  --synth: #6c8cff;
  --critic: #fbbf24;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Header --- */
header {
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
header h1 span { color: var(--accent); }

/* Navigation links */
.nav-links { display: flex; gap: 16px; }
.nav-links a,
header a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
}
.nav-links a:hover,
header a:hover { color: var(--accent); }

/* --- Main Layout --- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Panel --- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.panel h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- User Panel --- */
.user-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}
.user-panel label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.user-panel select {
  background: var(--bg);
  border: 2px solid var(--accent);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.user-panel select:focus { outline: none; border-color: var(--accent-hover); }

/* --- Auth Overlay --- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.auth-overlay.hidden { display: none; }
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.auth-box h2 { margin-bottom: 8px; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 18px; }
.auth-box p { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.auth-box input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
}
.auth-box input:focus { border-color: var(--accent); }
.auth-box button {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.auth-box button:hover { background: var(--accent-hover); }
.auth-error { color: var(--red); font-size: 12px; margin-top: 8px; }

/* --- Spinner --- */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Fade-in Animation --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out both; }

/* --- Confidence Track / Fill --- */
.conf-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.conf-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.conf-fill.high { background: var(--green); }
.conf-fill.medium { background: var(--amber); }
.conf-fill.low { background: var(--red); }

/* --- Badges (shared base + common modifiers) --- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge.flag { background: rgba(248,113,113,0.15); color: var(--red); }
.badge.supp { background: rgba(52,211,153,0.15); color: var(--green); }
.badge.gap { background: rgba(139,143,163,0.15); color: var(--text-muted); }
.badge.challenge { background: rgba(251,191,36,0.15); color: var(--amber); }
.badge.interaction { background: rgba(108,140,255,0.15); color: var(--accent); }
.badge.conflict { background: rgba(248,113,113,0.15); color: var(--red); }
.badge.warning { background: rgba(248,113,113,0.15); color: var(--red); }
.badge.approved { background: rgba(52,211,153,0.15); color: var(--green); }
.badge.not-approved { background: rgba(248,113,113,0.15); color: var(--red); }
.badge.cost { background: rgba(108,140,255,0.12); color: var(--accent); }
.badge.iter { background: rgba(251,191,36,0.12); color: var(--amber); }
.badge.profile { background: rgba(167,139,250,0.12); color: #a78bfa; }
.badge.grounding { background: rgba(52,211,153,0.12); color: var(--green); }
.badge.sfr-held { background: rgba(251,191,36,0.15); color: var(--amber); }
.badge.sfr-issued { background: rgba(52,211,153,0.15); color: var(--green); }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 13px; max-width: 400px; margin: 0 auto; }

/* --- Action Buttons (shared) --- */
.action-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.action-btn:hover { background: var(--accent-hover); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.action-btn.secondary:hover { border-color: var(--accent); color: var(--text); }

/* --- Confidence Gauge (insights / board) --- */
.conf-gauge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.conf-gauge label { font-size: 12px; color: var(--text-muted); min-width: 80px; }
.conf-gauge span { font-size: 12px; min-width: 30px; text-align: right; }

/* --- Card Confidence (board inline) --- */
.card-confidence {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
}
