/* HControl Center WEB — R4.3.2 corrective UI layer
   Alcance: solo WEB HControl Center. Sin Control Center ni KORYTIVA.
   Objetivo: corregir desalineaciones visuales detectadas el 17/10/2026,
   mantener coherencia en Mac/Windows/navegadores y no alterar permisos.
*/
:root{
  --hcc432-red:#E23B33;
  --hcc432-red-hover:#C9342D;
  --hcc432-red-active:#AF2D28;
  --hcc432-ink:#172C45;
  --hcc432-muted:#5A6F87;
  --hcc432-line:#C8D4E2;
  --hcc432-line-soft:#DCE4EC;
  --hcc432-soft:#F6F8FB;
  --hcc432-radius:10px;
  --hcc432-card-radius:14px;
  --hcc432-control-h:40px;
}

/* === 1) PANEL DE CLIENTES: barra de vistas guardadas integrada y con cajón === */
body.authenticated #admin-view #productivity-clients .productivity-toolbar{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  margin-top:10px!important;
  padding:10px 12px!important;
  border:1px solid var(--hcc432-line-soft)!important;
  border-radius:12px!important;
  background:#fff!important;
  box-sizing:border-box!important;
}
body.authenticated #admin-view #productivity-clients .productivity-view-controls{
  display:flex!important;
  flex:1 1 360px!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
}
body.authenticated #admin-view #productivity-clients .productivity-view-controls .productivity-label{
  font-size:11px!important;
  font-weight:700!important;
  letter-spacing:.03em!important;
  text-transform:uppercase!important;
  color:#35704B!important;
}
body.authenticated #admin-view #productivity-clients .productivity-view-controls :is(select,button){
  min-height:var(--hcc432-control-h)!important;
  height:var(--hcc432-control-h)!important;
  border-radius:var(--hcc432-radius)!important;
  border:1px solid var(--hcc432-line)!important;
  box-sizing:border-box!important;
}
body.authenticated #admin-view #productivity-clients .productivity-view-controls select{
  min-width:185px!important;
  flex:0 1 230px!important;
  background:#fff!important;
  color:var(--hcc432-ink)!important;
}
body.authenticated #admin-view #productivity-clients .productivity-toolbar button[data-pv-delete],
body.authenticated #admin-view #productivity-clients .productivity-toolbar .btn-ghost{
  background:#fff!important;
  color:var(--hcc432-ink)!important;
  -webkit-text-fill-color:var(--hcc432-ink)!important;
  border:1px solid var(--hcc432-line)!important;
}
body.authenticated #admin-view #admin-client-page-size{
  width:min(120px,100%)!important;
  min-height:var(--hcc432-control-h)!important;
  border-radius:var(--hcc432-radius)!important;
}

/* === 2) ASIGNACIÓN MASIVA DE PROVEEDOR HABITUAL === */
body.authenticated #admin-articles-view #m719-supplier-bulk .m719-supplier-bulk-grid{
  display:grid!important;
  grid-template-columns:minmax(280px,1fr) auto!important;
  gap:12px!important;
  align-items:end!important;
}
body.authenticated #admin-articles-view #m719-supplier-bulk .m719-supplier-bulk-grid > label{
  display:grid!important;
  gap:6px!important;
  min-width:0!important;
}
body.authenticated #admin-articles-view #m719-supplier-bulk-mode,
body.authenticated #admin-articles-view #m719-supplier-bulk-preview,
body.authenticated #admin-articles-view #m719-supplier-bulk-apply{
  min-height:var(--hcc432-control-h)!important;
  height:var(--hcc432-control-h)!important;
  box-sizing:border-box!important;
}
body.authenticated #admin-articles-view #m719-supplier-bulk-preview{
  align-self:end!important;
  white-space:nowrap!important;
}

