/* ============================================================================
   BidHound — Theme v1.4
   Phase 3 Visual Design — Vercel/Linear-inspired light mode
   
   Single source of truth for design tokens, typography, and component
   foundations. Link before any page-specific <style> blocks:
   <link rel="stylesheet" href="/theme.css">
   ============================================================================ */

/* --- Web Font ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Design Tokens ------------------------------------------------------- */
:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-heading: var(--font-sans);
  --font-body: var(--font-sans);
  --mono: var(--font-mono);  /* alias for legacy pages */

  /* Legacy aliases for pipeline compatibility */
  --border-bright: var(--border-strong);
  --amber-dim: var(--amber-dark);
  --red-dim: var(--red-dark);
  --blue-dim: var(--blue-dark);
  --purple-dim: var(--purple-dark);

  /* Type scale — tight, weight-driven hierarchy */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;
  --leading-tight:  1.2;
  --leading-normal: 1.5;
  --tracking-tight: -0.02em;
  --tracking-normal: 0em;
  --tracking-wide:  0.04em;
  --tracking-caps:  0.08em;

  /* Backgrounds */
  --bg:        #FAFAFA;
  --bg-pure:   #FFFFFF;
  --bg-subtle: #F5F5F5;
  --bg-muted:  #F0F0F0;
  --bg-wash:   #E8E8E8;

  /* Surfaces (cards, panels, modals) */
  --surface:   #FFFFFF;
  --surface2:  #FAFAFA;
  --surface3:  #F5F5F5;

  /* Text — extreme contrast hierarchy */
  --text:       #111111;
  --text-secondary: #444444;
  --text-tertiary:  #666666;
  --text-dim:   #888888;
  --text-muted: #AAAAAA;
  --text-faint: #CCCCCC;
  --text-ghost: #E0E0E0;

  /* Borders — crisp, barely-there */
  --border:        #EAEAEA;
  --border-subtle: #F0F0F0;
  --border-strong: #D4D4D4;
  --border-focus:  var(--green);

  /* Brand accent — vibrant modern SaaS green */
  --green:       #059669;
  --green-hover: #047857;
  --green-active:#065F46;
  --green-light: #ECFDF5;
  --green-wash:  #D1FAE5;
  --green-dark:  #064E3B;
  --green-text:  #059669;

  /* Semantic palette */
  --red:         #EF4444;
  --red-light:   #FEF2F2;
  --red-dark:    #B91C1C;
  --amber:       #F59E0B;
  --amber-light: #FFFBEB;
  --amber-dark:  #92400E;
  --blue:        #3B82F6;
  --blue-light:  #EFF6FF;
  --blue-dark:   #1D4ED8;
  --purple:      #8B5CF6;
  --purple-light:#F5F3FF;
  --purple-dark: #5B21B6;
  --cyan:        #06B6D4;
  --rose:        #F43F5E;
  --emerald:     #10B981;
  --slate:       #64748B;

  /* Shadows — barely perceptible */
  --shadow-xs:  0 1px 3px rgba(0, 0, 0, 0.02), 0 12px 32px rgba(0, 0, 0, 0.04);
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl:  0 16px 48px rgba(0, 0, 0, 0.10);

  /* Radii — tight, not bubbly */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Transitions */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;
}


/* --- Reset & Global ------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';  /* Inter stylistic alternates */
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  font-weight: 600;
}

h1 { font-size: var(--text-2xl); font-weight: 700; }
h2 { font-size: var(--text-xl);  font-weight: 700; }
h3 { font-size: var(--text-lg);  font-weight: 600; }
h4 { font-size: var(--text-md);  font-weight: 600; }

