/* =============================================================
   AURA DESIGN SYSTEM - Option B: Light & Calming
   ============================================================= */

/* CSS Variables for theming */
:root {
  /* Light theme colors */
  --bg-primary: #faf9f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f3f0;
  --text-primary: #1a1a1a;
  --text-secondary: #5a5a5a;
  --text-muted: #8a8a8a;
  --border-color: #e5e2dd;
  --border-light: #f0ede8;

  /* Accent colors - Teal */
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-light: #ccfbf1;
  --accent-bg: rgba(13, 148, 136, 0.08);

  /* Status colors */
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.1);
  --warning: #ca8a04;
  --warning-bg: rgba(202, 138, 4, 0.1);
  --error: #dc2626;
  --error-bg: rgba(220, 38, 38, 0.1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

/* Dark theme for Debug page */
body.theme-dark {
  --bg-primary: #0b0f14;
  --bg-secondary: #0f1720;
  --bg-tertiary: #0b1220;
  --text-primary: #e7eef7;
  --text-secondary: #b8c7db;
  --text-muted: #94a3b8;
  --border-color: #223043;
  --border-light: #1e293b;
  --accent: #2dd4bf;
  --accent-hover: #14b8a6;
  --accent-light: rgba(45, 212, 191, 0.15);
  --accent-bg: rgba(45, 212, 191, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* =============================================================
   BASE STYLES
   ============================================================= */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3 {
  margin: 0 0 0.5em 0;
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.25rem;
}
h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 1em 0;
}

/* =============================================================
   LAYOUT
   ============================================================= */

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

/* =============================================================
   TOPBAR / NAVIGATION
   ============================================================= */

.topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

nav a:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

nav a.active {
  background: var(--accent-bg);
  color: var(--accent);
}

/* =============================================================
   CARDS
   ============================================================= */

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-header h2 {
  margin: 0;
}

.card-header .card-subtitle {
  margin: 4px 0 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* =============================================================
   BUTTONS
   ============================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  background: var(--accent);
  color: white;
}

.btn:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid transparent;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
}

/* =============================================================
   FORM ELEMENTS
   ============================================================= */

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

input[type="date"] {
  cursor: pointer;
}

.form-row {
  margin-bottom: 20px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-inline {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-inline .form-group {
  flex: 1;
}

.form-inline .btn {
  flex-shrink: 0;
}

/* =============================================================
   BADGES (Check-in selectors) - 5 COLUMN GRID
   ============================================================= */

.badge-group {
  margin-bottom: 24px;
}

.badge-group:last-of-type {
  margin-bottom: 20px;
}

.badge-group label {
  margin-bottom: 12px;
  font-size: 0.9375rem;
}

/* Badges now use CSS Grid with exactly 5 columns */
.badges {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-align: center;
  min-height: 48px;
}

.badge:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.badge.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

/* Small badge labels in tables */
.badge-label {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* =============================================================
   SYNC CARD - COMPACT LAYOUT
   ============================================================= */

.sync-controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.sync-controls .form-group {
  flex: 0 0 120px;
}

.sync-controls .form-group label {
  font-size: 0.8125rem;
  margin-bottom: 6px;
}

.sync-controls .form-group input {
  padding: 10px 12px;
}

.sync-actions {
  display: flex;
  gap: 12px;
}

/* =============================================================
   SYNC STATUS PANEL
   ============================================================= */

.sync-status-panel {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
}

.sync-status-panel h3 {
  font-size: 0.9375rem;
  margin-bottom: 8px;
}

.sync-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.sync-meta .sep {
  margin: 0 8px;
  opacity: 0.5;
}

.sync-section {
  margin-top: 16px;
}

.sync-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
}

.badge-muted {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.sync-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sync-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8125rem;
}

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

.dataset-name {
  font-weight: 500;
}

.record-count {
  color: var(--text-muted);
}

.sync-reason {
  color: var(--text-muted);
  text-align: right;
  max-width: 60%;
}

.sync-item.success .dataset-name {
  color: var(--success);
}
.sync-item.warning .dataset-name {
  color: var(--warning);
}
.sync-item.error .dataset-name {
  color: var(--error);
}
.sync-item.muted-item .dataset-name {
  color: var(--text-muted);
}

/* =============================================================
   TABLES
   ============================================================= */

.table-container {
  overflow-x: auto;
  margin: 0 -28px -28px -28px;
  padding: 0 28px 28px 28px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
}

.table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  font-size: 0.8125rem;
}

.table th:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.table th:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.notes-cell {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.actions-cell {
  white-space: nowrap;
}

.actions-cell .btn {
  margin-right: 6px;
}

.actions-cell .btn:last-child {
  margin-right: 0;
}

/* =============================================================
   SPINNER
   ============================================================= */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s ease-in-out infinite;
}

.spinner.hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================================
   HOW TO USE / COLLAPSIBLES
   ============================================================= */

.how-to-use {
  margin-bottom: 24px;
}

.how-to-use summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
}

.how-to-use summary::-webkit-details-marker {
  display: none;
}

.how-to-use summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 10px;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.how-to-use[open] summary::before {
  transform: rotate(90deg);
}

.how-to-content {
  margin-top: 12px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.how-to-content ol,
.how-to-content ul {
  margin: 0;
  padding-left: 20px;
}

.how-to-content li {
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.how-to-content li:last-child {
  margin-bottom: 0;
}

.how-to-content li strong {
  color: var(--text-primary);
}

.checkin-info {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

/* =============================================================
   NOTICES / ALERTS
   ============================================================= */

.notice {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.notice.warn {
  border-left-color: var(--warning);
  background: var(--warning-bg);
}

.notice.error {
  border-left-color: var(--error);
  background: var(--error-bg);
}

.disclaimer {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--warning-bg);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--warning);
}

.expectation-note {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--accent);
}

/* =============================================================
   PAGE HEADERS
   ============================================================= */

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 0 0 6px 0;
  font-size: 1.875rem;
  font-weight: 700;
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* =============================================================
   CARD ENHANCEMENTS
   ============================================================= */

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

.card-subtle {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
}

/* =============================================================
   INFO DETAILS (Collapsible help sections)
   ============================================================= */

.info-details {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.info-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  list-style: none;
}

.info-details summary::-webkit-details-marker {
  display: none;
}

.info-details summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 10px;
  font-size: 0.625rem;
  transition: transform 0.2s ease;
}

.info-details[open] summary::before {
  transform: rotate(90deg);
}

.info-content {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.info-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.info-content p:last-child {
  margin-bottom: 0;
}

/* =============================================================
   CORRELATION FORM - REDESIGNED
   ============================================================= */

.correlation-form {
  margin-bottom: 24px;
}

.correlation-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-select,
.form-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all 0.15s ease;
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* =============================================================
   CORRELATION RESULT - REDESIGNED
   ============================================================= */

.correlation-result {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.result-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.result-vs {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}

.stat {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.positive {
  color: var(--success);
}

.stat-value.negative {
  color: var(--error);
}

.stat-value.significant {
  color: var(--accent);
}

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

/* Badge-style interpretation labels for correlation and p-value */
.interpretation-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 4px;
}

.interpretation-badge.badge-positive {
  background: var(--success-bg);
  color: var(--success);
}

.interpretation-badge.badge-negative {
  background: var(--error-bg);
  color: var(--error);
}

.interpretation-badge.badge-neutral {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.interpretation-badge.badge-significant {
  background: var(--accent-bg);
  color: var(--accent);
}

.interpretation-badge.badge-not-significant {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Better spacing for result footer section */
.result-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-narrative {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.result-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--warning-bg);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--warning);
}

.save-correlation-form {
  display: flex;
  justify-content: flex-start;
}

.btn-save-correlation {
  gap: 8px;
}

/* =============================================================
   CHART CONTAINER
   ============================================================= */

.chart-container {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

/* =============================================================
   CORRELATION TABLE ENHANCEMENTS
   ============================================================= */

.metric-pair {
  font-weight: 500;
  display: block;
}

.correlation-value {
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.correlation-value.positive {
  color: var(--success);
}

.correlation-value.negative {
  color: var(--error);
}

.significant {
  color: var(--accent);
  font-weight: 600;
}

/* =============================================================
   CLINICIAN REPORT FEATURES
   ============================================================= */

.report-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
  color: var(--accent);
  flex-shrink: 0;
}

/* =============================================================
   DISCLAIMER BOX
   ============================================================= */

.disclaimer-box {
  background: var(--warning-bg);
  border: 1px solid rgba(202, 138, 4, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 28px;
  font-size: 0.875rem;
  color: var(--warning);
}

/* =============================================================
   REPORT FORM
   ============================================================= */

.report-form {
  margin-bottom: 24px;
}

.report-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
  width: 100%;
}

/* =============================================================
   SYNC STATUS INDICATOR
   ============================================================= */

.sync-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.sync-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sync-indicator.synced {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-bg);
}

.sync-indicator.not-synced {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-bg);
}

/* =============================================================
   DETAILS TITLE (for notes sections)
   ============================================================= */

.details-title {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  padding: 4px 0;
}

.details-content {
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.details-content ul {
  margin: 12px 0 0 0;
  padding-left: 20px;
}

.details-content li {
  margin-bottom: 8px;
}

.details-content li:last-child {
  margin-bottom: 0;
}

/* =============================================================
   EMPTY STATE ICON (SVG)
   ============================================================= */

.empty-state-icon svg {
  color: var(--text-muted);
}

/* =============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================= */

@media (max-width: 640px) {
  .correlation-form .form-row,
  .report-form .form-row {
    grid-template-columns: 1fr;
  }

  .result-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .report-features {
    grid-template-columns: 1fr;
  }

  .badges {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =============================================================
   SAVED CORRELATIONS - REDESIGNED WITH BADGES
   ============================================================= */

.saved-correlations-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-correlation-item {
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.saved-correlation-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.saved-correlation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.saved-metrics {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

/* New badge layout for saved correlations */
.saved-correlation-badges {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
}

.saved-stat-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.saved-stat-value {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.saved-correlation-meta {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--error-bg);
  color: var(--error);
}

.delete-form {
  margin: 0;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.empty-state-text {
  padding: 20px 0;
  text-align: center;
}