/* === 3) IMPORTAR TARIFA DE PROVEEDOR === */
body.authenticated #admin-service-view #r26-tariff-card .r26-form-grid,
body.authenticated #admin-service-view [data-r26-panel="intelligence"] #r26-tariff-card .r26-form-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:14px!important;
  align-items:end!important;
}
body.authenticated #admin-service-view #r26-tariff-card .r26-form-grid > label,
body.authenticated #admin-service-view [data-r26-panel="intelligence"] #r26-tariff-card .r26-form-grid > label{
  display:grid!important;
  gap:6px!important;
  min-width:0!important;
}
body.authenticated #admin-service-view #r26-tariff-card #r26-tariff-supplier,
body.authenticated #admin-service-view #r26-tariff-card #r26-tariff-file,
body.authenticated #admin-service-view [data-r26-panel="intelligence"] #r26-tariff-card #r26-tariff-supplier,
body.authenticated #admin-service-view [data-r26-panel="intelligence"] #r26-tariff-card #r26-tariff-file{
  width:100%!important;
  min-height:var(--hcc432-control-h)!important;
  height:var(--hcc432-control-h)!important;
  box-sizing:border-box!important;
  border:1px solid var(--hcc432-line)!important;
  border-radius:var(--hcc432-radius)!important;
  background:#fff!important;
  color:var(--hcc432-ink)!important;
}
body.authenticated #admin-service-view #r26-tariff-card #r26-tariff-file,
body.authenticated #admin-service-view [data-r26-panel="intelligence"] #r26-tariff-card #r26-tariff-file{
  padding:4px 10px!important;
  font:500 13px/1.2 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;
}
body.authenticated #admin-service-view #r26-tariff-card #r26-tariff-file::file-selector-button,
body.authenticated #admin-service-view [data-r26-panel="intelligence"] #r26-tariff-card #r26-tariff-file::file-selector-button{
  margin-right:10px!important;
  min-height:30px!important;
  padding:6px 12px!important;
  border:1px solid var(--hcc432-line)!important;
  border-radius:8px!important;
  background:#fff!important;
  color:var(--hcc432-ink)!important;
  font:600 12px/1 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;
  cursor:pointer!important;
}

/* === 4) BLOQUES DE BACKUP: proporciones, ancho horizontal de los file inputs y armonía general === */
body.authenticated #admin-settings-view #settings-main-grid.hcc-r432-backup-layout{
  grid-template-columns:minmax(0,1.36fr) minmax(310px,.64fr)!important;
  gap:16px!important;
  align-items:stretch!important;
}
body.authenticated #admin-settings-view #admin-backup-settings-card,
body.authenticated #admin-settings-view .hcc-r432-auto-backups{
  min-width:0!important;
  height:100%!important;
}
body.authenticated #admin-settings-view #admin-backup-settings-card .backup-actions{
  display:grid!important;
  grid-template-columns:max-content minmax(190px,1fr) max-content!important;
  gap:12px!important;
  align-items:center!important;
  margin:14px 0!important;
  padding:0 0 14px!important;
  border-bottom:1px solid var(--hcc432-line-soft)!important;
}
body.authenticated #admin-settings-view #admin-backup-settings-card .backup-actions > button{
  min-height:var(--hcc432-control-h)!important;
  height:var(--hcc432-control-h)!important;
  margin:0!important;
  box-sizing:border-box!important;
}
body.authenticated #admin-settings-view #admin-backup-settings-card .backup-actions > .btn-danger-soft{
  background:var(--hcc432-red)!important;
  border:1px solid var(--hcc432-red)!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
body.authenticated #admin-settings-view #admin-backup-settings-card .backup-actions > .btn-danger-soft:hover:not(:disabled){
  background:var(--hcc432-red-hover)!important;
  border-color:var(--hcc432-red-hover)!important;
}
body.authenticated #admin-settings-view #admin-backup-settings-card .backup-restore-file{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
  width:100%!important;
}
body.authenticated #admin-settings-view #admin-backup-settings-card .backup-restore-file > span{
  white-space:nowrap!important;
  font-size:12px!important;
  font-weight:600!important;
  color:var(--hcc432-muted)!important;
}
body.authenticated #admin-settings-view #admin-backup-settings-card :is(#admin-backup-restore-file,#admin-recovery-key-file){
  flex:1 1 auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:var(--hcc432-control-h)!important;
  height:var(--hcc432-control-h)!important;
  padding:4px 10px!important;
  border:1px solid var(--hcc432-line)!important;
  border-radius:var(--hcc432-radius)!important;
  background:#fff!important;
  color:var(--hcc432-ink)!important;
  box-sizing:border-box!important;
  font:500 13px/1.2 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;
}
body.authenticated #admin-settings-view #admin-backup-settings-card :is(#admin-backup-restore-file,#admin-recovery-key-file)::file-selector-button{
  margin-right:10px!important;
  min-height:30px!important;
  padding:6px 12px!important;
  border:1px solid var(--hcc432-line)!important;
  border-radius:8px!important;
  background:#fff!important;
  color:var(--hcc432-ink)!important;
  font:600 12px/1 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;
  cursor:pointer!important;
}
body.authenticated #admin-settings-view .hcc-r432-auto-backups .hcc-r432-auto-fields{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px 14px!important;
  align-items:end!important;
}
body.authenticated #admin-settings-view .hcc-r432-auto-backups .hcc-r432-auto-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  margin-top:14px!important;
}
body.authenticated #admin-settings-view .hcc-r432-auto-backups .hcc-r432-auto-actions > button{
  min-height:var(--hcc432-control-h)!important;
  height:var(--hcc432-control-h)!important;
}

