:root {
  /* Colors */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --accent: #f59e0b;
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .layout-sidebar {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
  }
}

/* Navigation */
.sidebar {
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
}

.brand {
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--primary);
  margin-bottom: var(--space-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s;
  font-weight: 500;
}

.nav-link:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.nav-link.active {
  background-color: var(--primary);
  color: white;
}

/* Components */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  margin-bottom: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-weight: 600;
  font-size: var(--text-lg);
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  font-size: var(--text-sm);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-xs);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
}

.badge-success { background-color: #dcfce7; color: #166534; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-neutral { background-color: var(--bg-subtle); color: var(--text-muted); }

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: var(--radius-full);
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.mt-4 { margin-top: var(--space-md); }
.mb-4 { margin-bottom: var(--space-md); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-sm); }
.gap-4 { gap: var(--space-md); }

.w-full { width: 100%; }
.text-center { text-align: center; }
.block { display: block; }

/* Diagram */
.fear-loop-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  margin: var(--space-lg) 0;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.loop-node {
  background: white;
  padding: var(--space-md);
  border-radius: var(--radius);
  border: 2px solid var(--primary);
  font-weight: 600;
  text-align: center;
  width: 140px;
  position: relative;
}

.loop-arrow {
  color: var(--text-muted);
  font-size: var(--text-xl);
}

.highlight-box {
  border-left: 4px solid var(--accent);
  background-color: #fffbeb;
  padding: var(--space-md);
  border-radius: 0 var(--radius) var(--radius) 0;
}