p {
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

a {
  color: var(--green-text);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover {
  color: var(--green-hover);
}

strong, b {
  font-weight: 600;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 5px;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
}


/* --- Scrollbars — minimal, zero-distraction ----------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}


/* --- Inputs -------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="tel"],
textarea,
select {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg-pure);
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  width: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:disabled,
textarea:disabled,
select:disabled {
  background: var(--bg-subtle);
  color: var(--text-dim);
  cursor: not-allowed;
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}


/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--tracking-normal);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none;
  white-space: nowrap;
}

/* Primary — premium bevel green */
.btn-primary,
.btn { /* bare .btn defaults to primary */
  background: linear-gradient(180deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border: 1px solid #047857;
  border-top-color: #34D399;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.10) inset;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.btn-primary:hover,
.btn:hover {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  border-color: #065F46;
  border-top-color: #10B981;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}
.btn-primary:active,
.btn:active {
  background: linear-gradient(180deg, #047857 0%, #065F46 100%);
  border-color: #064E3B;
  border-top-color: #047857;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.20);
  text-shadow: none;
  transform: translateY(0.5px);
}

/* Accent — green for secondary CTA / confirm actions */
.btn-accent {
  background: var(--green);
  color: #FFFFFF;
  border-color: var(--green);
}
.btn-accent:hover {
  background: var(--green-hover);
  border-color: var(--green-hover);
}
.btn-accent:active {
  background: var(--green-active);
  border-color: var(--green-active);
  transform: scale(0.98);
}

/* Secondary — outlined */
.btn-secondary {
  background: var(--bg-pure);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}
.btn-secondary:active {
  background: var(--bg-muted);
}

/* Ghost — borderless */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text);
}
.btn-ghost:active {
  background: var(--bg-muted);
}

/* Danger */
.btn-danger {
  background: var(--red);
  color: #FFFFFF;
  border-color: var(--red);
}
.btn-danger:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

/* Size variants */
.btn-sm {
  font-size: var(--text-xs);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
}
.btn-lg {
  font-size: var(--text-md);
  padding: 12px 24px;
  border-radius: var(--radius-md);
}
.btn-full {
  width: 100%;
}

/* Disabled state */
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* --- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
}

.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.card-padded {
  padding: var(--space-5);
}

.card-flush {
  box-shadow: none;
}


/* --- Badges -------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  line-height: 1.4;
}

.badge-green  { background: var(--green-light); color: var(--green-text); }
.badge-amber  { background: var(--amber-light); color: var(--amber-dark); }
.badge-red    { background: var(--red-light);   color: var(--red-dark); }
.badge-blue   { background: var(--blue-light);  color: var(--blue-dark); }
.badge-purple { background: var(--purple-light); color: var(--purple-dark); }
.badge-gray   { background: var(--bg-muted);    color: var(--text-dim); }


/* --- Labels / Caps text -------------------------------------------------- */
.label-caps {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-dim);
}


/* --- Dividers ------------------------------------------------------------ */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-4) 0;
}


/* --- Utility helpers ----------------------------------------------------- */
.text-primary   { color: var(--text) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary  { color: var(--text-tertiary) !important; }
.text-dim       { color: var(--text-dim) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-green     { color: var(--green-text) !important; }
.text-red       { color: var(--red) !important; }
.text-amber     { color: var(--amber) !important; }

.font-mono      { font-family: var(--font-mono) !important; }
.font-medium    { font-weight: 500 !important; }
.font-semibold  { font-weight: 600 !important; }
.font-bold      { font-weight: 700 !important; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* --- Transitions / Animations ------------------------------------------- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-pulse   { animation: pulse 2s ease-in-out infinite; }
.animate-fadeIn  { animation: fadeIn var(--duration-normal) var(--ease-out); }
.animate-slideUp { animation: slideUp var(--duration-slow) var(--ease-out); }

/* --- Sidebar (shared across all pages) ----------------------------------- */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-pure);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--z-sticky);
  padding: var(--space-5) 0;
}
.sidebar-top { flex: 1; }
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--space-5);
  margin-bottom: var(--space-8);
  text-decoration: none;
  color: var(--text);
}
.sidebar-logo .logo-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-logo .logo-mark svg { width: 22px; height: 22px; }
.sidebar-logo .logo-text {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}
.sidebar-group { margin-bottom: var(--space-4); }
.sidebar-group-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 var(--space-5);
  margin-bottom: var(--space-2);
}
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-3);
}
.sidebar-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-dim);
  padding: 8px var(--space-3);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}