/* === 5) PROMOCIONES: botones de Eliminar con color correcto === */
body.authenticated #admin-settings-view #home-promo-admin-list .home-promo-admin-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
}
body.authenticated #admin-settings-view #home-promo-admin-list :is([data-home-edit-promo],[data-home-remove-promo]){
  width:88px!important;
  min-width:88px!important;
  max-width:88px!important;
  min-height:34px!important;
  height:34px!important;
  padding:0 10px!important;
  border:1px solid #D6DFE8!important;
  border-radius:8px!important;
  background:#fff!important;
  color:#26313B!important;
  -webkit-text-fill-color:#26313B!important;
  font-size:13px!important;
  font-weight:600!important;
  line-height:1!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
body.authenticated #admin-settings-view #home-promo-admin-list :is([data-home-edit-promo],[data-home-remove-promo]):hover:not(:disabled){
  background:#F7F9FB!important;
  border-color:#BFC8D2!important;
}

/* === 6) TAREAS INTERNAS: homogeneidad de botones === */
body.authenticated #admin-dashboard-view #admin-tasks-list button,
body.authenticated #admin-dashboard-view .task-list button{
  min-height:40px!important;
  height:40px!important;
  padding:0 16px!important;
  border-radius:10px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  white-space:nowrap!important;
}

/* === 7) HOY / MI TRABAJO: alinear acciones, sustituir completar por control coherente y ocultar actualizar redundante === */
/* Actualizar permanece visible: la carga automática total no está garantizada. */
body.authenticated #admin-work-center-view #work-center-kpis{margin-top:12px!important}
body.authenticated #work-center-list .operations-item-actions{
  align-items:flex-end!important;
  gap:10px!important;
  flex-wrap:wrap!important;
}
body.authenticated #work-center-list .wc-assign{
  align-items:end!important;
  gap:8px!important;
}
body.authenticated #work-center-list .wc-assign :is(select,button),
body.authenticated #work-center-list .operations-item-actions > button,
body.authenticated #work-center-list .hcc-r432-status-select{
  min-height:42px!important;
  height:42px!important;
  box-sizing:border-box!important;
  border-radius:10px!important;
}
body.authenticated #work-center-list .hcc-r432-status-select{
  min-width:156px!important;
  padding:8px 12px!important;
  border:1px solid var(--hcc432-line)!important;
  background:#fff!important;
  color:var(--hcc432-ink)!important;
}
body.authenticated #work-center-list .hcc-r432-status-wrap{
  display:flex!important;
  align-items:flex-end!important;
  gap:8px!important;
  flex-wrap:wrap!important;
}
body.authenticated #work-center-list .hcc-r432-status-wrap label{
  display:grid!important;
  gap:4px!important;
  margin:0!important;
}
body.authenticated #work-center-list .hcc-r432-status-wrap .hcc-r432-status-label{
  font-size:11px!important;
  font-weight:700!important;
  letter-spacing:.03em!important;
  color:var(--hcc432-muted)!important;
  text-transform:uppercase!important;
}

/* === 8) AUTOCOMPLETADO SOLO DE PROVEEDORES EN CATÁLOGO / ACCIONES === */
body.authenticated #admin-articles-view .hcc-r432-supplier-anchor{position:relative!important}
body.authenticated #admin-articles-view .hcc-r432-supplier-menu{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:calc(100% + 6px)!important;
  z-index:120!important;
  border:1px solid var(--hcc432-line)!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:0 14px 36px rgba(17,34,58,.16)!important;
  overflow:hidden!important;
}
body.authenticated #admin-articles-view .hcc-r432-supplier-option,
body.authenticated #admin-articles-view .hcc-r432-supplier-empty{
  display:block!important;
  width:100%!important;
  border:0!important;
  background:#fff!important;
  color:var(--hcc432-ink)!important;
  text-align:left!important;
  padding:10px 12px!important;
  font:500 13px/1.35 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;
  cursor:pointer!important;
}
body.authenticated #admin-articles-view .hcc-r432-supplier-option:hover,
body.authenticated #admin-articles-view .hcc-r432-supplier-option[aria-selected="true"]{
  background:var(--hcc432-soft)!important;
}
body.authenticated #admin-articles-view .hcc-r432-supplier-empty{
  color:var(--hcc432-muted)!important;
  cursor:default!important;
}

