/* Operaciones de RRHH: grupos amplios y acciones alineadas. */
.workspace-payroll{--rrhh-blue:#1d4ed8;--rrhh-teal:#087f8c;--rrhh-amber:#955400;--rrhh-green:#17653a;--rrhh-red:#ad2535}
.workspace-payroll .rrhh-dashboard{display:grid;gap:20px;min-width:0}
.workspace-payroll .rrhh-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.workspace-payroll .rrhh-kpi{position:relative;display:flex;flex-direction:column;gap:10px;padding:22px;border:1px solid var(--border);border-top:4px solid var(--rrhh-blue);border-radius:16px;background:linear-gradient(135deg,color-mix(in srgb,var(--rrhh-blue) 7%,var(--surface)),var(--surface));min-width:0}
.workspace-payroll .rrhh-accent-teal{border-top-color:var(--rrhh-teal);background:linear-gradient(135deg,color-mix(in srgb,var(--rrhh-teal) 8%,var(--surface)),var(--surface))}
.workspace-payroll .rrhh-accent-amber{border-top-color:var(--rrhh-amber);background:linear-gradient(135deg,color-mix(in srgb,var(--rrhh-amber) 8%,var(--surface)),var(--surface))}
.workspace-payroll .rrhh-kpi-label{font-size:13px;font-weight:650;color:var(--muted)}
.workspace-payroll .rrhh-kpi-value{font-size:clamp(22px,2.3vw,32px);line-height:1.2;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.workspace-payroll .rrhh-kpi-detail{font-size:12px;color:var(--muted);line-height:1.5}
.workspace-payroll .rrhh-kpi-link{align-self:flex-start;margin-top:auto;background:transparent;color:var(--rrhh-blue);padding:5px 0;border:0;font-weight:650;min-height:32px}
.workspace-payroll .rrhh-dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}
.workspace-payroll .rrhh-dashboard-panel{min-width:0;margin:0;border-radius:16px;padding:22px}
.workspace-payroll .rrhh-dashboard-panel h3{margin:0 0 16px;font-size:17px}
.workspace-payroll .rrhh-progress{height:8px;background:var(--border);border-radius:8px;overflow:hidden;margin:14px 0}
.workspace-payroll .rrhh-progress>span{display:block;height:100%;background:linear-gradient(90deg,var(--rrhh-blue),var(--rrhh-teal));border-radius:inherit}
.workspace-payroll .rrhh-flow,.workspace-payroll .rrhh-agenda{list-style:none;padding:0;margin:0}
.workspace-payroll .rrhh-flow li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--border);font-size:14px}
.workspace-payroll .rrhh-flow-number{flex:none;color:var(--muted);font-variant-numeric:tabular-nums}
.workspace-payroll .rrhh-flow-name{flex:1;text-align:left}
.workspace-payroll .rrhh-flow li.is-actionable{padding:0}
.workspace-payroll .rrhh-flow-action{display:flex;align-items:center;gap:12px;width:100%;min-height:48px;padding:11px 4px;border:0;border-radius:6px;background:transparent;color:inherit;font:inherit;cursor:pointer}
.workspace-payroll .rrhh-flow-action:hover{background:color-mix(in srgb,var(--rrhh-blue) 7%,var(--surface))}
.workspace-payroll .rrhh-flow-action:hover .rrhh-flow-name{text-decoration:underline}
.workspace-payroll .rrhh-flow-action:focus-visible{outline:2px solid var(--rrhh-blue);outline-offset:2px}
.workspace-payroll .rrhh-status{display:inline-flex;align-items:center;gap:6px;border-radius:99px;padding:5px 10px;font-size:12px;font-weight:650;line-height:1.4;white-space:nowrap;color:var(--muted);background:color-mix(in srgb,var(--muted) 10%,var(--surface))}
.workspace-payroll .rrhh-status::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}
.workspace-payroll .rrhh-success{color:var(--rrhh-green);background:color-mix(in srgb,var(--rrhh-green) 9%,var(--surface))}
.workspace-payroll .rrhh-warning{color:var(--rrhh-amber);background:color-mix(in srgb,var(--rrhh-amber) 9%,var(--surface))}
.workspace-payroll .rrhh-danger{color:var(--rrhh-red);background:color-mix(in srgb,var(--rrhh-red) 8%,var(--surface))}
.workspace-payroll .rrhh-info{color:var(--rrhh-blue);background:color-mix(in srgb,var(--rrhh-blue) 9%,var(--surface))}
.workspace-payroll .rrhh-alert{border-left:3px solid currentColor;border-radius:8px;padding:12px 15px;margin:10px 0;font-size:13px;line-height:1.5}
.workspace-payroll .rrhh-alert p{margin:5px 0 0;overflow-wrap:anywhere}
.workspace-payroll .rrhh-payment-note{font-size:14px;font-weight:600}
.workspace-payroll .rrhh-state-list{display:flex;flex-wrap:wrap;gap:12px}
.workspace-payroll .rrhh-state-list>div{display:flex;gap:12px;align-items:center;padding:10px;border:1px solid var(--border);border-radius:12px}
.workspace-payroll .rrhh-agenda li{display:flex;align-items:center;gap:16px;border-bottom:1px solid var(--border);padding:15px 0}
.workspace-payroll .rrhh-agenda time{font-size:12px;font-weight:650;color:var(--rrhh-blue);font-variant-numeric:tabular-nums}
.workspace-payroll .rrhh-agenda li>div{display:grid;gap:5px;flex:1;min-width:0;font-size:13px;overflow-wrap:anywhere}
.workspace-payroll .rrhh-agenda small{color:var(--muted)}
.workspace-payroll table tbody tr:nth-child(even){background:color-mix(in srgb,var(--rrhh-blue) 3%,var(--surface))}
.workspace-payroll table thead th{background:color-mix(in srgb,var(--rrhh-blue) 7%,var(--surface))}
.workspace-payroll .rrhh-grupo:nth-child(3n+1){border-left:4px solid var(--rrhh-blue)}
.workspace-payroll .rrhh-grupo:nth-child(3n+2){border-left:4px solid var(--rrhh-teal)}
.workspace-payroll .rrhh-grupo:nth-child(3n){border-left:4px solid var(--rrhh-amber)}
:root[data-tema="oscuro"] .workspace-payroll,[data-theme="dark"] .workspace-payroll{--rrhh-blue:#9bbcff;--rrhh-teal:#65d5db;--rrhh-amber:#f4c76f;--rrhh-green:#85dda7;--rrhh-red:#ff9daa}
.ficha-trabajador .workspace-tabs{gap:8px;padding:8px;background:color-mix(in srgb,#2563eb 5%,var(--surface));border-radius:12px;flex-wrap:wrap}
.ficha-trabajador .workspace-tabs button.active{background:#1d4ed8;color:#fff;border-color:#1d4ed8}
.workspace-payroll button:focus-visible,.ficha-trabajador .workspace-tabs button:focus-visible{outline:3px solid var(--rrhh-blue,#2563eb);outline-offset:3px}
@media(max-width:1100px){.workspace-payroll .rrhh-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.workspace-payroll .rrhh-dashboard-grid{grid-template-columns:minmax(0,1fr)}.workspace-payroll .rrhh-kpi,.workspace-payroll .rrhh-dashboard-panel{padding:16px}.workspace-payroll .rrhh-agenda li{flex-wrap:wrap}.workspace-payroll .rrhh-kpi-value{font-size:24px}}
@media(max-width:480px){.workspace-payroll .rrhh-kpis{grid-template-columns:minmax(0,1fr)}.workspace-payroll .rrhh-kpi-value{overflow-wrap:normal;font-size:24px}}
@media(prefers-reduced-motion:reduce){.workspace-payroll .rrhh-dashboard *{animation:none!important;transition:none!important}}
.workspace-payroll .rrhh-grupos{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.workspace-payroll details.rrhh-grupo{padding:0;overflow:hidden;background:var(--surface);border:1px solid var(--border);border-radius:12px}
.workspace-payroll .rrhh-grupo-resumen{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 24px;cursor:pointer;list-style:none}
.workspace-payroll .rrhh-grupo-resumen::-webkit-details-marker{display:none}
.workspace-payroll .rrhh-grupo-resumen::after{content:'+';font-size:24px;flex-shrink:0}
.workspace-payroll .rrhh-grupo[open]>.rrhh-grupo-resumen::after{content:'−'}
.workspace-payroll .rrhh-grupo-resumen>span:first-child{flex:1;min-width:0}
.workspace-payroll .rrhh-grupo-titulo{display:block;font-size:16px;font-weight:650;line-height:1.5}
.workspace-payroll .rrhh-grupo-ayuda{display:block;margin-top:4px;font-size:13px;line-height:1.5;color:var(--muted)}
.workspace-payroll .rrhh-grupo-cantidad{font-size:12px;color:var(--muted);white-space:nowrap}
.workspace-payroll .rrhh-grupo-botones{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:4px 24px 24px;align-items:stretch}
.workspace-payroll .rrhh-grupo-botones button{width:100%;min-width:0;min-height:48px;margin:0;padding:12px 16px;white-space:normal;text-align:left;line-height:1.5;overflow-wrap:anywhere}
.workspace-payroll .rrhh-grupo-resumen:focus-visible{outline:2px solid var(--primary,#2563eb);outline-offset:-4px}
@media(max-width:760px){
  .workspace-payroll .rrhh-grupo-resumen{padding:16px;gap:12px}
  .workspace-payroll .rrhh-grupo-botones{grid-template-columns:minmax(0,1fr);padding:0 16px 16px}
  .workspace-payroll .rrhh-grupo-cantidad{display:none}
}

.worker-novelty-form .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px}
.worker-novelty-form .form-draft-banner{grid-column:1/-1}
.worker-novelties{min-width:0}
@media(max-width:740px){.worker-novelty-form .form-grid{grid-template-columns:minmax(0,1fr)!important}}

/* Personas y contratos: lectura completa, sin encerrar la lista en una altura fija. */
@media(min-width:1101px){
  #view .workspace-payroll:has(.rrhh-contracts) .ordered-layout{grid-template-columns:minmax(0,1fr)}
  #view .workspace-payroll:has(.rrhh-contracts) .module-section-nav{position:static;display:flex!important;flex-wrap:wrap;gap:24px}
  #view .workspace-payroll:has(.rrhh-contracts) .module-nav-group{display:flex;flex-wrap:wrap;gap:8px;margin:0}
  #view .workspace-payroll:has(.rrhh-contracts) .module-nav-group h3{width:100%}
  #view .workspace-payroll:has(.rrhh-contracts) .module-nav-group button{width:auto;margin:0}
}
#view .rrhh-contracts .grid-scroll{max-height:none!important}
#view .rrhh-contracts .datagrid table{table-layout:fixed;width:100%;min-width:1240px}
#view .rrhh-contracts th[data-column=rut_trabajador]{width:130px}
#view .rrhh-contracts th[data-column=nombre_trabajador]{width:260px}
#view .rrhh-contracts th[data-column=fecha_ingreso]{width:115px}
#view .rrhh-contracts th[data-column=cargo]{width:225px}
#view .rrhh-contracts th[data-column=sueldo_base]{width:130px}
#view .rrhh-contracts th[data-column=estado]{width:120px}
#view .rrhh-contracts th:last-child{width:260px}
#view .rrhh-contracts .datagrid :is(th,td){padding:14px 16px!important;height:auto;white-space:nowrap}
#view .rrhh-contracts .datagrid td{height:64px}
#view .rrhh-contracts td:is([data-column=nombre_trabajador],[data-column=cargo]){white-space:normal;overflow-wrap:anywhere}
#view .rrhh-contracts .grid-actions>button{min-height:38px;white-space:nowrap}
#view .rrhh-contracts .row-menu[open] .row-menu-items{position:static;box-shadow:none;margin-top:8px}
#view .rrhh-contracts .grid-actions:has(.row-menu[open]){align-items:flex-start}
