:root {
  --paper: #F2F3EF;
  --panel: #FFFFFF;
  --ink: #1B2430;
  --ink-soft: #5B6472;
  --line: #DFE2DC;
  --teal: #0F6B5C;
  --teal-soft: #E4F0EC;
  --amber: #C98A2C;
  --amber-soft: #FBF0DD;
  --rose: #B4483A;
  --rose-soft: #F8E7E3;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
}

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  height: 100vh;
  transition: grid-template-columns 0.18s ease;
}

.app.sidebar-collapsed { grid-template-columns: 72px 1fr; }

/* ---------- Sidebar ---------- */

.sidebar {
  background: var(--ink);
  color: #EDEFEA;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 16px;
}

.app.sidebar-collapsed .brand-row { justify-content: center; padding: 0 0 24px; }
.app.sidebar-collapsed .brand { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Logo naranja con fondo transparente: sin recuadro, se apoya directo sobre el
   fondo del sidebar. Alto chico para que funcione como ícono sin ocupar espacio de más. */
.brand-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  height: 30px;
  width: auto;
  object-fit: contain;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.brand-text strong { font-family: var(--font-display); font-size: 14px; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: none;
  border: none;
  color: #C4C9D2;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }

.nav-item.active {
  background: var(--teal);
  color: #fff;
}

.nav-icon { display: inline-flex; flex-shrink: 0; width: 18px; height: 18px; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }

/* Ícono con fondo propio para distinguir los ítems que despliegan un submenú */
.nav-group-toggle .nav-icon {
  background: rgba(15, 107, 92, 0.35);
  border-radius: 7px;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.nav-group-toggle:hover .nav-icon { background: rgba(15, 107, 92, 0.55); }

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: none;
  border: none;
  color: #C4C9D2;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 6px;
  white-space: nowrap;
}
.nav-group-toggle:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-group-toggle .chevron { font-size: 11px; transition: transform 0.15s ease; margin-left: auto; }
.nav-group-toggle.collapsed .chevron { transform: rotate(-90deg); }

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.12);
  margin-left: 12px;
}
.nav-group[hidden] { display: none; }
.nav-sub { font-size: 13px; padding: 8px 12px; }

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: #7C8492;
  padding: 0 8px;
  white-space: nowrap;
}

.density-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  margin: 4px 0;
}

.density-toggle-label {
  font-size: 12px;
  color: #C4C9D2;
  white-space: nowrap;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  transition: background 0.15s ease;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-track { background: var(--teal); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 2px rgba(255,255,255,0.35); }

/* ---------- Sesión (barra lateral) ---------- */

.sesion-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 8px;
  margin: 4px 0 0;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.sesion-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.sesion-usuario {
  font-size: 12.5px;
  font-weight: 600;
  color: #E7E9EC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sesion-rol {
  font-size: 11px;
  color: #9AA1AC;
}
.sesion-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  color: #C4C9D2;
  cursor: pointer;
}
.sesion-logout-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sesion-logout-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.sesion-logout-label { display: none; }

/* ---------- Densidad compacta (toda la app) ---------- */

body.density-compact .data-table th { padding: 7px 10px; }
body.density-compact .data-table td { padding: 4px 10px; }
body.density-compact .grid-table th,
body.density-compact .grid-table td { padding: 3px 6px; }
body.density-compact .cell-entry { padding: 1px 3px; }
body.density-compact .capacity-cell { padding: 2px 2px; }
body.density-compact .edit-form,
body.density-compact .inline-form { gap: 6px; }

/* ---------- Ordenamiento y auto-ajuste de columnas ---------- */

.th-sort-label { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 4px; }
.th-sort-arrow { font-size: 9px; opacity: 0; width: 8px; display: inline-block; }
.th-sort-arrow.active { opacity: 1; }

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  color: #C4C9D2;
  cursor: pointer;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-collapse-btn svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.18s ease; }

/* Estado colapsado: solo iconos, centrados */
.app.sidebar-collapsed .nav-label,
.app.sidebar-collapsed .sidebar-footer,
.app.sidebar-collapsed .density-toggle,
.app.sidebar-collapsed .sesion-info,
.app.sidebar-collapsed .nav-group-toggle .chevron { display: none; }

.app.sidebar-collapsed .sesion-box { justify-content: center; border-top: none; padding-top: 0; }

