/* ========= Payroll Queue (scoped, brand-applied) ========= */
:root {
  --fc-text:   #231F20; /* Brand black */
  --fc-blue:   #1E2A5B; /* Azul principal */
  --fc-gray:   #C1CCD1; /* Gris claro */
  --fc-orange: #FF4F00; /* Naranja acento */
  --fc-orange-hover: #d94300;
  --fc-bg:     #f7f9fa;
  --fc-white:  #ffffff;

  --fc-radius: 12px;
}

#payrollQueueSection {
  background: var(--fc-white);
  border-radius: var(--fc-radius);
  box-shadow: 0 0 8px rgba(0,0,0,.06);
  padding: 18px;
  color: var(--fc-blue);
  max-width: 1080px;
}

#payrollQueueSection h2 {
  margin: 4px 0 14px;
  font-family: 'Michroma', sans-serif;
  text-transform: uppercase;
  font-size: 20px;
  color: var(--fc-blue);
}

/* Grid 2 paneles */
#payrollQueueSection .grid-2 {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 16px;
}

/* Tarjetas */
#payrollQueueSection .card {
  background: var(--fc-white);
  border: 1px solid #e5e7eb;
  border-radius: var(--fc-radius);
  padding: 14px;
}

/* Botones */
#payrollQueueSection .material-button {
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  background: var(--fc-orange);
  border: 1px solid var(--fc-orange);
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, transform .05s ease;
  margin-bottom:10px;
  width: 25%;
  font-weight: 500;
}
#payrollQueueSection .material-button:hover { background: var(--fc-orange-hover); }
#payrollQueueSection .material-button:active { transform: translateY(1px); }
#payrollQueueSection .material-button:disabled {
  opacity: .5; cursor: not-allowed;
}

/* Tabla base */
#payrollQueueSection .entry-table-wrapper {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}
#payrollQueueSection .entry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}
#payrollQueueSection .entry-table thead th, .entry-table tfoot tr  {
  position: sticky; top: 0;
  background: var(--fc-blue);
  color: #fff;
  font-family: 'Michroma', sans-serif;
  font-weight: 600;
  text-align: left;
  padding: 10px 10px;
  z-index: 1;
}
#payrollQueueSection .entry-table td {
  border-top: 1px solid #eef0f3;
  padding: 10px 10px;
  vertical-align: middle;
  color: var(--fc-text);
}
#payrollQueueSection .entry-table tbody tr:nth-child(odd) {
  background: #fafbfc;
}
#payrollQueueSection .entry-table tbody tr:hover {
  background: #f1f5fb;
}

/* Utilidades de alineación */
#payrollQueueSection .text-right { text-align: right; }
#payrollQueueSection .text-center { text-align: center !important; }
#payrollQueueSection .entry-table td.text-center .icon-btn { margin: 0; } 

/* Acciones icon-only */
#payrollQueueSection .icon-btn {
  background: transparent;
  border: 0;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
#payrollQueueSection .icon-btn:hover { background: #edf1f6; }

/* Encabezado de Items + estatus */
#payrollQueueSection #pqSelectedInfo {
  font-size: 12px;
  color: #475569;
}

/* Panel de ajustes dentro del panel derecho */
#payrollQueueSection #pqAdjPanel {
  margin-top: 10px;
  background: #fcfdff;
}

/* Badges */
#payrollQueueSection .badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f5f7fa;
  color: #334155;
  font-weight: 700;
}

/* Modal */
#payrollQueueSection .modal.hidden { display: none !important; }
#payrollQueueSection .modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 40px;
}
#payrollQueueSection .modal__backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: -1;
}
#payrollQueueSection .modal__content {
  background: var(--fc-white);
  border-radius: var(--fc-radius);
  width: 92%; max-width: 560px;
  max-height: 90vh; overflow: auto;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
