/* The management dashboard: every board you can see, read at once. */

.dash { height: 100%; overflow-y: auto; padding: var(--s5) var(--s6) var(--s6); }
.dash-head { display: flex; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.dash-head h2 { margin: 0; font-size: 20px; font-weight: 650; }
.dash-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-faint); }

.muted { color: var(--text-faint); }
.bad { color: var(--danger); }
.hint { font-size: 11.5px; color: var(--text-faint); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dash-empty { margin: 0; font-size: 13px; color: var(--text-faint); }

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

.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: var(--s4); }
.dash-tile {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r3); background: var(--ink-850);
}
.dash-tile .label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.dash-tile b { font-size: 28px; line-height: 1.1; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.dash-tile .note { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The state is said in words beside the figure, not by its colour alone. */
.dash-tile.good { border-left: 3px solid var(--ok); }
.dash-tile.warn { border-left: 3px solid var(--warn); }
.dash-tile.bad { border-left: 3px solid var(--danger); }
.dash-tile.bad b { color: var(--danger); }

/* --- panels ----------------------------------------------------------------- */

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dash-panel { min-width: 0; padding: 14px 16px 16px; border: 1px solid var(--rule); border-radius: var(--r3); background: var(--ink-850); }
.dash-panel.wide { grid-column: 1 / -1; }
.dash-panel header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-panel h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.dash-panel h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.dash-sort { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); }
.dash-sort .select { width: auto; padding: 3px 8px; font-size: 12px; }
@media (max-width: 900px) {
  .dash { padding: var(--s4); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

/* One hue for how far along something is; the track is the rest. */
.dash-bar { flex: 1; min-width: 60px; height: 8px; border-radius: 4px; background: var(--ink-600); overflow: hidden; }
.dash-bar i { display: block; height: 100%; border-radius: 4px; background: var(--signal); }

/* --- boards table ---------------------------------------------------------------- */

/* Fixed columns, so the table fits its panel: the board name wraps and the
   rest is cut short. On a phone the stage and last-activity columns go. */
.dash-table-wrap { overflow: hidden; }
.dash-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.dash-table td { overflow: hidden; text-overflow: ellipsis; }
.dash-table th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-table th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--rule);
}
.dash-table th.num { text-align: right; }
.dash-table td { padding: 8px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table .grow { width: 26%; }
@media (max-width: 640px) {
  .dash-table .col-stage, .dash-table .col-last { display: none; }
  .dash-table th:first-child { width: 38%; }
  .dash-table .grow { width: 28%; }
  .dash-table .dash-bar { min-width: 24px; }
}
.dash-table.compact td, .dash-table.compact th { padding: 3px 6px; font-size: 12px; }
.dash-board { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; color: var(--text); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.dash-board:hover { text-decoration: underline; }
.dash-board .swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.sub-note { display: block; font-size: 11px; color: var(--text-faint); margin-left: 17px; }
.dash-bar-row { display: flex; align-items: center; gap: 10px; }
.dash-table .status-pill { font-size: 11.5px; padding: 2px 8px; }

/* --- priority and labels ---------------------------------------------------------- */

.dash-prio, .dash-labels { display: flex; flex-direction: column; gap: 8px; }
.dash-prio-row, .dash-label-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px; align-items: center; gap: 10px; }
.dash-prio-row .prio-chip { justify-self: start; }
.dash-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-label .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* --- activity chart ------------------------------------------------------------------ */

.dash-chart svg { display: block; overflow: visible; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; font-size: 12px; color: var(--text-dim); }
.dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dash-legend i { width: 10px; height: 10px; border-radius: 2px; }
.dash-axis { display: flex; justify-content: space-between; margin-top: 4px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }
.dash-data { margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.dash-data summary { cursor: pointer; color: var(--text-faint); }
.dash-data table { margin-top: 6px; }

/* --- people --------------------------------------------------------------------------- */

.dash-mine { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--rule-soft); }
.dash-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.dash-person { border: 1px solid var(--rule-soft); border-radius: var(--r2); background: var(--ink-800); min-width: 0; }
.dash-person summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; }
.dash-person summary::-webkit-details-marker { display: none; }
.dash-person .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-person .who b { font-size: 13px; }
.dash-person .who span { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-person .counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; font-size: 11.5px; font-family: var(--font-mono); color: var(--text-dim); }
.dash-person .dash-tasks { padding: 0 10px 8px; }
.dash-person .hint { padding: 0 10px 8px; margin: 0; }

.dash-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-tasks a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 0 8px; align-items: center;
  padding: 5px 6px; border-radius: var(--r1); color: var(--text); text-decoration: none;
}
.dash-tasks a:hover { background: var(--ink-700); }
.dash-tasks .title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tasks .where { grid-column: 2 / 3; font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tasks .due { grid-row: 1 / 3; grid-column: 3; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }
.dash-tasks .due.overdue { color: var(--danger); }
.dash-tasks .due.today { color: var(--signal); }
.dash-tasks .prio-chip { grid-row: 1 / 3; }
.dash-tasks .prio-chip em { display: none; }

/* --- feeds ------------------------------------------------------------------------------- */

.dash-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: 460px; overflow-y: auto; }
.dash-feed.compact { gap: 8px; }
.dash-feed .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-feed .head b { font-size: 12.5px; }
.dash-feed .when { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }
.dash-feed p { margin: 3px 0; font-size: 13px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.dash-feed .where { font-size: 11.5px; color: var(--text-faint); }
.dash-feed a { color: var(--text-dim); }
.dash-feed a:hover { color: var(--text); }

/* --- the overview ------------------------------------------------------------------------- */

/* Health is said in words on the pill, and its colour only repeats it. */
.ov-health {
  display: inline-block; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.ov-health.bad { color: var(--danger); background: rgba(255, 107, 107, .1); }
.ov-health.warn { color: var(--warn); background: rgba(255, 200, 97, .1); }
.ov-health.good { color: var(--ok); background: rgba(74, 222, 128, .08); }
.ov-filter { margin-left: auto; }

.ov-table { font-size: 13px; }
.ov-table .ov-h { width: 96px; }
.ov-table .ov-p { width: 17%; }
.ov-table .ov-d { width: 96px; }
.ov-table .ov-n { width: 64px; }
.ov-table .ov-why { width: 30%; }
.ov-table td { vertical-align: top; }
.ov-table .sub-note { margin-left: 0; }
.ov-table .dash-board + .sub-note { margin-left: 17px; }
.ov-table .ov-basis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-reasons { white-space: normal; }
.ov-reasons span { display: block; font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.ov-reasons span + span { margin-top: 2px; }

.ov-load { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ov-load li {
  display: grid; grid-template-columns: minmax(0, 200px) minmax(60px, 1fr) 200px minmax(0, 260px);
  align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--rule-soft);
}
.ov-load li:first-child { border-top: 0; }
.ov-load .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ov-load .who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ov-load .who b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-load .who em { font-style: normal; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.ov-bar { display: flex; height: 8px; border-radius: 4px; background: var(--ink-600); overflow: hidden; }
.ov-bar i { display: block; height: 100%; background: var(--signal); }
/* What they own is solid; what they have joined trails it, fainter. */
.ov-bar i.joined { background: var(--signal); opacity: .35; }
.ov-count { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.ov-count b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.ov-work { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 10px; border: 1px solid var(--rule-strong); color: var(--text-faint);
}
.ov-tag.warn { color: var(--signal); border-color: var(--signal-dim); }

.ov-changes .meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 11.5px; font-family: var(--font-mono); color: var(--text-dim); }
.ov-changes p a { color: var(--text); }
.ov-move { font-weight: 600; padding: 0 5px; border-radius: 4px; background: var(--ink-600); color: var(--text-dim); }
.ov-move.bad { color: var(--danger); background: rgba(255, 107, 107, .12); }
.ov-move.good { color: var(--ok); background: rgba(74, 222, 128, .1); }

@media (max-width: 900px) {
  .ov-load li { grid-template-columns: minmax(0, 1fr) auto; }
  .ov-load .ov-bar { grid-column: 1 / -1; grid-row: 2; }
  .ov-load .ov-work { grid-column: 1 / -1; }
  .ov-table .ov-p, .ov-table td:nth-child(3) { display: none; }
}
/* On a phone each project is a block: health and name, then its progress and why. */
@media (max-width: 640px) {
  .ov-filter { margin-left: 0; }
  .ov-table, .ov-table tbody { display: block; width: 100%; }
  .ov-table thead { display: none; }
  .ov-table tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 6px 10px;
    padding: 10px 0; border-bottom: 1px solid var(--rule-soft);
  }
  .ov-table tr:last-child { border-bottom: 0; }
  .ov-table td { display: block; padding: 0; border: 0; width: auto; }
  .ov-table td:nth-child(1) { grid-area: 1 / 1; }
  .ov-table td:nth-child(2) { grid-area: 1 / 2; }
  .ov-table td:nth-child(4) { grid-area: 1 / 3; text-align: right; }
  .ov-table td:nth-child(3) { display: block; grid-area: 2 / 1 / 3 / -1; }
  .ov-table td:nth-child(7) { grid-area: 3 / 1 / 4 / -1; }
  .ov-table td:nth-child(5), .ov-table td:nth-child(6) { display: none; }
}
