/* ClockIn: assets/reports/reports.css. Part of what was style.css (split in 1.42.2, rules moved as is). The load order in index.html matters: see CLAUDE.md */
/* ============================================================
   REPORTS TAB
   ============================================================ */
.report-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

/* Date range + Export CSV, right-aligned on the same line as the
   "Detailed Report" title. align-items: center is what lines the
   picker (34px) up with the export button (32px). */
.report-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================================
   REPORT CHECKBOXES, SELECTION BAR AND BULK EDIT (see assets/bulk.js)
   ============================================================ */
.report-select {
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.report-select input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent-dark, var(--accent));
}
.report-select input:disabled { cursor: default; }

/* A ticked row. The hover rule repeats the colors so pointing at it does
   not fade the tint back to the normal hover look. */
.entry-row.is-selected,
.entry-row.is-selected:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

/* The bar that replaces the column labels while entries are ticked. It
   spans everything to the right of the checkbox, which stays where it is. */
.report-selection-bar {
  display: none;
  grid-column: 2 / -1;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-base);
  font-weight: var(--weight-medium);
  text-transform: none;
  letter-spacing: normal;
  color: var(--head-fg, var(--ink));
}
.report-list-header.has-selection .report-meta > *:not(.report-select):not(.report-selection-bar) { display: none; }
.report-list-header.has-selection .report-selection-bar { display: flex; }
.report-selection-count { margin-right: var(--space-2); }
.report-selection-bar .link-btn { margin: 0; }

/* .modal-card.x, not just .x: .modal-card is defined further down this file
   and would win on width and gap at equal specificity. */
.modal-card.bulk-edit-card {
  max-width: 540px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  gap: 0;
}
.bulk-edit-note {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-base);
  color: var(--text-muted);
}
.bulk-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.bulk-row.hidden { display: none; }
.modal-card label.bulk-apply {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.modal-card .bulk-apply input,
.modal-card .bulk-radio input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}
.bulk-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: opacity 120ms ease;
}
.bulk-control .picker { flex: none; }
/* Off until the row's checkbox is ticked (bulk.js also makes it inert). */
.bulk-row:not(.is-on) .bulk-control { opacity: 0.45; }
.bulk-mode { display: flex; flex-wrap: wrap; gap: 16px; }
.modal-card label.bulk-radio {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  cursor: pointer;
}
.bulk-sub-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.bulk-sub-note {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.bulk-remove-wrap { display: flex; flex-direction: column; gap: 8px; }
.bulk-remove-wrap.hidden { display: none; }
.bulk-control .segmented { align-self: flex-start; }
.bulk-edit-card .modal-actions { margin-top: var(--space-3); }

/* ============================================================
   EXPORT MENU AND EXPORT SETTINGS (Reports tab, see assets/export.js)
   ============================================================ */
.export-menu { position: relative; }

/* The menu opens under the button and lines up with its right edge, since
   the button sits at the right edge of the page. (Hidden by the existing
   .picker-panel.hidden rule.) */
.export-menu-panel {
  left: auto;
  right: 0;
  width: 200px;
  padding: 4px;
}

.export-menu-item {
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  justify-content: space-between;
  padding: 10px 12px;
}
.export-menu-item:hover,
.export-menu-item:focus-visible { background: var(--paper); }

.export-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-text);
  border: 1px solid var(--accent-text);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}
.export-badge.hidden { display: none; }

.modal-card.export-settings-card {
  max-width: 540px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  gap: var(--space-3);
}
.export-group-title { margin: var(--space-2) 0 0; }
/* Three columns (was two, 1.10.2) to save height. minmax(0, 1fr) so a long
   label can never widen a column. */
.export-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}
.modal-card label.export-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  cursor: pointer;
}
.modal-card .export-check input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}
.export-select-all span { font-weight: 600; }
/* The card is a scrolling flex column (max-height 100vh - 48px). Without this,
   on a window that is not tall enough every child was squeezed to fit, and the
   Notes box shrank to less than one line (1.10.2). Nothing shrinks now: the card
   scrolls instead. */
