/* JH Technology People 1.4.5
 * Centro operativo premium. Composición propia; valores visuales provienen del Design System.
 */

.jht-people-shell{
  display:grid;
  gap:20px;
}

.jht-people-shell > .jht-page-heading{
  align-items:center;
  gap:24px;
  margin:0;
  padding-bottom:2px;
}
.jht-people-shell > .jht-page-heading > div:first-child{
  min-width:0;
}
.jht-people-shell > .jht-page-heading h2{
  margin-top:5px;
}
.jht-people-shell > .jht-page-heading p{
  max-width:720px;
  margin:7px 0 0;
  color:var(--jht-muted);
}
.jht-people-shell > .jht-page-heading .jht-page-actions{
  flex:0 0 auto;
}

/* Acción principal: compacta, institucional y menos tipo píldora. */
.jht-people-create-trigger{
  min-height:min(var(--jht-button-height,42px),42px)!important;
  padding-inline:min(var(--jht-button-padding-x,16px),15px)!important;
  border-radius:min(var(--jht-button-radius,12px),10px)!important;
}

/* Una sola banda de métricas, no cinco tarjetas flotantes. */
.jht-people-shell .jht-people-stats{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:0;
  margin:0;
  overflow:hidden;
  border:1px solid var(--jht-border);
  border-radius:min(var(--jht-card-radius,14px),14px);
  background:var(--jht-surface);
  box-shadow:var(--jht-shadow-xs);
}
.jht-people-shell .jht-people-stats .jht-stat{
  min-width:0;
  padding:15px 18px;
  border:0;
  border-right:1px solid var(--jht-border);
  border-radius:0;
  background:transparent;
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
.jht-people-shell .jht-people-stats .jht-stat:last-child{
  border-right:0;
}
.jht-people-shell .jht-people-stats .jht-stat:hover{
  border-color:var(--jht-border);
  box-shadow:none;
  transform:none;
  background:var(--jht-surface-2);
}
.jht-people-shell .jht-people-stats .jht-stat-label{
  margin-bottom:7px;
  font-size:10px;
  letter-spacing:.08em;
}
.jht-people-shell .jht-people-stats .jht-stat-value{
  font-size:25px;
  letter-spacing:-.04em;
}
.jht-people-shell .jht-people-stats .jht-stat-meta{
  margin-top:4px;
  font-size:11px;
}

/* Navegación de Personas: línea editorial, no botones redondos. */
.jht-people-tabs{
  display:flex;
  align-items:center;
  gap:22px!important;
  min-height:42px;
  margin:0;
  padding:0;
  overflow-x:auto;
  border-bottom:1px solid var(--jht-border);
}
.jht-people-tabs .jht-chip{
  position:relative;
  min-height:42px;
  padding:0 2px;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--jht-muted);
  box-shadow:none;
  font-weight:650;
}
.jht-people-tabs .jht-chip:hover{
  border:0;
  background:transparent;
  color:var(--jht-text);
  box-shadow:none;
  transform:none;
}
.jht-people-tabs .jht-chip.is-selected,
.jht-people-tabs .jht-chip[data-selected="true"]{
  border:0;
  background:transparent;
  color:var(--jht-text);
  box-shadow:none;
}
.jht-people-tabs .jht-chip.is-selected::after,
.jht-people-tabs .jht-chip[data-selected="true"]::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-1px;
  height:2px;
  border-radius:999px;
  background:var(--jht-primary);
}

/* Permisos: una caja administrativa sobria. */
.jht-people-permissions{
  margin:0;
  padding:18px 20px;
  border-radius:min(var(--jht-card-radius,14px),12px);
  background:var(--jht-surface);
  box-shadow:none;
}
.jht-people-permissions .jht-section-header{
  margin-bottom:12px;
}
.jht-people-permissions .jht-section-header h3{
  margin:0 0 4px;
}
.jht-people-permissions .jht-section-header p{
  margin:0;
  color:var(--jht-muted);
}
.jht-people-permissions .jht-form-grid{
  gap:7px 20px;
}
.jht-people-permissions .jht-page-actions{
  margin-top:12px;
}
.jht-people-permissions .jht-btn{
  min-height:min(var(--jht-button-height,42px),38px)!important;
  border-radius:min(var(--jht-button-radius,12px),9px)!important;
}

