/* =====================================================================
   GASCA · Recursos Humanos — cuadro de mando con Sage 200 Advanced (vista 'rrhh-dash-view').
   Estilo Victoria (Inter, tarjetas blancas, rojo GASCA) y paleta de datos validada (categórica en orden fijo).
   Prefijo .rh- para no chocar con nada.
   ===================================================================== */
/* INC-01168 (Susana): también la pantalla Empleados (#rrhh-emp-view); sin estas variables la cabecera fija de la tabla quedaba transparente y las filas se veían por debajo */
#rrhh-dash-view, #rrhh-emp-view, .rh-modal-root {
    --rh-red: #b4000c; --rh-ink: #0f172a; --rh-ink2: #334155; --rh-muted: #64748b; --rh-line: #e2e8f0; --rh-card: #fff; --rh-bg: #f8fafc;
    --rh-s1: #2a78d6; --rh-s2: #eb6834; --rh-s3: #1baf7a; --rh-s4: #eda100; --rh-s5: #e87ba4; --rh-s6: #008300; --rh-s7: #4a3aa7; --rh-s8: #e34948;
    --rh-good: #0f7b48; --rh-bad: #c0262d; --rh-warn: #a15c00;
    --rh-radius: 16px; --rh-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 30px -14px rgba(15,23,42,.16);
    font-family: 'Inter', sans-serif; color: var(--rh-ink); font-size: 14px; line-height: 1.45;
}
#rrhh-dash-view.active, #rrhh-emp-view.active { container-type: inline-size; container-name: rh; }
:where(#rrhh-dash-view, #rrhh-emp-view, .rh-modal-root) :is(h2, h3, h4, p) { margin: 0; padding: 0; font-family: inherit; color: var(--rh-ink); }
:where(#rrhh-dash-view, #rrhh-emp-view, .rh-modal-root) :is(button, select, input) { font-family: inherit; }
.rh-root { display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }

/* cabecera */
.rh-head { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; }
.rh-tit { display: flex; align-items: center; gap: 14px; }
.rh-tit-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 1.2rem;
    background: linear-gradient(135deg, #b4000c, #e34948); box-shadow: 0 10px 22px -12px rgba(180,0,12,.8); }
.rh-tit h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.rh-tit p { font-size: .8rem; color: var(--rh-muted); }
.rh-head-r { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.rh-ctl input[type=date] { min-width: 128px; }
.rh-ctl { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--rh-line); border-radius: 10px; background: #fff;
    font-size: .8rem; font-weight: 700; color: var(--rh-muted); }
.rh-ctl input, .rh-ctl select { border: 0; outline: 0; background: transparent; font-size: .84rem; font-weight: 700; color: var(--rh-ink); }
.rh-btn { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--rh-line); background: #fff; font-weight: 700; font-size: .82rem; cursor: pointer;
    color: var(--rh-ink); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.rh-btn:hover { border-color: var(--rh-ink); }
.rh-btn.rh-prim { background: var(--rh-ink); color: #fff; border-color: var(--rh-ink); }

/* filtros */
.rh-filtros { position: sticky; top: 0; z-index: 20; background: rgba(248,250,252,.92); backdrop-filter: blur(8px); border: 1px solid var(--rh-line);
    border-radius: var(--rh-radius); padding: 10px 12px; display: grid; gap: 8px; box-shadow: var(--rh-shadow); }
.rh-f-fila { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rh-f { display: grid; gap: 2px; min-width: 130px; flex: 1 1 140px; max-width: 260px; }
.rh-f label { font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--rh-muted); padding-left: 2px; }
.rh-f select, .rh-f input { height: 34px; border: 1px solid var(--rh-line); border-radius: 9px; padding: 0 8px; font-size: .82rem; background: #fff; color: var(--rh-ink); min-width: 0; }
.rh-f select.rh-on, .rh-f input.rh-on { border-color: var(--rh-s1); box-shadow: 0 0 0 3px rgba(42,120,214,.14); font-weight: 700; }
.rh-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rh-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: 999px; background: #e8f1fc; color: #1c5cab;
    font-size: .74rem; font-weight: 700; border: 0; cursor: pointer; }
.rh-chip i { opacity: .7; }
.rh-chip:hover i { opacity: 1; }
.rh-hint { font-size: .72rem; color: var(--rh-muted); }

/* pestañas */
.rh-tabs { display: flex; gap: 4px; flex-wrap: wrap; background: #eef2f6; padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; }
.rh-tabs button { height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--rh-muted); font-weight: 700; font-size: .82rem;
    cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.rh-tabs button:hover { color: var(--rh-ink); }
.rh-tabs button.rh-on { background: #fff; color: var(--rh-ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }

/* KPI */
.rh-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.rh-kpi { background: var(--rh-card); border: 1px solid var(--rh-line); border-radius: var(--rh-radius); box-shadow: var(--rh-shadow); padding: 14px 16px;
    display: grid; gap: 4px; position: relative; overflow: hidden; }
.rh-kpi[data-tab] { cursor: pointer; }
.rh-kpi[data-tab]:hover { border-color: #cbd5e1; }
.rh-kpi-l { font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--rh-muted); display: flex; gap: 6px; align-items: flex-start; line-height: 1.3; min-width: 0; }
.rh-kpi-l span { overflow-wrap: anywhere; }
.rh-kpi-l i { color: var(--rh-s1); }
.rh-kpi-v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.rh-kpi-v.rh-largo { font-size: 1.3rem; }
.rh-kpi { min-width: 0; }
.rh-kpi[data-desg] { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rh-kpi[data-desg]:hover, .rh-kpi[data-desg]:focus-visible { border-color: var(--rh-s1); box-shadow: 0 0 0 3px rgba(42,120,214,.12), var(--rh-shadow); transform: translateY(-1px); outline: none; }
.rh-kpi-lupa { position: absolute; right: 12px; bottom: 10px; font-size: .75rem; color: #cbd5e1; }
.rh-kpi[data-desg]:hover .rh-kpi-lupa { color: var(--rh-s1); }
.rh-kpis-desg { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.rh-kpis-desg .rh-kpi-v { font-size: 1.4rem; }
.rh-kpi-v small { font-size: .9rem; font-weight: 700; color: var(--rh-muted); margin-left: 2px; }
.rh-kpi-s { font-size: .74rem; color: var(--rh-muted); }
.rh-kpi-s b { color: var(--rh-ink2); }
.rh-up { color: var(--rh-good); font-weight: 800; }
.rh-down { color: var(--rh-bad); font-weight: 800; }
.rh-kpi canvas.rh-spark { position: absolute; right: 12px; top: 12px; width: 64px !important; height: 22px !important; opacity: .85; pointer-events: none; }
.rh-kpi:has(canvas.rh-spark) .rh-kpi-l { padding-right: 70px; }
.rh-kpi:has(canvas.rh-spark) .rh-kpi-lupa { display: none; }

/* tarjetas y rejilla */
.rh-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.rh-card { grid-column: span 6; background: var(--rh-card); border: 1px solid var(--rh-line); border-radius: var(--rh-radius); box-shadow: var(--rh-shadow);
    padding: 14px 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.rh-card.rh-w12 { grid-column: span 12; }
.rh-card.rh-w8 { grid-column: span 8; }
.rh-card.rh-w4 { grid-column: span 4; }
.rh-card.rh-w3 { grid-column: span 3; }
@container rh (max-width: 1100px) { .rh-card, .rh-card.rh-w8, .rh-card.rh-w4, .rh-card.rh-w3 { grid-column: span 12; } }
.rh-card-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.rh-card-h h3 { font-size: .95rem; font-weight: 800; }
.rh-card-h p { font-size: .74rem; color: var(--rh-muted); margin-top: 2px; }
.rh-card-h .rh-acc { display: flex; gap: 6px; flex-shrink: 0; }
.rh-mini { height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--rh-line); background: #fff; font-size: .72rem; font-weight: 700; color: var(--rh-muted); cursor: pointer; }
.rh-mini.rh-on { background: var(--rh-ink); color: #fff; border-color: var(--rh-ink); }
.rh-chart { position: relative; height: 280px; }
.rh-chart.rh-alto { height: 360px; }
.rh-chart.rh-bajo { height: 220px; }
.rh-leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .74rem; color: var(--rh-ink2); }
.rh-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.rh-leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rh-nada { font-size: .82rem; color: var(--rh-muted); padding: 30px 0; text-align: center; }

/* barras horizontales HTML (rankings con clic) */
.rh-rank { display: grid; gap: 4px; max-height: 420px; overflow: auto; padding-right: 4px; }
.rh-rank button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; text-align: left; border: 0; background: none; padding: 5px 6px;
    border-radius: 8px; cursor: pointer; font: inherit; color: var(--rh-ink); }
.rh-rank button:hover { background: #f1f5f9; }
.rh-rank .rh-rk-n { font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-rank .rh-rk-v { font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rh-rank .rh-rk-b { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: #eef2f6; overflow: hidden; }
.rh-rank .rh-rk-b i { display: block; height: 100%; border-radius: 4px; background: var(--rh-s1); }
.rh-rank .rh-rk-s { grid-column: 1 / -1; font-size: .68rem; color: var(--rh-muted); }

/* tablas */
.rh-tabla-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.rh-buscar { display: inline-flex; align-items: center; gap: 6px; height: 34px; border: 1px solid var(--rh-line); border-radius: 9px; padding: 0 10px; background: #fff;
    color: var(--rh-muted); flex: 1 1 240px; max-width: 420px; }
.rh-buscar input { border: 0; outline: 0; width: 100%; font-size: .84rem; background: transparent; color: var(--rh-ink); }
.rh-tw { overflow: auto; max-height: 620px; border: 1px solid var(--rh-line); border-radius: 12px; }
.rh-t { width: 100%; border-collapse: collapse; font-size: .8rem; }
.rh-t th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: .63rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--rh-muted);
    padding: 9px 10px; border-bottom: 1px solid var(--rh-line); background: var(--rh-bg); white-space: nowrap; cursor: pointer; user-select: none; }
.rh-t th:hover { color: var(--rh-ink); }
.rh-t th.rh-sort-a::after { content: ' ▲'; } .rh-t th.rh-sort-d::after { content: ' ▼'; }
.rh-t td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.rh-t tr.rh-cl { cursor: pointer; }
.rh-t tr.rh-cl:hover td { background: #f8fafc; }
.rh-t .rh-n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rh-t .rh-spk { width: 90px; }
.rh-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; background: #f1f5f9; color: #475569; }
.rh-pill.rh-p-it { background: #fde8e8; color: #9b1c1c; }
.rh-pill.rh-p-fd { background: #e8f1fc; color: #1c5cab; }
.rh-pill.rh-p-tmp { background: #fff1e5; color: #9a3412; }
.rh-pill.rh-p-ind { background: #e3f6ee; color: #0f6b44; }
.rh-pill.rh-p-exc { background: #f1edfb; color: #4a3aa7; }
.rh-dias { font-weight: 800; }
.rh-dias.rh-mal { color: var(--rh-bad); }
.rh-dias.rh-reg { color: var(--rh-warn); }

/* heatmap categoría × modalidad */
.rh-heat { overflow: auto; }
.rh-heat table { border-collapse: separate; border-spacing: 2px; font-size: .74rem; }
.rh-heat th { font-size: .64rem; font-weight: 800; color: var(--rh-muted); text-align: left; padding: 2px 6px; white-space: nowrap; }
.rh-heat td { min-width: 70px; height: 26px; text-align: center; border-radius: 5px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }

/* carga, errores, leyendas */
.rh-cargando { padding: 50px 20px; text-align: center; color: var(--rh-muted); display: grid; gap: 10px; justify-items: center; }
.rh-cargando .rh-barra { width: 220px; height: 4px; border-radius: 4px; background: #e2e8f0; overflow: hidden; position: relative; }
.rh-cargando .rh-barra::after { content: ''; position: absolute; inset: 0; width: 40%; background: var(--rh-s1); border-radius: 4px; animation: rh-carga 1.1s ease-in-out infinite; }
@container rh (max-width: 900px) { .rh-filtros { position: static; } .rh-f { flex: 1 1 45%; max-width: none; } }
@keyframes rh-carga { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.rh-error { background: #fff; border: 1px solid #fecaca; border-radius: var(--rh-radius); padding: 20px; color: #991b1b; display: grid; gap: 10px; justify-items: start; }
.rh-notas { display: grid; gap: 8px; }
.rh-nota { display: flex; gap: 10px; align-items: flex-start; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; border-radius: 12px; padding: 10px 14px; font-size: .78rem; line-height: 1.45; }
.rh-nota code { font-size: .72rem; background: rgba(0,0,0,.05); padding: 0 3px; border-radius: 4px; }
.rh-nota button { margin-left: 6px; background: none; border: 0; color: #92400e; font-weight: 800; text-decoration: underline; cursor: pointer; font-size: .76rem; }

/* ficha del empleado */
.rh-modal-root { position: fixed; inset: 0; z-index: 3000; background: rgba(15,23,42,.5); display: flex; justify-content: flex-end; }
.rh-modal { width: min(980px, 100%); height: 100%; overflow: auto; background: var(--rh-bg); box-shadow: -30px 0 60px -20px rgba(15,23,42,.5); padding: 20px; display: grid; gap: 14px; align-content: start;
    animation: rh-entra .2s ease-out; }
@keyframes rh-entra { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.rh-modal .rh-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.rh-modal .rh-card, .rh-modal .rh-card.rh-w12 { grid-column: auto; }
.rh-modal.rh-modal-desg { width: min(1280px, 100%); }
.rh-eyebrow { font-size: .64rem !important; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--rh-s1) !important; }
.rh-ficha-h .rh-acc { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rh-reps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.rh-rep { background: #fff; border: 1px solid var(--rh-line); border-radius: 12px; padding: 10px; display: grid; gap: 3px; align-content: start; }
.rh-rep-t { font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--rh-muted); display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.rh-rep-f { position: relative; display: flex; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 4px 6px; border-radius: 7px; cursor: pointer; font: inherit; font-size: .76rem; color: var(--rh-ink); text-align: left; overflow: hidden; }
.rh-rep-f span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; z-index: 1; }
.rh-rep-f b { position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.rh-rep-f i { position: absolute; left: 0; top: 0; bottom: 0; background: #e8f1fc; border-radius: 7px; z-index: 0; }
.rh-rep-f:hover i { background: #d6e7fb; }
.rh-rep-f.rh-on i { background: var(--rh-s1); }
.rh-rep-f.rh-on { color: #fff; }
.rh-largo-txt { display: inline-block; max-width: 420px; white-space: normal; }
.rh-heat td[data-desg] { cursor: pointer; }
.rh-heat td[data-desg]:hover { outline: 2px solid var(--rh-ink); }
.rh-ficha-h { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.rh-avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: #fff; background: var(--rh-s1); flex-shrink: 0; }
.rh-ficha-h h3 { font-size: 1.2rem; font-weight: 800; }
.rh-ficha-h p { font-size: .8rem; color: var(--rh-muted); }
.rh-datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 16px; }
.rh-dato span { display: block; font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--rh-muted); }
.rh-dato b { font-size: .86rem; }
.rh-tl { display: grid; gap: 6px; }
.rh-tl div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: .78rem; padding: 6px 0; border-bottom: 1px solid #eef2f6; }
.rh-tl div b { font-variant-numeric: tabular-nums; }

/* ===== ficha del empleado (vista 360º) ===== */
.rh-modal.rh-modal-ficha { width: min(1180px, 100%); gap: 14px; }
.rh-fhero { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 92%, #000) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 70%, #fff) 100%); color: #fff; border-radius: 18px; padding: 18px 20px; display: grid; gap: 12px; box-shadow: 0 18px 40px -22px rgba(15,23,42,.6); }
.rh-fhero h3, .rh-fhero p { color: #fff !important; }
.rh-fhero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rh-fid { display: flex; gap: 14px; align-items: center; min-width: 0; }
.rh-favatar { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; font-weight: 800; font-size: 1.35rem; background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.45); flex-shrink: 0; }
.rh-fid h3 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.rh-fid p { font-size: .84rem; opacity: .95; }
.rh-fid .rh-fsub { font-size: .74rem; opacity: .8; }
.rh-btn.rh-btn-cl { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); }
.rh-btn.rh-btn-cl:hover { background: rgba(255,255,255,.28); border-color: #fff; }
.rh-fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.rh-fchips .rh-pill { height: 24px; font-size: .72rem; }
.rh-fchip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: rgba(255,255,255,.18); color: #fff; }
.rh-fchip.rh-fc-ok { background: #dcfce7; color: #166534; }
.rh-fchip.rh-fc-mal { background: #fee2e2; color: #991b1b; }
.rh-fchip.rh-fc-aviso { background: #fef3c7; color: #92400e; }
.rh-fcontacto { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; }
.rh-fcontacto a, .rh-fcontacto span { color: #fff; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; opacity: .95; }
.rh-fcontacto a:hover { text-decoration: underline; }
.rh-frango { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; background: rgba(255,255,255,.12); border-radius: 12px; padding: 8px 10px; font-size: .78rem; font-weight: 700; }
.rh-frango .rh-mini { background: rgba(255,255,255,.9); color: var(--rh-ink); border: 0; }
.rh-frango label { display: inline-flex; gap: 6px; align-items: center; }
.rh-frango input { height: 28px; border-radius: 8px; border: 0; padding: 0 6px; font: inherit; font-size: .78rem; color: var(--rh-ink); }
.rh-fscore { display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: 14px; background: #fff; border: 1px solid var(--rh-line); border-radius: var(--rh-radius); padding: 14px 16px; box-shadow: var(--rh-shadow); }
@media (max-width: 760px) { .rh-fscore { grid-template-columns: 1fr; } }
.rh-fgauge { display: flex; gap: 12px; align-items: center; }
.rh-gauge { width: 140px; height: auto; flex-shrink: 0; }
.rh-fgauge b { display: block; font-size: .92rem; }
.rh-fgauge small { font-size: .72rem; color: var(--rh-muted); }
.rh-fcomp { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; align-content: center; }
.rh-fcomp-h { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 700; }
.rh-fbar { height: 8px; border-radius: 6px; background: #eef2f6; overflow: hidden; margin: 4px 0 3px; }
.rh-fbar i { display: block; height: 100%; border-radius: 6px; }
.rh-fcomp small { font-size: .68rem; color: var(--rh-muted); line-height: 1.3; display: block; }
.rh-ftiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.rh-ftiles-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rh-ftile { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--rh-line); border-radius: 14px; padding: 11px 12px; min-width: 0; }
.rh-ftile > i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #e8f1fc; color: var(--rh-s1); flex-shrink: 0; font-size: .85rem; }
.rh-ftile div { display: grid; gap: 1px; min-width: 0; }
.rh-ftile span { font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--rh-muted); }
.rh-ftile b { font-size: 1.05rem; font-weight: 800; overflow-wrap: anywhere; }
.rh-ftile small { font-size: .7rem; color: var(--rh-muted); }
.rh-ftile.rh-ft-mal > i { background: #fde8e8; color: #b91c1c; }
.rh-ftile.rh-ft-aviso > i { background: #fef3c7; color: #a15c00; }
.rh-ftabs { position: sticky; top: -20px; z-index: 2; }
.rh-ftabs button small { background: #e2e8f0; color: var(--rh-ink2); border-radius: 999px; padding: 0 6px; font-size: .66rem; }
.rh-ftabs button small.rh-nota-pend { background: #fde047; color: #713f12; font-weight: 800; margin-left: 2px; }   /* llamadas pendientes de seguimiento (antes en el botón «Nota de llamada») */
.rh-fmeses { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
/* INC-00729: selector de ficha de Sage (una nómina por empresa/código) en la pestaña Nóminas */
.rh-fnomfichas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--rh-line); border-radius: 12px; background: #f8fafc; }
.rh-fnomfichas > span { font-size: .78rem; font-weight: 800; color: var(--rh-ink); margin-right: 4px; }
.rh-fnomfichas button { border: 1px solid var(--rh-line); background: #fff; color: var(--rh-ink); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.rh-fnomfichas button small { color: var(--rh-muted); font-weight: 600; }
.rh-fnomfichas button.rh-on { background: var(--rh-ink); border-color: var(--rh-ink); color: #fff; }
.rh-fnomfichas button.rh-on small { color: rgba(255,255,255,.75); }
/* INC-00720/681: contratos que no están de alta a la fecha «Hasta», traídos al buscar */
.rh-p-fuera { background: #fef3c7; color: #92400e; }
.rh-fuera-aviso { background: #fffbeb; color: #92400e; text-align: left; }
/* INC-00728: bases de cotización de la nómina */
.rh-fbases-h { margin: 12px 0 4px; font-size: .8rem; font-weight: 800; color: var(--rh-ink); }
.rh-fbases tr.rh-fbase-tot td { background: #f8fafc; }
.rh-fmeses button { flex-shrink: 0; display: grid; gap: 1px; border: 1px solid var(--rh-line); background: #fff; border-radius: 10px; padding: 6px 10px; cursor: pointer; font: inherit; text-align: left; }
.rh-fmeses button span { font-size: .68rem; color: var(--rh-muted); font-weight: 700; }
.rh-fmeses button b { font-size: .84rem; }
.rh-fmeses button.rh-on { background: var(--rh-ink); border-color: var(--rh-ink); }
.rh-fmeses button.rh-on span, .rh-fmeses button.rh-on b { color: #fff; }
.rh-ctl-tl { display: grid; gap: 0; }
.rh-ctl-i { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 10px 0 10px 14px; border-left: 3px solid #e2e8f0; position: relative; }
.rh-ctl-i::before { content: ''; position: absolute; left: -7px; top: 14px; width: 11px; height: 11px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; }
.rh-ctl-i.rh-vivo { border-left-color: var(--rh-s3); }
.rh-ctl-i.rh-vivo::before { background: var(--rh-s3); }
.rh-ctl-f { display: grid; font-size: .8rem; }
.rh-ctl-f small, .rh-ctl-c small { font-size: .7rem; color: var(--rh-muted); }
.rh-ctl-c { display: grid; gap: 2px; font-size: .8rem; }
.rh-ctl-c span { color: var(--rh-ink2); }
.rh-ruta { color: var(--rh-muted); }
@media (max-width: 640px) { .rh-ctl-i { grid-template-columns: 1fr; gap: 4px; } }

/* ===== posibles errores ===== */
.rh-err-k { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.rh-err-k.rh-on { border-color: var(--rh-ink); box-shadow: 0 0 0 3px rgba(15,23,42,.12), var(--rh-shadow); }
.rh-rank button.rh-rank-on { background: #eef2f6; outline: 2px solid var(--rh-ink); }
.rh-pill.rh-g-alta { background: #fde8e8; color: #b91c1c; }
.rh-pill.rh-g-media { background: #fef3c7; color: #92400e; }
.rh-pill.rh-g-baja { background: #f1f5f9; color: #475569; }

/* estado de la persona (de un vistazo) y salario */
.rh-festado { display: flex; gap: 14px; align-items: center; border-radius: 16px; padding: 12px 18px; color: #fff; box-shadow: 0 12px 26px -16px rgba(15,23,42,.6); }
.rh-festado > i { font-size: 1.9rem; }
.rh-festado b { display: block; font-size: 1.15rem; letter-spacing: .04em; color: #fff; }
.rh-festado span { font-size: .82rem; opacity: .95; }
.rh-festado.rh-fe-alta { background: linear-gradient(90deg, #0f7b48, #1baf7a); }
.rh-festado.rh-fe-it { background: linear-gradient(90deg, #b91c1c, #e34948); }
.rh-festado.rh-fe-baja { background: linear-gradient(90deg, #334155, #64748b); }
.rh-festado.rh-fe-exc { background: linear-gradient(90deg, #4a3aa7, #7c6fe0); }
.rh-fcopy { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.rh-fcopy:hover { background: rgba(255,255,255,.28); }
.rh-fcopy .rh-fcopy-i { opacity: .7; font-size: .72rem; }
.rh-fcopy.rh-copiado { background: #dcfce7; color: #166534; }
.rh-fsal { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 10px; }
@media (max-width: 980px) { .rh-fsal { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.rh-fsal > div { background: #fff; border: 1px solid var(--rh-line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; box-shadow: var(--rh-shadow); min-width: 0; }
.rh-fsal span { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--rh-muted); }
.rh-fsal > div > b { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rh-fsal small { font-size: .72rem; color: var(--rh-muted); }
.rh-fsal .rh-fsal-p { background: linear-gradient(135deg, #0f172a, #1e3a5f); border-color: #0f172a; }
.rh-fsal .rh-fsal-p span, .rh-fsal .rh-fsal-p small { color: #cbd5e1; }
.rh-fsal .rh-fsal-p > b { color: #fff; font-size: 1.6rem; }
.rh-fsal .rh-fsal-p small b { color: #fff; }

/* ficha y desglose a pantalla completa (sin desbordes laterales) */
.rh-modal-root:has(.rh-modal-ficha), .rh-modal-root:has(.rh-modal-desg) { justify-content: center; }
.rh-modal.rh-modal-ficha, .rh-modal.rh-modal-desg { width: 100%; max-width: none; padding: 20px clamp(16px, 3vw, 44px); overflow-x: hidden; }
.rh-modal.rh-modal-ficha > *, .rh-modal.rh-modal-desg > * { width: 100%; max-width: 1640px; margin-inline: auto; min-width: 0; }
.rh-modal .rh-card, .rh-modal .rh-grid > * { min-width: 0; }
.rh-tw-libre { overflow-x: auto; max-width: 100%; }
.rh-tw-libre .rh-t td, .rh-tw-libre .rh-t th { white-space: nowrap; }
.rh-tw-libre .rh-t td:first-child { white-space: normal; }

/* documentos de la ficha y visor */
.rh-docg { display: grid; gap: 6px; margin-top: 8px; }
.rh-docg-t { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--rh-muted); display: flex; gap: 8px; align-items: center; }
.rh-docg-t small { background: #e2e8f0; color: var(--rh-ink2); border-radius: 999px; padding: 0 7px; }
.rh-doc { display: flex; align-items: center; gap: 10px; border: 1px solid var(--rh-line); border-radius: 12px; padding: 8px 10px; background: #fff; flex-wrap: wrap; }
.rh-doc:hover { border-color: #cbd5e1; background: #f8fafc; }
.rh-doc-ico { color: #c0262d; font-size: 1.3rem; }
.rh-doc-n { flex: 1 1 260px; display: grid; min-width: 0; }
.rh-doc-n b { font-size: .86rem; overflow-wrap: anywhere; }
.rh-doc-n small { font-size: .72rem; color: var(--rh-muted); }
.rh-visor-root { justify-content: center; align-items: stretch; padding: 2vh 2vw; }
.rh-visor { width: 100%; max-width: 1400px; background: #fff; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 70px -20px rgba(15,23,42,.6); }
.rh-visor-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rh-line); flex-wrap: wrap; }
.rh-visor-h b { font-size: .92rem; display: inline-flex; gap: 8px; align-items: center; }
.rh-visor-h b i { color: #c0262d; }
.rh-visor-h span { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rh-visor-c { flex: 1; min-height: 60vh; display: grid; }
.rh-visor-c iframe { width: 100%; height: 100%; min-height: 80vh; border: 0; }

/* importes y cifras nunca partidos en dos líneas */
.rh-kpi-v, .rh-n, .rh-rk-v, .rh-ftile b, .rh-fsal > div > b, .rh-fmeses b, .rh-kpis-desg .rh-kpi-v, .rh-rep-f b, .rh-card-h > b, .rh-dias { white-space: nowrap; }
.rh-kpi-v { overflow-wrap: normal; }
.rh-kpi-v.rh-largo { font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.rh-ftile b, .rh-fsal > div > b { overflow-wrap: normal; }

/* asistente de IA en la ficha */
.rh-fhero-acc { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rh-btn.rh-btn-ia { background: #fff; color: #4a3aa7; border-color: #fff; font-weight: 800; }
.rh-btn.rh-btn-ia:hover { background: #f1edfb; }
.rh-ia h3 i { color: #4a3aa7; }
.rh-ia-aviso { display: flex; gap: 8px; align-items: flex-start; background: #f1edfb; color: #3b2f86; border-radius: 10px; padding: 8px 12px; font-size: .74rem; }
.rh-ia-msgs { min-height: 260px; max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 10px; background: var(--rh-bg); border: 1px solid var(--rh-line); border-radius: 14px; }
.rh-ia-vacio { margin: auto; display: grid; justify-items: center; gap: 8px; color: var(--rh-muted); font-size: .84rem; }
.rh-ia-vacio i { font-size: 2rem; color: #cbd5e1; }
.rh-ia-m { display: flex; }
.rh-ia-usuario { justify-content: flex-end; }
.rh-ia-b { max-width: min(760px, 88%); border-radius: 14px; padding: 9px 13px; font-size: .86rem; line-height: 1.5; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.rh-ia-usuario .rh-ia-b { background: var(--rh-ink); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.rh-ia-asistente .rh-ia-b { background: #fff; border: 1px solid var(--rh-line); border-bottom-left-radius: 4px; }
.rh-ia-b p { margin: 0 0 6px !important; color: inherit !important; }
.rh-ia-b p:last-child { margin-bottom: 0 !important; }
.rh-ia-b ul { margin: 4px 0 6px 18px; padding: 0; }
.rh-ia-b small { display: block; margin-top: 6px; font-size: .66rem; color: var(--rh-muted); }
.rh-ia-pensando { display: inline-flex; gap: 5px; align-items: center; }
.rh-ia-pensando span { width: 7px; height: 7px; border-radius: 50%; background: #9085e9; animation: rh-ia-bote 1s infinite ease-in-out; }
.rh-ia-pensando span:nth-child(2) { animation-delay: .15s; } .rh-ia-pensando span:nth-child(3) { animation-delay: .3s; }
@keyframes rh-ia-bote { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
.rh-ia-sug { display: flex; flex-wrap: wrap; gap: 6px; }
.rh-ia-sug .rh-mini { height: auto; min-height: 28px; padding: 4px 10px; text-align: left; }
.rh-ia-form { display: flex; gap: 8px; align-items: stretch; }
.rh-ia-form textarea { flex: 1; border: 1px solid var(--rh-line); border-radius: 12px; padding: 9px 12px; font: inherit; font-size: .88rem; resize: vertical; min-height: 46px; }
.rh-ia-form textarea:focus { outline: 2px solid rgba(74,58,167,.3); border-color: #4a3aa7; }

/* «Desde» / «Hasta» legibles sobre la cabecera de color de la ficha */
.rh-frango label, .rh-frango > span { color: #fff !important; font-weight: 800; font-size: .8rem; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.rh-frango { background: rgba(15,23,42,.22); }
.rh-ia-t { margin: 4px 0 8px; font-size: .8rem; }
.rh-ia-t td:last-child, .rh-ia-t th:last-child { text-align: right; white-space: nowrap; }

/* ficha: casillas agrupadas por tema, iconos grandes y semáforo de estado */
.rh-fgrupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.rh-fg { --t: #2a78d6; --tf: #e8f1fc; background: #fff; border: 1px solid var(--rh-line); border-top: 4px solid var(--t); border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,23,42,.05); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.rh-fg:hover, .rh-fg:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,23,42,.10); outline: none; }
.rh-fg > header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--tf); color: var(--t); }
.rh-fg > header > i:first-child { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--t); color: #fff; font-size: 1rem; }
.rh-fg > header h4 { margin: 0; font-size: .86rem; font-weight: 800; color: #0f172a; flex: 1; }
.rh-fg-ir { font-size: .75rem; opacity: .7; }
.rh-fg-c { display: grid; }
.rh-gt { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--rh-line); }
.rh-gt:first-child { border-top: 0; }
.rh-gt > i.rh-gt-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--tf); color: var(--t); font-size: 1.3rem; }
.rh-gt-c { display: grid; gap: 1px; min-width: 0; }
.rh-gt-c span { font-size: .64rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--rh-muted); }
.rh-gt-c b { font-size: 1.3rem; font-weight: 800; color: #0f172a; white-space: nowrap; line-height: 1.2; }
.rh-gt-c small { font-size: .72rem; color: var(--rh-muted); }
.rh-sem { display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-size: .7rem; font-weight: 800; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.rh-sem-ok { background: #dcfce7; color: #15803d; }
.rh-sem-aviso { background: #fef9c3; color: #a16207; }
.rh-sem-mal { background: #fee2e2; color: #b91c1c; }
.rh-gt-mal { background: #fff7f7; } .rh-gt-mal > i.rh-gt-ic { background: #fee2e2; color: #dc2626; }
.rh-gt-aviso { background: #fffdf0; } .rh-gt-aviso > i.rh-gt-ic { background: #fef9c3; color: #ca8a04; }
.rh-fg-persona { --t: #4a3aa7; --tf: #efedfb; }
.rh-fg-contrato { --t: #2a78d6; --tf: #e8f1fc; }
.rh-fg-ausencias { --t: #eb6834; --tf: #fdeee7; }
.rh-fg-dinero { --t: #0f766e; --tf: #e3f4f2; }
.rh-fg-salud { --t: #d6407e; --tf: #fcebf2; }
.rh-fg-docs { --t: #475569; --tf: #eef2f6; }
@media (max-width: 520px) { .rh-gt { grid-template-columns: 40px 1fr; } .rh-gt > i.rh-gt-ic { width: 40px; height: 40px; font-size: 1.1rem; } .rh-sem { grid-column: 2; justify-self: start; } }

/* notas de llamadas */
.rh-btn.rh-btn-nota { background: #1baf7a; color: #fff; border-color: #1baf7a; font-weight: 800; }
.rh-btn.rh-btn-nota:hover { background: #159567; }
.rh-nota-pend { background: #fde047; color: #713f12; border-radius: 999px; padding: 0 6px; font-weight: 800; margin-left: 4px; }
.rh-nform, .rh-nhist { display: grid; gap: 12px; align-content: start; }
.rh-nseg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rh-nseg button { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; border: 2px solid var(--rh-line); background: #fff; font: inherit; font-size: .76rem; font-weight: 700; color: var(--rh-muted); cursor: pointer; }
.rh-nseg button i { font-size: 1.25rem; }
.rh-nseg button.rh-on { border-color: #1baf7a; background: #e7f7f0; color: #0f6b4a; }
.rh-nmotivos { display: flex; flex-wrap: wrap; gap: 6px; }
.rh-nmot { border: 1px solid var(--rh-line); background: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .74rem; font-weight: 600; color: #334155; cursor: pointer; }
.rh-nmot.rh-on { background: #2a78d6; border-color: #2a78d6; color: #fff; }
span.rh-nmot { cursor: default; }
.rh-ngrab { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: #f1f5f9; border: 1px dashed #cbd5e1; }
.rh-ngrab div { display: grid; gap: 2px; min-width: 0; } .rh-ngrab b { font-size: .88rem; } .rh-ngrab small { font-size: .72rem; color: var(--rh-muted); }
.rh-ngrab audio { height: 36px; max-width: 220px; }
.rh-grabando { background: #fef2f2; border-color: #fca5a5; }
.rh-nmic { width: 54px; height: 54px; border-radius: 50%; border: 0; background: #e34948; color: #fff; font-size: 1.35rem; cursor: pointer; box-shadow: 0 4px 12px rgba(227,73,72,.35); }
.rh-nmic:hover { background: #c93a39; }
.rh-nmic-on { animation: rh-pulso 1.2s infinite; background: #b91c1c; }
@keyframes rh-pulso { 0% { box-shadow: 0 0 0 0 rgba(227,73,72,.55); } 70% { box-shadow: 0 0 0 14px rgba(227,73,72,0); } 100% { box-shadow: 0 0 0 0 rgba(227,73,72,0); } }
.rh-nerr { color: #b91c1c; }
.rh-nform textarea, .rh-nedit textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--rh-line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: .88rem; resize: vertical; }
.rh-nform textarea:focus, .rh-nedit textarea:focus { outline: 2px solid rgba(27,175,122,.3); border-color: #1baf7a; }
.rh-nseg-chk { display: flex; gap: 8px; align-items: center; font-size: .82rem; font-weight: 600; color: #334155; cursor: pointer; }
.rh-nseg-chk i { color: #ca8a04; }
.rh-nguardar { justify-self: stretch; height: 44px; font-size: .92rem; }
.rh-nfil { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rh-nfil .rh-mini.rh-on { background: var(--rh-ink); color: #fff; border-color: var(--rh-ink); }
.rh-nfil input { flex: 1; min-width: 160px; height: 32px; border: 1px solid var(--rh-line); border-radius: 10px; padding: 0 10px; font: inherit; font-size: .82rem; }
.rh-nlista { display: grid; gap: 10px; max-height: 70vh; overflow-y: auto; padding-right: 2px; }
.rh-llam { --c: #64748b; --cf: #f1f5f9; display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--rh-line); border-left: 4px solid var(--c); border-radius: 14px; background: #fff; }
.rh-llam > i.rh-llam-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--cf); color: var(--c); font-size: 1.2rem; }
.rh-nt-in { --c: #1baf7a; --cf: #e7f7f0; } .rh-nt-out { --c: #2a78d6; --cf: #e8f1fc; } .rh-nt-nota { --c: #4a3aa7; --cf: #efedfb; }
.rh-llam-p { background: #fffdf0; }
.rh-llam-c { display: grid; gap: 6px; min-width: 0; }
.rh-llam-c header { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.rh-llam-c header b { font-size: .88rem; }
.rh-llam-c header small { width: 100%; font-size: .72rem; color: var(--rh-muted); }
.rh-llam-c p { margin: 0 !important; font-size: .86rem; line-height: 1.5; color: #0f172a !important; overflow-wrap: anywhere; }
.rh-llam-acc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .72rem; }
.rh-llam-acc audio { height: 32px; max-width: 260px; }
.rh-nedit { display: grid; gap: 6px; } .rh-nedit > div { display: flex; gap: 6px; }

/* ficha: sexo y edad a simple vista */
.rh-fbadges { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.rh-fbadge { --b: #64748b; display: inline-flex; align-items: center; gap: 7px; background: #fff; color: #0f172a; border-radius: 999px; padding: 4px 12px 4px 4px; font-size: .9rem; font-weight: 800; box-shadow: 0 2px 8px rgba(15,23,42,.18); white-space: nowrap; }
.rh-fbadge > i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--b); color: #fff; font-size: .95rem; }
.rh-fbadge small { font-size: .68rem; font-weight: 700; color: #64748b; }
.rh-fb-m { --b: #d6407e; } .rh-fb-h { --b: #2a78d6; }
.rh-fb-e1 { --b: #1baf7a; } .rh-fb-e2 { --b: #0f766e; } .rh-fb-e3 { --b: #eda100; } .rh-fb-e4 { --b: #eb6834; }
.rh-ngrid { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .rh-ngrid { grid-template-columns: 1fr; } }

/* cabecera de la ficha: azul si es hombre, rosa si es mujer (texto blanco legible en ambos: contraste ≥ 4,5:1) */
.rh-fhero.rh-fhero-h { --c: #1f5fb4; }
.rh-fhero.rh-fhero-m { --c: #b8306c; }
.rh-fhero.rh-fhero-x { --c: #475569; }
.rh-fhero.rh-fhero-h, .rh-fhero.rh-fhero-m, .rh-fhero.rh-fhero-x { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 82%, #000) 0%, var(--c) 60%, color-mix(in srgb, var(--c) 88%, #fff) 100%); }
.rh-fhero-m .rh-frango { background: rgba(80, 10, 40, .32); }
.rh-fhero-h .rh-frango { background: rgba(10, 30, 70, .32); }

/* ficha: casa y trabajo */
.rh-fcasa { display: grid; gap: 12px; }
.rh-fcasa h3 i { color: #4a3aa7; }
.rh-fcasa-g { display: grid; grid-template-columns: minmax(0, 1fr) 210px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.rh-fcasa-m { --t: #1baf7a; --tf: #e7f7f0; display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--rh-line); border-top: 4px solid var(--t); border-radius: 14px; overflow: hidden; min-width: 0; background: #fff; }
.rh-fcasa-m.trabajo { --t: #2a78d6; --tf: #e8f1fc; }
.rh-fcasa-m > header { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--tf); }
.rh-fcasa-m > header > i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--t); color: #fff; font-size: 1.1rem; flex-shrink: 0; }
.rh-fcasa-m > header > div { display: grid; gap: 1px; min-width: 0; }
.rh-fcasa-m > header span { font-size: .64rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--t); }
.rh-fcasa-m > header b { font-size: .9rem; color: #0f172a; }
.rh-fcasa-m > header b:empty { display: none; }
.rh-fcasa-m > header small { font-size: .76rem; color: #334155; }
.rh-map { height: 240px; position: relative; background: #eef2f6; z-index: 0; }
.rh-map-vacio { position: absolute; inset: 0; display: grid; place-items: center; color: var(--rh-muted); font-size: .82rem; gap: 6px; }
.rh-fcasa-d { display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; padding: 14px 10px; border-radius: 14px; background: #f1f5f9; border: 1px solid var(--rh-line); }
.rh-fcasa-d.rh-fcd-ok { background: #f0fdf4; border-color: #bbf7d0; }
.rh-fcasa-d.rh-fcd-aviso { background: #fefce8; border-color: #fde68a; }
.rh-fcasa-d.rh-fcd-mal { background: #fef2f2; border-color: #fecaca; }
.rh-fcasa-car { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #4a3aa7; color: #fff; font-size: 1.4rem; box-shadow: 0 6px 16px rgba(74,58,167,.3); }
.rh-fcasa-d b { font-size: 1.7rem; font-weight: 800; color: #0f172a; white-space: nowrap; line-height: 1.1; }
.rh-fcasa-d span { font-size: .84rem; font-weight: 700; color: #334155; }
.rh-fcasa-d small { font-size: .72rem; color: var(--rh-muted); }
.rh-fcasa-aprox { line-height: 1.3; }
.rh-fcasa-d a.rh-mini { text-decoration: none; }
.rh-pin span { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.rh-pin span i { transform: rotate(45deg); color: #fff; font-size: .85rem; }
@media (max-width: 900px) { .rh-fcasa-g { grid-template-columns: 1fr; } .rh-map { height: 200px; } }

/* foto de Sage del empleado */
.rh-favatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; display: block; }
.rh-favatar:has(img) { padding: 0; overflow: hidden; }
.rh-foto-mini { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 7px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); }

/* semáforo de las casillas debajo del valor (no tapa el texto) */
.rh-gt { grid-template-columns: 46px minmax(0, 1fr); }
.rh-gt > .rh-sem { grid-column: 2; justify-self: start; margin-top: -4px; }
.rh-gt-c b { white-space: normal; }
/* respuestas rápidas de la centralita */
.rh-fresp h3 i { color: #1baf7a; }
.rh-fresp-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rh-fr { --t: #2a78d6; --tf: #e8f1fc; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: #fff;
  border: 1px solid var(--rh-line); border-left: 5px solid var(--t); }
.rh-fr > i.rh-fr-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--tf); color: var(--t); font-size: 1.35rem; }
.rh-fr > div { display: grid; gap: 2px; min-width: 0; }
.rh-fr span { font-size: .76rem; font-weight: 700; color: #334155; }
.rh-fr b { font-size: 1.3rem; font-weight: 800; color: #0f172a; line-height: 1.2; }
.rh-fr small { font-size: .72rem; color: var(--rh-muted); line-height: 1.35; }
.rh-fr-cobro, .rh-fr-ytd { --t: #0f766e; --tf: #e3f4f2; }
.rh-fr-pagas, .rh-fr-anticipo { --t: #eda100; --tf: #fdf5e0; }
.rh-fr-trienio { --t: #4a3aa7; --tf: #efedfb; }
.rh-fr-vacaciones { --t: #eb6834; --tf: #fdeee7; }
.rh-fr-baja { --t: #d6407e; --tf: #fcebf2; }
.rh-fr-fin, .rh-fr-llamamiento { --t: #2a78d6; --tf: #e8f1fc; }
.rh-fr-cuenta, .rh-fr-embargo { --t: #475569; --tf: #eef2f6; }
.rh-fr-e-mal { background: #fff7f7; border-left-color: #dc2626; } .rh-fr-e-mal > i.rh-fr-ic { background: #fee2e2; color: #dc2626; }
.rh-fr-e-aviso { background: #fffdf0; border-left-color: #eab308; } .rh-fr-e-aviso > i.rh-fr-ic { background: #fef9c3; color: #ca8a04; }
.rh-fr-e-ok { border-left-color: #16a34a; }
/* grupos de la ficha: siempre filas completas (6 grupos → 3+3, 6 o 2+2+2) */
.rh-fgrupos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1900px) { .rh-fgrupos { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1050px) { .rh-fgrupos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rh-fgrupos { grid-template-columns: 1fr; } }

/* ficha: varios contratos en alta a la vez */
.rh-fcontratos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); border-radius: 12px; padding: 7px 10px; }
.rh-fcontratos > span { font-size: .78rem; font-weight: 800; color: #fff; margin-right: 4px; }
.rh-fcontratos button { border: 1px solid rgba(255,255,255,.55); background: transparent; color: #fff; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.rh-fcontratos button:hover { background: rgba(255,255,255,.15); }
.rh-fcontratos button.rh-on { background: #fff; color: #0f172a; border-color: #fff; }
.rh-fcontratos button small { opacity: .75; font-weight: 600; }
.rh-fcasa-sec { margin-top: 3px; color: #1e3a8a !important; }
.rh-fcasa-sec b { font-size: .76rem !important; color: inherit !important; }

/* INC-00066/00075: bloque de ausencias de Sage y periodos de la ficha */
.rh-sec-t { margin: 22px 0 10px !important; font-size: 1rem; font-weight: 800; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rh-sec-t small { font-size: .74rem; font-weight: 600; color: var(--rh-muted); }
.rh-fperiodos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); border-radius: 12px; padding: 7px 10px; }
.rh-fperiodos > span { font-size: .78rem; font-weight: 800; color: #fff; margin-right: 4px; }
.rh-fperiodos .rh-mini { background: rgba(255,255,255,.92); }
.rh-fperiodos .rh-mini small { color: #64748b; }
.rh-t tr.rh-tenue td { color: #94a3b8; }
.rh-fr-medico { --t: #d6407e; --tf: #fcebf2; } .rh-fr-libre, .rh-fr-permisos { --t: #eb6834; --tf: #fdeee7; }
.rh-rr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rh-fcorreo { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.rh-correo { display: grid; gap: 10px; padding: 4px 2px; }
.rh-correo label { display: grid; gap: 4px; font-size: .74rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.rh-correo input, .rh-correo textarea { font: inherit; font-size: .9rem; text-transform: none; letter-spacing: 0; color: #0f172a; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; font-weight: 400; }
.rh-correo textarea { resize: vertical; line-height: 1.5; }
.rh-correo-acc { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.rh-btn-p { background: #b4000c !important; color: #fff !important; border-color: #b4000c !important; }
.rh-sil-ok { background: #dcfce7 !important; color: #166534 !important; } .rh-sil-mal { background: #fee2e2 !important; color: #991b1b !important; }
.rh-sil-aviso { background: #fef3c7 !important; color: #92400e !important; } .rh-sil-gris { background: #f1f5f9 !important; color: #64748b !important; }
.rh-sil-txt { white-space: pre-wrap; font-size: .74rem; max-width: 760px; max-height: 320px; overflow: auto; background: #f8fafc; padding: 8px; border-radius: 8px; }

/* ficha del empleado › Gestión de sustituciones (filas que abren la incidencia) */
.rh-t tr.rh-clic { cursor: pointer; }
.rh-t tr.rh-clic:hover td { background: #f1f6fd; }

/* INC-00197: periodos en la empresa agrupados por ficha de Sage */
.rh-fper-g { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; padding: 4px 0; border-top: 1px dashed rgba(255,255,255,.35); }
.rh-fper-g > b { font-size: .74rem; color: #fff; margin-right: 4px; }

/* INC-00265: coste hora empresa en la ficha (sexta tarjeta del salario) */
.rh-fsal:has(.rh-fsal-ch) { grid-template-columns: 1.3fr repeat(5, 1fr); }
@media (max-width: 1280px) { .rh-fsal:has(.rh-fsal-ch) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .rh-fsal:has(.rh-fsal-ch) { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.rh-fsal > .rh-fsal-ch { background: linear-gradient(135deg, #eff6ff, #fff); border-color: #bfdbfe; cursor: help; } .rh-fsal-ch > b { color: #1d4ed8; }

/* INC-00370: con la tarjeta de coste anual proyectado son 7: la fila se reparte sola */
.rh-fsal:has(.rh-fsal-proy) { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.rh-fsal-proy b { color: #0b6e5b; }

/* INC-00371 (Susana): centro y categoría grandes en la cabecera de la ficha, y DNI con copia rápida */
.rh-fid .rh-fcentro { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 6px 0 2px; }
.rh-fid .rh-fcentro span { font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; }
.rh-fid .rh-fcentro span i { opacity: .7; font-size: .9em; margin-right: 4px; }
.rh-fid .rh-fcentro small { font-size: .78rem; opacity: .8; }

/* INC-00414 (alex, 22/10/2026): el cuadro de mando en el móvil — cabecera compacta, filtros plegados y cada fila de las tablas como una tarjeta */
.rh-f-toggle { display: none; }
@container rh (max-width: 640px) {
  .rh-tit { align-items: flex-start; } .rh-tit-ico { flex: none; width: 40px; height: 40px; font-size: 1rem; }
  .rh-tit h2 { font-size: 1.15rem; } .rh-tit p { font-size: .72rem; }
  .rh-head-r { width: 100%; justify-content: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .rh-head-r > .rh-ctl:first-child, .rh-head-r > .rh-btn { grid-column: 1 / -1; }
  .rh-ctl { min-width: 0; } .rh-ctl input[type=date] { min-width: 0; width: 100%; }
  .rh-f-toggle { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; font: inherit; font-weight: 800; font-size: .88rem; color: var(--rh-ink); padding: 2px 0; cursor: pointer; }
  .rh-f-toggle b { background: #b4000c; color: #fff; border-radius: 999px; padding: 0 7px; font-size: .72rem; }
  .rh-f-toggle .fa-chevron-down { margin-left: auto; transition: transform .2s; }
  .rh-f-abierto .rh-f-toggle .fa-chevron-down { transform: rotate(180deg); }
  .rh-filtros:not(.rh-f-abierto) .rh-f-fila { display: none; }
  .rh-filtros:not(.rh-f-abierto) .rh-chips .rh-hint { display: none; }
  .rh-f-abierto .rh-f-fila { margin-top: 10px; }
  .rh-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .rh-tabs button { flex: none; }
  .rh-tw { border: 0; overflow-x: hidden; max-height: none !important; }
  .rh-t, .rh-t tbody { display: block; width: 100%; }
  .rh-t thead { display: none; }
  .rh-t tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--rh-line); border-radius: 12px; background: #fff; }
  .rh-t td { display: flex; flex-direction: column; min-width: 0; border: 0 !important; padding: 0 !important; text-align: left !important; font-size: .8rem; white-space: normal; overflow-wrap: anywhere; }
  .rh-t td::before { content: attr(data-l); font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--rh-muted); }
  .rh-t td:first-child { grid-column: 1 / -1; display: block; font-size: .95rem; }
  .rh-t td:first-child::before, .rh-t td.rh-nada::before { display: none; }
  .rh-t td.rh-nada { grid-column: 1 / -1; text-align: center !important; }
  .rh-t tr:has(td.rh-nada) { border: 0; background: none; }
  .rh-tabla-h { flex-wrap: wrap; }
}
/* INC-00553: filtros con buscador (Tom Select) con el mismo aspecto que los desplegables */
.rh-f .ts-wrapper { min-width: 0; }
.rh-f .ts-wrapper .ts-control { min-height: 34px; border: 1px solid var(--rh-line); border-radius: 9px; padding: 6px 8px; font-size: .82rem; box-shadow: none; }
.rh-f .ts-wrapper.rh-on .ts-control { border-color: var(--rh-s1); box-shadow: 0 0 0 3px rgba(42,120,214,.14); font-weight: 700; }
.rh-f .ts-wrapper.focus .ts-control { border-color: var(--rh-s1); }
.ts-dropdown.rh-ts { z-index: 3000; font-size: .82rem; border-radius: 9px; min-width: 280px; }
.rh-f .ts-wrapper .ts-control, .rh-f .ts-wrapper .ts-control input, .rh-f .ts-wrapper .ts-control .item { font-size: .82rem !important; line-height: 1.25; }   /* style.css pone .ts-control a 1.15rem !important */
.rh-f .ts-wrapper .ts-control { flex-wrap: nowrap; overflow: hidden; }
.rh-f .ts-wrapper .ts-control .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ts-dropdown.rh-ts .option { padding: 6px 10px; }

/* INC-00591: índice orientativo compacto en la cabecera de la ficha y distancia casa-trabajo */
.rh-findice { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 14px; background: rgba(255,255,255,.94); color: #0f172a; margin-left: auto; cursor: help; align-self: flex-start; }
.rh-findice-g { display: flex; }
.rh-findice .rh-gauge { width: 86px; }
.rh-findice small { font-size: .72rem; line-height: 1.15; color: #475569; font-weight: 600; }
.rh-fdist { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.18); font-weight: 600; }

/* INC-00590: explicación del periodo y opciones del listado de empleados */
.rh-periodo-exp { margin: 6px 0 10px; padding: 8px 12px; border-radius: 10px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; font-size: .84rem; line-height: 1.5; }
.rh-emp-ops { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; margin-top: 10px; }
.rh-emp-campos { flex: 1; min-width: 280px; border: 1px solid var(--rh-line, #e2e8f0); border-radius: 10px; padding: 6px 10px; background: #fff; }
.rh-emp-campos summary { cursor: pointer; font-weight: 600; font-size: .86rem; }
.rh-emp-campos > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; margin: 8px 0; font-size: .84rem; }
.rh-emp-campos label { display: flex; gap: 6px; align-items: center; }

/* INC-00629: notas de Sage del contrato */
.rh-nota-sage { margin-top: 6px; padding: 6px 10px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; font-size: .8rem; color: #78350f; line-height: 1.4; }
/* INC-00090: documento informativo del contrato (gasca_rrhh.js · docContrato) */
.rh-doc-modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.rh-doc-box { background: #fff; border-radius: 14px; padding: 18px 20px; width: min(620px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.rh-doc-box h3 { margin: 0 0 6px; } .rh-doc-n { color: #64748b; font-size: .85rem; margin: 6px 0; }
.rh-doc-box label { display: block; margin: 10px 0; font-weight: 600; } .rh-doc-box select { width: 100%; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; margin-top: 4px; }
.rh-doc-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; } .rh-doc-box dt { color: #64748b; } .rh-doc-box dd { margin: 0; }
.rh-doc-acc { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
/* INC-00952 (Hugo): ficha del empleado en el móvil, los botones de la cabecera se salían por la derecha */
@media (max-width: 640px) {
  .rh-fhero { padding: 14px; }
  .rh-fhero-top { flex-wrap: wrap; }
  .rh-fhero-top > .rh-fid { flex: 1 1 100%; }
  .rh-findice { margin-left: 0; }
  .rh-fhero-acc { justify-content: flex-start; width: 100%; }
  .rh-fhero-acc .rh-btn { flex: 1 1 auto; justify-content: center; }
  .rh-fhero .rh-fcopy, .rh-fhero .rh-mini, .rh-fhero .rh-pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; height: auto; }
  .rh-fid h3 { font-size: 1.15rem; }
}