.app.sidebar-collapsed .nav-item,
.app.sidebar-collapsed .nav-group-toggle { justify-content: center; }

.app.sidebar-collapsed .nav-group {
  margin-left: 0;
  padding-left: 0;
  border-left: none;
  align-items: center;
}

.app.sidebar-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* ---------- Main ---------- */

.main {
  padding: 20px 28px;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.view:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.view-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  margin: 0 0 4px;
}

.subtitle { margin: 0; color: var(--ink-soft); font-size: 14px; }

.month-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
}

.month-picker input[type="month"] {
  border: none;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 6px 4px;
  background: transparent;
  color: var(--ink);
}

.icon-btn {
  border: none;
  background: none;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-soft);
}
.icon-btn:hover { background: var(--paper); color: var(--ink); }

/* ---------- Panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-head h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.hint { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.hint input {
  font-family: var(--font-mono);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
}

/* ---------- Capacity grid (heatmap) ---------- */

.capacity-cell {
  position: relative;
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  border-radius: 4px;
  padding: 4px 2px;
  white-space: nowrap;
}

/* Marcas de nivel (perfil consultor vs. perfil asignado): roja arriba-derecha, verde abajo-derecha.
   Ambas alineadas verticalmente sobre el borde derecho, sin superar el alto de la celda. */