#payrollQueueSection .modal__header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px;
}
#payrollQueueSection .modal__header h3 {
  margin: 0; font-family: 'Michroma', sans-serif; color: var(--fc-blue);
}
#payrollQueueSection .modal__close {
  background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--fc-blue);
}
#payrollQueueSection .modal__footer {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px;
}
#payrollQueueSection .modal__content label {
  display: block; margin-top: 10px; font-weight: 600; color: var(--fc-blue);
}
#payrollQueueSection .modal__content input,
#payrollQueueSection .modal__content select {
  width: 100%; border: 1px solid var(--fc-gray); border-radius: 8px;
  padding: 10px 12px; margin-top: 6px; font-size: 14px; box-sizing: border-box;
}
#payrollQueueSection .row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

/* Estados de “pendiente/procesado” */
#payrollQueueSection .status-pill {
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid transparent;
}
#payrollQueueSection .status-pill.pending {
  background: #fff7e6; color: #9a6b00; border-color: #ffe0a3;
}
#payrollQueueSection .status-pill.processed {
  background: #e8f5ee; color: #256c3a; border-color: #cdebd7;
}

/* Responsive */
@media (max-width: 960px) {
  #payrollQueueSection .grid-2 { grid-template-columns: 1fr; }
  #payrollQueueSection .entry-table { min-width: 640px; }
}

/* Botones de acción (edición/borrado) */


#payrollQueueSection .entry-table button { width: auto; margin: 0; }

/* Centrado real con flex, gana por especificidad */
#payrollQueueSection .entry-table tr > td.text-center{
  justify-content:center !important;
  align-items:center !important;
}

/* Evita que el propio botón rompa el centrado */
#payrollQueueSection .entry-table td.text-center .icon-btn{
  display:inline-flex;  /* asegura inline-level dentro del flex */
  margin:0 !important;
  width:auto !important;
  float:none !important;
}
button.icon-btn{
    color: green;
}

button.icon-btn.edit,
button.icon-btn.delete {
  padding: 2px 2px;
  margin-right: 10px;
  border: none;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: color 0.2s ease;
}

button.icon-btn.edit { color: #1976d2; }
button.icon-btn.edit:hover { color: darkblue; }

button.icon-btn.delete { color: red; }
button.icon-btn.delete:hover { color: darkred; }
/* Centra y elimina el espacio inferior */
#payrollQueueSection td.actions{
  display:flex;
  justify-content:center;
  align-items:center;
}

#payrollQueueSection .chk-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  line-height: 0;          /* <- quita el espacio de línea */
}

#payrollQueueSection .row-check{
  display:block;           /* <- evita baseline gap */
  margin:0;
  width:16px;
  height:16px;
  accent-color: var(--fc-orange);
}
#payrollQueueSection .entry-table thead th.select-all{
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;        /* <- clave */
  word-break: normal;
  overflow-wrap: normal;
}
#payrollQueueSection th.select-all input[type="checkbox"]{
  display:block;  /* sin baseline gap */
  margin:0;
  accent-color: var(--fc-orange);
}
#payrollQueueSection .stack .card { margin-top: 12px; }

#payrollQueueSection .multi-table-title{
  font-family: 'Michroma', sans-serif;
  color: var(--fc-blue);
  font-weight: 700;
  margin: 10px 0 6px;
  font-size: 14px;
}

#payrollQueueSection .status-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:8px;
}

#payrollQueueSection #pqProcess.material-button{
  margin-left:auto;   /* empuja a la derecha */
  
}

:root {
  --toast-bg-error: #f44336;
  --toast-bg-success: #4CAF50;
  --toast-bg-info: #2196F3;
  --toast-bg-warning: #FF9800;
}

.toast {
  position: fixed;
  /* Centro exacto del viewport */
  top: 30%;
  left: 30%;
  transform: translate(-50%, 0%);

  /* Layout y responsivo */
  max-width: min(92vw, 420px);
  width: max-content;
  box-sizing: border-box;
  max-height: 80vh;
  overflow: auto;

  /* Estilos visuales (los tuyos + tweaks) */
  background-color: var(--toast-bg-info);
  color: #fff;
  padding: 18px 28px;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);

  /* Animación */
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 2147483647; /* arriba de todo */
  pointer-events: none; /* no bloquea clics en el fondo */
}