.export-settings-card > * { flex-shrink: 0; }
.export-settings-card textarea {
  box-sizing: border-box;
  width: 100%;
  /* never less than 2 lines (line height x 2, plus 9px padding and 1px border
     top and bottom), and it scrolls inside when the notes are longer than the box */
  min-height: calc(2em * var(--line-height-body) + 20px);
  overflow-y: auto;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
.export-settings-card textarea:disabled { opacity: 0.5; }
.export-notes-pos {
  display: flex;
  align-items: center;
  gap: 12px;
}
.export-notes-pos-label { color: var(--text-muted); }
.export-reset-btn { margin-right: auto; }
/* Dashboard export (2.26.0): a checkbox and, for the lists, a Top picker on each row */
.dash-export-all-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.dash-export-all-row select { flex: none; width: 170px; }
.dash-export-sections { display: flex; flex-direction: column; gap: var(--space-2); }
.dash-export-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.dash-export-row select { flex: none; width: 110px; }
.dash-export-row select:disabled { opacity: 0.5; }
#dash-export-menu.hidden { display: none; }
/* The window scrolls on short screens; keep Save reachable without scrolling. */
.export-settings-card .modal-actions {
  position: sticky;
  bottom: calc(-1 * var(--space-5));
  margin: 0 calc(-1 * var(--space-5)) calc(-1 * var(--space-5));
  padding: var(--space-3) var(--space-5);
  background: var(--paper-raised);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
@media (max-width: 480px) {
  .export-field-grid { grid-template-columns: 1fr; }
}

.report-page-title { margin: 0; }

/* ---- Date range picker (trigger + outer prev/next + panel) ---- */
.date-range-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.range-nav-btn {
  width: 30px;
  height: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-light);
  cursor: pointer;
  font-size: var(--font-size-md);
  line-height: 1;
}

.range-nav-btn:hover { border-color: var(--ink-light); color: var(--ink); }

.date-range-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: var(--font-size-base);
  color: var(--ink);
  white-space: nowrap;
}

.date-range-trigger:hover { border-color: var(--ink-light); }

.date-range-icon { font-size: var(--font-size-base); opacity: 0.7; }

.date-range-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-pop);
  z-index: 20;
  overflow: hidden;
}

.date-range-panel.hidden { display: none; }

.date-range-presets {
  display: flex;
  flex-direction: column;
  min-width: 140px;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: var(--paper-raised);
}

.date-range-presets button {
  background: none;
  border: none;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-base);
  color: var(--ink);
}

.date-range-presets button:hover { background: var(--paper); }

.date-range-calendars {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
}

.date-range-cal-pair {
  display: flex;
  gap: 20px;
}

.cal-month { width: 210px; }

.cal-month-title {
  text-align: center;
  font-weight: 700;
  font-size: var(--font-size-base);
  margin-bottom: 8px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2px;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  background: none;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: var(--font-size-sm);
  color: var(--ink);
  cursor: pointer;
}

.cal-day:hover { background: var(--paper); }
.cal-day-outside { color: var(--line); }
.cal-day-in-range { background: var(--paper-raised); border-radius: 0; }
.cal-day-today { font-weight: 700; }

.cal-day-endpoint {
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
}

/* ---- Filter bar ---- */
.report-filterbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--paper-raised);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.report-filterbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.report-filter-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 4px;
}

.picker.report-filter { flex: none; min-width: 0; width: auto; }
.report-filter .picker-trigger { width: auto; }
.report-filter .picker-panel { width: 240px; }

.picker-select-all {
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  padding-bottom: 8px;
  font-weight: 600;
}

/* Filters with a "No project / No task / No tag" choice: it sits right under
   Select all as part of the same top group, and the divider moves below it. */
.picker-select-all.has-none-row {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 7px; /* same as any .picker-item */
}
.picker-none-row {
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  padding-bottom: 8px;
  font-weight: 600;
}

.picker-group-header {
  padding: 6px 6px 2px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.report-filter-clear { margin: 0; }

/* ---- Summary strip ----
   Deliberately a different background than .report-filterbar right
   above it (surface/white vs paper-raised) so the two read as two
   distinct bands rather than one fused block, per the same "more
   noticeable, not just a bg color" idea as the SECTION HEADER BAND
   note near .week-heading. */
.report-summary {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-5);
}

.report-summary-stat { display: flex; flex-direction: column; gap: 2px; }

.report-summary-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.report-summary-stat strong {
  font-family: var(--font-mono);
  font-size: var(--font-size-md);
}

/* ---- Entry list header + rows ----
   The header mirrors each row's own two-part shape: a full-width
   description line, then a meta line using the exact same grid
   (.report-meta, defined once below) so columns always line up. */
