* { box-sizing: border-box; }

@font-face {
  font-family: 'Boomer Tantrum';
  src: url('assets/fonts/BoomerTantrum.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Dark is the fixed look for this dashboard — intentionally not tied to
   each viewer's OS theme, so it's the same on every screen it's left open
   on (desktop app, shared monitor, browser tab). */
.viz-root {
  color-scheme: dark;
  --surface-1:      #1a1a19;
  --page-plane:     #0d0d0d;
  --text-primary:   #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted:      #898781;
  --gridline:        #2c2c2a;
  --track:           #242422;
  --border:          rgba(255,255,255,0.08);
  --shadow:          0 1px 2px rgba(0,0,0,0.3);
  --series-1:        #3987e5; /* blue   - sales / revenue */
  --series-2:        #d95926; /* orange - monthly pacing */
  --series-3:        #199e70; /* aqua   - unused reserve */
  --series-5:        #d55181; /* magenta - instagram */
  --series-7:        #9085e9; /* violet - FY goal */
  --good:            #0ca30c;
  --critical:        #e66767;
  background: var(--page-plane);
  min-height: 100vh;
}

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

.brand { display: flex; align-items: center; gap: 10px; }

/* the logo file is a black wordmark on transparent — invert it to read on
   this dashboard's dark surface (alpha is untouched by invert()) */
.brand-logo { height: 22px; width: auto; display: block; filter: invert(1); }

.brand-name {
  font-family: 'Boomer Tantrum', system-ui, sans-serif;
  font-size: 22px;
  font-weight: normal;
  color: var(--series-7);
  letter-spacing: 0.01em;
  line-height: 1;
  padding-top: 2px; /* optical alignment against the logo's cap-height */
}

.topbar-right { display: flex; align-items: center; gap: 16px; }

.updated-at { font-size: 12px; color: var(--text-muted); }

.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s ease;
}
.btn:hover { background: var(--track); }

main { padding: 28px 32px 56px; max-width: 1200px; margin: 0 auto; }

/* ---------- Hero: FY goal progress ---------- */

.hero {
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 20px;
}

.hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 32px;
}

.hero-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--series-7);
}

.hero-value {
  font-family: 'Boomer Tantrum', system-ui, sans-serif;
  font-size: 52px;
  font-weight: normal;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: 0.01em;
}

.hero-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.hero-pacing {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.hero-pacing.good { color: var(--good); }
.hero-pacing.critical { color: var(--critical); }

.progress-track {
  position: relative;
  height: 12px;
  background: var(--track);
  border-radius: 999px;
  overflow: visible;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--series-7);
  transition: width 0.4s ease;
}

.progress-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--text-primary);
  opacity: 0.55;
  border-radius: 1px;
}

.progress-marker-label {
  position: absolute;
  top: -20px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.hero-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Stat tiles ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 18px 20px;
  border-top: 3px solid var(--accent, var(--series-1));
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.stat-delta {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}
.stat-delta.good { color: var(--good); }
.stat-delta.critical { color: var(--critical); }
.stat-delta.neutral { color: var(--text-muted); }

.stat-sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); }

.mini-track {
  margin-top: 10px;
  height: 5px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}
.mini-fill { height: 100%; border-radius: 999px; background: var(--accent, var(--series-1)); }

/* ---------- Panel / account list ---------- */

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 22px 24px;
}

.panel h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.account-list { display: flex; flex-direction: column; gap: 14px; }

.account-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gridline);
}
.account-row:last-child { border-bottom: none; padding-bottom: 0; }

.account-rank {
  color: var(--text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.account-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.account-state { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.account-amount {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.account-amount .of-target {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.account-row .progress-track { grid-column: 2 / 4; height: 6px; }
.account-row .progress-fill { background: var(--series-1); }
.account-row.over-target .progress-fill { background: var(--good); }

.empty-state { color: var(--text-muted); font-size: 14px; padding: 8px 0; }

.key-prompt {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.key-prompt.hidden { display: none; }
.key-prompt-box {
  background: var(--surface-1);
  border-radius: 12px;
  padding: 24px;
  width: 320px;
  text-align: center;
}
.key-prompt-box h3 { margin: 0 0 8px; color: var(--text-primary); }
.key-prompt-box p { margin: 0 0 14px; color: var(--text-secondary); font-size: 13px; }
.key-prompt-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
}