.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.hidden {
  display: none;
}

/* Toast: centrado y por encima de todo */
#toast-confirm {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  z-index: 2147483647; /* enorme para ganar a cualquier overlay */
  max-width: 720px;
  width: min(720px, 94vw);
}

/* Sistema de visibilidad */
#toast-confirm.hidden { display: none; }
#toast-confirm.show   { display: grid; place-items: center; }

/* Contenido (si no lo tenías) */
#toast-confirm .toast-content{
  background: var(--toast-bg-info, #334155);
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.15);
}
#toast-confirm .toast-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }
#toast-confirm .toast-btn{ height:36px; padding:0 14px; border-radius:10px; border:0; font-weight:700; cursor:pointer }
#toast-confirm .toast-btn--ok{ background:#16a34a; cursor:pointer;}
#toast-confirm .toast-btn--cancel{ background:#52525b; cursor:pointer; }
#toast-ok {cursor:pointer;}


/* Nombre clicable en la tabla */
.entry-table td.emp-name{
  cursor: pointer;
  transition: color .15s ease, text-decoration-color .15s ease;
}

/* Hover: subrayado discreto */
.entry-table td.emp-name:hover{
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Focus visible (accesibilidad con teclado) */
.entry-table td.emp-name:focus-visible{
  outline: 2px solid rgba(30,42,91,.35); /* azul tenue */
  outline-offset: 2px;
  border-radius: 6px;
}

/* === Payroll Breakdown Modal (global) === */
#payrollBreakdownModal.hidden { display: none; }

#payrollBreakdownModal{
  position: fixed;        /* overlay pantalla completa */
  inset: 0;
  z-index: 9999;
}

#payrollBreakdownModal .modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(1px);
}

#payrollBreakdownModal .modal-content{
  position: relative;             /* para posicionar la X */
  margin: 8vh auto 6vh;
  width: min(520px, calc(100% - 32px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
  color: var(--fc-blue);
}

/* Header apilado + espacio para la X a la derecha */
#payrollBreakdownModal .modal-header{
  display: flex;
  flex-direction: column;      /* <- apila */
  align-items: flex-start;
  gap: 4px;                    /* separación entre h3 y subtítulo */
  padding: 14px 48px 12px 16px;/* deja hueco para la X a la derecha */
  border-bottom: 1px solid #eef2f7;
}

#payrollBreakdownModal .modal-header h3{ margin:0; }
#payrollBreakdownModal .modal-subtitle{
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.35;
}

#payrollBreakdownModal .modal-body{
  max-height: calc(100vh - 20vh);
  overflow: auto;
}

#payrollBreakdownModal .modal__close{
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px; height: 32px;
  border: 0; border-radius: 8px;
  background: transparent;
  line-height: 1;
  font-size: 20px;
  cursor: pointer;
  color: #334155;
}
#payrollBreakdownModal .modal__close:hover{ background: #f1f5f9; }
  
#payrollQueueSection,
#payrollQueueSection.container {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0;              /* opcional: quita relleno del panel grande */
}

/* el contenedor de secciones crea el “aire” entre grupos */
.page-stack {
  display: grid;
  gap: 40px;               /* separación entre Pending y History */
}

/* opcional: aire interior de cada bloque (título + grid) */
.stack { display: grid; gap: 14px; }

/* asegúrate de que las tarjetas sí tengan fondo y sombra */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 10px 20px rgba(2, 6, 23, .06),
    0 2px 6px   rgba(2, 6, 23, .04);
}
.hist-summary{
    text-align:center;
}
#toast-anchor { scroll-margin-top: 24px; }

#toast-confirm.toast{
  position: fixed;
  left: 50%;
  top: 80px;                 /* o bottom:24px si lo prefieres abajo */
  transform: translateX(-50%);
  z-index: 2147483647;       /* overkill */
  pointer-events: auto;      /* asegúrate que recibe clics */
}