.report-list-header {
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-4);
  /* Same 24px gap to the first row as everywhere else this pattern
     appears — see SECTION HEADER BAND note near .week-heading. */
  margin-bottom: var(--space-5);
  background: var(--head-bg, var(--paper-raised));
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  /* Was --font-size-xs (11px) split across two lines ("Time entry"
     above, the column labels below). Merging "Time entry" into the
     Project column's own label (see index.html) made this one line
     instead of two, which would have made the whole band noticeably
     thinner — doubled to 22px to compensate, so the header still
     carries the same visual weight as before. */
  font-size: calc(var(--font-size-xs) * 2);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--head-fg-muted, var(--text-muted));
  /* Sticks below the nav once you scroll past the title/filter bar/
     totals bar above it (none of those are sticky, only nav + this
     column-header row are). Same 66px offset as everywhere else this
     pattern appears — see TRACKER STICKY GAP at .timer-bar. */
  position: sticky;
  top: 66px;
  z-index: 4;
  /* TALLER BAND: was ~30px (Projects/Reports) and ~35px (Clients),
     just the text line plus 8px padding, which read as a thin strip.
     Now a fixed 64px minimum (--space-8, about twice what it was),
     with the column row centered vertically inside it. The same
     rule covers Projects and Clients, which carry this class too. */
  box-sizing: border-box;
  min-height: var(--space-8);
  display: flex;
  align-items: center;
}

/* The one child (.report-meta / .project-row / .client-row) is a
   grid; flex: 1 keeps it full width inside the centering flex box
   above so its columns line up exactly as before. */
.report-list-header > * { flex: 1; min-width: 0; }

.report-sort-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--head-fg-muted, var(--text-muted));
  text-align: left;
  cursor: pointer;
}

.report-sort-btn:hover { color: var(--ink); }

/* 1.9.2: the Duration column is 120px (was 85px) so the Billable Item chip
   fits in it, and the Time Entry / Project column gave up that room
   (1fr, was 1.2fr with a 130px floor). Change the duration width in the
   variable, and the description width below follows it. */
.report-list-header,
.report-row { --report-dur-col: 120px; }
.report-meta {
  display: grid;
  grid-template-columns: 24px minmax(110px, 1fr) minmax(80px, 0.7fr) minmax(70px, 0.5fr) 70px 30px 150px var(--report-dur-col) 90px 104px;
  align-items: center;
  gap: 20px;
}

/* ROW HEIGHT CONSISTENCY: only on data rows, not the header (header
   keeps its own compact height via .report-list-header .report-meta
   below) — same 28px floor as .entry-meta on Tracker, so Reports
   rows aren't taller just because this grid happens to hold one
   taller cell (the stacked time button — see .entry-time-stacked,
   trimmed to fit under 28px specifically so it doesn't force this
   min-height to do the opposite and stretch the row instead). */
.report-row .report-meta { min-height: 28px; }

/* Reports renders <description> before <meta> in the markup
   (reportRowHtml in app.js), but it needs to sit below the meta
   line visually, same as Tracker. .entry-row is a column flexbox,
   so this reorders on screen only — DOM order and tab order are
   untouched, only worth knowing since this can surprise anyone who
   goes looking for the description in the HTML expecting it last. */
.report-row .entry-desc { order: 2; }
.report-row .report-meta { order: 1; }

