/* Dosta — Look ahead, charts and calendar (M3 part 2). */

/* Forecast chart */
.chart-scroll { overflow-x: auto; margin: 0 0 12px; }
.chart { display: block; width: 100%; min-width: 640px; height: auto; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-zero { stroke: var(--ink-soft); stroke-width: 1.5; }
.chart-label { fill: var(--ink-soft); font-family: var(--font); font-size: 13px; }
.chart-bar { fill: var(--seg-goals); }
.chart-bar--heavy { fill: var(--kowhai); }
.chart-buffer { stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 6 5; }
.chart-line { fill: none; stroke: var(--fern); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: var(--surface); stroke: var(--fern); stroke-width: 2; }
.chart-point--low { fill: var(--kowhai); stroke: var(--ink); }
.chart-bonus { fill: var(--sky); }

.chart-legend {
  list-style: none; margin: 0 0 8px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  color: var(--ink-soft); font-size: var(--text-s);
}
.chart-legend li { display: inline-flex; align-items: center; gap: 8px; }
.swatch--bar { background: var(--seg-goals); }
.swatch--heavy { background: var(--kowhai); }
.swatch--line { height: 4px; border-radius: 2px; background: var(--fern); }
.swatch--buffer { height: 0; border-top: 2px dashed var(--ink-soft); border-radius: 0; background: none; }
.swatch--bonus { border-radius: 50%; background: var(--sky); }

/* Today horizon strip */
.strip { display: block; width: 100%; height: 72px; margin: 0 0 10px; }
.strip-bar { fill: var(--seg-goals); }
.strip-bar--low, .strip-bar--tight { fill: var(--kowhai); }
.strip-bar--short { fill: var(--pohutukawa); }
.strip-buffer { stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.strip-caption { margin: 0; }

/* Plan health */
.health {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px;
  max-width: 460px; margin: 0 0 14px; font-variant-numeric: tabular-nums;
}
.health dt, .health dd { margin: 0; }
.health dd { text-align: right; }
.health .health-total { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 700; }

/* Table view */
.tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: var(--text-xs); font-weight: 700; vertical-align: 0.1em;
}
.tag--heavy { background: var(--kowhai-tint); color: var(--kowhai-text); }
.data-table .is-negative { color: var(--kowhai-text); font-weight: 700; }
.heavy-list { margin: 0 0 12px; padding-left: 1.2em; }
.heavy-list li { margin-bottom: 6px; }

/* Calendar */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.cal-title { margin: 0; font-size: var(--text-xl); text-align: center; }
.calendar { width: 100%; table-layout: fixed; border-collapse: collapse; }
.calendar th { padding: 6px; color: var(--ink-soft); font-size: var(--text-s); text-align: left; }
.calendar td {
  height: 104px; padding: 6px; vertical-align: top;
  border: 1px solid var(--line); background: var(--surface);
}
.calendar td.cal-empty { background: transparent; }
.calendar td.is-today { box-shadow: inset 0 0 0 2px var(--fern); }
.cal-date { display: block; margin-bottom: 4px; font-size: var(--text-s); font-weight: 700; }
.cal-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.cal-event { padding: 2px 6px; border-radius: 6px; font-size: var(--text-xs); line-height: 1.35; overflow-wrap: anywhere; }
.cal-event--pay { background: var(--fern-tint); color: var(--fern); font-weight: 700; }
.cal-event--bill { background: var(--paper); color: var(--ink); }
.cal-agenda { display: none; }
.cal-agenda-day { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cal-agenda-day h3 { margin: 0 0 6px; }
.cal-agenda-day.is-today h3 { color: var(--fern); }
.cal-total { margin: 16px 0 0; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .cal-grid-wrap { display: none; }
  .cal-agenda { display: block; }
}

/* --- Added in M5: clearer bars in dark mode, two-line month labels --- */
:root { --chart-bar: #8FBFAA; }
.chart-bar, .strip-bar { fill: var(--chart-bar); }
.swatch--bar { background: var(--chart-bar); }
.chart-bar--heavy { fill: var(--kowhai); }
.strip-bar--low, .strip-bar--tight { fill: var(--kowhai); }
.strip-bar--short { fill: var(--pohutukawa); }
.chart-year { font-weight: 700; }