/* Feature: Overview (staff). #staff
   Owner: Wei Ye
   Styles for the four clickable panels and the chart they control (js/features/triage-overview.js).
   Everything else on the Overview keeps the styles in triage-console.css. Load this after it. */

/* The four panels are buttons: an outline and a shadow so they look pressable, a lift on hover and a
   press-down on click. The picked one is filled dark red, the others are white. */
.ov-kpis li { display: flex; }
.ov-kpi {
  flex: 1; width: 100%; min-width: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
  border: 2px solid var(--field-border);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .14), 0 8px 16px rgba(0, 0, 0, .10);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.ov-kpi:hover { transform: translateY(-2px); border-color: var(--text); box-shadow: 0 5px 0 rgba(0, 0, 0, .16), 0 12px 20px rgba(0, 0, 0, .12); }
.ov-kpi:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .14), 0 3px 6px rgba(0, 0, 0, .10); }
.ov-kpi:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.ov-kpi[aria-pressed="true"] { background: var(--red-dark); color: var(--white); border-color: var(--red-dark); }
.ov-kpi[aria-pressed="true"] .kpi-note { color: var(--white); }
@media (prefers-reduced-motion: reduce) { .ov-kpi { transition: none; } .ov-kpi:hover, .ov-kpi:active { transform: none; } }

/* The chart's day and week names: weekday over date, or date over month */
.ov-days { font-size: .8125rem; }
.ov-days li { display: grid; line-height: 1.2; }
.ov-short { display: none; }

@media (max-width: 47.99rem) {
  .ov-days { font-size: .6875rem; }
  .ov-long { display: none; }
  .ov-short { display: inline; }
}

/* The hovered bar's label sits above its neighbours, not behind them */
#ov-chart .bar-col:hover, #ov-chart .bar-col:focus-within { position: relative; z-index: 5; }

/* "Show as a table" looks like a button: outline, shadow, press-down */
#ov-chart .chart-table summary {
  display: inline-flex; align-items: center; gap: .5rem; padding: 0 1.25rem; list-style: none;
  background: var(--surface); color: var(--text); font-weight: 700;
  border: 2px solid var(--field-border); border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .14), 0 6px 12px rgba(0, 0, 0, .08);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
#ov-chart .chart-table summary::-webkit-details-marker { display: none; }
#ov-chart .chart-table summary::after { content: "\25BE"; transition: transform .15s; }
#ov-chart .chart-table[open] summary::after { transform: rotate(180deg); }
#ov-chart .chart-table summary:hover { transform: translateY(-2px); border-color: var(--text); box-shadow: 0 5px 0 rgba(0, 0, 0, .16), 0 10px 16px rgba(0, 0, 0, .10); }
#ov-chart .chart-table summary:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .14); }
#ov-chart .chart-table summary:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
#ov-chart .chart-table .table-wrap { margin-top: .75rem; }
@media (prefers-reduced-motion: reduce) { #ov-chart .chart-table summary { transition: none; } #ov-chart .chart-table summary:hover, #ov-chart .chart-table summary:active { transform: none; } }

/* Lines: the bars stay as invisible hover columns and the line is drawn over them */
#ov-chart .chart-scale { grid-column: 1; grid-row: 1; }
#ov-chart .bars { grid-column: 2; grid-row: 1; }
#ov-chart .bar-days { grid-column: 2; grid-row: 2; }
.ov-lines { grid-column: 2; grid-row: 1; position: relative; margin-bottom: 2px; pointer-events: none; }
.ov-lines svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ov-lines polyline { fill: none; stroke: var(--red-dark); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ov-pt { position: absolute; width: .875rem; height: .875rem; border-radius: 50%; background: var(--red-dark); border: 2px solid var(--surface); transform: translate(-50%, 50%); }
.ov-pt.is-today { width: 1.125rem; height: 1.125rem; }
.ov-line-mode .bar { background: transparent; border-radius: 0; width: 100%; }
.ov-line-mode .bar:hover, .ov-line-mode .bar:focus-visible { filter: none; background: rgba(0, 0, 0, .06); }
.ov-line-mode .bar-value, .ov-line-mode .bar-tip { bottom: calc(var(--v) + 14px); }