.report-list-header .report-meta {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.report-client {
  font-size: var(--font-size-base);
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.report-tags {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: var(--radius-sm);
}

.report-tags:hover { background: var(--paper); }

.tag-chip {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  margin-right: 4px;
  font-size: var(--font-size-xs);
  color: var(--accent-text);
  white-space: nowrap;
}

.report-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* .entry-billable is a clickable button on both the tracker's
   entries list and report rows, so it needs its native button
   chrome reset to keep the same look everywhere it's used. Chrome
   only — no "font: inherit" here, since that shorthand also resets
   font-size/weight and was quietly shrinking the $ back down from
   the 24px/28px set on .entry-billable above. */
button.entry-billable {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.invoiced-toggle {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.invoiced-toggle:hover { border-color: var(--accent-dark); color: var(--accent-text); }

.invoiced-toggle.active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--on-accent);
}

/* ============================================================
   DASHBOARD (1.13.0)
   An overview of tracked time for a date range, Project or
   Billability view (see loadDashboard/renderDashboard in app.js).
   Cards reuse the app's existing surface/border/radius tokens so
   they read as the same kind of "card" as everywhere else; chart
   colors come from each project's own stored color, or --success
   for Billable/Non-billable, so every built-in and custom theme
   already works with no Dashboard-specific palette to maintain.
   ============================================================ */
.dash-mode-picker { width: 160px; flex: none; }
.dash-mode-picker .picker-panel { width: 160px; }
.dash-mode-picker .picker-trigger-label { flex: 1; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);  /* 2.27.0: one column; the stats run the whole width, Most Tracked Activities sits underneath */
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 1000px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}

.dashboard-main { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }

.dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

/* ---- Summary strip: three big stats divided by vertical rules
   instead of separate boxes — same idea as .report-summary but
   bigger, since this is the headline of the page, not a strip
   above a list. ---- */
.dash-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.dash-summary-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-left: 1px solid var(--line);
  min-width: 0;
}
.dash-summary-stat:first-child { border-left: none; }
/* 2.25.0: five stats (Total, Top Project, Client, Task, Tag), each Top with its time and share under it */
.dash-summary-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dash-summary-5 .dash-summary-stat { padding: var(--space-4); gap: var(--space-1); }
.dash-summary-5 .dash-summary-stat strong { font-size: var(--font-size-lg); }
.dash-summary-sub {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-summary-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.dash-summary-stat strong {
  font-family: var(--font-mono);
  font-size: var(--font-size-xl);
  font-weight: var(--weight-bold);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Bar chart ---- */
.dash-chart-card { position: relative; }
.dash-bar-chart { display: block; width: 100%; height: 320px; }
.dash-gridline { stroke: var(--line); stroke-width: 1; }
.dash-axis-baseline { stroke: var(--line); stroke-width: 1; }
.dash-axis-label {
  font-family: var(--font-ui);
  font-size: 11px;
  fill: var(--text-muted);
}
.dash-bar-total {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
}
.dash-bar-dollar {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  fill: var(--on-success);
}
.dash-bar-seg { transition: opacity 120ms ease; }
.dash-bar-seg:hover { opacity: 0.85; }
/* Fixed Billable/Non-billable colors (Billability view). Set on both
   fill (SVG rects/paths) and background (the HTML tooltip/legend
   swatches that reuse these same two class names) so one class works
   in both contexts. */
.dash-billable-color { fill: var(--success); background: var(--success); }
.dash-nonbillable-color {
  fill: color-mix(in srgb, var(--success), var(--surface) 62%);
  background: color-mix(in srgb, var(--success), var(--surface) 62%);
}
.dash-chart-empty {
  position: absolute;
  inset: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-base);
}
.dash-chart-empty.hidden { display: none; }

/* ---- Donut + legend ---- */
/* 2.25.0: the breakdown cards, one column */
.dash-breakdowns { display: flex; flex-direction: column; gap: var(--space-5); }
.dash-breakdown { display: flex; flex-direction: column; gap: var(--space-3); }
.dash-bd-note { margin: 0; font-size: var(--font-size-sm); color: var(--text-muted); }
.dash-donut-card { display: flex; gap: var(--space-6); align-items: flex-start; }
.dash-donut-wrap { position: relative; width: 200px; height: 200px; flex-shrink: 0; }
.dash-donut-chart { width: 100%; height: 100%; }
.dash-donut-slice { transition: opacity 120ms ease; cursor: default; }
.dash-donut-slice:hover { opacity: 0.85; }
.dash-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--font-size-md);
  font-weight: var(--weight-bold);
  color: var(--ink);
  pointer-events: none;
  text-align: center;
}
.dash-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-legend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 120px 96px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
  cursor: default;
}
.dash-legend-row:first-child { border-top: none; }
/* Column headings (2.27.0) */
.dash-legend-head, .dash-activity-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 120px 96px;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.dash-activity-head { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dash-head-right { text-align: right; }
.dash-legend-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-base);
  color: var(--ink);
}
.dash-legend-time {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--ink);
  text-align: right;
}
.dash-legend-bar {
  display: block;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--paper-raised);
  overflow: hidden;
}
.dash-legend-bar-fill { display: block; height: 100%; }
.dash-legend-trailing {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: right;
}

