/* HDI_V5_CAMBIOS_PDF_GNP_20260828
   Fuente: Cambios HDI.pdf
   Paleta: #006a34 #ec1c24 #54a264 #e2f3e3
*/
:root{
  --hdi-v5-green:#006a34;
  --hdi-v5-red:#ec1c24;
  --hdi-v5-soft-green:#54a264;
  --hdi-v5-pale:#e2f3e3;
  --hdi-v5-text:#17352a;
}

/* Branding general */
body:not(.hdi-v5-portada-principal) .sidebar,
body:not(.hdi-v5-portada-principal) .navbar-side,
body:not(.hdi-v5-portada-principal) .side-menu,
body:not(.hdi-v5-portada-principal) .gnp-sidebar,
body:not(.hdi-v5-portada-principal) .pt-sidebar{
  background:var(--hdi-v5-green)!important;
}

body:not(.hdi-v5-portada-principal) .sidebar::after,
body:not(.hdi-v5-portada-principal) .navbar-side::after,
body:not(.hdi-v5-portada-principal) .gnp-sidebar::after,
body:not(.hdi-v5-portada-principal) .pt-sidebar::after{
  background:var(--hdi-v5-red)!important;
}

/* Separadores y acentos rojos solicitados */
body:not(.hdi-v5-portada-principal) .sidebar .nav-link i,
body:not(.hdi-v5-portada-principal) .side-menu i,
body:not(.hdi-v5-portada-principal) .gnp-sidebar i,
body:not(.hdi-v5-portada-principal) .pt-sidebar i,
body:not(.hdi-v5-portada-principal) .section-kicker i,
body:not(.hdi-v5-portada-principal) .pt-section-kicker i{
  color:var(--hdi-v5-red)!important;
}

/* Cedulas: iconos de modulos homologados en verde */
.pt-module-card i,
.pt-module-card__icon,
.pt-module-tile i,
.gnp-module-card i,
.gnp-module-card__icon,
[data-pt-module] > i,
[data-pt-module] .fa,
[data-pt-module] .fas,
[data-pt-module] .far{
  color:var(--hdi-v5-green)!important;
}
.pt-module-card__icon,
.gnp-module-card__icon,
.pt-module-tile__icon{
  background:var(--hdi-v5-pale)!important;
  border-color:rgba(0,106,52,.2)!important;
}

/* Iconos naranjas del editor/header -> rojo HDI */
.gnp-editor-hero i,
.pt-editor-hero i,
.gnp-panel-header > i,
.pt-panel-header > i,
.gnp-header-icon,
.pt-header-icon{
  color:var(--hdi-v5-red)!important;
}
.gnp-editor-hero .icon,
.pt-editor-hero .icon,
.gnp-panel-header > .icon,
.pt-panel-header > .icon{
  background:var(--hdi-v5-red)!important;
  color:#fff!important;
}

/* Portal asegurado: texto gris sobre hero pasa a blanco */
body:not(.hdi-v5-portada-principal) .pdd-portal-hero p,
body:not(.hdi-v5-portada-principal) .pdd-portal-hero small,
body:not(.hdi-v5-portada-principal) .pdd-portal-hero .text-muted,
body:not(.hdi-v5-portada-principal) .pt-v627-mobile-hero p,
body:not(.hdi-v5-portada-principal) .pt-v627-mobile-hero small,
body:not(.hdi-v5-portada-principal) .portal-hero p,
body:not(.hdi-v5-portada-principal) .portal-hero small{
  color:#fff!important;
  opacity:.94!important;
}

/* Dashboard: tonos mas claros conservando identidad HDI */
.pt-dashboard-card,
.dashboard-card,
.gnp-dashboard-card,
.card.pt-report-card{
  border-color:rgba(84,162,100,.32)!important;
}
.pt-dashboard-card .card-header,
.dashboard-card .card-header,
.gnp-dashboard-card .card-header,
.pt-report-card .card-header{
  background:linear-gradient(135deg,rgba(226,243,227,.96),rgba(255,255,255,.98))!important;
  color:var(--hdi-v5-green)!important;
}

