:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #183129;
  background: #eff4f0;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --green: #008f4b;
  --green-dark: #00783e;
  --green-soft: #e0f2e8;
  --mint: #dff2e7;
  --yellow: #ffed00;
  --red: #e30613;
  --muted: #78857f;
  --line: #e8ece9;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 360px; background: #eff4f0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; padding: 16px max(28px, calc((100vw - 1440px) / 2));
  background: var(--green); border-bottom: 4px solid var(--yellow); box-shadow: 0 3px 14px #1831290b;
}
.brand { display: flex; align-items: center; gap: 20px; min-width: 0; }
.brand img { display: block; width: 145px; height: auto; }
.brand > div { border-left: 1px solid #ffffff65; padding-left: 18px; }
h1, h2, p { margin: 0; }
h1 { color: #fff; font-size: 20px; letter-spacing: -.035em; font-weight: 720; }
.brand p { color: #e2f4e9; font-size: 13px; margin-top: 4px; }
.brand p span { color: var(--green); }
.toolbar, .filter-actions { display: flex; align-items: center; gap: 12px; }
.live-status, .data-badge { color: var(--green); border: 1px solid #cfe6d7; background: #f5fbf7; border-radius: 999px; padding: 7px 11px; font-size: 12px; white-space: nowrap; }
.topbar .live-status { color: #fff; border-color: #ffffff70; background: #ffffff16; }
.topbar .live-status i { background: #7bd99d; }
.live-status i, .data-badge i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2da76a; margin-right: 6px; }
.button { border: 0; border-radius: 9px; padding: 10px 15px; font-weight: 650; font-size: 13px; transition: transform .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px #193c2a24; }
.button-primary { color: var(--green-dark); background: #fff; }
.button-light { color: var(--green-dark); background: var(--green-soft); }
.page { max-width: 1440px; margin: 0 auto; padding: 24px 28px 20px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 12px #18312908; }
.filter-panel { padding: 20px 22px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h2 { font-size: 16px; letter-spacing: -.02em; font-weight: 700; }
.subtle { color: var(--muted); font-size: 12px; margin-top: 4px; }
.filter-actions { gap: 18px; }
.text-button { background: none; border: 0; color: #495a52; font-size: 12px; padding: 8px 0; }
.filter-grid { display: grid; grid-template-columns: repeat(4,minmax(130px,1fr)); gap: 16px; margin-top: 19px; }
.filter-grid label { color: #64726b; display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
select, input { color: #263a31; border: 1px solid #dfe5e1; background: #eff4f0; border-radius: 9px; height: 40px; padding: 0 12px; outline: none; }
select:focus, input:focus { border-color: #75b58f; box-shadow: 0 0 0 3px #007a3d18; }
.notice { margin-top: 14px; padding: 11px 14px; border: 1px solid #f0d38a; background: #fff9df; border-radius: 10px; color: #705a00; font-size: 13px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.metric { position: relative; overflow: hidden; min-height: 119px; padding: 17px 20px 15px; border: 1px solid transparent; border-radius: 14px; box-shadow: 0 3px 12px #18312912; }
.metric-total, .metric-hired, .metric-apprentices { color: #fff; background: var(--green); }
.metric-interview { color: var(--green-dark); background: var(--mint); }
.metric-rejected { color: #fff; background: #d62828; }
.metric-average { color: #543000; background: #f4a340; }
.metric-apprentices { color: #fff; background: #2468b4; }
.metric-pending { color: var(--green-dark); background: var(--yellow); }
.metric-label { color: inherit; opacity: .88; text-transform: uppercase; letter-spacing: .045em; font-size: 10px; font-weight: 720; }
.metric-value { display: block; margin-top: 10px; font-size: 30px; line-height: 1; font-weight: 750; letter-spacing: -.04em; }
.metric-note { display: block; color: inherit; opacity: .82; font-size: 11px; margin-top: 7px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 14px; margin-top: 17px; }
.chart-panel { padding: 19px 20px; min-height: 245px; }
.stage-chart { min-height: 155px; padding: 20px 0 0; display: flex; flex-direction: column; justify-content: center; gap: 13px; }
.stage-row { display: grid; grid-template-columns: 95px 1fr 30px; gap: 10px; align-items: center; font-size: 12px; }
.stage-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #58675f; }
.bar-track { height: 9px; border-radius: 99px; overflow: hidden; background: #eef1ef; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--bar-color); }
.stage-count { text-align: right; font-weight: 700; color: #33453b; }
.reason-chart { display: flex; flex-direction: column; gap: 12px; margin-top: 19px; }
.reason-row { display: grid; grid-template-columns: minmax(0,1fr) 1fr 25px; gap: 9px; align-items: center; font-size: 11px; color: #58675f; }
.reason-name { overflow-wrap: anywhere; color: #c23e37; }
.reason-row .bar-track { height: 7px; }
.timing-metrics { display: flex; gap: 26px; margin: 20px 0 15px; }
.timing-stat strong { display: block; font-size: 23px; letter-spacing: -.04em; }
.timing-stat span { color: var(--muted); font-size: 10px; }
.role-chart { display: flex; flex-direction: column; gap: 8px; }
.role-bar-row { display: grid; grid-template-columns: minmax(100px, 155px) 1fr 35px; gap: 8px; align-items: center; font-size: 10px; color: #65726c; }
.role-bar-row .bar-track { height: 6px; }
.role-bar-row .bar-fill { background: var(--green); }
.summary-panel, .candidates-panel { margin-top: 16px; padding: 18px 20px 8px; }
.table-wrap { overflow-x: auto; margin-top: 13px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
thead th { color: #75817b; font-weight: 650; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; background: #f8faf8; }
th, td { padding: 11px 10px; border-bottom: 1px solid #edf0ee; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7fbf8; }
.summary-panel td:first-child { font-weight: 620; min-width: 220px; }
.summary-panel td:not(:first-child) { font-variant-numeric: tabular-nums; }
.candidates-table { min-width: 1120px; }
.candidates-table td { white-space: nowrap; }
.candidates-table td:nth-child(2), .candidates-table td:nth-child(3), .candidates-table td:nth-child(8) { white-space: normal; min-width: 135px; max-width: 230px; }
.stage-pill { display: inline-block; border-radius: 999px; padding: 5px 9px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.reason-pill { display: inline-block; border-radius: 999px; padding: 5px 9px; background: #fff0ef; color: #c23e37; font-size: 10px; font-weight: 650; }
.stage-contratado { background: #e5f5eb; color: #08733b; }
.stage-entrevista { background: #e8f1ff; color: #345f9b; }
.stage-pendiente { background: #fff6da; color: #886710; }
.stage-no-aprobado { background: #fff0ef; color: #c23e37; }
.empty-state { text-align: center; color: var(--muted); padding: 35px 15px; }
footer { padding: 22px 4px 5px; text-align: center; color: #8a958f; font-size: 11px; }
@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .timing-panel { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .topbar { position: static; align-items: flex-start; padding: 14px 16px; flex-direction: column; gap: 14px; }
  .brand { gap: 12px; }
  .brand > div { padding-left: 11px; }
  .brand img { width: 94px; }
  h1 { font-size: 16px; }
  .brand p { font-size: 11px; }
  .toolbar { width: 100%; gap: 8px; }
  .live-status { margin-right: auto; }
  .button { padding: 9px 11px; font-size: 12px; }
  .page { padding: 15px 12px; }
  .filter-panel { padding: 16px; }
  .filter-grid { grid-template-columns: 1fr 1fr; gap: 13px 10px; }
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 12px; }
  .metric { padding: 14px 13px; min-height: 108px; }
  .metric-value { font-size: 27px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
  .timing-panel { grid-column: auto; }
  .chart-panel { min-height: unset; padding: 16px; }
  .summary-panel, .candidates-panel { padding: 15px 13px 5px; margin-top: 12px; }
  .panel-heading { align-items: flex-start; }
  .data-badge { font-size: 10px; padding: 6px 8px; }
  .timing-metrics { gap: 22px; }
  .role-bar-row { grid-template-columns: minmax(100px, 130px) 1fr 25px; }
}
@media (max-width: 420px) {
  .filter-actions { gap: 10px; }
  .filter-actions .subtle { font-size: 10px; }
  .text-button { font-size: 11px; }
  .filter-grid { grid-template-columns: 1fr; }
}