/* ---- Sidebar: Most tracked activities ---- */
.dashboard-side { min-width: 0; }
.dash-activities-card { display: flex; flex-direction: column; gap: var(--space-3); }
.dash-activities-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.dash-activities-title { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.dash-limit-picker { width: 100px; flex: none; }
.dash-limit-picker .picker-trigger { padding: 4px 8px; }
.dash-limit-picker .picker-panel { width: 100px; }
.dash-activities-list { display: flex; flex-direction: column; }
.dash-activity-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}
.dash-activity-row:first-child { border-top: none; }
.dash-activity-main { min-width: 0; }
.dash-activity-desc {
  font-size: var(--font-size-base);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-activity-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-legend-dot, .dash-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-activity-time {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Shared hover tooltip (bar chart, donut, legend rows) ----
   One fixed-position element reused by all three; app.js positions it
   from the mouse's viewport coordinates, so it never has to account
   for the bar chart SVG's own viewBox scaling. */
.dash-tooltip {
  position: fixed;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--ink);
  pointer-events: none;
  max-width: 260px;
}
.dash-tooltip.hidden { display: none; }
.dash-tooltip-title { font-weight: 600; margin-bottom: 4px; }
.dash-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.dash-tooltip-row b { margin-left: auto; font-family: var(--font-mono); font-weight: 600; }
.dash-tooltip-row span:last-child { color: var(--text-muted); min-width: 44px; text-align: right; }
.dash-tooltip-label { overflow: hidden; text-overflow: ellipsis; }
/* Budget Report row overlay (1.36.0): a little wider, long project lists
   are cut with an ellipsis, a line between the details and the numbers. */
#budget-tooltip { max-width: 340px; }
#budget-tooltip .dash-tooltip-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; padding-left: var(--space-3); }
#budget-tooltip .dash-tooltip-label { flex: none; }
.dash-tooltip-sep { border-top: 1px solid var(--line); margin: 6px 0; }
.dash-tooltip-note { margin-top: 6px; color: var(--text-muted); white-space: normal; }


/* ============================================================
   PHONE LAYOUT (1.45.0), 700px and below: Detailed Report
   The date range and Export get a line of their own, the totals are a
   2 x 2 grid, and each entry is a card like the Tracker's (see PHONE
   LAYOUT in tracker/entries.css), with nothing hidden:
     [x] Description (up to 2 lines)            00:21:44
     Project - Task  · Client
     #tag #tag
     AMOUNT $81.00                          [Mark Invoiced]
     ------------------------------------------------------
     $   3:50 PM - 4:12 PM / Oct 2            Play  More  Delete
   .report-meta steps aside (display: contents) and `order` places the
   cells; ::before is the line break, ::after the divider. The header band
   keeps Select All and the Time and Duration sort buttons. .entry-row.
   report-row selectors so these beat tracker/entries.css, loaded later.
   ============================================================ */
@media (max-width: 700px) {
  .report-topbar-actions { flex: 1 1 100%; flex-wrap: wrap; }
  .report-topbar-actions .date-range-picker { flex: 1 1 auto; min-width: 0; }
  .report-topbar-actions .date-range-trigger { flex: 1 1 auto; min-width: 0; }
  #date-range-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .report-summary { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-4); }

  /* The date range panel (Detailed and Dashboard): as wide as the picker,
     the presets as a wrapping row on top, and one month instead of two
     (the arrows still step a month at a time). */
  .date-range-panel { left: 0; right: 0; flex-direction: column; }
  .date-range-presets { flex-direction: row; flex-wrap: wrap; min-width: 0; border-right: none; border-bottom: 1px solid var(--line); }
  .date-range-presets button { padding: 6px 10px; }
  .date-range-calendars { justify-content: center; }
  .date-range-cal-pair .cal-month + .cal-month { display: none; }
  .cal-month { width: auto; flex: 1; min-width: 210px; }

  .entry-row.report-row .report-tags .empty-inline { font-size: var(--font-size-sm); }

  /* Filter panels open under the whole filter bar, full width, instead of
     under their own button (which ran them off the right edge). Export's
     menu opens from its left edge. */
  .report-filterbar-row { position: relative; }
  .report-filterbar-row > .picker.report-filter { position: static; }
  .report-filter .picker-panel { left: 0; right: 0; width: auto; }
  .export-menu-panel { left: 0; right: auto; }

  .entry-row.report-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0 10px;
    height: auto;
    padding: 12px 14px 4px;
  }
  .entry-row.report-row .report-meta { display: contents; }

  .entry-row.report-row .report-select { order: 1; flex: none; align-self: flex-start; padding-top: 2px; }
  .entry-row.report-row .entry-desc {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    margin: -2px 0 -2px -4px;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
  }
  .entry-row.report-row .entry-duration { order: 3; flex: none; margin-left: auto; align-self: flex-start; }
  .entry-row.report-row .entry-duration.is-editable { box-sizing: border-box; width: calc(8ch + 16px); }
  .entry-row.report-row::before { content: ''; order: 4; flex: 1 0 100%; height: 8px; }

  .entry-row.report-row .entry-project { order: 5; flex: 0 1 auto; min-width: 0; max-width: calc(100% - 7em); }
  .entry-row.report-row:has(.report-client .empty-inline) .entry-project { max-width: 100%; }
  .entry-row.report-row .report-client { order: 6; flex: 1 1 0; min-width: 0; }
  .entry-row.report-row .report-client::before { content: '\00b7\00a0'; }
  .entry-row.report-row .report-client:has(.empty-inline) { display: none; }

  .entry-row.report-row .report-tags { order: 7; flex: 1 0 100%; margin: 6px 0 0 -4px; }

  .entry-row.report-row .report-amount { order: 8; flex: 0 1 auto; margin-top: 8px; text-align: left; }
  .entry-row.report-row .report-amount::before { content: 'AMOUNT'; margin-right: 6px; font-family: var(--font-body, inherit); font-size: var(--font-size-xs); font-weight: var(--weight-bold); letter-spacing: 0.03em; color: var(--text-muted); }
  .entry-row.report-row .invoiced-toggle { order: 9; margin: 8px 0 0 auto; }

  .entry-row.report-row::after {
    content: '';
    order: 10;
    flex: 1 0 calc(100% + 28px);
    height: 1px;
    margin: 10px -14px 4px;
    background: var(--line);
  }

  .entry-row.report-row .entry-billable { order: 11; flex: none; }
  .entry-row.report-row .entry-time { order: 12; flex: 0 1 auto; min-width: 0; }
  .entry-row.report-row .entry-actions { order: 13; margin-left: auto; }
  .entry-row.report-row.is-item .entry-actions .icon-btn-spacer { display: none; }

  /* The header band: Select All, then the two sort buttons. */
  #report-list-header .report-meta { display: flex; align-items: center; gap: 16px; }
  #report-list-header .report-meta > div:not(.report-select):not(.report-selection-bar) { display: none; }
  .report-list-header.has-selection .report-selection-bar { flex-wrap: wrap; }
}