/* Documentos: contraste de acciones */
.gnp-file-action,
.pt-v625-doc-action,
.pt-v625-view-doc,
.pdd-download-button,
.hdi-v5-doc-action{
  border-color:rgba(0,106,52,.25)!important;
}
.gnp-file-preview,
.pt-v625-view-doc,
.pdd-view-button{
  background:var(--hdi-v5-pale)!important;
  color:var(--hdi-v5-green)!important;
}
.gnp-file-actions a[title*="Descargar"],
.gnp-file-actions a[aria-label*="Descargar"],
.pt-v625-doc-actions a[title*="Descargar"]{
  background:#fff!important;
  color:var(--hdi-v5-green)!important;
}
.gnp-file-validate,
.pt-v625-doc-validate,
.is-valid .pt-v625-doc-status{
  background:var(--hdi-v5-green)!important;
  color:#fff!important;
}
.gnp-file-delete,
.pt-v625-doc-delete,
button[title="Eliminar documento"],
button[aria-label="Eliminar documento"]{
  background:#fff0f0!important;
  color:var(--hdi-v5-red)!important;
  border-color:rgba(236,28,36,.25)!important;
}

/* Checklist HDI V5 */
.hdi-v5-doc-matrix{display:grid;gap:10px;min-width:0}
.hdi-v5-doc-context{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px;border:1px solid rgba(0,106,52,.18);border-radius:12px;background:var(--hdi-v5-pale);color:var(--hdi-v5-green);font-size:.86rem;font-weight:700}
.hdi-v5-doc-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px;border:1px solid rgba(0,106,52,.16);border-radius:12px;background:#fff;min-width:0}
.hdi-v5-doc-row__copy{min-width:0}
.hdi-v5-doc-row__copy strong{display:block;color:#15382b;line-height:1.25}
.hdi-v5-doc-row__copy small{display:block;margin-top:4px;color:#66756f;line-height:1.35}
.hdi-v5-doc-status{min-width:76px;text-align:center;border-radius:999px;padding:6px 10px;font-weight:800;font-size:.78rem;white-space:nowrap;background:#f4f7f5;color:#65736d;border:1px solid #d9e2dd}
.hdi-v5-doc-status.is-received{background:var(--hdi-v5-pale);color:var(--hdi-v5-green);border-color:rgba(0,106,52,.22)}
.hdi-v5-doc-status.is-valid{background:var(--hdi-v5-green);color:#fff;border-color:var(--hdi-v5-green)}
.hdi-v5-doc-extra{border-left:4px solid var(--hdi-v5-red)}

/* Numero de serie en barra superior */
.hdi-v5-top-serial{display:flex!important;align-items:center!important;gap:9px!important;min-width:0!important}
.hdi-v5-top-serial i{color:var(--hdi-v5-red)!important}
.hdi-v5-top-serial span{display:block;font-size:.72rem;opacity:.78}
.hdi-v5-top-serial strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:280px}

/* DataTables: length izquierda, busqueda centrada, spacer derecha */
.dataTables_wrapper .hdi-v5-dt-toolbar,
.dataTables_wrapper > .row:first-child,
.pt-datatable-toolbar{
  display:grid!important;
  grid-template-columns:minmax(120px,1fr) minmax(280px,640px) minmax(120px,1fr)!important;
  align-items:center!important;
  gap:12px!important;
}
.dataTables_wrapper .dataTables_length{justify-self:start!important;margin:0!important}
.dataTables_wrapper .dataTables_filter{justify-self:center!important;width:100%!important;margin:0!important;text-align:center!important}
.dataTables_wrapper .dataTables_filter label{display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;width:100%!important;margin:0!important}
.dataTables_wrapper .dataTables_filter input{width:min(100%,520px)!important;min-width:0!important;margin-left:0!important}
.dataTables_wrapper .dataTables_paginate{display:flex!important;flex-wrap:wrap!important;gap:4px!important;align-items:center!important;justify-content:flex-end!important}

/* SweetAlert sobre modales */
.swal2-container{z-index:20050!important}
.swal2-popup{max-width:min(92vw,520px)!important}

/* Footer de modales y botones: nunca encimados */
.modal-footer,
.pt-module-window__footer,
.gnp-modal-footer,
.pdd-portal-modal-footer{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  align-items:center!important;
}
.modal-footer > *,
.pt-module-window__footer > *,
.gnp-modal-footer > *,
.pdd-portal-modal-footer > *{margin:0!important}

/* Documentos mobile / viewer */
#pt-module-documentos,
#pt-module-documentos .pt-module-window__body,
.pt-module-window[data-pt-module-window="documentos"],
.pt-module-window[data-pt-module-window="documentos"] .pt-module-window__body,
#documentos,
#documentos .pdd-portal-modal-panel__body{min-width:0!important;max-width:100%!important}
.gnp-file-card,
.pt-v625-doc-card,
.pdd-document-card{min-width:0!important;max-width:100%!important}
.gnp-file-actions,
.pt-v625-doc-actions{display:flex!important;flex-wrap:wrap!important;gap:7px!important}
#ptV631ViewerFrame,
#gnpDocumentoPreviewModal iframe,
.pt-document-viewer iframe{max-width:100%!important;width:100%!important}

/* WhatsApp SIEMPRE conserva verde de marca */
.fa-whatsapp,
[class*="whatsapp" i] .fa-whatsapp,
#gnp_whatsapp_cliente,
.whatsapp-button,
.btn-whatsapp,
a[href*="wa.me"]{
  --whatsapp-green:#25D366;
}
.fa-whatsapp{color:#25D366!important}
.whatsapp-button,.btn-whatsapp,a[href*="wa.me"].btn{background:#25D366!important;border-color:#25D366!important;color:#fff!important}

@media(max-width:767.98px){
  .dataTables_wrapper .hdi-v5-dt-toolbar,
  .dataTables_wrapper > .row:first-child,
  .pt-datatable-toolbar{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:10px!important}
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter{width:100%!important;justify-self:stretch!important;text-align:left!important}
  .dataTables_wrapper .dataTables_filter label{justify-content:stretch!important;flex-wrap:wrap!important}
  .dataTables_wrapper .dataTables_filter input{width:100%!important;max-width:none!important}
  .dataTables_wrapper .dataTables_paginate{justify-content:center!important;width:100%!important}
  .hdi-v5-doc-row{grid-template-columns:1fr!important}
  .hdi-v5-doc-status{justify-self:start!important}
  .hdi-v5-top-serial strong{max-width:190px}
}

@media(max-width:575.98px){
  .modal-footer,
  .pt-module-window__footer,
  .gnp-modal-footer,
  .pdd-portal-modal-footer{flex-direction:column!important;align-items:stretch!important}
  .modal-footer > .btn,
  .modal-footer > button,
  .modal-footer > a,
  .pt-module-window__footer > .btn,
  .pt-module-window__footer > button,
  .gnp-modal-footer > .btn,
  .gnp-modal-footer > button,
  .pdd-portal-modal-footer > button,
  .pdd-portal-modal-footer > a{width:100%!important;max-width:100%!important;min-height:44px!important}
  #pt-module-documentos .pt-module-window__body,
  .pt-module-window[data-pt-module-window="documentos"] .pt-module-window__body,
  #documentos .pdd-portal-modal-panel__body{padding-left:10px!important;padding-right:10px!important;overflow-x:hidden!important}
  .hdi-v3-formatos__grid{grid-template-columns:1fr!important}
  .hdi-v3-formato__actions{display:grid!important;grid-template-columns:1fr!important}
  .hdi-v3-formato__actions a{width:100%!important}
}