.cap-marks {
  position: absolute;
  top: 2px;
  right: 2px;
  bottom: 2px;
  width: 6px;
  pointer-events: none;
}
.cap-mark {
  position: absolute;
  right: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.cap-mark.red { top: 0; background: var(--rose); }
.cap-mark.green { bottom: 0; background: #2E9E5B; }

.capacity-cell.ok { background: var(--teal-soft); color: var(--teal); }
.capacity-cell.near { background: var(--amber-soft); color: var(--amber); }
.capacity-cell.over { background: var(--rose-soft); color: var(--rose); }
.capacity-cell.empty { color: var(--ink-soft); background: none; }

/* ---------- Tables ---------- */

.table-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.roles-matrix-panel { margin-top: 16px; overflow: auto; }
.roles-matrix-head { align-items: end; gap: 16px; }
.roles-selector-label { display: grid; gap: 5px; min-width: 220px; font-size: 12px; color: var(--ink-soft); }
.roles-selector-label select { min-height: 36px; }
.roles-matrix { overflow-x: auto; }
.roles-capabilities-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.roles-capabilities-table th,
.roles-capabilities-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.roles-capabilities-table th:first-child { text-align: left; }
.roles-capabilities-table thead th { font-size: 12px; color: var(--ink-soft); }
.roles-capacidad-checkbox { width: 17px; height: 17px; accent-color: var(--teal); cursor: pointer; }
.roles-capacidad-checkbox:disabled { cursor: wait; opacity: .6; }
.roles-no-aplicable { color: var(--ink-soft); opacity: .55; }

.table-scroll {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 4px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, var(--teal) 0%, #0C5A4E 100%);
  padding: 12px 10px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
}

/* Las tablas ABM son table-layout:fixed y sus columnas se pueden angostar a mano:
   sin overflow oculto el texto se montaría sobre la columna siguiente. */
.data-table th,
.data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table .num { text-align: right; }
.data-table td.num { font-family: var(--font-mono); text-align: right; }

.data-table th.col-actions, .data-table td:last-child { width: 96px; text-align: right; white-space: nowrap; }

/* La celda de acciones es el <td> mismo (crud.js:151), no un div interno: con `display: flex`
   dejaba de comportarse como celda de tabla, no se estiraba al alto de la fila y su
   `border-bottom` --la línea separadora-- quedaba dibujado al alto de su contenido (unidad
   0023: 17 px arriba sin botones visibles, 19 px en una fila alta). Como `table-cell` se
   estira sola. `vertical-align: top` conserva los botones donde estaban; el `margin-left`
   repone los 10 px que daba el `gap` del flex (no aplica a una celda de tabla). */
.row-actions { display: table-cell; vertical-align: top; text-align: right; }
.row-actions > * + * { margin-left: 10px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag button {
  border: none;
  background: none;
  color: var(--teal);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.tag-add {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.tag-add select {
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.edit-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.edit-form input, .edit-form select {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: var(--paper);
}

.edit-form button {
  font-size: 12px;
  padding: 5px 10px;
}

/* Anchos fijos de los campos de edición inline (unidad 0006: eran style="width:…" en el
   innerHTML; la CSP con style-src 'self' los bloquearía). Mismos valores exactos. */
.edit-form .e-abbr { width: 90px; }
.edit-form .e-nivel { width: 110px; }
.edit-form .e-initials { width: 120px; }
.edit-form .e-team { width: 140px; }
.edit-form .e-puesto { width: 140px; }
.edit-form .e-capacity { width: 110px; }
.edit-form .e-usuario { width: 140px; }

.empty-state {
  color: var(--ink-soft);
  font-size: 13px;
  padding: 16px 4px;
}

/* ---------- Forms & buttons ---------- */

.inline-form {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.inline-form .form-actions { flex-shrink: 0; }

.inline-form input, .inline-form select {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  flex: 1 1 110px;
  min-width: 85px;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: #0C5A4E; }

.btn-ghost { background: none; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--paper); }

/* ---------- Icon action buttons ---------- */

.icon-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  flex-shrink: 0;
}
.icon-btn-action svg { width: 16px; height: 16px; }
.icon-btn-action:hover { background: var(--paper); color: var(--ink); border-color: var(--ink-soft); }

.icon-btn-action.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.icon-btn-action.primary:hover { background: #0C5A4E; border-color: #0C5A4E; }

.icon-btn-action.danger:hover { color: var(--rose); border-color: var(--rose); }

.icon-btn-action.small { width: 30px; height: 30px; }
.icon-btn-action.small svg { width: 14px; height: 14px; }

.icon-btn-action.file-btn { position: relative; }

.icon-btn-action:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn-action:disabled:hover { background: var(--panel); color: var(--ink-soft); border-color: var(--line); }
.icon-btn-action.syncing svg { animation: icon-spin 0.9s linear infinite; }
@keyframes icon-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

/* ---------- Filter bar ---------- */

.filter-bar {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
}
.filter-bar-actions { flex-shrink: 0; }

.filter-bar > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  flex: 1 1 120px;
  min-width: 95px;
}

.filter-bar select {
  font-family: var(--font-body);
  font-size: 13px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  width: 100%;
  min-width: 0;
}

.filter-bar-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-left: auto;
}

/* ---------- Planning grid (Excel-style) ---------- */

.grid-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 6px;
}

.grid-controls select {
  font-family: var(--font-body);
  font-size: 13px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 6px;
  background: var(--paper);
  margin-left: 6px;
}

.grid-panel { padding: 0; overflow: hidden; }

/* ---------- Split panels (Planificación) ---------- */

.split-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 0;
}

.split-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 90px;
}

/* Split pane de Planificación: proporción inicial 55/45 entre la grilla de Asignaciones
   y la de Capacidad (antes, dos style="flex: ..." inline en index.html; sacados por CSP). */
.split-pane-inicial-top { flex: 0 0 55%; }
.split-pane-inicial-bottom { flex: 1 1 auto; }

.split-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 20px 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.split-pane-head h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.split-pane .empty-state { padding: 4px 20px 16px; }

.head-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-soft);
  cursor: help;
}
.head-hint svg { width: 14px; height: 14px; }

.split-resizer {
  height: 8px;
  flex-shrink: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: row-resize;
  position: relative;
}

.split-resizer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
}

.split-resizer:hover::after, .split-resizer.resizing::after { background: var(--teal); }

.grid-wrapper {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 0 20px 16px;
}

.grid-table {
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-body);
  font-size: 12px;
  width: 100%;
  table-layout: fixed;
}

.grid-table th, .grid-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 6px 8px;
  overflow: hidden;
}