/* ============================================================
   PHONE LAYOUT (1.45.0), 700px and below: Dashboard Report
   The mode and date range take their own line under the title, the three
   headline numbers stack, the donut sits above its legend, and a legend
   row is two lines (name and time, then its bar and share). The bar chart
   is drawn at its real width there (renderDashBarChart).
   ============================================================ */
@media (max-width: 700px) {
  #report-page-dashboard .tab-header-actions { flex: 1 1 100%; flex-wrap: wrap; }
  #report-page-dashboard .date-range-picker { flex: 1 1 auto; min-width: 0; }
  #report-page-dashboard .date-range-trigger { flex: 1 1 auto; min-width: 0; }
  #dash-date-range-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .dash-summary { grid-template-columns: minmax(0, 1fr); }
  .dash-summary-stat { flex-direction: row; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-left: none; border-top: 1px solid var(--line); }
  .dash-summary-stat:first-child { border-top: none; }
  .dash-summary-stat strong { font-size: var(--font-size-lg); min-width: 0; }
  .dash-summary-5 { grid-template-columns: minmax(0, 1fr); }
  .dash-summary-5 .dash-summary-stat { flex-wrap: wrap; }
  .dash-summary-sub { flex-basis: 100%; text-align: right; }

  .dash-donut-card { flex-direction: column; align-items: center; gap: var(--space-4); }
  .dash-legend { align-self: stretch; }
  .dash-legend-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-3); }
  .dash-legend-head { display: none; }
}