/* === Responsive === */
@media (max-width:1024px){
  body.authenticated #admin-settings-view #settings-main-grid.hcc-r432-backup-layout{
    grid-template-columns:minmax(0,1fr)!important;
  }
}
@media (max-width:900px){
  body.authenticated #admin-settings-view #admin-backup-settings-card .backup-actions{
    grid-template-columns:max-content minmax(155px,1fr) max-content!important;
  }
  body.authenticated #admin-service-view #r26-tariff-card .r26-form-grid,
  body.authenticated #admin-service-view [data-r26-panel="intelligence"] #r26-tariff-card .r26-form-grid,
  body.authenticated #admin-articles-view #m719-supplier-bulk .m719-supplier-bulk-grid{
    grid-template-columns:1fr!important;
  }
}
@media (max-width:640px){
  body.authenticated #admin-view #productivity-clients .productivity-view-controls,
  body.authenticated #admin-view #productivity-clients .productivity-toolbar{
    width:100%!important;
  }
  body.authenticated #admin-view #productivity-clients .productivity-view-controls select{
    flex:1 1 100%!important;
    min-width:0!important;
  }
  body.authenticated #admin-settings-view #admin-backup-settings-card .backup-actions{
    grid-template-columns:1fr!important;
  }
  body.authenticated #admin-settings-view #admin-backup-settings-card .backup-restore-file{
    flex-wrap:wrap!important;
  }
  body.authenticated #admin-settings-view .hcc-r432-auto-backups .hcc-r432-auto-fields{
    grid-template-columns:1fr!important;
  }
  body.authenticated #admin-settings-view .hcc-r432-auto-backups .hcc-r432-auto-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  body.authenticated #admin-dashboard-view #home-promo-admin-list article,
  body.authenticated #admin-settings-view #home-promo-admin-list article{
    flex-direction:column!important;
    align-items:stretch!important;
  }
  body.authenticated #admin-settings-view #home-promo-admin-list .home-promo-admin-actions{
    width:100%!important;
    justify-content:flex-end!important;
  }
  body.authenticated #work-center-list .hcc-r432-status-wrap{
    width:100%!important;
  }
  body.authenticated #work-center-list .hcc-r432-status-select{
    width:100%!important;
  }
}

/* R2: filtro Pendientes / Completadas / Todas y estado reversible. */
body.authenticated #admin-work-center-view .operations-toolbar .hcc432-state-filter{display:grid!important;gap:6px!important;min-width:155px!important}
body.authenticated #admin-work-center-view .operations-toolbar .hcc432-state-filter>span,
body.authenticated #work-center-list .hcc432-status-control>span{font-size:11px!important;font-weight:700!important;color:#5A6F87!important;text-transform:uppercase!important;letter-spacing:.035em!important}
body.authenticated #admin-work-center-view #work-center-task-status,
body.authenticated #work-center-list [data-wc-status]{min-height:42px!important;height:42px!important;width:100%!important;min-width:155px!important;box-sizing:border-box!important;border:1px solid #C8D4E2!important;border-radius:10px!important;background:#fff!important;color:#172C45!important;-webkit-text-fill-color:#172C45!important;font:500 13px/1.2 Inter,"Segoe UI",Arial,sans-serif!important;padding:8px 12px!important}
body.authenticated #work-center-list .hcc432-status-control{display:grid!important;gap:4px!important;align-self:end!important;margin:0!important}
body.authenticated #work-center-list .hcc432-readonly{display:inline-flex!important;align-items:center!important;height:42px!important;color:#52667f!important;font-weight:600!important}
body.authenticated #admin-work-center-view #work-center-refresh{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:40px!important}
body.authenticated #admin-dashboard-view #admin-tasks-list .task-row-actions>button{min-width:116px!important;height:40px!important;min-height:40px!important;padding:0 14px!important;box-sizing:border-box!important}
@media(max-width:640px){body.authenticated #admin-work-center-view .operations-toolbar .hcc432-state-filter{width:100%!important}body.authenticated #work-center-list .hcc432-status-control{width:100%!important}}

/* R2: superar las reglas heredadas de alta especificidad en acciones destructivas. */
html body.authenticated #admin-settings-view #home-promo-admin-list .home-promo-admin-actions :is([data-home-edit-promo],[data-home-remove-promo]):not(#hcc432-a#hcc432-b#hcc432-c#hcc432-d){color:#26313b!important;-webkit-text-fill-color:#26313b!important;font-family:Inter,"Segoe UI",Arial,sans-serif!important;font-weight:600!important;background:#fff!important;border:1px solid #c8d4e2!important;opacity:1!important}
html body.authenticated #admin-settings-view #home-promo-admin-list .home-promo-admin-actions [data-home-remove-promo]:disabled:not(#hcc432-a#hcc432-b#hcc432-c#hcc432-d){color:#495e78!important;-webkit-text-fill-color:#495e78!important;opacity:.75!important}