/* Buscador sin otra tarjeta grande alrededor. */
.jht-people-filter,
.jht-people-shell > form.jht-filter{
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.jht-people-filter:hover,
.jht-people-shell > form.jht-filter:hover{
  border-color:transparent;
  box-shadow:none;
}
.jht-people-filter .jht-page-actions,
.jht-people-shell > form.jht-filter .jht-page-actions{
  display:flex;
  align-items:end;
  justify-content:flex-start;
  gap:10px;
  margin:0;
}
.jht-people-filter label,
.jht-people-shell > form.jht-filter label{
  width:min(390px,100%);
}
.jht-people-filter .jht-filter-input,
.jht-people-shell > form.jht-filter .jht-input[type="search"]{
  width:100%;
  min-height:42px;
  border-radius:min(var(--jht-input-radius,14px),10px);
}
.jht-people-filter .jht-btn,
.jht-people-shell > form.jht-filter .jht-btn{
  min-height:min(var(--jht-button-height,42px),40px)!important;
  border-radius:min(var(--jht-button-radius,12px),9px)!important;
}

/* Directorio: una superficie única con filas, en vez de una nube de tarjetas. */
.jht-people-grid,
.jht-people-shell > .jht-module-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:0;
  align-items:stretch;
  overflow:hidden;
  border:1px solid var(--jht-border);
  border-radius:min(var(--jht-table-radius,14px),14px);
  background:var(--jht-surface);
  box-shadow:var(--jht-shadow-xs);
}
.jht-people-grid .jht-person-card,
.jht-people-shell > .jht-module-grid > .jht-person-card{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto auto;
  grid-template-rows:auto;
  align-items:center;
  gap:14px;
  width:100%;
  min-height:74px;
  margin:0;
  padding:13px 16px;
  border:0;
  border-bottom:1px solid var(--jht-border);
  border-radius:0;
  background:var(--jht-surface);
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
.jht-people-grid .jht-person-card:last-child,
.jht-people-shell > .jht-module-grid > .jht-person-card:last-child{
  border-bottom:0;
}
.jht-people-grid .jht-person-card:hover,
.jht-people-shell > .jht-module-grid > .jht-person-card:hover{
  border-color:var(--jht-border);
  background:var(--jht-surface-2);
  box-shadow:none;
  transform:none;
}
.jht-person-card-top{
  display:contents;
}
.jht-person-card-top .jht-module-card-icon{
  grid-column:1;
  width:var(--jht-icon-size,18px);
  height:var(--jht-icon-size,18px);
  min-width:var(--jht-icon-size,18px);
  min-height:var(--jht-icon-size,18px);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  justify-self:center;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:none!important;
  box-shadow:none!important;
  color:var(--jht-primary);
  line-height:0;
}
.jht-person-card-top .jht-badge{
  grid-column:3;
  justify-self:end;
}
.jht-person-card-body{
  grid-column:2;
  min-width:0;
  display:grid;
  gap:4px;
}
.jht-person-card-body h3{
  margin:0;
  font-size:14px;
  line-height:1.3;
  letter-spacing:-.015em;
}
.jht-person-card-body p{
  margin:0;
  color:var(--jht-muted);
  font-size:11.5px;
  line-height:1.5;
}
.jht-person-card-footer{
  grid-column:4;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  margin:0;
  padding:0;
  border:0;
}
.jht-person-card-action{
  min-height:34px!important;
  padding:0 10px!important;
  border-radius:min(var(--jht-button-radius,12px),8px)!important;
  color:var(--jht-primary)!important;
  box-shadow:none!important;
}
.jht-person-card-action:hover{
  transform:none!important;
}

/* Modales People: limpios, con jerarquía y sin cajas redondas anidadas. */
.jht-people-modal-dialog{
  max-height:calc(100vh - 32px);
  overflow:auto;
  border-radius:min(var(--jht-modal-radius,18px),16px)!important;
}
.jht-people-modal-head{
  display:grid;
  gap:6px;
  padding-right:46px;
  margin-bottom:18px;
}
.jht-people-modal-head h2{
  margin:0;
  font-size:clamp(1.35rem,2.6vw,1.85rem);
  line-height:1.08;
  letter-spacing:-.035em;
}
.jht-people-modal-head p{
  margin:0;
  color:var(--jht-muted);
  font-size:12.5px;
  line-height:1.55;
}
.jht-people-create-form{
  margin-top:14px;
}
.jht-people-create-form .jht-selection-grid{
  gap:11px 14px;
}
.jht-people-modal-actions{
  justify-content:flex-end;
  padding-top:14px;
  margin-top:4px;
  border-top:1px solid var(--jht-border);
}
.jht-people-modal-actions .jht-btn{
  border-radius:min(var(--jht-button-radius,12px),9px)!important;
}
.jht-people-icon{
  flex:0 0 auto;
}
.jht-people-create-trigger [data-jht-icon],
.jht-person-card-action [data-jht-icon],
.jht-people-modal-actions [data-jht-icon]{
  pointer-events:none;
}

/* Ficha modal. */
.jht-people-detail-dialog{
  width:min(980px,calc(100vw - 32px));
  max-width:980px;
  max-height:min(88vh,860px);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.jht-people-detail-head{
  flex:0 0 auto;
  margin-bottom:12px;
}
.jht-people-detail-body{
  min-height:180px;
  overflow:auto;
  overscroll-behavior:contain;
  padding-right:4px;
}
.jht-people-detail-loading{
  min-height:180px;
  display:grid;
  place-items:center;
  color:var(--jht-muted);
}
.jht-people-detail-modal .jht-view-shell{
  gap:14px;
}
.jht-people-detail-modal .jht-hero{
  padding:18px;
  border-radius:12px;
  box-shadow:none;
}
.jht-people-detail-modal .jht-hero h1{
  font-size:clamp(1.45rem,3vw,2rem);
}
.jht-people-detail-modal .jht-hero-actions .jht-btn-secondary:first-child{
  display:none;
}
.jht-people-detail-modal .jht-stat-grid{
  gap:0;
  overflow:hidden;
  border:1px solid var(--jht-border);
  border-radius:12px;
  background:var(--jht-surface);
}
.jht-people-detail-modal .jht-stat-grid .jht-stat{
  border:0;
  border-right:1px solid var(--jht-border);
  border-radius:0;
  box-shadow:none;
  background:transparent;
}
.jht-people-detail-modal .jht-stat-grid .jht-stat:last-child{
  border-right:0;
}
.jht-people-detail-modal .jht-form-section{
  margin:0;
  border-radius:12px;
  box-shadow:none;
}

@media (max-width:1100px){
  .jht-people-shell .jht-people-stats{grid-template-columns:repeat(3,minmax(0,1fr));}
  .jht-people-shell .jht-people-stats .jht-stat:nth-child(3n){border-right:0;}
  .jht-people-shell .jht-people-stats .jht-stat:nth-child(n+4){border-top:1px solid var(--jht-border);}
}
@media (max-width:760px){
  .jht-people-shell{gap:16px;}
  .jht-people-shell > .jht-page-heading{align-items:flex-start;flex-direction:column;}
  .jht-people-shell .jht-people-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
  .jht-people-shell .jht-people-stats .jht-stat{border-right:1px solid var(--jht-border);border-top:1px solid var(--jht-border);}
  .jht-people-shell .jht-people-stats .jht-stat:nth-child(-n+2){border-top:0;}
  .jht-people-shell .jht-people-stats .jht-stat:nth-child(2n){border-right:0;}
  .jht-people-tabs{gap:18px!important;}
  .jht-people-filter .jht-page-actions,
  .jht-people-shell > form.jht-filter .jht-page-actions{align-items:stretch;flex-direction:column;}
  .jht-people-filter label,
  .jht-people-shell > form.jht-filter label{width:100%;}
  .jht-people-grid .jht-person-card,
  .jht-people-shell > .jht-module-grid > .jht-person-card{
    grid-template-columns:24px minmax(0,1fr) auto;
    gap:10px 12px;
    padding:13px 14px;
  }
  .jht-person-card-top .jht-badge{grid-column:3;}
  .jht-person-card-footer{grid-column:2/4;justify-content:flex-start;}
  .jht-people-detail-dialog{width:calc(100vw - 20px);max-height:92vh;}
}
@media (max-width:480px){
  .jht-people-shell .jht-people-stats{grid-template-columns:1fr;}
  .jht-people-shell .jht-people-stats .jht-stat{border-right:0!important;border-top:1px solid var(--jht-border)!important;}
  .jht-people-shell .jht-people-stats .jht-stat:first-child{border-top:0!important;}
  .jht-people-grid .jht-person-card,
  .jht-people-shell > .jht-module-grid > .jht-person-card{grid-template-columns:24px minmax(0,1fr);}
  .jht-person-card-top .jht-badge{grid-column:2;grid-row:2;justify-self:start;}
  .jht-person-card-footer{grid-column:2;grid-row:3;}
}


/* NEXO: acción IA nativa junto al alta manual. */
.jht-people-shell > .jht-page-heading .jht-page-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px;
}
.jht-people-ai-trigger{
  min-height:min(var(--jht-button-height,42px),42px)!important;
  padding-inline:min(var(--jht-button-padding-x,16px),14px)!important;
  border-radius:min(var(--jht-button-radius,12px),10px)!important;
  white-space:nowrap;
}
.jht-people-ai-trigger [data-jht-icon]{
  color:currentColor;
  pointer-events:none;
}
@media (max-width:760px){
  .jht-people-shell > .jht-page-heading .jht-page-actions{
    width:100%;
    justify-content:flex-start;
  }
}
@media (max-width:480px){
  .jht-people-shell > .jht-page-heading .jht-page-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .jht-people-shell > .jht-page-heading .jht-page-actions .jht-btn{
    width:100%;
    justify-content:center;
    padding-inline:10px!important;
  }
}