/* ---- Dashboard Pomodoro view (2.12.0, renderDashPomodoro) ---- */
.dash-pomodoro { display: flex; flex-direction: column; gap: var(--space-5); }
.dashboard-grid.hidden, .dash-pomodoro.hidden { display: none; }
.dash-pomo-summary { grid-template-columns: repeat(4, 1fr); }
.dash-pomo-sub { font-size: var(--font-size-xs); color: var(--text-muted); }
.dash-pomo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); align-items: start; }
.dash-pomo-days-card, .dash-sit-card { grid-column: 1 / -1; }
.dash-pomo-title { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-3); }
.dash-pomo-note { font-size: var(--font-size-xs); color: var(--text-muted); }
.dash-pomo-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--line); }
.dash-pomo-seg { display: block; min-width: 4px; }
.dash-pomo-seg.is-empty { flex: 1; background: var(--line); }
.dash-pomo-legend { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.dash-pomo-legend-row { display: grid; grid-template-columns: auto 1fr auto 3.5em; align-items: center; gap: var(--space-2); font-size: var(--font-size-sm); }
.dash-pomo-legend-row b { font-family: var(--font-mono); }
.dash-pomo-pct { color: var(--text-muted); text-align: right; font-family: var(--font-mono); }
.dash-pomo-proj { display: grid; grid-template-columns: minmax(0, 10em) 1fr 2.5em; align-items: center; gap: var(--space-3); padding: var(--space-1) 0; font-size: var(--font-size-sm); }
.dash-pomo-proj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-pomo-proj-name .dash-legend-dot { margin-right: var(--space-2); }
.dash-pomo-proj-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.dash-pomo-proj-bar > span { display: block; height: 100%; border-radius: 4px; }
.dash-pomo-proj b { font-family: var(--font-mono); text-align: right; }
.dash-pomo-hours { display: block; width: 100%; height: 140px; }
.dash-pomo-hours-axis { display: flex; justify-content: space-between; font-size: var(--font-size-xs); color: var(--text-muted); margin-top: var(--space-1); }
.dash-pomo-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.dash-pomo-table th { text-align: left; font-weight: var(--weight-medium, 500); font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); padding: var(--space-2); border-bottom: 1px solid var(--line); }
.dash-pomo-table td { padding: var(--space-2); border-bottom: 1px solid var(--line); }
.dash-pomo-table tr:last-child td { border-bottom: none; }
.dash-pomo-table .num { text-align: right; font-family: var(--font-mono); }
.dash-pomo-table td.is-long { color: #E4572E; }
.dash-pomo-goal.is-met { color: var(--success); }
@media (max-width: 900px) {
  .dash-pomo-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-pomo-summary { grid-template-columns: repeat(2, 1fr); }
  .dash-pomo-summary .dash-summary-stat:nth-child(odd) { border-left: none; }
  .dash-pomo-summary .dash-summary-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .dash-pomo-summary { grid-template-columns: minmax(0, 1fr); }
  .dash-pomo-summary .dash-summary-stat { flex-wrap: wrap; }
  .dash-pomo-summary .dash-pomo-sub { flex-basis: 100%; }
  .dash-pomo-table th:nth-child(3), .dash-pomo-table td:nth-child(3) { display: none; }
}
.dash-pomo-more { margin-top: var(--space-3); }

/* ---- Sitting Without A Break (2.12.2, renderDashSitting) ---- */
.dash-sit-lead { margin: 0 0 var(--space-3); font-size: var(--font-size-md, 1rem); }
.dash-sit-table { display: flex; flex-direction: column; gap: var(--space-2); }
.dash-sit-row { display: grid; grid-template-columns: 7em 1fr 6.5em 6.5em; align-items: center; gap: var(--space-3); font-size: var(--font-size-sm); }
.dash-sit-head { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.dash-sit-num { text-align: right; font-family: var(--font-mono); }
.dash-sit-head .dash-sit-num { font-family: inherit; }
.dash-sit-bar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.dash-sit-bar > span { display: block; height: 100%; border-radius: 5px; background: var(--sit-color); }
.dash-sit-row.is-level-1 { --sit-color: #E8B04B; }
.dash-sit-row.is-level-2 { --sit-color: #E59140; }
.dash-sit-row.is-level-3 { --sit-color: #E4572E; }
.dash-sit-row.is-level-4 { --sit-color: #C73A1E; }
.dash-sit-row.is-level-5 { --sit-color: #9E2A16; }
.dash-sit-card .dash-pomo-note { margin: var(--space-3) 0 0; }
.dash-sit-health { margin-top: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: color-mix(in srgb, #E4572E, var(--surface) 90%); border: 1px solid color-mix(in srgb, #E4572E, var(--surface) 70%); font-size: var(--font-size-sm); }
.dash-sit-health p { margin: 0; }
.dash-sit-health p + p { margin-top: var(--space-2); }
@media (max-width: 700px) {
  .dash-sit-row { grid-template-columns: 6em 1fr 4.5em 4.5em; gap: var(--space-2); }
}