.sidebar-links a:hover { color: var(--text); background: var(--bg-subtle); }
.sidebar-links a.active {
  color: #111827;
  background: var(--bg-muted);
  font-weight: 600;
  border-left: 3px solid #10B981;
  padding-left: 9px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.sidebar-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
}
.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

/* --- Score Ring --------------------------------------------------------- */
.score-ring-wrapper { position: relative; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.score-ring-svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.score-ring-bg { fill: none; stroke: #F3F4F6; stroke-width: 6; }
.score-ring-progress { fill: none; stroke: #10B981; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1); }
.score-ring-text { position: absolute; font-family: var(--font-sans); font-size: 20px; font-weight: 700; color: #111827; letter-spacing: -0.02em; }
.score-ring-label { font-size: 10px; font-weight: 500; color: #6B7280; text-transform: uppercase; letter-spacing: 0.05em; position: absolute; bottom: -20px; text-align: center; width: 100%; }

/* --- AI Intelligence Report --------------------------------------------- */

/* 1. Top-Level Metrics Grid */
.ai-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid #EAEAEA;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}
.ai-metric-item {
  padding: 16px;
  border-right: 1px solid #EAEAEA;
  border-bottom: 1px solid #EAEAEA;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-metric-item:nth-child(2n)  { border-right: none; }
.ai-metric-item:nth-last-child(-n+2) { border-bottom: none; }
.ai-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #6B7280;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.ai-metric-value {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}
.ai-metric-value.green { color: #10B981; }
.ai-metric-value.red   { color: #EF4444; }
.ai-metric-value.amber { color: #F59E0B; }

/* 2. Structural Accordions */
.ai-accordion-item {
  border-bottom: 1px solid #EAEAEA;
  padding: 16px 0;
}
.ai-accordion-item:last-child { border-bottom: none; }
.ai-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  user-select: none;
}
.ai-accordion-header::after {
  content: '+';
  font-size: 16px;
  font-weight: 400;
  color: #9CA3AF;
  transition: transform var(--duration-fast) var(--ease-out);
}
.ai-accordion-item.open .ai-accordion-header::after {
  content: '\2212';
}
.ai-accordion-content {
  font-size: 13px;
  color: #4B5563;
  line-height: 1.6;
  padding-top: 12px;
  display: none;
}
.ai-accordion-item.open .ai-accordion-content {
  display: block;
}

/* 3. Action Lists & Flags */
.ai-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.ai-list-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid #EAEAEA;
  border-radius: 4px;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}
.ai-list-item .item-label {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}
.flag-green { border-left: 3px solid #10B981; }
.flag-red   { border-left: 3px solid #EF4444; }
.flag-amber { border-left: 3px solid #F59E0B; }
.flag-muted { border-left: 3px solid #D1D5DB; }

/* 4. Action Item Checkboxes */
.ai-action-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid #EAEAEA;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  background-color: #FFFFFF;
}
.ai-action-item:last-child { margin-bottom: 0; }
.ai-action-item:hover {
  border-color: #D1D5DB;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.ai-action-item input[type="checkbox"] { display: none; }
.ai-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.ai-checkbox svg { opacity: 0; transition: opacity 0.15s ease; }
.ai-action-content {
  font-size: 13px;
  color: #111827;
  line-height: 1.5;
  flex: 1;
}
.ai-action-meta {
  font-size: 11px;
  color: #6B7280;
  font-weight: 500;
  padding-top: 4px;
  display: block;
}
.ai-action-item.is-completed {
  background-color: #FAFAFA;
  border-color: #F3F4F6;
}
.ai-action-item.is-completed .ai-checkbox {
  background-color: #10B981;
  border-color: #10B981;
}
.ai-action-item.is-completed .ai-checkbox svg { opacity: 1; }
.ai-action-item.is-completed .ai-action-content {
  color: #9CA3AF;
  text-decoration: line-through;
}

/* 5. Copyable Draft Blocks */
.draft-block {
  position: relative;
  background-color: #F9FAFB;
  border: 1px solid #EAEAEA;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s ease;
}
.draft-block:last-child { margin-bottom: 0; }
.draft-block:hover { border-color: #D1D5DB; }
.draft-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6B7280;
  margin-bottom: 10px;
}
.draft-content {
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
  white-space: pre-wrap;
}
.btn-copy-draft {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #FFFFFF;
  border: 1px solid #EAEAEA;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: #6B7280;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
}
.draft-block:hover .btn-copy-draft { opacity: 1; }
.btn-copy-draft:hover {
  color: #111827;
  border-color: #D1D5DB;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-copy-draft.copied {
  color: #10B981;
  border-color: #10B981;
}

/* 6. Bid Timeline */
.timeline-container {
  position: relative;
  padding-left: 20px;
  margin-bottom: 32px;
}
.timeline-container::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 0;
  width: 1px;
  background-color: #EAEAEA;
}
.timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child ~ .timeline-container::before { display: none; }
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #D1D5DB;
  border: 2px solid #FFFFFF;
  box-sizing: content-box;
}
.timeline-date {
  font-size: 11px;
  color: #6B7280;
  font-weight: 600;
  margin-bottom: 2px;
}
.timeline-title {
  font-size: 13px;
  color: #111827;
  font-weight: 500;
  line-height: 1.4;
}
.timeline-note {
  font-size: 12px;
  color: #6B7280;
  margin-top: 2px;
}
.timeline-item-critical .timeline-dot {
  background-color: #10B981;
}
.timeline-item-critical .timeline-date {
  color: #10B981;
}

/* 7. Analytics Dashboard ------------------------------------------------- */

/* Overview grid */
.analytics-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 900px) {
  .analytics-overview { grid-template-columns: repeat(2, 1fr); }
}

/* Metric cards */
.metric-card {
  background-color: #FFFFFF;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.metric-card-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #6B7280;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.metric-card-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
  line-height: 1;
}
.metric-card-value.green { color: #10B981; }
.metric-trend {
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
}
.metric-trend.positive { color: #10B981; }
.metric-trend.negative { color: #EF4444; }

/* Chart containers */
.chart-container {
  background-color: #FFFFFF;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}
.chart-container:last-child { margin-bottom: 0; }
.chart-header {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid #EAEAEA;
}
.chart-body {
  position: relative;
  min-height: 200px;
}
.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .chart-row { grid-template-columns: 1fr; }
}

/* 8. Network Graph ------------------------------------------------------- */

/* Canvas wrapper */
.network-canvas-wrapper {
  position: relative;
  background-color: #F9FAFB;
  background-image: radial-gradient(#D1D5DB 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  overflow: hidden;
}
.network-canvas-wrapper svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Controls bar */
.network-controls {
  display: flex;
  gap: 8px;
  padding: 12px 0;
}
.network-controls button {
  background: #FFFFFF;
  border: 1px solid #EAEAEA;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.15s ease;
}
.network-controls button:hover {
  border-color: #D1D5DB;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.network-controls button.active {
  background: #111827;
  border-color: #111827;
  color: #FFFFFF;
}

/* Dark tooltip */
.network-tooltip {
  position: absolute;
  background: #111827;
  color: #FFFFFF;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  z-index: 50;
  max-width: 260px;
  line-height: 1.4;
}
.network-tooltip.visible { opacity: 1; }
.network-tooltip-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
  margin-bottom: 2px;
}

/* Gazette sidebar panel */
.network-gazette {
  background: #FFFFFF;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
}
.network-gazette-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid #EAEAEA;
}
