/* Biblioteca de componentes compartidos del panel administrativo — mismos
   tokens/paleta/modo oscuro/animaciones que el Dashboard ejecutivo
   (dashboard.css), generalizados bajo .tal-shell para usarse en cualquier
   módulo (Reportes, Detalle por persona, Pagos y accesos, Licencias,
   Curación de catálogo, y el resto). No se tocó dashboard.css ni Home.razor
   para no arriesgar el Dashboard ya verificado — esta es una copia
   deliberada de los mismos tokens bajo otro alcance. */
.tal-shell {
  --navy: #1B2D55; --navy2: #2A4A8A; --gold: #F5A800;
  --bg: #F0F4FA; --card: #fff; --line: #E2E8F4; --ink: #1e293b; --ink2: #64748B; --ink3: #94a3b8;
  --ok: #16A34A; --bad: #DC2626;
  --s1: #3B72D9; --s2: #E8920C; --s3: #12A59E; --s4: #8B5CF6; --s5: #E11D74;
  --shadow: 0 1px 2px rgba(27,45,85,.06), 0 8px 24px rgba(27,45,85,.07);
  --shadow-h: 0 2px 4px rgba(27,45,85,.08), 0 16px 36px rgba(27,45,85,.14);
  --heat0: #EAF0FB; --heat1: #B9CCF0; --heat2: #7DA1E3; --heat3: #3B72D9; --heat4: #1B2D55;
  --grid: #E8EDF6; --hi3: #fff; --hi4: #fff;
  font-size: 14px; color: var(--ink);
}
[data-mud-color-scheme="dark"] .tal-shell {
  --bg: #0B1327; --card: #121D38; --line: #22305A; --ink: #E6ECFA; --ink2: #9AA9C9; --ink3: #6B7BA3;
  --s1: #5B8CF0; --s2: #F5B31A; --s3: #2DD4BF; --s4: #A78BFA; --s5: #F472B6;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-h: 0 2px 4px rgba(0,0,0,.5), 0 16px 36px rgba(0,0,0,.5);
  --heat0: #16244A; --heat1: #223D7A; --heat2: #2F5BB5; --heat3: #5B8CF0; --heat4: #BCD0FA; --grid: #1d2a4d; --hi4: #0B1327;
}
.tal-shell { background: var(--bg); padding: 16px; border-radius: 12px; }

