/* ============================================================================
   Dashboard-specific layout
   ============================================================================ */

.dash-page {
  padding: 8px 20px 28px;
  min-width: 0;
  overflow-x: hidden;        /* defensive — nothing should push horizontal scroll */
  display: flex;
  flex-direction: column;
  gap: 16px;                 /* default breathing room between every section */
}
.dash-page .card { min-width: 0; }
.dash-page .card-header {
  flex-wrap: wrap;           /* let kicker + period toggle wrap on narrow viewports */
  row-gap: 8px;
}
/* Section titles (h2.section-title) need less gap above so they group with the
   card below them instead of floating between gaps */
.dash-page .section-title { margin: 4px 0 -8px; }
@media (min-width: 1024px) {
  .dash-page { padding: 24px 0 40px; gap: 20px; }
}

.attention-list { display: flex; flex-direction: column; gap: 0; }
.attention-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 0; border-top: 1px solid var(--border-l);
}
.attention-row:first-child { border-top: none; padding-top: 6px; }
.attention-row.clickable { cursor: pointer; transition: background var(--t-fast); border-radius: var(--r-sm); margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.attention-row.clickable:hover { background: var(--cream); }
.attention-task {
  flex: 1; font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attention-task .source { color: var(--text-l); font-size: 12px; margin-left: 8px; }
.attention-meta { font-size: 12px; color: var(--text-m); text-align: right; flex-shrink: 0; min-width: 130px; }
.attention-age  { color: var(--danger-d); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 768px) {
  .attention-row { flex-wrap: wrap; gap: 8px; }
  .attention-task { white-space: normal; min-width: 60%; }
  .attention-meta { text-align: left; min-width: 0; }
}

.outstanding-subhead {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--brown); font-weight: 600;
  padding: 12px 0 6px; border-top: 1px solid var(--border-l);
}
.card.accent-warn > .outstanding-subhead:first-of-type { border-top: none; padding-top: 0; }
.outstanding-extra { font-size: 11px; color: var(--text-l); padding: 8px 0 4px; letter-spacing: 0.04em; }

/* --- Estate health 4-cell grid --- */
.health-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.health-cell {
  padding: 6px 16px; border-right: 1px solid var(--border-l);
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; transition: background var(--t-fast); border-radius: var(--r-sm);
}
.health-cell:first-child { padding-left: 0; }
.health-cell:last-child  { padding-right: 0; border-right: none; }
.health-cell:hover { background: var(--cream); }
.health-period {
  font-size: 10px; color: var(--text-l);
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
}
.health-pct {
  font-family: var(--font-display); font-size: 28px; font-weight: 500;
  line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums; margin-top: 4px;
}
.health-detail { font-size: 11px; color: var(--text-l); font-variant-numeric: lining-nums tabular-nums; }

@media (max-width: 768px) {
  .health-grid  { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .health-cell  { padding: 8px !important; border-right: none; border-bottom: 1px solid var(--border-l); }
  .health-cell:nth-last-child(-n+2) { border-bottom: none; }
}

/* --- Team performance card --- */
.team-row {
  display: grid; grid-template-columns: 36px 1fr 90px 110px;
  align-items: center; gap: 16px;
  padding: 13px 0; border-top: 1px solid var(--border-l);
}
.team-row:first-of-type { border-top: none; padding-top: 6px; }
.team-row .name  { font-size: 13px; font-weight: 500; color: var(--text); }
.team-row .stats { font-size: 11px; color: var(--text-l); margin-top: 2px; }
.team-row .pct {
  font-family: var(--font-display); font-size: 20px; font-weight: 500;
  text-align: right; letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
}
@media (max-width: 768px) {
  .team-row { grid-template-columns: 32px 1fr 60px; gap: 10px; }
  .team-row .spark { display: none; }
}

/* --- Trend / category cards --- */
.trend-card .chart-wrap { position: relative; width: 100%; height: 180px; min-width: 0; overflow: hidden; }
.trend-card .chart-wrap canvas { max-width: 100% !important; height: auto !important; }

.cat-bar-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) 50px;
  align-items: center; gap: 14px;
  padding: 10px 0; border-top: 1px solid var(--border-l);
  cursor: pointer; transition: background var(--t-fast); border-radius: var(--r-sm);
}
.cat-bar-row:first-of-type { border-top: none; padding-top: 6px; }
.cat-bar-row:hover  { background: var(--cream); }
.cat-bar-row.active { background: var(--sage-soft); }
.cat-bar-row .lbl   { font-size: 13px; color: var(--text); padding-left: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-bar-row.active .lbl { font-weight: 600; }
.cat-bar-row .progress { min-width: 0; }
.cat-bar-row .pct {
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  text-align: right; padding-right: 6px;
  font-variant-numeric: lining-nums tabular-nums;
}
@media (max-width: 600px) {
  .cat-bar-row { grid-template-columns: 90px minmax(0, 1fr) 42px; gap: 10px; }
  .cat-bar-row .lbl { padding-left: 0; font-size: 12px; }
  .cat-bar-row .pct { padding-right: 0; font-size: 12px; }
}

/* --- Coming up forward strip --- */
.upcoming-list { display: grid; grid-template-columns: 1fr; gap: 0; }
.upcoming-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 14px; padding: 11px 0;
  border-top: 1px solid var(--border-l);
  cursor: pointer; transition: background var(--t-fast); border-radius: var(--r-sm);
  margin: 0 -8px; padding-left: 8px; padding-right: 8px;
}
.upcoming-row:first-child { border-top: none; }
.upcoming-row:hover { background: var(--cream); }
.upcoming-row .info .n { font-size: 13px; color: var(--text); font-weight: 500; }
.upcoming-row .info .s { font-size: 11px; color: var(--text-l); margin-top: 2px; letter-spacing: 0.04em; }
.upcoming-row .when {
  font-size: 12px; color: var(--text-m); align-self: center;
  font-variant-numeric: lining-nums tabular-nums; text-align: right;
}

/* --- Individual leaderboard --- */
.leader-row {
  display: grid; grid-template-columns: 36px 1fr auto;
  align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--border-l);
}
.leader-row:first-of-type { border-top: none; }
.leader-row .nm  { font-size: 13px; color: var(--text); font-weight: 500; }
.leader-row .st  { font-size: 11px; color: var(--text-l); margin-top: 2px; }
.leader-row .pct { font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
