/* Portfolio (§6.1). Grid templates and sizes are from the reference. */

.portfolio__head {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px;
}
.portfolio__greeting {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0;
}
.portfolio__sub { font-size: 13px; color: var(--p-ink-2); margin: 3px 0 0; }
.portfolio__head .btn-primary { margin-inline-start: auto; flex: none; text-decoration: none; }
.portfolio__head .btn-primary:hover { text-decoration: none; color: var(--p-on-brand); }

/* ---- Seven stat cards ---- */
.portfolio__stats {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: var(--p-surface); border: 1px solid var(--p-line);
  border-radius: var(--radius-lg); padding: 14px; text-align: start;
  cursor: pointer;
}
.stat:hover { border-color: var(--p-line-2); }
.stat__value {
  /* No font-family — see .cl__pct. The element carries `.num`. */
  font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1;
}
.stat__label { font-size: 11.5px; color: var(--p-ink-2); }
.stat--brand .stat__icon { color: var(--p-brand); }
.stat--warn  .stat__icon { color: var(--p-warn); }
.stat--risk  .stat__icon { color: var(--p-risk); }
.stat--audit .stat__icon { color: var(--p-audit); }
.stat--risk  .stat__value { color: var(--p-risk); }

/* ---- Priority work queue ---- */
.queue { margin-bottom: 16px; }
.queue__table { min-width: 720px; }
.queue__head,
.queue__row {
  display: grid;
  grid-template-columns: 148px 1fr 40px 74px 104px;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px 16px;
  text-align: start;
}
.queue__head {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--p-ink-3);
  border-bottom: 1px solid var(--p-line);
  padding-block: 8px;
}
.queue__row {
  background: transparent; border: none;
  border-bottom: 1px solid var(--p-line);
  cursor: pointer; font-family: inherit; color: inherit;
}
.queue__row:hover { background: var(--p-surface-2); }
.queue__row:last-child { border-bottom: none; }