.grid-table thead th {
  background: linear-gradient(135deg, var(--teal) 0%, #0C5A4E 100%);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  color: #fff;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}

.grid-table .row-label {
  position: sticky;
  background: var(--panel);
  z-index: 1;
  font-size: 12px;
  white-space: nowrap;
  /* overflow:hidden es imprescindible: sin él, text-overflow no aplica y el texto
     se desborda sobre la columna de al lado al angostar la columna */
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--line);
}

.grid-table .row-label.sticky-last { border-right: 2px solid var(--line); }

/* Columna pegajosa de la grilla de Asignaciones (unidad 0006: era style="left:0px" en el
   innerHTML del th y del td). Mismo valor exacto; aplica a los dos porque comparten
   data-colkey="group". */
.grid-table .row-label[data-colkey="group"] { left: 0; }

/* Fila "sin coincidencias" del filtro de Asignaciones (unidad 0006: era un style="…" inline
   en el <td>). Mismos valores exactos. */
.grid-table td.grid-sin-coincidencias { color: var(--ink-soft); text-align: center; padding: 20px; }

/* Columna agrupada de Asignaciones (Cliente / Proyecto / Perfil apilados, con País / Prospect /
   Producto como badges) — reemplaza las 6 columnas sueltas para ganar espacio horizontal. */
.grid-table td.row-label.row-group {
  white-space: normal;
  overflow: visible;
  vertical-align: top;
  padding-top: 7px;
  padding-bottom: 7px;
}
.grid-table .rg-top { display: flex; align-items: center; gap: 6px; margin-bottom: 1px; }
.grid-table .rg-client {
  font-weight: 600; font-size: 12.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.grid-table .rg-project {
  font-size: 11.5px; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grid-table .rg-profile {
  font-size: 11px; color: var(--ink-faint, var(--ink-soft)); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grid-table thead th .grp-sort-item {
  cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 3px;
}
.grid-table thead th .grp-sort-sep { color: rgba(255,255,255,0.5); }

.grid-table thead .row-label {
  z-index: 3;
  background: linear-gradient(135deg, var(--teal) 0%, #0C5A4E 100%);
  color: #fff;
}

.grid-table .client-name { color: var(--ink-soft); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; }
.grid-table .project-name { font-weight: 400; display: block; overflow: hidden; text-overflow: ellipsis; }
.grid-table .profile-name { font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; }
.grid-table .product-name { font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; }
.grid-table .country-abbr {
  display: inline-block;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 1px 6px;
  border-radius: 999px;
  vertical-align: middle;
}

.grid-table .prospect-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}
.grid-table .prospect-badge.si { background: var(--amber-soft); color: var(--amber); }
.grid-table .prospect-badge.no { background: var(--paper); color: var(--ink-soft); }

.grid-table tbody td.month-col { vertical-align: top; white-space: normal; overflow: visible; position: relative; }
.grid-table thead th.month-col { vertical-align: middle; white-space: normal; overflow: visible; }
.grid-table .month-total-col { text-align: right; font-family: var(--font-mono); background: var(--paper); }

.grid-table tfoot td {
  background: var(--paper);
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
}
.grid-table tfoot .row-label { background: var(--paper); }

/* Column resize handle: aplica a cualquier columna, no solo meses */
.col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
}
.col-resizer:hover, .col-resizer.resizing { background: rgba(255,255,255,0.45); }

.cell-entries { display: flex; flex-direction: column; gap: 4px; position: relative; }

/* Chip de asignación: avatar de color + nombre + horas. El fondo indica la carga
   mensual TOTAL de ese consultor (todas sus asignaciones, no solo esta celda),
   con los mismos colores que la grilla de Capacidad de abajo. */
.pc-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-soft);
  border-radius: 8px;
  padding: 3px 5px 3px 3px;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid transparent;
  overflow: hidden;
}
.pc-chip:hover { border-color: var(--teal); }

.pc-chip.status-near { background: var(--amber-soft); }
.pc-chip.status-over { background: var(--rose-soft); }

.pc-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  color: #fff;
}

