/* Hour Bank — banco de horas por fase y por área (js/hour-bank-module.js). Todo cuelga de .hb-root y usa prefijo hb-:
   styles.css tiene .card/.chip/.table genéricos. Tokens del DESIGN_SYSTEM de KOK (los mismos valores que outreach.css).
   Sin reglas .dark-mode (CLAUDE.md). */
.hb-root {
  --hb-navy: #163353; --hb-teal: #249083; --hb-ink: #132434; --hb-muted: #5f6774; --hb-label: #6b7480;
  --hb-surface: #ffffff; --hb-page: #f3f6f9; --hb-line: #e4e9ed; --hb-line-soft: #eef1f4;
  --hb-green-bg: #e6f4ee; --hb-green-tx: #007450; --hb-gray-bg: #e8e9eb; --hb-gray-tx: #414b58;
  --hb-amber-bg: #fdf5e3; --hb-amber-tx: #9c6300; --hb-note: #fffaed; --hb-note-line: #f1e2b8;
  color: var(--hb-ink); font-size: 14px; line-height: 1.45;
}
.hb-root .hb-sup-name { font-weight: 700; color: var(--hb-ink); }
.hb-root .hb-sup-name.hb-sup-none, .hb-root .hb-table td.hb-sup-none { font-weight: 500; font-style: italic; color: #9aa4ae; }
.hb-root .hb-card-sup { padding: 8px 14px; font-size: 13px; color: var(--hb-gray-tx); background: #f7fbfa; border-bottom: 1px solid var(--hb-line); }
.hb-root .hb-table td.hb-sup { text-align: left; white-space: nowrap; }
.hb-root .hb-source, .hb-root .hb-used-note {
  margin: 0 0 8px; padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--hb-gray-tx);
  background: var(--hb-page); border: 1px solid var(--hb-line);
}
.hb-root .hb-source { background: var(--hb-note); border-color: var(--hb-note-line); color: #6b4a00; }
.hb-root .hb-env { margin: 0 0 10px; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; background: var(--hb-amber-bg); color: var(--hb-amber-tx); border: 1px solid var(--hb-note-line); }
.hb-root .hb-empty { margin: 12px 0; padding: 18px; border: 1px dashed var(--hb-line); border-radius: 10px; color: var(--hb-muted); text-align: center; }
.hb-root .hb-sub { margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hb-label); }

.hb-root .hb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.hb-root .hb-card { background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 12px; overflow: hidden; }
.hb-root .hb-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--hb-line); background: #fafcfd; }
.hb-root .hb-card-title { font-size: 17px; font-weight: 700; color: var(--hb-navy); }
.hb-root .hb-card-total { margin-left: auto; font-size: 17px; font-weight: 700; color: var(--hb-ink); font-variant-numeric: tabular-nums; }
.hb-root .hb-line { display: grid; grid-template-columns: 118px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--hb-line-soft); }
.hb-root .hb-line:last-child { border-bottom: 0; }
.hb-root .hb-bank { font-weight: 600; }
.hb-root .hb-owner { color: var(--hb-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-root .hb-hours { grid-column: 4; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hb-root .hb-ref { grid-column: 1 / -1; font-size: 12px; color: var(--hb-label); }
.hb-root .hb-line-none .hb-bank, .hb-root .hb-line-none .hb-hours { color: #9aa4ae; font-weight: 500; }
.hb-root .hb-line-none .hb-hours { font-style: italic; }
.hb-root .hb-line-pending .hb-hours { color: var(--hb-muted); }

.hb-root .hb-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.hb-root .hb-chip-active { background: var(--hb-green-bg); color: var(--hb-green-tx); }
.hb-root .hb-chip-pending { background: var(--hb-gray-bg); color: var(--hb-gray-tx); }
.hb-root .hb-chip-partial { background: var(--hb-amber-bg); color: var(--hb-amber-tx); }
.hb-root .hb-chip-finished { background: var(--hb-gray-bg); color: var(--hb-gray-tx); }

.hb-root .hb-scroll { overflow-x: auto; margin-top: 20px; }
.hb-root .hb-error { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; background: #feebec; color: #c6292e; border: 1px solid #f6c9cb; }
.hb-root .hb-table { width: 100%; margin-top: 0; border-collapse: collapse; background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 12px; overflow: hidden; font-variant-numeric: tabular-nums; }
/* El relleno lateral es el de las celdas (8px): alinea el título con la primera columna y lo saca de la esquina
   redondeada de la tabla, cuyo recorte (border-radius + overflow) alcanza al título y se comía el borde de una letra
   recta (la P de "Preview"; con la A de "All areas" no se notaba). Medido en Chrome a 3x, 8-oct-2026. */
.hb-root .hb-table caption { caption-side: top; text-align: left; padding: 0 8px 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hb-label); }
.hb-root .hb-table-note { margin: 8px 0 0; font-size: 12.5px; color: var(--hb-label); }
.hb-root .hb-table th, .hb-root .hb-table td { padding: 8px; border-bottom: 1px solid var(--hb-line-soft); text-align: right; }
.hb-root .hb-table thead th { font-size: 12px; font-weight: 700; color: var(--hb-label); background: #fafcfd; border-bottom: 1px solid var(--hb-line); }
.hb-root .hb-table th:first-child, .hb-root .hb-table td:nth-child(2), .hb-root .hb-table thead th:nth-child(2), .hb-root .hb-table.hb-table-sup thead th:nth-child(3) { text-align: left; }
.hb-root .hb-table tbody th { font-weight: 700; color: var(--hb-navy); white-space: nowrap; }
/* Las cabeceras de dos palabras ("Windows In", "Portion Glass") pueden partirse: la columna de la ficha es angosta. */
.hb-root .hb-table thead th, .hb-root .hb-used thead th { vertical-align: bottom; }
.hb-root .hb-table td.hb-sup .hb-btn { vertical-align: baseline; }
.hb-root .hb-table.hb-table-sup thead th:nth-child(3) { white-space: normal; min-width: 130px; }
.hb-root .hb-table .hb-row-pending td, .hb-root .hb-table .hb-row-pending th { color: var(--hb-muted); }
.hb-root .hb-table .hb-total, .hb-root .hb-table .hb-grand { font-weight: 700; color: var(--hb-ink); }
.hb-root .hb-table tfoot th, .hb-root .hb-table tfoot td { border-top: 2px solid var(--hb-line); border-bottom: 0; font-weight: 700; background: #fafcfd; }

/* Botones y formularios (js/hour-bank-form.js). Sólo los ve quien gestiona el banco. */
.hb-root .hb-btn { border: 0; border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; color: #ffffff; background: var(--hb-teal); cursor: pointer; }
.hb-root .hb-btn:hover { background: #1f7c70; }
.hb-root .hb-btn:focus-visible, .hb-root .hb-link:focus-visible { outline: 2px solid var(--hb-navy); outline-offset: 2px; }
.hb-root .hb-btn[disabled] { opacity: .55; cursor: default; }
.hb-root .hb-btn-quiet { background: transparent; color: var(--hb-gray-tx); border: 1px solid var(--hb-line); }
.hb-root .hb-btn-quiet:hover { background: var(--hb-page); }
.hb-root .hb-btn-sm { padding: 4px 10px; font-size: 12px; }
.hb-root .hb-card-links { white-space: nowrap; }      /* Change y Print sheet bajan juntos, no uno solo */
.hb-root .hb-link { margin-left: 10px; border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--hb-teal); cursor: pointer; text-decoration: underline; }
.hb-root .hb-panel { margin: 0 0 12px; padding: 14px 16px; border: 1px solid #b9dcd6; border-radius: 12px; background: #f6fbfa; display: grid; gap: 10px; }
.hb-root .hb-panel-title { font-size: 15px; font-weight: 700; color: var(--hb-navy); }
.hb-root .hb-panel-help { margin: 0; font-size: 12.5px; color: var(--hb-muted); }
.hb-root .hb-panel-note { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; background: var(--hb-note); border: 1px solid var(--hb-note-line); color: #6b4a00; }
.hb-root .hb-panel-error { margin: 0; padding: 8px 10px 8px 26px; border-radius: 8px; font-size: 13px; background: #feebec; border: 1px solid #f6c9cb; color: #c6292e; }
.hb-root .hb-field { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--hb-label); }
.hb-root .hb-field select, .hb-root .hb-field input, .hb-root .hb-panel textarea { font: inherit; font-size: 13.5px; font-weight: 400; color: var(--hb-ink); padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 8px; background: #ffffff; min-width: 0; }
.hb-root .hb-panel textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; resize: vertical; white-space: pre; overflow: auto; }
/* Un ejemplo no puede parecer un dato ya escrito (Carlos en TEST, 8-oct: "v2 provisional" se leía como cargado). */
.hb-root .hb-field input::placeholder, .hb-root .hb-panel textarea::placeholder { color: #9aa5b1; font-style: italic; opacity: 1; }
/* La tabla dentro de un formulario es una vista previa: todavía no se guardó nada. */
.hb-root .hb-panel .hb-table caption { color: #b45309; }
.hb-root .hb-panel-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
/* El banco dentro del modal de un evento del Master Schedule, mientras llega. */
.hb-root .hb-loading { margin: 0; padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--hb-muted); background: var(--hb-page); border: 1px solid var(--hb-line); }
/* Cargar horas: cómo (casillas o tabla pegada) y las casillas. Una fila por área, o una sola del proyecto entero. */
.hb-root .hb-mode { display: inline-flex; width: max-content; border: 1px solid #b9dcd6; border-radius: 8px; overflow: hidden; background: #ffffff; }
.hb-root .hb-mode-btn { border: 0; background: transparent; padding: 6px 14px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--hb-gray-tx); cursor: pointer; }
.hb-root .hb-mode-btn + .hb-mode-btn { border-left: 1px solid #b9dcd6; }
.hb-root .hb-mode-btn[disabled] { opacity: .55; cursor: default; }
.hb-root .hb-mode-on { background: var(--hb-teal); color: #ffffff; }
.hb-root .hb-grid { width: 100%; border-collapse: collapse; background: var(--hb-surface); border: 1px solid var(--hb-line); font-variant-numeric: tabular-nums; }
.hb-root .hb-grid th, .hb-root .hb-grid td { padding: 6px 3px; border-bottom: 1px solid var(--hb-line-soft); text-align: right; }
.hb-root .hb-grid th:first-child, .hb-root .hb-grid td:first-child { padding-left: 8px; }
.hb-root .hb-grid th:last-child, .hb-root .hb-grid td:last-child { padding-right: 8px; }
.hb-root .hb-grid thead th { font-size: 12px; font-weight: 700; color: var(--hb-label); background: #fafcfd; border-bottom: 1px solid var(--hb-line); }
.hb-root .hb-grid th:first-child, .hb-root .hb-grid td:first-child { text-align: left; }
.hb-root .hb-grid tbody th { font-size: 13px; font-weight: 700; color: var(--hb-navy); white-space: nowrap; }
/* El número escrito se tiene que ver ENTERO: con más relleno, "115.04" quedaba cortado en la casilla (medido en Chrome). */
.hb-root .hb-grid input { width: 100%; min-width: 62px; box-sizing: border-box; font: inherit; font-size: 13px; font-weight: 400; color: var(--hb-ink); padding: 6px 4px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; text-align: right; }
.hb-root .hb-grid .hb-grid-area { min-width: 84px; padding-left: 6px; text-align: left; }
.hb-root .hb-grid input::placeholder { color: #9aa5b1; font-style: italic; opacity: 1; }
.hb-root .hb-grid .hb-grid-total { font-weight: 700; white-space: nowrap; color: var(--hb-ink); }
.hb-root .hb-grid-actions { display: flex; }
.hb-root .hb-panel-actions { display: flex; gap: 8px; }
.hb-root .hb-check-summary { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--hb-ink); }
.hb-root .hb-check-skipped, .hb-root .hb-check-warn { margin: 0; padding-left: 20px; font-size: 12.5px; color: var(--hb-muted); }
.hb-root .hb-check-skipped::before { content: "Not loaded:"; display: block; margin-left: -20px; font-weight: 700; }
.hb-root .hb-check-warn { color: #9c6300; }
.hb-root .hb-check-removed { margin: 0; font-size: 13px; font-weight: 600; color: #9c6300; }
.hb-root .hb-panel .hb-scroll { margin-top: 0; }

/* Horas reales de ClockShark contra el banco. */
.hb-root .hb-used-through { margin-left: 8px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--hb-muted); }
.hb-root .hb-used-project { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.hb-root .hb-used-zero { margin: 0 0 8px; padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--hb-gray-tx); background: var(--hb-page); border: 1px solid var(--hb-line); }
.hb-root .hb-used { width: 100%; border-collapse: collapse; background: var(--hb-surface); border: 1px solid var(--hb-line); font-variant-numeric: tabular-nums; }
.hb-root .hb-used th, .hb-root .hb-used td { padding: 8px; border-bottom: 1px solid var(--hb-line-soft); text-align: right; white-space: nowrap; }
.hb-root .hb-used thead th { white-space: normal; }
.hb-root .hb-used .hb-u { font-weight: 600; }
.hb-root .hb-used .hb-of { display: block; font-size: 12px; font-weight: 500; color: var(--hb-muted); }
/* Por fase: el % arriba (lo que se lee primero), y debajo las horas. Terminado: % usado y si se cumplió. */
.hb-root .hb-used .hb-pct { display: block; font-size: 13px; font-weight: 700; color: var(--hb-green-tx); }
.hb-root .hb-used .hb-pct-met { color: var(--hb-green-tx); }
.hb-root .hb-used .hb-pct-warn { color: var(--hb-amber-tx); }
.hb-root .hb-used .hb-pct-over { color: #c6292e; }
/* El % del job, arriba de sus horas y a la derecha, como el de cada fase. */
.hb-root .hb-used .hb-used-total .hb-use { display: block; width: max-content; min-width: 0; margin: 0 0 3px auto; }
.hb-root .hb-used .hb-of-none { color: #9aa4ae; }
.hb-root .hb-used .hb-pct-none { display: block; font-size: 12px; font-weight: 600; font-style: italic; color: #9aa4ae; }
.hb-root .hb-used thead th { font-size: 12px; font-weight: 700; color: var(--hb-label); background: #fafcfd; border-bottom: 1px solid var(--hb-line); }
.hb-root .hb-used th:first-child { text-align: left; }
.hb-root .hb-used tbody th { font-weight: 700; color: var(--hb-navy); }
.hb-root .hb-used .hb-used-total { font-weight: 700; }
.hb-root .hb-use { display: inline-block; min-width: 44px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-align: center; background: var(--hb-green-bg); color: var(--hb-green-tx); }
.hb-root .hb-use-warn { background: var(--hb-amber-bg); color: var(--hb-amber-tx); }
.hb-root .hb-use-over { background: #feebec; color: #c6292e; }
.hb-root .hb-use-met { background: var(--hb-green-bg); color: var(--hb-green-tx); }
.hb-root .hb-used-legend { margin: 6px 0 0; font-size: 12px; color: var(--hb-muted); }
.hb-root .hb-used-tasks, .hb-root .hb-used-outside, .hb-root .hb-used-cos-out { margin: 8px 0 0; font-size: 12.5px; color: var(--hb-label); }

/* La hoja de un área para el encargado de campo (hbSheetHtml). Sólo existe al imprimir: js/hour-bank-form.js la cuelga
   de <body> y marca body.hb-printing. Todo lo demás se esconde SÓLO con esa marca: sin ella, un Ctrl+P cualquiera en
   el CRM imprime lo de siempre. */
.hb-print-host { display: none; }
@media print {
  body.hb-printing > :not(.hb-print-host) { display: none !important; }
  body.hb-printing > .hb-print-host { display: block; }
  body.hb-printing { background: #ffffff !important; }      /* la hoja no hereda el gris de la página */
}
.hb-root.hb-sheet { max-width: 720px; padding: 4px 0; font-size: 14px; color: #111111; }
.hb-root .hb-sheet-env { display: inline-block; margin: 0 0 8px; padding: 4px 10px; border: 2px solid #9c6300; font-size: 13px; font-weight: 700; color: #9c6300; }
.hb-root .hb-sheet-project { margin: 0 0 2px; font-size: 14px; font-weight: 700; color: var(--hb-teal); letter-spacing: .02em; }
.hb-root .hb-sheet-title { margin: 0 0 10px; font-size: 24px; font-weight: 700; color: var(--hb-navy); }
.hb-root .hb-sheet-state { display: inline-block; margin: 0 0 10px; padding: 2px 10px; border: 1px solid #9aa4ae; border-radius: 999px; font-size: 12px; font-weight: 700; }
.hb-root .hb-sheet-sup, .hb-root .hb-sheet-source, .hb-root .hb-sheet-from, .hb-root .hb-sheet-through { margin: 0 0 4px; font-size: 13.5px; }
.hb-root .hb-sheet-sup { margin-bottom: 8px; font-size: 15px; }
.hb-root .hb-sheet-label { font-weight: 700; }
.hb-root .hb-sheet-table { width: 100%; margin: 14px 0 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hb-root .hb-sheet-table th, .hb-root .hb-sheet-table td { padding: 8px 10px; border: 1px solid #b8c0c8; text-align: right; }
.hb-root .hb-sheet-table th:first-child { text-align: left; }
.hb-root .hb-sheet-table thead th { font-size: 12.5px; background: #f1f4f6; }
.hb-root .hb-sheet-table tfoot th, .hb-root .hb-sheet-table tfoot td { font-weight: 700; border-top: 2px solid #5f6774; }
.hb-root .hb-sheet-over { font-weight: 700; color: #c6292e; }
/* Una fase que no se puede medir por fase (revisión final, R10): "Not measured", sin %, en gris como en la tabla. */
.hb-root .hb-sheet-none { font-style: italic; color: #5f6774; }
.hb-root .hb-sheet-tasks { margin: 8px 0 0; font-size: 12.5px; }
.hb-root .hb-sheet-shared { margin: 14px 0 0; padding: 8px 12px; border: 1px solid #b8c0c8; border-radius: 6px; font-size: 13px; }
.hb-root .hb-sheet-shared-title { margin: 0 0 4px; font-weight: 700; }
.hb-root .hb-sheet-shared ul { margin: 0; padding-left: 18px; }
.hb-root .hb-sheet-foot { margin: 16px 0 0; font-size: 11.5px; color: var(--hb-label); }

/* Correction Cleaning (Carlos, 9-oct-2026): la pérdida, aparte del banco. En rojo, como lo que se pasó. */
.hb-correction { margin: 8px 0 10px; padding: 8px 12px; border: 1px solid #FECACA; border-left: 4px solid #B91C1C; border-radius: 8px; background: #FEF2F2; }
.hb-correction-line { margin: 0; font-size: 13px; color: #7F1D1D; }
.hb-correction-note { margin: 4px 0 0; font-size: 12px; color: #991B1B; }

/* ── Bancos de Change Order en la ficha (Carlos, 15-oct-2026: cada CO tiene su banco aparte) ───────────────────── */
.hb-root .hb-co-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hb-root .hb-co { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 12px; border: 1px solid var(--hb-line); border-radius: 8px; }
.hb-root .hb-co-notfirm { border-style: dashed; background: var(--hb-note); }
.hb-root .hb-co-desc { color: var(--hb-ink); }
.hb-root .hb-co-via { font-size: 12.5px; color: var(--hb-muted); }
.hb-root .hb-co-notfirm .hb-co-via { color: var(--hb-amber-tx); font-weight: 600; }
.hb-root .hb-co-hours { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hb-root .hb-co .hb-btn { margin-left: auto; }
/* La propuesta del contrato en el formulario de carga */
.hb-root .hb-proposal { margin: 8px 0 10px; padding: 10px 12px; border: 1px solid var(--hb-line); border-radius: 8px; background: #f7fbfa; }
.hb-root .hb-proposal-line { margin: 0 0 6px; font-size: 13.5px; }
.hb-root .hb-proposal-max { margin: 0 0 6px; font-size: 13px; color: #5b6b69; }

/* ── El bloque HOUR BANK (js/hour-bank-total.js): ficha, Final Cleaning y Dashboard. Spec FINAL v1.2, 5.5. ────────────
   No cuelga de .hb-root: lo usan también las filas de Operations. El color nunca es la única señal: cada luz tiene su
   forma (svg) y su palabra. */
.hbt {
  --hbt-ink: #132434; --hbt-muted: #5f6774; --hbt-label: #6b7480; --hbt-line: #e4e9ed; --hbt-track: #eef1f4;
  --hbt-green: #007450; --hbt-green-bg: #e6f4ee; --hbt-green-dot: #12a26b;
  --hbt-yellow: #9c6300; --hbt-yellow-bg: #fdf5e3;
  --hbt-red: #b42318; --hbt-red-bg: #fdecea; --hbt-red-dot: #d92d20;
  --hbt-teal: #1d6f66;
  border: 1px solid var(--hbt-line); border-radius: 10px; padding: 12px 14px; background: #fff; color: var(--hbt-ink);
  font-size: 13px; line-height: 1.4; margin: 0 0 12px;
}
.hbt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hbt-title { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--hbt-label); }
.hbt-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px 2px 6px; border-radius: 999px; }
.hbt-chip.hbt-green { color: var(--hbt-green); background: var(--hbt-green-bg); }
.hbt-chip.hbt-yellow { color: var(--hbt-yellow); background: var(--hbt-yellow-bg); }
.hbt-chip.hbt-red { color: var(--hbt-red); background: var(--hbt-red-bg); }
.hbt-chip.hbt-none { color: #414b58; background: #fff; border: 1px dashed #8a939d; }
.hbt-ico { width: 14px; height: 14px; flex: none; }
.hbt-bar { position: relative; height: 8px; border-radius: 999px; background: var(--hbt-track); margin: 8px 0 6px; overflow: hidden; }
.hbt-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--hbt-green-dot); }
.hbt-labor { margin: 4px 0; color: var(--hbt-muted); font-variant-numeric: tabular-nums; }
.hbt-labor b { color: var(--hbt-ink); }
.hbt-over { color: var(--hbt-red); }
.hbt-outside { margin: 4px 0; color: var(--hbt-muted); font-size: 12px; }
/* Dónde cuentan las ventanas una vez elegido (hbtWindowsNote), en "Hours by ClockShark job". */
.hbt-windows { margin: 4px 0; color: var(--hbt-muted); font-size: 12px; }
/* Hours of phase-less tasks assigned to a phase from the info@ calendar (Carlos, Oct 15, option B). */
.hbt-assigned { margin: 4px 0; color: var(--hbt-muted); font-size: 12px; }
.hbt-notset { border-style: dashed; }
/* La luz de una línea (hbCompactHtml), en las filas del Dashboard: misma forma y mismo color que el bloque. */
.hbt-mini { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbt-mini.hbt-green { color: #007450; }
.hbt-mini.hbt-yellow { color: #9c6300; }
.hbt-mini.hbt-red { color: #b42318; }
.hbt-mini.hbt-none { color: #5f6774; font-weight: 600; }
.hbt-empty-title { margin: 6px 0 2px; font-weight: 700; }
.hbt-empty-why, .hbt-empty-who { margin: 0; color: var(--hbt-muted); }
.hbt-btn { margin-top: 8px; background: var(--hbt-teal); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font-weight: 700; cursor: pointer; min-height: 32px; }
@media (max-width: 768px) { .hbt-btn { min-height: 44px; } }
.hb-root .hb-windows-phase { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; }
.hb-root .hb-windows-error { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; background: #feebec; border: 1px solid #f6c9cb; color: #c6292e; }

/* La tarjeta liviana (hbtLightCardHtml, spec banco-pagina-propia 5.1). El color es el del banco TOTAL (D6); cada fase, el suyo (D5).
   Los colores salen de los tokens de .hbt; la tarjeta no es .hbt, así que se repiten acá. */
.hbt-card, .hbt-pb, .hbp-root {
  --hbt-ink: #132434; --hbt-muted: #5f6774; --hbt-line: #e4e9ed; --hbt-track: #eef1f4;
  --hbt-green: #007450; --hbt-green-bg: #e6f4ee; --hbt-green-dot: #12a26b;
  --hbt-yellow: #9c6300; --hbt-yellow-bg: #fdf5e3; --hbt-yellow-dot: #d99a00;
  --hbt-red: #b42318; --hbt-red-bg: #fdecea; --hbt-red-dot: #d92d20;
}
.hbt-card { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 13px; color: var(--hbt-ink);
  background: #fff; border: 1px solid var(--hbt-line); border-left: 5px solid #8a939d; border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; cursor: pointer; }
.hbt-card:hover { background: #fafcfd; }
.hbt-card:focus-visible { outline: 2px solid #163353; outline-offset: 2px; }
.hbt-card-green { border-left-color: var(--hbt-green-dot); }
.hbt-card-yellow { border-left-color: var(--hbt-yellow-dot); }
.hbt-card-red { border-left-color: var(--hbt-red-dot); }
.hbt-card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hbt-chip.hbt-decision { color: #414b58; background: #eef1f4; padding-left: 9px; }
.hbt-card-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.hbt-card-big { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hbt-card-small { font-size: 12px; color: var(--hbt-muted); font-variant-numeric: tabular-nums; }
.hbt-card .hbt-card-bar { display: block; margin: 0; }
.hbt-card-green .hbt-card-bar > span { background: var(--hbt-green-dot); }
.hbt-card-yellow .hbt-card-bar > span { background: var(--hbt-yellow-dot); }
.hbt-card-red .hbt-card-bar { background: var(--hbt-red-bg); box-shadow: inset 0 0 0 1px var(--hbt-red-dot); }
.hbt-card-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 14px; }
/* Una fase: nombre, palabra, % left u "over X h", y su barra. Lo usado es sólido; lo que podría ser suyo, a rayas (hbt-stripe). */
.hbt-pb { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; min-width: 0; }
.hbt-pb-name { font-weight: 700; overflow-wrap: anywhere; }
.hbt-pb-word { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; grid-column: 1; }
.hbt-pb-pct { grid-column: 2; grid-row: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.hbt-pb-word.hbt-green, .hbt-pb-pct.hbt-green { color: var(--hbt-green); }
.hbt-pb-word.hbt-yellow, .hbt-pb-pct.hbt-yellow { color: var(--hbt-yellow); }
.hbt-pb-word.hbt-red, .hbt-pb-pct.hbt-red { color: var(--hbt-red); }
.hbt-pb-word.hbt-none, .hbt-pb-pct.hbt-none { color: var(--hbt-muted); }
.hbt-pb-track { grid-column: 1 / -1; display: flex; height: 6px; border-radius: 999px; background: var(--hbt-track); overflow: hidden; }
.hbt-pb-used { display: block; height: 100%; background: var(--hbt-green-dot); }
.hbt-pb[data-light="yellow"] .hbt-pb-used { background: var(--hbt-yellow-dot); }
.hbt-pb[data-light="red"] .hbt-pb-used { background: var(--hbt-red-dot); }
.hbt-stripe { display: block; height: 100%; background: repeating-linear-gradient(45deg, #8a939d 0 3px, #dfe3e8 3px 6px); }
.hbt-pb-mini .hbt-pb-word { display: none; }       /* en la tarjeta la palabra va en aria-label; la forma y el color ya están */
.hbt-pb-big { font-size: 14px; }
.hbt-pb-big .hbt-pb-track { height: 10px; }

/* La página propia del banco (js/hour-bank-page.js, spec banco-pagina-propia 5.2). Pantalla completa sobre la ficha; en teléfono
   nada de anchos fijos y las tablas van dentro de su propio contenedor con scroll horizontal (.hb-scroll). */
/* z-index 10000 (revisión final, I1): arriba de la ficha del lead (1000) y de los modales del Master Schedule (.ms-modal-overlay,
   9999, styles.css), y DEBAJO del toast que corre de verdad (contacts-module.js, 10001: carga después de core.js y pisa su
   showToast) y de kok-confirm (11000). Con 10050 la página tapaba "Saved: …" y el aviso del Activity Log, que solo existe en el
   toast. hour-bank-page.test.js compara los tres números leyendo las fuentes. */
.hbp-overlay { position: fixed; inset: 0; z-index: 10000; overflow-y: auto; overflow-x: hidden; background: #f3f6f9; -webkit-overflow-scrolling: touch; }
.hbp-root { box-sizing: border-box; max-width: 100%; margin: 0 auto; padding: 14px 16px 40px; }
@media (min-width: 900px) { .hbp-root { max-width: 1100px; padding-top: 24px; } }
.hbp-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 12px; }
.hbp-back { border: 1px solid #c7ddd9; background: #fff; color: #163353; border-radius: 8px; padding: 7px 12px; font: inherit; font-weight: 700; cursor: pointer; min-height: 36px; }
.hbp-back:focus-visible, .hbp-edit:focus-visible { outline: 2px solid #163353; outline-offset: 2px; }
/* Mientras un guardado está en camino ← Back no cierra (hour-bank-page.js, hbpShell): se ve apagado y dice por qué en su title. */
.hbp-back[aria-disabled="true"] { opacity: .55; cursor: progress; }
.hbp-title { margin: 0; font-size: 20px; font-weight: 800; color: #163353; overflow-wrap: anywhere; }
.hbp-kok { font-size: 13px; font-weight: 700; color: #249083; letter-spacing: .02em; }
.hbp-edit { margin-left: auto; }
@media (max-width: 768px) { .hbp-back, .hbp-edit { min-height: 44px; } }
.hbp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 12px; }
.hbp-kpi { display: flex; flex-direction: column; gap: 3px; min-width: 0; background: #fff; border: 1px solid #e4e9ed; border-radius: 10px; padding: 12px 14px; }
.hbp-kpi-label { font-size: 12px; font-weight: 700; color: #5f6774; text-transform: uppercase; letter-spacing: .04em; }
.hbp-kpi-big { font-size: 26px; font-weight: 800; line-height: 1.1; color: #132434; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hbp-kpi-small { font-size: 12.5px; color: #5f6774; min-height: 20px; }
/* "Hours may be stale · through {fecha}" (Carlos, 15-oct): amarillo y con su ícono, en la línea del KPI Used. El semáforo no cambia. */
.hbp-stale { display: inline-flex; align-items: center; gap: 4px; color: #9c6300; font-weight: 700; }
.hbp-decision { margin: 0 0 12px; padding: 11px 14px; border-radius: 10px; background: #fdf5e3; border: 1px solid #f1e2b8; color: #6b4a00; font-size: 15px; font-weight: 700; }
.hbp-decision-q { margin: 0; }
/* Quien gestiona: un botón por fase con su consecuencia; el borde izquierdo lleva el color de esa fase si se elige (el texto ya lo dice). */
.hbp-decision-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hb-root .hbp-decision-btn { background: #fff; color: var(--hbt-ink); border: 1px solid #e0cf9f; border-left: 5px solid #8a939d; font-size: 14px; }
.hb-root .hbp-decision-btn:hover { background: #fffaf0; }
.hb-root .hbp-decision-btn[data-light="green"] { border-left-color: var(--hbt-green-dot); }
.hb-root .hbp-decision-btn[data-light="yellow"] { border-left-color: var(--hbt-yellow-dot); }
.hb-root .hbp-decision-btn[data-light="red"] { border-left-color: var(--hbt-red-dot); }
.hbp-decision .hb-windows-error { margin-top: 10px; font-weight: 600; }
@media (max-width: 768px) { .hb-root .hbp-decision-btn { flex: 1 1 100%; min-height: 44px; } }
.hbp-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 0 0 16px; }
.hbp-phase { display: flex; flex-direction: column; gap: 4px; min-width: 0; background: #fff; border: 1px solid #e4e9ed; border-radius: 10px; padding: 12px 14px; }
.hbp-phase-hours { font-size: 20px; font-weight: 800; color: #132434; font-variant-numeric: tabular-nums; }
.hbp-panel { margin: 0 0 16px; }
.hbp-sections { display: flex; flex-direction: column; gap: 8px; }
.hbp-section { background: #fff; border: 1px solid #e4e9ed; border-radius: 10px; }
.hbp-section > summary { padding: 12px 14px; font-weight: 700; color: #163353; cursor: pointer; min-height: 20px; }
.hbp-section > summary:focus-visible { outline: 2px solid #163353; outline-offset: -2px; border-radius: 10px; }
.hbp-section-body { padding: 4px 14px 14px; min-width: 0; overflow-wrap: anywhere; }
.hbp-history { border-collapse: collapse; width: 100%; font-size: 13px; }
.hbp-history th, .hbp-history td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.hbp-history td { white-space: nowrap; }
.hbp-history td:last-child { white-space: normal; min-width: 180px; }
.hbp-sheets { display: flex; flex-wrap: wrap; gap: 10px 4px; }
.hbp-banks-actions { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
.hb-sheet-who { margin: 0; color: #5f6774; }
.hbp-root .hb-link { margin-left: 0; }
/* Banks en teléfono (revisión final, M2): la pista de 340 px de .hb-root .hb-cards no entra a 400 px (quedan 338) y, con el
   overflow-x del overlay, la columna de horas se cortaba. Va DESPUÉS de esa regla: misma especificidad, gana la última. */
.hbp-root .hb-cards { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
