/* ═══════════════════════════════════════════════════════════
   Workforce Dashboard (SWHW-217) — Forge-parity compliance view.
   Reuses .cards / .card / .page-title / .btn-secondary from
   app.css; everything below is wd-* scoped to this page.
   ═══════════════════════════════════════════════════════════ */

.wd-page { padding: 24px 28px 40px; }

/* ── Header ───────────────────────────────────────────────── */
.wd-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.wd-header .page-title { margin: 0; }
.wd-header-actions { display: flex; align-items: center; gap: 10px; }
.wd-period {
  height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit;
}
.wd-header-actions .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
.wd-header-actions .btn-secondary svg { width: 15px; height: 15px; }

/* ── Stat cards ───────────────────────────────────────────── */
.wd-stats { margin-bottom: 20px; }
.wd-stat { position: relative; text-align: center; padding-top: 26px; }
.wd-stat .card-value { font-size: 34px; margin-bottom: 6px; }
.wd-stat .card-label { justify-content: center; }
.wd-stat-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--muted); }
.wd-stat-icon svg { width: 20px; height: 20px; }
/* Left accent rail — amber on Avg Compliance, red on At Risk (Forge parity). */
.wd-stat-amber { border-left: 3px solid var(--orange); }
.wd-stat-red { border-left: 3px solid var(--red); }
.wd-stat-amber .wd-stat-icon { color: var(--orange); }
.wd-stat-red .wd-stat-icon { color: var(--red); }

/* ── Panels ───────────────────────────────────────────────── */
.wd-panel {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.wd-panel-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.wd-panel-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.wd-panel-title + .wd-chart, .wd-panel-title + .wd-table { margin-top: 14px; }
.wd-chart { min-height: 300px; }
.wd-empty { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }
.wd-error {
  background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}

/* ── Progress bars (shared by the team table + attention list) ── */
.wd-bar-cell { display: flex; align-items: center; gap: 10px; }
.wd-bar {
  flex: 1 1 auto; min-width: 90px; max-width: 220px; height: 8px;
  background: var(--bg-alt); border-radius: 999px; overflow: hidden;
}
.wd-bar-fill { height: 100%; border-radius: 999px; }
.wd-bar-fill.good { background: var(--green); }
.wd-bar-fill.warn { background: var(--orange); }
.wd-bar-fill.bad { background: var(--red); }
.wd-pct { font-size: 13px; font-weight: 600; color: var(--text); min-width: 42px; }

/* ── Team breakdown ───────────────────────────────────────── */
.wd-table { width: 100%; border-collapse: collapse; }
.wd-table th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border-light);
}
.wd-table td { padding: 12px; border-bottom: 1px solid var(--border-light); font-size: 13px; color: var(--text); }
.wd-table tbody tr:last-child td { border-bottom: none; }
.wd-table .num { text-align: right; }
.wd-table th.num { text-align: right; }
.wd-team { font-weight: 600; }

/* ── Attention required ───────────────────────────────────── */
.wd-attn {
  display: grid; grid-template-columns: minmax(180px, 1.4fr) auto minmax(160px, 1fr);
  align-items: center; gap: 16px;
  border-left: 3px solid var(--red); border-radius: 8px;
  background: var(--red-bg); padding: 12px 16px; margin-bottom: 8px;
}
.wd-attn.warn { border-left-color: var(--orange); background: var(--orange-bg); }
.wd-attn.good { border-left-color: var(--green); background: var(--green-bg); }
.wd-attn-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wd-attn-who svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.wd-attn-name { font-size: 14px; font-weight: 600; color: var(--text); }
.wd-attn-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.wd-attn-hours { font-size: 13px; color: var(--text-strong); white-space: nowrap; }
/* Secondary line: Jira worklog hours, shown only when they exceed the timesheet. */
.wd-attn-jira { font-size: 11px; color: var(--muted); margin-top: 2px; }

@media (max-width: 860px) {
  .wd-attn { grid-template-columns: 1fr; gap: 8px; }
  .wd-page { padding: 18px 16px 32px; }
}