.pc-chip .who { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 5px; }
.pc-chip .name {
  color: var(--teal);
  font-weight: 600;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-chip.status-near .name { color: var(--amber); }
.pc-chip.status-over .name { color: var(--rose); }

.pc-chip .hrs {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  flex-shrink: 0;
  white-space: nowrap;
}

/* consultor dado de baja (Activo = Falso): fondo rojo oscuro y texto blanco */
.pc-chip.inactivo { background: #7A1F16; }
.pc-chip.inactivo .name,
.pc-chip.inactivo .hrs { color: #FFFFFF; }

.cell-add-btn {
  border: 1px dashed var(--line);
  background: none;
  color: var(--ink-soft);
  border-radius: 6px;
  font-size: 11px;
  padding: 3px 4px;
  cursor: pointer;
  width: 100%;
}
.cell-add-btn:hover { border-color: var(--teal); color: var(--teal); }

.cell-add-more {
  border: none;
  background: none;
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 1px 2px;
  text-align: left;
}
.cell-add-more:hover { text-decoration: underline; }

/* Menú contextual (botón derecho sobre asignaciones / botón +) */
.ctx-menu {
  position: fixed;
  z-index: 1000;
  min-width: 148px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(27,36,48,0.18);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ctx-menu-item {
  border: none;
  background: none;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.ctx-menu-item:hover { background: var(--paper); }
.ctx-menu-item.danger { color: var(--rose); }
.ctx-menu-item.danger:hover { background: var(--rose-soft); }
.ctx-menu-item:disabled { color: var(--ink-soft); cursor: default; opacity: 0.55; }
.ctx-menu-item:disabled:hover { background: none; }

/* ---------- Drawer de asignación (reemplaza el popover flotante) ---------- */

.asg-scrim {
  position: fixed;
  inset: 0;
  background: rgba(27,36,48,0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 900;
}
.asg-scrim.open { opacity: 1; pointer-events: auto; }

.asg-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 420px;
  max-width: 92vw;
  background: var(--panel);
  box-shadow: -8px 0 32px rgba(27,36,48,0.18);
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1);
  z-index: 901;
  display: flex;
  flex-direction: column;
}
.asg-drawer.open { transform: translateX(0); }

.asg-head {
  position: relative;
  padding: 20px 44px 16px 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.asg-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin: 0 0 4px; }
.asg-head h2 { font-family: var(--font-display); font-size: 17px; margin: 0; font-weight: 600; }
.asg-meta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.asg-close {
  position: absolute; top: 18px; right: 16px;
  border: none; background: none; color: var(--ink-soft); cursor: pointer; font-size: 16px; padding: 4px;
  /* .asg-head aparece después en el DOM y también está posicionado (position: relative),
     así que sin z-index pinta encima del botón y le roba los clics aunque se vea bien. */
  z-index: 5;
}
.asg-close:hover { color: var(--rose); }

.asg-body { flex: 1; overflow-y: auto; padding: 16px 22px 22px; }

.asg-search input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  box-sizing: border-box;
}
.asg-team-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 16px; }
.asg-team-chip {
  font-size: 11px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); cursor: pointer;
}
.asg-team-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.asg-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); font-weight: 600; margin: 18px 0 8px; }
.asg-section-label:first-child { margin-top: 0; }

.asg-assigned-row { display: flex; gap: 6px; flex-wrap: wrap; }
.asg-mini-pill { display: flex; align-items: center; gap: 5px; background: var(--paper); border-radius: 999px; padding: 3px 8px 3px 3px; font-size: 11px; border: none; cursor: pointer; }
.asg-mini-pill:hover { background: var(--rose-soft); color: var(--rose); }
.asg-mini-pill .pc-avatar { width: 16px; height: 16px; font-size: 8px; }
.asg-empty-note { font-size: 11.5px; color: var(--ink-faint, var(--ink-soft)); }

.asg-callout {
  background: var(--teal-soft); border-radius: 10px; padding: 10px 12px; font-size: 11.5px; color: var(--teal); margin-bottom: 16px; line-height: 1.4;
}

.asg-candidate {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--panel);
}
.asg-candidate:hover { border-color: var(--teal); background: var(--teal-soft); }
.asg-candidate.selected { border-color: var(--teal); background: var(--teal-soft); }
.asg-candidate .pc-avatar { width: 32px; height: 32px; font-size: 11px; }
.asg-candidate .info { flex: 1; min-width: 0; }
.asg-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.asg-candidate .name { font-weight: 600; font-size: 13px; }
.asg-badge {
  font-size: 9.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; letter-spacing: 0.02em;
}
.asg-badge.match { background: var(--teal-soft); color: var(--teal); }
.asg-badge.over { background: var(--rose-soft); color: var(--rose); }
.asg-tags { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.asg-cap-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.asg-cap-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.asg-cap-fill { height: 100%; border-radius: 3px; background: var(--teal); }
.asg-cap-fill.near { background: var(--amber); }
.asg-cap-fill.over { background: var(--rose); }
.asg-cap-label { font-family: var(--font-mono); font-size: 10px; color: var(--ink-soft); white-space: nowrap; }

.asg-form { margin: 12px 0; padding: 12px; border-radius: 12px; background: var(--paper); }
.asg-form .row { display: flex; gap: 10px; }
.asg-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; min-width: 0; }
.asg-field label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); font-weight: 600; }
.asg-field input {
  width: 100%;
  font-family: var(--font-body); font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; box-sizing: border-box; background: var(--panel);
}
.asg-field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.asg-hint { font-size: 11px; color: var(--ink-soft); margin-top: 8px; }
.asg-hint.warn { color: var(--rose); }

