/* Palette: validated default instance (see the dataviz skill's
   references/palette.md) - light values first, dark stepped from the
   same ramps under prefers-color-scheme, not an automatic flip. */
:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page-plane: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --gridline: #e1e0d9;
  --baseline: #c3c2b7;
  --series-1: #2a78d6;
  --series-1-wash: #2a78d61a;
  --border: rgba(11, 11, 11, 0.10);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page-plane: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --gridline: #2c2c2a;
    --baseline: #383835;
    --series-1: #3987e5;
    --series-1-wash: #3987e526;
    --border: rgba(255, 255, 255, 0.10);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.5;
}

a { color: var(--series-1); }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

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

/* ---- header / footer ---- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text-primary);
}

.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a { color: var(--text-secondary); text-decoration: none; font-size: 0.92rem; }
.site-header nav a:hover { color: var(--series-1); }

main { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem 4rem; }

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--text-muted); }

/* ---- buttons ---- */

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  text-decoration: none;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}
.btn:hover { border-color: var(--series-1); }
.btn-primary {
  background: var(--series-1);
  border-color: var(--series-1);
  color: #fff;
}
.btn-primary:hover { opacity: 0.92; }

/* ---- landing page ---- */

.hero { padding: 4rem 0 2rem; text-align: center; }
.hero h1 { font-size: 2.4rem; margin-bottom: 0.75rem; }
.hero-image {
  max-width: 100%;
  /* width: 640px; */
  height: auto;
  /* border-radius: var(--radius); */
  /* border: 1px solid var(--border); */
  margin: 0 auto 1.5rem;
  display: block;
}
.hero .tagline {
  max-width: 700px;
  margin: 0 auto 1.75rem;
  color: var(--text-secondary);
  font-size: 1.08rem;
}
.hero .cta { display: flex; gap: 0.75rem; justify-content: center; }

.features { padding: 3rem 0; }
.features h2, .install h2 { font-size: 1.4rem; margin-bottom: 1.25rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.feature {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.feature h3 { margin: 0 0 0.5rem; font-size: 1.02rem; }
.feature p { margin: 0; color: var(--text-secondary); font-size: 0.92rem; }

.install { padding: 2rem 0 3rem; }

/* ---- login ---- */

.login-card {
  max-width: 360px;
  margin: 5rem auto;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.login-card h1 { font-size: 1.3rem; margin: 0 0 1.25rem; }
.login-card label { display: block; font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 0.35rem; }
.login-card input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--page-plane);
  color: var(--text-primary);
  font: inherit;
  margin-bottom: 1rem;
}
.login-card .btn { width: 100%; text-align: center; }
.error {
  background: var(--series-1-wash);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

/* ---- dashboard ---- */

.dashboard { padding: 2rem 0; }
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.dashboard-header h1 { font-size: 1.5rem; margin: 0; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.tile-value { font-size: 1.6rem; font-weight: 600; }
.tile-label { font-size: 0.82rem; color: var(--text-muted); }

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.chart-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.chart-card h2 { margin: 0 0 1rem; font-size: 1rem; color: var(--text-secondary); font-weight: 600; }
.chart-card canvas { max-height: 260px; }

.recent h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
.table-wrap {
  overflow-x: auto;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--gridline);
  white-space: nowrap;
}
th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; }
td { font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }

.hint { color: var(--text-muted); font-size: 0.82rem; margin-top: 1.5rem; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.9rem; }
  .dashboard-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
