/* Dashboard styles — extends theme.css variables */
:root {
  --bg: #f8f4ee;
  --bg-alt: #f0ebe2;
  --fg: #1a2e1a;
  --fg-muted: #5a6e5a;
  --accent: #d4a853;
  --accent-dark: #b8892e;
  --forest: #1a3a2f;
  --cream: #f8f4ee;
  --warm-gray: #c8c0b4;
  --danger: #c0392b;
  --warning: #e67e22;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; }
a { color: inherit; text-decoration: none; }

/* Nav */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248, 244, 238, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200, 192, 180, 0.4);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 1rem 2rem;
  display: flex; align-items: baseline; gap: 1.5rem;
}
.nav-logo { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.25rem; color: var(--forest); }
.nav-tagline { font-size: 0.875rem; color: var(--fg-muted); }
.nav-links { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.nav-link { font-size: 0.875rem; color: var(--fg-muted); }
.nav-link:hover { color: var(--fg); }

/* Dashboard Layout */
.dashboard { max-width: 900px; margin: 0 auto; padding: 2rem; }

/* Alert Banner */
.alert-banner {
  background: #fff5f5; border: 1px solid #f5c6c6;
  border-radius: 6px; padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
}
.alert-banner.hidden { display: none; }
.alert-inner { display: flex; align-items: center; gap: 0.75rem; }
.alert-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger); flex-shrink: 0;
}
.alert-dot.medium { background: var(--warning); }
.alert-dot.low { background: var(--accent); }
#alert-text { font-size: 0.9rem; color: var(--fg); flex: 1; }
.alert-dismiss {
  background: none; border: 1px solid var(--warm-gray); border-radius: 4px;
  padding: 0.25rem 0.75rem; font-size: 0.8rem; cursor: pointer; color: var(--fg-muted);
}
.alert-dismiss:hover { background: var(--bg-alt); }

/* Connect Banner */
.connect-banner {
  background: var(--forest); color: var(--cream);
  border-radius: 6px; padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.connect-banner.hidden { display: none; }
.connect-banner p { font-size: 0.9rem; flex: 1; }
.btn-google {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: white; color: #333; border-radius: 4px;
  padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; flex-shrink: 0;
}
.btn-google:hover { background: var(--bg-alt); }

/* Status Cards */
.hero-status { margin-bottom: 2.5rem; }
.status-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.status-card {
  background: white; border: 1px solid rgba(200, 192, 180, 0.4);
  border-radius: 8px; padding: 1.25rem;
  text-align: center;
}
.status-card.anomaly {
  border-color: var(--warning);
  background: #fffbf5;
}
.status-card.anomaly-high {
  border-color: var(--danger);
  background: #fff5f5;
}
.status-icon {
  width: 36px; height: 36px; margin: 0 auto 0.75rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26, 58, 47, 0.06); border-radius: 6px;
  color: var(--forest);
}
.status-value { font-family: 'Fraunces', serif; font-size: 1.75rem; font-weight: 700; color: var(--forest); }
.status-label { font-size: 0.75rem; color: var(--fg-muted); margin-top: 0.25rem; }
.status-baseline { font-size: 0.7rem; color: var(--fg-muted); margin-top: 0.25rem; }

/* Sync Row */
.sync-row { display: flex; align-items: center; gap: 1rem; }
.btn-sync {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--forest); color: white; border: none;
  border-radius: 6px; padding: 0.625rem 1.25rem;
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
}
.btn-sync:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sync:not(:disabled):hover { background: #0f2a22; }
.sync-status { font-size: 0.8rem; color: var(--fg-muted); }
.baseline-status { font-size: 0.8rem; color: var(--accent); }

/* History Chart */
.history-section { background: white; border-radius: 8px; padding: 1.5rem; border: 1px solid rgba(200, 192, 180, 0.4); margin-bottom: 1.5rem; }
.history-section h2 { font-size: 1.1rem; color: var(--forest); margin-bottom: 1rem; }
.chart-container { height: 200px; position: relative; margin-bottom: 1rem; }
.metric-tabs { display: flex; gap: 0.5rem; }
.tab {
  background: none; border: 1px solid var(--warm-gray); border-radius: 4px;
  padding: 0.375rem 0.75rem; font-size: 0.8rem; cursor: pointer; color: var(--fg-muted);
}
.tab.active { background: var(--forest); color: white; border-color: var(--forest); }

/* Alerts List */
.alerts-section { background: white; border-radius: 8px; padding: 1.5rem; border: 1px solid rgba(200, 192, 180, 0.4); }
.alerts-section h2 { font-size: 1.1rem; color: var(--forest); margin-bottom: 1rem; }
.alerts-list { display: flex; flex-direction: column; gap: 0.75rem; }
.alert-item {
  border: 1px solid rgba(200, 192, 180, 0.4); border-radius: 6px;
  padding: 1rem 1.25rem; display: flex; align-items: flex-start; gap: 1rem;
}
.alert-item.high { border-left: 3px solid var(--danger); }
.alert-item.medium { border-left: 3px solid var(--warning); }
.alert-item.low { border-left: 3px solid var(--accent); }
.alert-severity { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.2rem 0.5rem; border-radius: 3px; flex-shrink: 0; }
.alert-severity.high { background: #fde8e8; color: var(--danger); }
.alert-severity.medium { background: #fef3e2; color: var(--warning); }
.alert-severity.low { background: #fef9e7; color: #b8892e; }
.alert-body { flex: 1; }
.alert-metric { font-weight: 600; color: var(--fg); font-size: 0.875rem; }
.alert-message { font-size: 0.8rem; color: var(--fg-muted); margin-top: 0.25rem; }
.alert-time { font-size: 0.75rem; color: var(--warm-gray); flex-shrink: 0; }
.empty-state { font-size: 0.875rem; color: var(--fg-muted); padding: 1rem 0; }

/* Responsive */
@media (max-width: 700px) {
  .status-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard { padding: 1rem; }
}
@media (max-width: 480px) {
  .status-grid { grid-template-columns: repeat(2, 1fr); }
}