.asg-foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}


.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27,36,48,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background: var(--panel);
  border-radius: 14px;
  padding: 24px;
  width: 360px;
  max-width: 90vw;
}

.modal.wide { width: 440px; }

.modal h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 16px;
}

.modal form { display: flex; flex-direction: column; gap: 12px; }

.modal label {
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 500;
}

.modal select, .modal input {
  font-family: var(--font-body);
  font-size: 14px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ---------- Administración (configuración del sistema) ---------- */
.admin-panel { max-width: 640px; }
.admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
}
.admin-field-label { color: var(--ink); font-weight: 600; font-size: 13px; }
.admin-field input {
  font-family: var(--font-body);
  font-size: 14px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
}
.admin-field input:focus { outline: none; border-color: var(--teal); }
.admin-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.admin-status { color: var(--teal); font-size: 13px; font-weight: 600; }
.admin-field-note { color: var(--ink-soft); font-size: 11px; font-weight: 400; }

/* ---------- Toasts (notificaciones no bloqueantes) ---------- */
.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  cursor: pointer;
  min-width: 220px;
  max-width: 360px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.35;
  color: #fff;
  background: var(--ink);
  padding: 11px 14px;
  border-radius: 10px;
  border-left: 4px solid var(--ink-soft);
  box-shadow: 0 6px 20px rgba(27,36,48,0.28);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-left-color: #2E9E5B; }
.toast-error { border-left-color: var(--rose); }
.toast-info { border-left-color: var(--teal); }

/* ---------- Overlay de carga inicial ---------- */
.app-loading[hidden] {
  display: none;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}
.app-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 14px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* botón Sincronizar en curso: el ícono gira */
.icon-btn-action.syncing svg { animation: spin 0.8s linear infinite; }
.icon-btn-action.syncing { pointer-events: none; opacity: 0.7; }

/* ---------- Botón peligroso (confirmaciones de borrado) ---------- */
.btn-danger { background: var(--rose); border: 1px solid var(--rose); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); }

/* ---------- Buscador de tablas (Configuración) ---------- */
.table-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--panel);
  height: 34px;
}
.table-search svg { width: 15px; height: 15px; color: var(--ink-soft); flex-shrink: 0; }
.table-search input {
  border: none;
  outline: none;
  background: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  width: 180px;
}

/* ---------- Botón limpiar filtros ---------- */
.filter-clear { align-self: end; display: inline-flex; align-items: center; gap: 5px; }
.filter-clear svg { width: 14px; height: 14px; }

/* ---------- Modal de resultado (import / sync) ---------- */
.result-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.result-stat {
  flex: 1 1 90px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.result-stat-value { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); }
.result-stat-label { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.result-stat.ok .result-stat-value { color: var(--teal); }
.result-stat.warn .result-stat-value { color: var(--amber); }
.result-stat.error .result-stat-value { color: var(--rose); }
.result-sections { display: flex; flex-direction: column; gap: 12px; max-height: 46vh; overflow-y: auto; }
.result-section h3 { font-family: var(--font-body); font-size: 13px; margin: 0 0 6px; }
.result-section.error h3 { color: var(--rose); }
.result-section.warn h3 { color: var(--amber); }
.result-section ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink); display: flex; flex-direction: column; gap: 3px; }
.result-section .result-more { list-style: none; color: var(--ink-soft); font-style: italic; }

/* mensaje del modal de confirmación */
.confirm-message { font-size: 14px; color: var(--ink-soft); margin: 4px 0 6px; line-height: 1.4; }

/* Mapa de colores de Capacidad */
#capacity-colors-table { max-width: 520px; margin-bottom: 14px; }
#capacity-colors-table td { overflow: visible; }
#capacity-colors-table input[type="number"] {
  font-family: var(--font-body);
  font-size: 13px;
  width: 100%;
  max-width: 120px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}
#capacity-colors-table input[type="color"] {
  width: 54px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: flex; flex-direction: row; overflow-x: auto; }
  .nav { flex-direction: row; }
  .main { padding: 20px; }
}

