/* ---- Employer › Insights ----
   One job in numbers (employer-insights.js). Every bar has its number
   written beside it, so a bar is never the only way to read a figure. */

.insights-body { display: flex; flex-direction: column; gap: 18px; }

/* The headline numbers. */
.insights-stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.insights-stat {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.insights-stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.insights-stat-label { font-size: 13px; font-weight: 500; color: var(--muted-strong); }
.insights-stat-sub { font-size: 12px; color: var(--muted); }
.insights-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.insights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.insights-card { margin: 0; min-width: 0; }
.insights-card h2 { margin: 0 0 6px; font-size: 16px; }
.insights-wide { grid-column: 1 / -1; }
.insights-hint { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.insights-hint[hidden] { display: none; }

/* A bar: its track, and the share filled. */
.insights-bar-track { display: block; min-width: 0; height: 10px; border-radius: var(--radius-pill); background: var(--neutral-bg); overflow: hidden; }
.insights-bar { display: block; height: 100%; border-radius: inherit; background: var(--accent2); }

/* How far applicants got. */
.insights-funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.insights-funnel-step {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) 40px; grid-template-areas: "label bar count" ". rate rate";
  align-items: center; column-gap: 10px; row-gap: 2px;
}
.insights-funnel-label { grid-area: label; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.insights-funnel-step .insights-bar-track { grid-area: bar; height: 14px; }
.insights-funnel-count { grid-area: count; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.insights-funnel-rate { grid-area: rate; font-size: 12px; color: var(--muted); }
.insights-funnel-rate:empty { display: none; }

/* Applications per day: a column a day, quiet days a thin line. */
.insights-days { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--border); }
.insights-day { display: flex; align-items: flex-end; flex: 1 1 0; min-width: 2px; max-width: 28px; height: 100%; }
.insights-day-fill { display: block; width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; background: var(--accent2); }
.insights-day.is-zero .insights-day-fill { height: 2px !important; min-height: 0; background: var(--border); }
.insights-days-axis { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* Against the requirements: met, missed and unknown, in that order. */
.insights-check { padding: 12px 0; border-top: 1px solid var(--border); }
.insights-check:first-child { padding-top: 0; border-top: 0; }
.insights-check-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.insights-check-label { min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.insights-tag {
  flex: none; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 600;
  background: var(--accent2-soft); border: 1px solid var(--accent2-border); color: var(--accent2-dark);
}
.insights-tag.is-quiet { background: var(--neutral-bg); border-color: var(--border); color: var(--muted-strong); }
.insights-stack { display: flex; height: 12px; border-radius: var(--radius-pill); background: var(--neutral-bg); overflow: hidden; }
.insights-stack-part { display: block; height: 100%; }
.insights-check-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: var(--text); }
.insights-count { display: inline-flex; align-items: center; gap: 6px; }
.insights-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.insights-stack-part.is-met, .insights-swatch.is-met { background: var(--good); }
.insights-stack-part.is-missed, .insights-swatch.is-missed { background: var(--danger); }
.insights-stack-part.is-unknown, .insights-swatch.is-unknown { background: var(--muted); }

/* Answers, and the self-identification totals: two columns of questions. */
.insights-questions, .insights-selfid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; }
.insights-question { min-width: 0; }
.insights-question-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.insights-question-label { min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.insights-question-answered { flex: none; font-size: 12.5px; color: var(--muted); }
.insights-question-note { margin: 8px 0 0; font-size: 13px; color: var(--muted-strong); }
.insights-bars { display: flex; flex-direction: column; gap: 6px; }
/* The number column is a fixed width, so every bar in a question starts and
   ends in the same place - "Fewer than 5" included. */
.insights-bar-row { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) 3em; align-items: center; gap: 10px; font-size: 13px; }
.insights-selfid .insights-bar-row { grid-template-columns: minmax(0, 38%) minmax(0, 1fr) 7.5em; }
.insights-bar-label { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.insights-bar-value { text-align: right; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }

/* Skills by level: a row a skill, a column a level. */
.insights-table-scroll { overflow-x: auto; }
.insights-skills { width: 100%; border-collapse: collapse; font-size: 13px; }
.insights-skills th, .insights-skills td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--border); }
.insights-skills thead th { font-size: 12px; font-weight: 600; color: var(--muted-strong); }
.insights-skills th[scope="row"] { text-align: left; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.insights-skills td { font-variant-numeric: tabular-nums; color: var(--muted); }
.insights-skills td.has-count { font-weight: 600; color: var(--accent2-dark); background: var(--accent2-soft); }

@media (max-width: 960px) {
  .insights-stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .insights-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights-grid, .insights-questions, .insights-selfid { grid-template-columns: 1fr; }
  .insights-funnel-step { grid-template-columns: 76px minmax(0, 1fr) 34px; }
}
