/* The Reports page and its charts. */
.reports { padding: 22px 24px 28px; display: grid; gap: 18px; }
.rp-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.rp-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.rp-period { position: relative; display: inline-flex; align-items: center; height: 48px; padding: 0 12px 0 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); }
.rp-period svg { display: none; }
.rp-period select { appearance: none; border: 0; background: transparent; font-size: 16px; font-weight: 600; color: var(--ink); padding-right: 26px; height: 100%; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 9px) 50%, calc(100% - 4px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

.rp-tiles { display: flex; margin-left: auto; align-items: stretch; }
.rp-tile { display: flex; align-items: center; gap: 14px; padding: 2px 28px; border-left: 1px solid var(--line); min-width: 0; }
.rp-tile:first-child { border-left: 0; }
.rp-tile:last-child { padding-right: 0; }
.rp-k { display: block; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.rp-tile b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-tile .mark svg { display: block; width: 40px; height: 40px; }
.rp-of { font-size: 20px; color: var(--ink-2); font-weight: 650; }
.rp-tile.is-alert b { color: var(--st-red-text); }

.rp-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rp-col { display: grid; gap: 16px; min-width: 0; align-content: start; }
.rp-card { padding: 18px 20px 16px; display: grid; gap: 12px; min-width: 0; }
.rp-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rp-card h2 { font-size: 20px; font-weight: 700; }
.rp-total { color: var(--ink-2); font-size: 15px; font-weight: 600; }
.rp-legend { display: inline-flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 15px; }
.lg-line { width: 36px; height: 0; border-top: 2px solid var(--blue); border-radius: 1px; position: relative; }
.lg-line::after { content: ""; position: absolute; left: 13px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--surface); }
.rp-chart { position: relative; min-width: 0; }
.rp-note { color: var(--ink-2); font-size: 14px; }
.rp-card > footer { color: var(--ink-2); font-size: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; }

/* Status breakdown */
.rp-rows { list-style: none; display: grid; gap: 4px; }
.rp-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 44px; align-items: center; gap: 14px; min-height: 44px; }
.rp-label { display: inline-flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 500; }
.rp-track { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.rp-track i { display: block; height: 100%; min-width: 0; border-radius: 6px; background: currentColor; }
.rp-n { text-align: right; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Overdue */
.rp-late-list { list-style: none; display: grid; }
.rp-late { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 6px; border-top: 1px solid var(--line-soft); border-radius: 8px; color: inherit; text-decoration: none; }
.rp-late-list li:first-child .rp-late { border-top: 0; }
.rp-late:hover { background: var(--surface-2); }
.rp-late-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rp-late-text b { font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-late-text span { color: var(--ink-2); font-size: 14px; }
.rp-due { color: var(--st-red-text); font-size: 15px; font-weight: 600; white-space: nowrap; }
.rp-late > svg { color: var(--muted); flex: none; }
.rp-none { color: var(--ink-2); padding: 8px 0; }

/* Chart tables */
.rp-table summary { cursor: pointer; color: var(--blue-strong); font-size: 14px; font-weight: 600; width: max-content; padding: 4px 0; }
.rp-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.rp-table th, .rp-table td { text-align: left; padding: 6px 10px; border-top: 1px solid var(--line-soft); }
.rp-table thead th { color: var(--ink-2); font-weight: 600; border-top: 0; }

/* SVG charts */
.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.ch-grid { stroke: var(--line-soft); stroke-width: 1; }
.ch-grid-v { stroke-dasharray: 2 4; }
.ch-ylab, .ch-xlab { fill: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ch-val { fill: var(--ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.ch-line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--blue); opacity: .1; stroke: none; }
.ch-dot { fill: var(--blue); stroke: var(--surface); stroke-width: 2; transition: r .1s; }
.ch-gap { fill: var(--surface-2); }
.ch-gaplab { fill: var(--muted); font-size: 13px; font-style: italic; }
.ch-barfill { fill: var(--blue); }
.ch-zero { stroke: var(--line); stroke-width: 2; }
.ch-band { fill: transparent; }
.ch-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.ch-pt, .ch-bar { outline: none; cursor: default; }
.ch-pt:hover .ch-band, .ch-pt:focus .ch-band, .ch-bar:hover .ch-band, .ch-bar:focus .ch-band { fill: var(--blue-wash); opacity: .55; }
.ch-pt:hover .ch-cross, .ch-pt:focus .ch-cross { opacity: 1; }
.ch-pt:hover .ch-dot, .ch-pt:focus .ch-dot { r: 6; }
.ch-pt:focus-visible .ch-band, .ch-bar:focus-visible .ch-band { stroke: var(--focus); stroke-width: 2; }
.ring-track { stroke: var(--track); }
.ring-arc { stroke: var(--blue); }

.chart-tip { position: fixed; z-index: 60; pointer-events: none; max-width: 260px; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 13px; line-height: 1.4; box-shadow: var(--shadow-pop); white-space: pre-line; }
.chart-tip b { font-size: 16px; display: block; }
.chart-tip[hidden] { display: none; }

@media (max-width: 1100px) { .rp-cols { grid-template-columns: 1fr; } .rp-tiles { margin-left: 0; width: 100%; } .rp-tile:first-child { padding-left: 0; } }
@media (max-width: 720px) { .reports { padding: 16px 14px 24px; } .rp-tile { padding: 2px 14px; } .rp-row { grid-template-columns: 130px minmax(0, 1fr) 36px; } }
/* Three tiles side by side need 520 px; stacked label over value they share the width, as in the dock. */
@media (max-width: 720px) {
  .rp-tiles { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
  .rp-tile { flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 10px; }
  .rp-tile:first-child { padding-left: 0; }
  /* The ring, the status symbol and the clock are one size, so the three labels and values line up. */
  .rp-tile > svg, .rp-tile .mark svg { width: 32px; height: 32px; }
  .rp-tile b { font-size: 22px; }
  .rp-tile .rp-of { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); }
  .rp-k { font-size: 13px; }
}
.rp-docked.reports { padding: 14px 12px 20px; gap: 14px; }
.rp-docked .rp-head h1 { font-size: 26px; }
.rp-docked .rp-head { gap: 12px; }
.rp-docked .rp-period { height: 40px; margin-left: auto; }
.rp-docked .rp-tiles { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.rp-docked .rp-tile { flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 10px; }
.rp-docked .rp-tile:first-child { padding-left: 0; }
.rp-docked .rp-tile > svg, .rp-docked .rp-tile .mark svg { width: 32px; height: 32px; }
.rp-docked .rp-tile b { font-size: 22px; }
.rp-docked .rp-of { font-size: 14px; display: block; }
.rp-docked .rp-k { font-size: 13px; }
.rp-docked .rp-cols, .rp-docked .rp-col { display: contents; }
.rp-docked .rp-cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.rp-docked .rp-progress { order: 1; } .rp-docked .rp-status { order: 2; } .rp-docked .rp-weeks { order: 3; } .rp-docked .rp-overdue { order: 4; }
.rp-docked .rp-row { grid-template-columns: 124px minmax(0, 1fr) 34px; gap: 10px; }
.rp-docked .rp-late-text b { white-space: normal; }
.rp-docked .rp-due { font-size: 14px; white-space: normal; text-align: right; max-width: 6.5em; }