/* ---------- Multi-select dropdowns (filtro Equipo, botón Vista) ---------- */

.ms-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ms-dropdown-title {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
}

.ms-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  min-width: 110px;
}
.ms-dropdown-btn:hover { border-color: var(--ink-soft); }
.ms-dropdown-btn svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.12s ease; color: var(--ink-soft); }
.ms-dropdown.open .ms-dropdown-btn svg { transform: rotate(180deg); }

/* el dropdown "Equipo" vive entre los campos del filtro: se achica igual que ellos */
.filter-bar > .ms-dropdown {
  flex: 0 0 auto;
}
.filter-bar > .ms-dropdown .ms-dropdown-btn { width: auto; min-width: 150px; }

/* variante botón-icono (ej. "Vista"), sin caja tipo select */
.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
}
.btn-icon-text svg { width: 16px; height: 16px; }

.ms-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  z-index: 10;
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(27,36,48,0.18);
  padding: 6px;
}
.ms-dropdown-panel.align-right { left: auto; right: 0; }

.ms-dropdown-panel .ms-dropdown-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.ms-dropdown-panel .ms-dropdown-option:hover { background: var(--paper); }
.ms-dropdown-panel .ms-dropdown-option input { width: auto; margin: 0; flex-shrink: 0; order: -1; }
.ms-dropdown-panel .ms-dropdown-option-text { flex: 1; text-align: left; }
.ms-dropdown-panel .ms-dropdown-option.master { font-weight: 600; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 4px; padding-bottom: 8px; }

/* ---------- Reporte de Asignación (grilla en árbol) ---------- */

.report-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  flex: 1;
  display: flex;
  min-height: 0;
}
.report-panel .grid-wrapper { padding: 0; }
.report-panel .grid-table { table-layout: auto; }

.report-table .row-label { white-space: nowrap; }

/* Primera columna pegajosa del Reporte (unidad 0006: era style="left:0" sólo en el primer
   <th> de cada fila, generado con un condicional `i === 0`). Sin tocar el marcado: la
   primera celda de etiqueta de cada fila del reporte es siempre :first-child. */
.report-table .row-label:first-child { left: 0; }

.report-table .team-row .row-label {
  font-weight: 600;
  background: var(--teal-soft);
}
.report-table .team-row td { background: var(--teal-soft); border-bottom: 1px solid var(--line); }
.report-table .team-row:hover td { filter: brightness(0.98); }

.team-toggle-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--teal);
}
.team-toggle-cell svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.12s ease;
}
.report-table .team-row.collapsed .team-toggle-cell svg { transform: rotate(-90deg); }
.team-toggle-cell .team-count {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 11px;
}

.report-table .consultant-row .row-label.tree-indent {
  padding-left: 26px;
  font-weight: 400;
}

/* consultor dado de baja (Activo = Falso): texto en rojo */
.report-table .consultant-row.inactivo .row-label,
.report-table .consultant-row.inactivo .row-label .cname { color: var(--rose); }

/* fila de consultor desplegable: chevron a la izquierda del nombre */
.report-table .consultant-row .row-label.tree-indent.expandable { padding-left: 20px; cursor: pointer; }
.consultant-toggle-cell {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.consultant-toggle-cell svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--ink-soft);
  transform: rotate(-90deg);
  transition: transform 0.12s ease;
}
.report-table .consultant-row.expanded .consultant-toggle-cell svg { transform: rotate(0deg); }

/* filas de detalle (proyectos del consultor) */
.report-table .detail-row td { background: var(--paper); border-bottom: 1px solid var(--line); }
.report-table .detail-row .detail-label { padding-left: 44px; }
.report-table .detail-row .detail-profile { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.detail-line { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.detail-line .detail-client { color: var(--ink-soft); }
.detail-line .detail-sep { color: var(--ink-soft); }
.detail-line .detail-project { color: var(--ink); }
.report-table .detail-row .detail-hours {
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink);
}
.report-table .detail-row .detail-hours:empty::after { content: "—"; color: var(--ink-soft); }

.team-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}
.team-bar.ok { background: var(--teal); }
.team-bar.near { background: var(--amber); }
.team-bar.over { background: var(--rose); }
.team-bar.empty { background: var(--line); color: var(--ink-soft); }
