:root {
  --ink: #302838;
  --muted: #746b7d;
  --canvas: #f7f4f9;
  --paper: #fff;
  --line: #e5ddea;
  --brand: #76518d;
  --brand-dark: #503663;
  --brand-soft: #eee6f3;
  --error: #a43f3a;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--canvas); font-family: Heebo, sans-serif; }
a, button { font: inherit; -webkit-tap-highlight-color: transparent; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(20px, calc((100vw - 1080px) / 2)); color: #fff; background: var(--brand-dark); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 600 1.3rem Newsreader, serif; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 45%); border-radius: 50%; font-family: Heebo, sans-serif; }
.top-actions { display: flex; gap: 6px; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; color: inherit; background: transparent; border: 1px solid rgb(255 255 255 / 25%); border-radius: 5px; cursor: pointer; text-decoration: none; }
.icon-button svg { width: 19px; height: 19px; }
.dashboard-shell { width: min(1080px, calc(100% - 32px)); margin: 32px auto 56px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 3px; color: var(--brand); font-size: .72rem; font-weight: 800; }
h1 { margin: 0; font-size: 1.7rem; }
.page-heading p:last-child { margin: 5px 0 0; color: var(--muted); }
.page-heading > svg { width: 34px; height: 34px; color: var(--brand); }
.dashboard-message, .dashboard-error { padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; }
.dashboard-error { margin: 0 0 16px; color: var(--error); }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-card { min-height: 146px; display: grid; grid-template-columns: auto 1fr; align-content: center; align-items: center; column-gap: 12px; row-gap: 8px; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; }
.stat-card > svg { width: 22px; height: 22px; color: var(--brand); }
.stat-card span { color: var(--muted); font-size: .9rem; }
.stat-card strong { grid-column: 2; font-size: 1.8rem; line-height: 1.2; }
.chart-card { margin-top: 18px; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; }
.chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chart-heading h2 { margin: 0; font-size: 1.1rem; }
.chart-heading p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.chart-heading > svg { width: 22px; height: 22px; color: var(--brand); }
.chart-container { min-height: 230px; margin-top: 18px; }
.visits-chart { width: 100%; height: auto; overflow: visible; }
.visits-chart-grid { stroke: var(--line); stroke-width: 1; }
.visits-chart-bar { fill: var(--brand); }
.visits-chart-label { fill: var(--muted); font: 12px Heebo, sans-serif; }
.updated-at { margin: 16px 0 0; color: var(--muted); font-size: .82rem; }
[hidden] { display: none !important; }
@media (max-width: 680px) {
  .dashboard-shell { margin-top: 24px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { min-height: 128px; padding: 16px; }
  .chart-card { padding: 16px; }
  .chart-container { min-height: 180px; }
}
@media (max-width: 390px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 100px; }
}