.queue__client { display: flex; align-items: center; gap: 9px; min-width: 0; }
.queue__client-name {
  display: block; flex: 1; min-width: 0;
  font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.queue__task { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-inline-end: 12px; }
.queue__task-title {
  display: block; min-width: 0; font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.queue__task-next {
  display: block; min-width: 0; font-size: 10.5px; color: var(--p-ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.queue__who-dot {
  width: 22px; height: 22px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--p-surface-2); border: 1px solid var(--p-line);
  color: var(--p-ink-2); font-size: 8.5px; font-weight: 700;
}
.queue__due { font-size: 12px; color: var(--p-ink-2); }
.queue__due.is-urgent { color: var(--p-risk); font-weight: 600; }
.queue__status { display: flex; justify-content: flex-start; }
.queue__empty { padding: 24px 16px; font-size: 12.5px; color: var(--p-ink-3); }

/* ---- Queue + deadlines/activity rail ----
 *
 * `1fr 340px` VERBATIM from the export's own isHome grid. It was
 * `minmax(0, 2.25fr) minmax(280px, 1fr)`, which is not the same thing above
 * 1100px: a proportional rail keeps growing with the viewport, so at 1600px it
 * resolved to roughly 490px against the design's 340px, and the deadlines and
 * activity cards stretched while the work queue — the column an accountant is
 * actually reading — lost the space.
 *
 * The ratio only looked right at 1440, where it lands within ~14px of 340px.
 * That is what made the drift invisible.
 *
 * `minmax(0, …)` is kept on the MAIN column, where it does real work: it stops
 * a long client name or task title from pushing the grid wider than its
 * container. The rail needs no such guard — it is a fixed track.
 *
 * Nothing here carries the responsive collapse; the @media (max-width: 1099px)
 * rule below drops this to a single column, which is why a fixed rail is safe.
 */
.portfolio__work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start; gap: 16px; margin-bottom: 20px;
}
.portfolio__work-grid .queue { margin-bottom: 0; }
.portfolio__rail { display: grid; gap: 16px; min-width: 0; }
.deadlines, .activity { list-style: none; margin: 0; padding: 0 16px 16px; }
.deadlines__row, .activity__row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 0; border-top: 1px solid var(--p-line);
}
.deadlines__row:first-child, .activity__row:first-child { border-top: none; }
.deadlines__date {
  flex: none; width: 54px; padding-top: 2px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
  text-transform: uppercase;
}
.deadlines__date--risk    { color: var(--p-risk); }
.deadlines__date--warn    { color: var(--p-warn); }
.deadlines__date--audit   { color: var(--p-audit); }
.deadlines__date--neutral { color: var(--p-ink-3); }
.deadlines__title, .activity__text { display: block; font-size: 12.5px; font-weight: 600; }
.deadlines__meta, .activity__meta { display: block; font-size: 10.5px; color: var(--p-ink-3); margin-top: 2px; }

.activity__tile {
  flex: none; width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.activity__tile--ok      { background: var(--p-ok-soft);    color: var(--p-ok); }
.activity__tile--warn    { background: var(--p-warn-soft);  color: var(--p-warn); }
.activity__tile--audit   { background: var(--p-audit-soft); color: var(--p-audit); }
.activity__tile--brand   { background: var(--p-brand-soft); color: var(--p-brand); }
.activity__tile--neutral { background: var(--p-surface-2);  color: var(--p-ink-2); }

/* ---- Client readiness ---- */
.portfolio__ready-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.ready {
  display: block; text-align: start; cursor: pointer;
  background: var(--p-surface); border: 1px solid var(--p-line);
  border-radius: var(--radius-lg); padding: 16px;
  font-family: inherit; color: inherit;
}
.ready:hover { border-color: var(--p-line-2); }
.ready__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ready__ident { flex: 1; min-width: 0; }
.ready__name {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ready__meta { font-size: 10.5px; color: var(--p-ink-3); margin-top: 1px; }

.ready__status { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.ready__dot { width: 8px; height: 8px; border-radius: var(--radius-pill); flex: none; }
.ready__dot--ok   { background: var(--p-ok); }
.ready__dot--warn { background: var(--p-warn); }
.ready__dot--risk { background: var(--p-risk); }
.ready__word { font-size: 11.5px; font-weight: 600; }
.ready__word--ok   { color: var(--p-ok); }
.ready__word--warn { color: var(--p-warn); }
.ready__word--risk { color: var(--p-risk); }
.ready__why { font-size: 11px; color: var(--p-ink-3); }

/* Four metrics in a 2×2 grid: label left, value right, twice per row. */
.ready__metrics {
  display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px 14px; margin: 0;
}
.ready__metrics dt { font-size: 11px; color: var(--p-ink-3); }
.ready__metrics dd {
  margin: 0; font-size: 11.5px; font-weight: 600; text-align: end;
  color: var(--p-ink);
}
.ready__metric--ok   { color: var(--p-ok); }
.ready__metric--warn { color: var(--p-warn); }
.ready__metric--risk { color: var(--p-risk); }

/* ---- Responsive (C4) ---- */
@media (max-width: 1319px) {
  .portfolio__stats { grid-template-columns: repeat(4, 1fr); }
  .portfolio__ready-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1099px) {
  .portfolio__work-grid { grid-template-columns: 1fr; }
  .portfolio__rail { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 899px) {
  .portfolio__stats { grid-template-columns: repeat(2, 1fr); }
  .portfolio__rail { grid-template-columns: 1fr; }
  .portfolio__ready-grid { grid-template-columns: 1fr; }
  .portfolio__head { flex-direction: column; }
  .portfolio__head .btn-primary { margin-inline-start: 0; }
}

/* The queue's own account of why it is empty. An empty table would read as
   "nothing waiting on you", which for an auditor is the opposite of the truth:
   the queue does not apply to them at all. */
.queue__unavailable {
  margin: 0; padding: 18px 16px 20px;
  font-size: 12.5px; line-height: 1.55; color: var(--p-ink-2);
}

.portfolio__readiness { display: block; }
.queue__who { display: flex; justify-content: flex-start; }