/* PageHeader */
.tal-shell .tal-header { border-radius: 20px; padding: 22px 26px; background: linear-gradient(135deg, #1B2D55 0%, #2A4A8A 100%); color: #fff; border-top: 3px solid var(--gold); position: relative; overflow: hidden; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
/* pointer-events: none — puramente decorativo (el círculo dorado que
   "flota" en la esquina); sin esto, el óvalo invisible (260x260px, sin
   recorte real por el gradiente transparente) se come los clics de
   Excel/PDF/"Sincronizar ahora"/etc. en TODAS las páginas que usan
   PageHeader con Actions — confirmado con Playwright
   (document.elementFromPoint en el centro del botón devolvía
   <section class="tal-header">, nunca el botón) en Coursera, Correos
   enviados, Configuración, Control de calidad, Directorio, Journey,
   Licencias, Seguimiento, Solicitudes, Soporte, Usuarios y Auditoría —
   ver docs/VALIDACION-EXPORTS.md, 2026-11-05. */
.tal-shell .tal-header::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(245,168,0,.35), transparent 65%); animation: tal-float 7s ease-in-out infinite; pointer-events: none; }
@keyframes tal-float { 50% { transform: translate(-20px,16px); } }
.tal-shell .tal-header h1 { font-size: 22px; letter-spacing: -.01em; margin: 0; }
.tal-shell .tal-header p { color: #c6d3f2; margin-top: 4px; font-size: 13px; }
.tal-shell .tal-breadcrumbs { font-size: 11.5px; color: #c6d3f2; margin-bottom: 4px; }
.tal-shell .tal-breadcrumbs a { color: #e3eafc; text-decoration: none; }
.tal-shell .chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 11px; font-size: 12px; background: rgba(255,255,255,.14); color: #fff; }
.tal-shell .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.7); animation: tal-pulse 2s infinite; }
@keyframes tal-pulse { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
/* "Ingesta real por API" (2026-10-31): el chip "Datos al" se pone en ROJO
   (antes ámbar, pensado para el CSV manual de 7 días) cuando la
   sincronización horaria lleva más de 2h sin una corrida exitosa — ver
   ExecutiveDashboardService.DataFreshnessThresholdHours. */
.tal-shell .chip.stale { background: rgba(220,38,38,.22); border: 1px solid rgba(220,38,38,.6); }
.tal-shell .chip.stale .dot { background: #DC2626; animation: none; box-shadow: none; }
.tal-shell .tal-header .tal-action-btn.mud-button-root { background: #fff !important; color: var(--navy) !important; font-weight: 700; border: 1px solid rgba(255,255,255,.6); }
.tal-shell .tal-header .tal-action-btn.mud-button-root:hover { background: #eef2fb !important; }
.tal-shell .tal-header .tal-action-btn .mud-icon-root { color: var(--navy) !important; }

/* FilterBar */
.tal-shell .tal-filters { display: flex; gap: 10px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.tal-shell .tal-seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.tal-shell .tal-seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; cursor: pointer; color: var(--ink2); font: inherit; transition: all .2s; }
.tal-shell .tal-seg button.on { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(27,45,85,.3); }
.tal-shell .tal-select .mud-input-outlined { border-radius: 12px; background: var(--card); }
.tal-shell .tal-select .mud-input-outlined-border { border-color: var(--line) !important; border-radius: 12px; }
.tal-shell .tal-select:hover .mud-input-outlined-border { border-color: var(--navy2) !important; }

/* Grid + cards (KpiCard, ChartCard) */
.tal-shell .egrid { display: grid; gap: 16px; }
.tal-shell .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tal-shell .ecard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; animation: tal-up .6s both; }
.tal-shell .ecard:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); }
@keyframes tal-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tal-shell .kpi .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; margin-bottom: 10px; }
.tal-shell .kpi .v { font-size: 27px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tal-shell .kpi .l { color: var(--ink2); font-size: 12px; margin-top: 2px; cursor: help; border-bottom: 1px dotted var(--ink3); display: inline-block; }
.tal-shell .delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 8px; margin-top: 8px; }
.tal-shell .delta.up { color: #0f7a37; background: rgba(22,163,74,.12); }
.tal-shell .delta.down { color: #b42318; background: rgba(220,38,38,.12); }
.tal-shell .delta.neutral { color: var(--ink2); background: var(--grid); cursor: help; }
.tal-shell .spark { height: 30px; width: 100%; margin-top: 8px; }
.tal-shell .spark path { fill: none; stroke-width: 2; stroke-linecap: round; }
.tal-shell h3 { font-size: 14.5px; display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.tal-shell h3 small { font-weight: 400; color: var(--ink2); font-size: 12px; }
.tal-shell .legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink2); margin-bottom: 6px; }
.tal-shell .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tal-shell svg text { font-family: inherit; fill: var(--ink2); font-size: 11px; }
.tal-shell .bar { display: grid; grid-template-columns: 130px 1fr 46px; align-items: center; gap: 10px; margin: 9px 0; font-size: 12.5px; }
.tal-shell .bar .t { height: 12px; border-radius: 7px; background: var(--grid); overflow: hidden; }
.tal-shell .bar .t i { display: block; height: 100%; border-radius: 7px; width: 0; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.tal-shell .bar b { text-align: right; font-variant-numeric: tabular-nums; }
.tal-shell .empty-note { color: var(--ink2); font-size: 12.5px; font-style: italic; padding: 8px 0; }

/* Skeleton (ChartCard / KpiCard loading) */
.tal-shell .tal-skel { border-radius: 10px; background: linear-gradient(90deg, var(--grid) 25%, var(--line) 37%, var(--grid) 63%); background-size: 400% 100%; animation: tal-shimmer 1.4s ease infinite; }
@keyframes tal-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* StatusChip */
.tal-shell .tal-status { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; }
.tal-shell .tal-status i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* AttentionList */
.tal-shell .att { list-style: none; padding: 0; margin: 0; }
.tal-shell .att li { display: flex; gap: 12px; align-items: center; padding: 11px 10px; border-radius: 12px; cursor: pointer; transition: background .2s, transform .2s; text-decoration: none; color: inherit; }
.tal-shell .att li:hover { background: var(--bg); transform: translateX(3px); }
.tal-shell .att .b { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.tal-shell .att small { display: block; color: var(--ink2); }
.tal-shell .att .go { margin-left: auto; color: var(--ink3); }

/* Timeline */
.tal-shell .tal-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.tal-shell .tal-timeline li { position: relative; padding: 0 0 18px 18px; }
.tal-shell .tal-timeline li::before { content: ""; position: absolute; left: -24px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--s1); border: 2px solid var(--card); }
.tal-shell .tal-timeline .tal-tl-date { font-size: 11px; color: var(--ink2); }
.tal-shell .tal-timeline .tal-tl-title { font-weight: 600; font-size: 13px; }
.tal-shell .tal-timeline .tal-tl-desc { font-size: 12px; color: var(--ink2); }

/* AiInsightButton */
.tal-shell .ai { margin-top: 16px; border-radius: 18px; padding: 18px 20px; background: linear-gradient(135deg, rgba(139,92,246,.10), rgba(59,114,217,.10)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tal-shell .ai .go-btn { border: 0; cursor: pointer; color: #fff; font: 600 13px inherit; padding: 10px 16px; border-radius: 12px; background: linear-gradient(135deg,#8B5CF6,#3B72D9); box-shadow: 0 6px 18px rgba(99,102,241,.35); transition: transform .15s, box-shadow .2s; }
.tal-shell .ai .go-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(99,102,241,.45); }
.tal-shell .ai .go-btn:active { transform: scale(.97); }
.tal-shell .ai .out { margin-top: 14px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.tal-shell .ai .out p { line-height: 1.55; margin: 0 0 8px; }
.tal-shell .ai .out ol { padding-left: 18px; line-height: 1.6; margin: 0; }
.tal-shell .ai .out li { margin-bottom: 6px; }
.tal-shell .ai .meta { font-size: 11.5px; color: var(--ink2); margin-top: 8px; }

/* DataTableModern */
.tal-shell .tal-table-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.tal-shell .tal-table-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tal-shell .tal-table-toolbar .mud-table-toolbar { padding: 0; }
.tal-shell .tal-chip-filter { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tal-shell table.mud-table-root thead th { background: var(--navy) !important; color: #fff !important; font-weight: 600; font-size: 12.5px; }
.tal-shell .mud-table-container { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }

.tal-shell .egrid.row2 { grid-template-columns: 2fr 1fr; margin-top: 16px; }
.tal-shell .egrid.row3 { grid-template-columns: 1fr 1fr 1fr; margin-top: 16px; }
.tal-shell .egrid.row4 { grid-template-columns: 1.2fr 1fr; margin-top: 16px; }
@media (max-width: 1200px) { .tal-shell .kpis { grid-template-columns: repeat(3,1fr); } .tal-shell .egrid.row2, .tal-shell .egrid.row3, .tal-shell .egrid.row4, .tal-shell .ai .out { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .tal-shell .kpis { grid-template-columns: repeat(2,1fr); } }
@media (prefers-reduced-motion: reduce) { .tal-shell * { animation: none !important; transition: none !important; } }

/* P1-5: resalta el item con foco de teclado en la búsqueda global (Ctrl+K). */
.talentus-search-selected { background: var(--surface-3, rgba(27,45,85,.08)); border-radius: 8px; }
