/* ===== ESTILOS GENERALES ===== */
:root {
  /* Colores base usados por vistas nuevas (alineados con referencias) */
  --brand-blue: #1f6feb; /* ya usado en otras partes */
  --primary-color: var(--brand-blue);
  --danger-color: #e74c3c;
  --success-color: #27ae60;
  --border-color: #ddd;
  --dark-gray: #555;
  --warning-color: #f39c12;
  --info-color: #17a2b8;
  --text-muted: #777;
  --inactive-color: #7f8c9d;
  --pink-color: #e91e63;
  --cancel-color: #6c757d;
  --light-gray: #f4f7f6;
}
body {
  font-family: 'Segoe UI', Roboto, Helvetica, sans-serif;
  background-color: #f8f9fb;
  margin: 0;
  padding: 30px;
  color: #2d2d2d;
  overflow-x: hidden;
}

h1 {
  text-align: center;
  color: #2f3e46;
  font-size: 28px;
  margin-bottom: 30px;
  letter-spacing: 0.5px;
}

/* Título principal con icono (coincide con referencia) */
#titulo-principal {
  color: #2c3e50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ===== BARRA SUPERIOR ===== */
.barra-superior {
  width: 95%;
  margin: 0 auto 20px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.barra-izquierda,
.barra-derecha {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.multiriesgo-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.multiriesgo-label {
  font-size: 14px;
  font-weight: 600;
  color: #2d2d2d;
}

.multiriesgo-select {
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  color: #2d2d2d;
}

.multiriesgo-chip {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background-color: #eef2ff;
  color: #3949ab;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

#busqueda {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  min-width: 250px;
  background-color: #fff;
  color: #2d2d2d;
}

.barra-derecha select,
#filtroDepartamento {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  min-width: 120px;
  background-color: #fff;
  color: #2d2d2d;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transition: border 0.3s ease;
}

#filtroDepartamento:hover { 
  border-color: #3a86ff;
}

#btnAgregar, #btnBuscarCliente {
  padding: 10px 16px;
  font-size: 14px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

#btnAgregar:hover, #btnBuscarCliente:hover {
  background-color: #0056b3;
}

/* ===== Botón “Agregar Riesgo” igual que “Agregar Ramo” ===== */
#btnAgregarRiesgo {
  padding: 10px 16px;
  font-size: 14px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
#btnAgregarRiesgo:hover {
  background-color: #0056b3;
}


/* ===== TABLA ===== */
.table-responsive {
  width: 100%;
  overflow-x: visible;
}

table {
  width: 95%;
  margin: 0 auto;
  border-collapse: collapse;
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  text-align: center;
}

table:not(.data-table) th,
table:not(.data-table) td {
  border-right: none;
  border-left: none;
}

th, td {
  padding: 14px;
  border-bottom: 1px solid #e6e6e6;
  font-size: 14px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

th {
  background-color: #3a86ff;
  color: white;
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: #f4f6f9;
}

tbody tr:hover {
  background-color: #e6f0ff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* ===== BOTONES DE ACCIÓN ===== */
button.editar, button.eliminar, button.permisos, button.riesgos, button.bienes, button.btn--edit, button.btn--delete, button.acuerdo {
    padding: 7px 12px;
    margin: 0 5px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

button.bienes {
    background-color: #ff7675;
}
button.bienes:hover {
    background-color: #e17055;
}

button.editar, button.btn--edit, button.acuerdo {
  background-color: #00b894;
}
button.editar, button.btn--edit:hover, button.acuerdo:hover {
  background-color: #019875;
}

button.eliminar, button.btn--delete {
  background-color: #ef233c;
}
button.eliminar, button.btn--delete:hover {
  background-color: #d90429;
}

button.permisos, button.riesgos{
  background-color: #6c5ce7;
}
button.permisos:hover {
  background-color: #5a4bcf;
}

/* Botón para registro financiero desde notas */
.btn-financiero-caso {
  width: 30%;
  max-width: 320px;
  min-width: 240px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--brand-blue), #0f5bd1);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(31, 111, 235, 0.25);
  transition: transform 0.1s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-financiero-caso:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 14px rgba(31, 111, 235, 0.3);
}

.btn-financiero-caso:active {
  transform: translateY(1px);
}

.btn-financiero-caso:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
}

.pulse-once {
  animation: pulse-once 0.8s ease;
}

@keyframes pulse-once {
  0% { box-shadow: 0 0 0 0 rgba(31,111,235,0.35); }
  70% { box-shadow: 0 0 0 14px rgba(31,111,235,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,111,235,0); }
}


/* ===== MODALES ===== */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.oculto {
  display: none;
}

.modal-contenido {
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  width: 95%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  box-sizing: border-box;
}

/* ===== Icono “X” de cierre en esquina ===== */
.modal-contenido {
  position: relative;  /* necesario para posicionar la X */
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #333;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.close-modal:hover {
  background-color: #d90429;
  color: white;
}

.modal input,
.modal textarea,
#comboDepartamento,
#comboCargo,
#comboRol, 
#nombreDepartamento,
#nombreCargo,
#descripcion,
#nombre,
#siglas,
#nombreRol {
  width: 100%;
  padding: 10px 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.modal input,
.modal select,
.modal textarea {
  margin: 6px 0;
}

#descripcion {
  min-height: 100px;
  resize: vertical;
}

.botones-modal {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.botones-modal button {
  width: 45%;
  padding: 11px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  border: none;
}

#btnConfirmarEliminar, #btnGuardarPermisos, #btnCancelarFacturar {
  background-color: #d90429;
  color: white;
}

#btnCancelarEliminar, #btnCancelarPermisos, #btnCerrarAdvertencia, #btnConfirmarFacturar {
  background-color: #6c757d;
  color: white;
}

#btnConfirmarEliminar:hover, #btnGuardarPermisos:hover, #btnCancelarFacturar:hover {
  background-color: #a80321;
}

#btnCancelarEliminar:hover, #btnCancelarPermisos:hover, #btnCerrarAdvertencia:hover, #btnConfirmarFacturar:hover{
  background-color: #495057;
}

#btnCancelar {
  padding: 10px 16px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.modal-advertencia p,
#modalEliminar p {
  text-align: center;
  font-size: 15px;
  margin-top: 10px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #3a86ff;
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.toast.toast-info {
  background-color: var(--primary-color, #3498db);
}

.toast.toast-success {
  background-color: var(--success-color, #27ae60);
}

.toast.toast-error {
  background-color: var(--danger-color, #e74c3c);
}

.toast.toast-warning {
  background-color: var(--warning-color, #f39c12);
}

.toast.mostrar {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ESTILOS CAMPOS CON ERROR DE VALIDACIÓN ===== */
.campo-error {
  border-color: var(--danger-color, #e74c3c) !important;
  background-color: #fff5f5 !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2) !important;
}

.campo-error:focus {
  border-color: var(--danger-color, #e74c3c) !important;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3) !important;
  outline: none;
}

select.campo-error {
  border-color: var(--danger-color, #e74c3c) !important;
  background-color: #fff5f5 !important;
}

/* Animación para campos con error */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
  20%, 40%, 60%, 80% { transform: translateX(3px); }
}

.campo-error-animado {
  animation: shake 0.4s ease-in-out;
}

/* Estilo para toast con múltiples errores */
.toast.error {
  white-space: pre-line;
  text-align: left;
  max-width: 450px;
  line-height: 1.5;
}

/* ===== CLASES GENERALES ===== */
.oculto {
  display: none;
}

/* ===== ESTILOS MODAL EXCLUSIÓN DE BIEN ===== */
.modal-contenido-exclusion {
  background-color: white;
  padding: 30px 40px;
  border-radius: 12px;
  width: 95%;
  max-width: 1600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  box-sizing: border-box;
  position: relative;
}

.modal-contenido-exclusion h2 {
  color: #2c3e50;
  font-size: 1.9em;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.context-header-exclusion {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  border: 1px solid #ddd;
}

.client-name-exclusion {
  margin-bottom: 15px;
  font-size: 1.1em;
}

.poliza-datos-basicos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.dato-basico {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label-exc {
  font-size: 0.85em;
  color: #666;
  font-weight: 600;
}

.field-value-exc {
  font-size: 1em;
  color: #2d2d2d;
  font-weight: 500;
}

.form-row-exclusion {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.form-section-exclusion {
  flex: 1;
  padding: 20px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  min-width: 400px;
}

.form-section-exclusion.bienes-section {
  flex: 2;
  min-width: 600px;
}

.form-section-exclusion.credito-section {
  flex: 1;
  min-width: 450px;
  border-color: #ef233c;
}

.form-section-exclusion h4 {
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
  color: #3a86ff;
  font-size: 1.1em;
}

.tabla-bienes-exclusion-wrapper {
  overflow-x: visible;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.tabla-bienes-exclusion {
  width: 100%;
  border-collapse: collapse;
}

.tabla-bienes-exclusion th,
.tabla-bienes-exclusion td {
  padding: 8px 10px;
  font-size: 0.9em;
  border-bottom: 1px solid #f0f0f0;
}

.tabla-bienes-exclusion thead th {
  background-color: #3a86ff;
  color: white;
  border-bottom: none;
  font-weight: 500;
}

.tabla-bienes-exclusion tbody tr {
  background-color: #fff;
}

.tabla-bienes-exclusion tbody tr:hover {
  background-color: #f0f0f0;
}

.tabla-bienes-exclusion .col-select-exc {
  width: 40px;
  text-align: center;
  padding: 5px;
}

.tabla-bienes-exclusion .col-valor-exc,
.tabla-bienes-exclusion .col-prima-exc,
.tabla-bienes-exclusion .col-monto-exc {
  text-align: right;
}

.form-row-exc {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.form-group-exc {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 150px;
}

.form-group-exc.compact-exc,
.form-group-exc#isc-acreditar-group-exc {
  min-width: 0;
}

.form-group-exc.three-col-exc {
  flex: 1 1 0px;
  min-width: 130px;
}

.form-group-exc.col-25-exc {
  flex: 1;
  max-width: 40%;
  min-width: 100px;
}

.form-group-exc.col-75-exc {
  flex: 3;
  max-width: 60%;
  min-width: 280px;
}

.form-group-exc label {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9em;
  color: #555;
}

.form-group-exc label .required {
  color: #ef233c;
  font-size: 1.2em;
  margin-left: 2px;
}

.form-group-exc input,
.form-group-exc select,
.form-group-exc textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 1em;
}

.form-group-exc textarea {
  resize: vertical;
  min-height: 80px;
}

.highlight-credit-exc {
  font-size: 1.2em;
  font-weight: 700;
  color: #ef233c;
  background-color: #fdedec;
  border: 2px solid #ef233c;
  text-align: right !important;
}

.highlight-credit-exc.new-premium-exc {
  color: #27ae60;
  background-color: #e8f8ef;
  border-color: #27ae60;
}

.form-actions-exc {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.btn-danger-exc {
  background-color: #ef233c;
  color: white;
  padding: 10px 25px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger-exc:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-cancelar-exc {
  background-color: #6c757d;
  color: white;
  padding: 10px 25px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-cancelar-exc:hover {
  background-color: #495057;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 768px) {
  .table-responsive:not(.renov-card .table-wrapper) {
    overflow-x: visible;
  }

  table, thead, tbody, th, td, tr {
    display: table;
    width: 100%;
  }

  td::before {
    content: "";
  }
  
  .modal-contenido-exclusion {
    padding: 20px;
    max-width: 95%;
  }
  
  .form-section-exclusion {
    min-width: 100%;
  }
  
  .poliza-datos-basicos {
    grid-template-columns: 1fr;
  }
}

/* ===== PAGINACIÓN ===== */
.paginacion {
  margin-top: 20px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.paginacion .btn-pagina {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #f0f0f0;
  cursor: pointer;
}

.paginacion .btn-pagina:hover:not(:disabled) {
  background-color: #dcdcdc;
}

.paginacion .btn-pagina.activa {
  background-color: #3a86ff;
  color: white;
  font-weight: bold;
}

.paginacion .btn-pagina:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ===== ESTADO Y RADIO BUTTONS ===== */
.estado-radio-group {
  margin-top: 8px;
}

.radio-options {
  display: flex;
  gap: 20px;
  margin-top: 4px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #333;
}

.estado-radio-group label strong {
  font-size: 14px;
  color: #2d2d2d;
}

/* ===== PERMISOS (solo roles) ===== */
#modalPermisos .modal-contenido {
  background-color: #fff;
  padding: 32px 28px 26px 28px;
  border-radius: 16px;
  width: 100%;
  height: 78vh; /* ajusta a tu gusto */
  max-height: 95vh;
  max-width: 1100px;
  min-height: 110px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.16);

  display: flex;
  flex-direction: column;
}

#modalPermisos #formPermisos {
  display: flex;
  flex-direction: column;
  flex: 1;
}

#modalPermisos h2 {
  font-size: 22px;
  margin-bottom: 18px;
  color: #2d2d2d;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#modalPermisos .tabla-permisos-scroll {
  flex: 1;
  overflow-y: auto;
}

.tabla-permisos {
  width: 100%;
  border-collapse: collapse;
}

.tabla-permisos th,
.tabla-permisos td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
}

.tabla-permisos th {
  background-color: #3a86ff;
  color: white;
  position: sticky;
  top: 0;
  z-index: 1;
}

.tabla-permisos td:first-child {
  text-align: center;
  font-weight: 500;
}

.acciones-marcado {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

#btnMarcarTodo, #btnDesmarcarTodo {
  padding: 7px 16px;
  background: #f1f3fa;
  border: 1px solid #3a86ff;
  border-radius: 6px;
  color: #3a86ff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#btnMarcarTodo:hover, #btnDesmarcarTodo:hover {
  background: #3a86ff;
  color: white;
}

#btnGuardarPermisos {
  background-color: #3a86ff;
  color: white;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 140px;
}

#btnGuardarPermisos:hover {
  background-color: #2f6ee2;
}

#btnCancelarPermisos {
  background-color: #6c757d;
  color: white;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 140px;
}

#btnCancelarPermisos:hover {
  background-color: #495057;
}

.acciones-modal {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 30px; /* puedes ajustar esto para separar de la tabla */
}


/* Ajustes específicos para descripción */
tbody td:nth-child(2) {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

#modalConfirmar .modal-contenido {
  max-width: 400px;
  padding: 24px 20px;
  text-align: center;
  margin: 0 auto;
}

#modalConfirmar h3,
#modalConfirmar p {
  text-align: center;
  font-size: 16px;
  margin-bottom: 20px;
  color: #2d2d2d;
}

#modalConfirmar .botones-modal {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}

#modalConfirmar .botones-modal button {
  width: auto;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 6px;
  font-weight: 600;
}

label {
  margin-bottom: 2px;
  display: block;
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-bottom: 20px;
}

/* MODAL DE RESTRICCIONES*/

#modalRestricciones .modal-contenido {
  background-color: #fff;
  padding: 32px;
  border-radius: 16px;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

#modalRestricciones h2 {
  font-size: 24px;
  margin-bottom: 28px;
  text-align: center;
  color: #2d2d2d;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Grilla de 3 columnas con espacio uniforme */
#formRestricciones .form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 30px;
  margin-bottom: 24px;
}

/* Estilo de labels */
#formRestricciones label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
  color: #333;
}

/* Estilo de selects */
#formRestricciones select {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #2d2d2d;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Botones */
#modalRestricciones .acciones-modal {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 12px;
}

#btnGuardarRestricciones,
#modalRestricciones .acciones-modal button[type="button"] {
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#btnGuardarRestricciones {
  background-color: #3a86ff;
  color: white;
}

#btnGuardarRestricciones:hover {
  background-color: #2f6ee2;
}

#modalRestricciones .acciones-modal button[type="button"] {
  background-color: #6c757d;
  color: white;
}

#modalRestricciones .acciones-modal button[type="button"]:hover {
  background-color: #495057;
}

/* Responsivo */
@media (max-width: 1024px) {
  #formRestricciones .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  #formRestricciones .form-grid {
    grid-template-columns: 1fr;
  }
}

/* boton de restricciones */
button.restricciones {
  padding: 7px 12px;
  margin: 0 5px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  
  color: #2d2d2d;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

button.restricciones:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

/* informacion del usuario modal restricciones */
#infoUsuarioRestricciones {
  margin-bottom: 20px;
  background-color: #f1f3f7;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

#infoUsuarioRestricciones p {
  margin: 6px 0;
  font-size: 14px;
  color: #333;
}

/* checkboxes del modal restricciones*/
.grupo-checkboxes {
  background-color: #f1f3f7;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: fit-content;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #2d2d2d;
}

.checkbox-label {
  white-space: nowrap;
}

.form-checkbox-group input[type="checkbox"] {
  transform: scale(1.1);
  cursor: pointer;
}

.form-checkbox-group label.checkbox-label {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #2d2d2d;
}

/*opcion vacia de los selects de restricciones*/
select option.opcion-vacia {
  color: #999;
}

select:has(option.opcion-vacia:checked) {
  color: transparent;
  text-shadow: 0 0 0 #000; /* Esto mantiene el texto editable pero visualmente en blanco */
}

/* Estilo uniforme para los selects del modal ramos */
.modal-contenido select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  margin: 6px 0;
  background-color: #fff;
  box-sizing: border-box;
}

/* ===== GRUPO DE PORCENTAJES EN LÍNEA ===== */
#formRamo .grupo-porcentajes {
  grid-column: span 2; /* Ocupa el ancho completo */
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columnas iguales */
  gap: 16px; /* Espacio entre inputs */
  margin-bottom: 10px;
}

/* Ajuste para labels de porcentajes */
#formRamo .grupo-porcentajes label {
  margin-bottom: 6px;
  font-size: 13px;
}

/* ===== CHECKBOXES EN COLUMNA - VERSIÓN CORREGIDA ===== */
.form-checkbox-group {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background-color: #f8f9fb;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  margin: 8px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #2d2d2d;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

/* ===== MODAL RIESGOS – TAMAÑO PERSONALIZADO ===== */
#modalRiesgos .modal-contenido {
  width: 90vw !important;        /* Ocupa el 80% del ancho de la ventana */
  max-width: 1300px !important;  /* Ancho máximo en píxeles */
  height: 80vh !important;       /* Ocupa el 80% de la altura de la ventana */
  max-height: 800px !important;  /* Altura máxima en píxeles */
  overflow-y: auto;   /* Scroll vertical si el contenido rebasa */
}

/* ===== AJUSTES ESPECÍFICOS PARA EL MODAL DE RIESGOS ===== */
#modalRiesgos .modal-contenido {
  /* Aumenta el ancho del modal */
  width: 125vw;         /* ahora ocupa hasta 95% de la ventana */
  max-width: 1300px;   /* máximo 1200px */
  /* mantén el resto igual */
}


/* Asegura que la barra y la tabla compartan la misma anchura */
#modalRiesgos .barra-superior {
  width: 95%;          /* igual que tu tabla */
  margin: 0 auto 10px; /* centrarla y algo de separación abajo */
}

/* Controles en línea, sin saltos */
#modalRiesgos .barra-superior .barra-derecha {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

/* El input de búsqueda ocupa el espacio disponible */
#modalRiesgos .barra-superior .barra-derecha #busquedaRiesgos {
  flex: 1 1 200px;     /* crece hasta ocupar todo, pero no menos de 200px */
  min-width: 200px;
}

/* El select mantiene un ancho fijo */
#modalRiesgos .barra-superior .barra-derecha #filtroEstadoRiesgos {
  flex: 0 0 150px;     /* siempre 150px de ancho */
  min-width: 150px;
}

/* ===== BOTÓN ELIMINAR EN MODAL DE RIESGO ===== */
#btnConfirmarEliminarRiesgo {
  background-color: #ef233c;      /* mismo rojo que los botones .eliminar */
  color: white;
  border: none;
  border-radius: 6px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#btnConfirmarEliminarRiesgo:hover {
  background-color: #d90429;      /* tono hover igual al de ramos */
}

/* ===== ALINEAR DATOS DE TABLAS A LA IZQUIERDA ===== */
table tbody td {
  text-align: left;       /* fuerza alineación izquierda */
  padding-left: 12px;     /* pequeña sangría para “indentar” */
}

/* Opcional: si quieres que también los encabezados estén a la izq. */
table thead th {
  text-align: left;
  padding-left: 12px;
}

/* ==== INDENTAR CELDAS DE DATOS, EXCLUYENDO LA COLUMNA DE ACCIONES ==== */
table tbody td:not(:last-child) {
  text-align: left;      /* alineación a la izquierda */
  padding-left: 12px;    /* sangría para el “indentado” */
}

/* Mantener la columna de acciones centrada */
table tbody td:last-child {
  text-align: left;
  padding-left: 0;       /* sin sangría */
}

#modalRiesgos .modal-contenido table .inpNota {
  width: 100%;
  box-sizing: border-box;
  min-width: 200px; /* opcional, para anchos muy grandes */
}

/* En tu CSS global (crudStyles.css) */
#modalRiesgos .modal-contenido input.inpCob,
#modalRiesgos .modal-contenido input.inpPorDed,
#modalRiesgos .modal-contenido input.inpMonCob,
#modalRiesgos .modal-contenido input.inpMonDed {
  min-width: 120px;     /* más espacio mínimo */
  max-width: 180px;     /* límite razonable para no romper la tabla */
  width: auto;          /* deja que se adapte */
  text-align: right;    /* números alineados a la derecha */
  padding: 6px 8px;     /* más cómodo para leer */
 /* font-family: monospace; x opcional: hace que los números se alineen mejor */
}
/* Observaciones ocupa el resto */
#modalRiesgos .modal-contenido input.inpNota {
  width: calc(100% - 88px); /* 100% de la celda menos margen de los inputs anteriores */
  box-sizing: border-box;
}

/* 1) Alinea el botón “Guardar” a la derecha dentro del modal de beneficios */
#modalRiesgos .botones-modal {
  justify-content: flex-end;
  gap: 12px;
  padding: 12px;       /* opcional: un poco de espacio */
}

/* 2) Dale al botón “Guardar Beneficios” el mismo azul del header */
#btnGuardarBeneficios {
  padding: 10px 2px;
  font-size: 14px;
  background-color: #3a86ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 145px; 
  white-space: nowrap;
  transition: background-color 0.3s ease;
}
#btnGuardarBeneficios:hover {
  background-color: #2f6ee2;
}

/* Añade esto al final de tu crudStyles.css o en tu CSS específico */
#modalRiesgos .modal-contenido .botones-modal {
  width: 95%;            /* mismo ancho que la tabla */
  margin: 10px auto 0;   /* centra horizontalmente y separa un poco de la tabla */
  display: flex;         
  justify-content: flex-end; /* sitúa el botón en la esquina derecha */
  gap: 8px;              /* espacio entre botones */
}

.modal-beneficios-plan {
  width: min(98vw, 1500px) !important;
  max-width: min(98vw, 1500px) !important;
  height: min(92vh, 900px) !important;
  max-height: min(92vh, 900px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 18px 20px 20px !important;
}

.tabla-beneficios-plan {
  width: 100% !important;
  table-layout: fixed;
}

.tabla-beneficios-plan th,
.tabla-beneficios-plan td {
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
}

.tabla-beneficios-plan th:nth-child(1),
.tabla-beneficios-plan td:nth-child(1) { width: 4%; }

.tabla-beneficios-plan th:nth-child(2),
.tabla-beneficios-plan td:nth-child(2) { width: 20%; }

.tabla-beneficios-plan th:nth-child(3),
.tabla-beneficios-plan td:nth-child(3) { width: 13%; }

.tabla-beneficios-plan th:nth-child(4),
.tabla-beneficios-plan td:nth-child(4) { width: 16%; }

.tabla-beneficios-plan th:nth-child(5),
.tabla-beneficios-plan td:nth-child(5) { width: 13%; }

.tabla-beneficios-plan th:nth-child(6),
.tabla-beneficios-plan td:nth-child(6) { width: 16%; }

.tabla-beneficios-plan th:nth-child(7),
.tabla-beneficios-plan td:nth-child(7) { width: 18%; }

.tabla-beneficios-plan .inpCob,
.tabla-beneficios-plan .inpPorDed,
.tabla-beneficios-plan .inpMonCob,
.tabla-beneficios-plan .inpMonDed,
.tabla-beneficios-plan .inpNota {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box;
}

.tabla-beneficios-plan .inpNota {
  resize: vertical;
  min-height: 52px;
}

/* Tres campos en línea: igual ancho y separación */
.inline-3 {
  display: flex;
  gap: 16px;
  margin: 6px 0 16px;
}
.inline-3 > div {
  flex: 1; /* cada uno ocupa el mismo espacio */
}

/* Dos campos en línea */
.inline-2 {
  display: flex;
  gap: 16px;
  margin: 6px 0 16px;
}
.inline-2 > div {
  flex: 1;
}

/* Asegura que los labels y inputs internos ocupen 100% */
.inline-3 label,
.inline-2 label,
.inline-3 input,
.inline-2 input {
  display: block;
  width: 100%;
}

#tituloRiesgos {
  margin-left: 0;
  padding-left: 8px;
  text-align: left;
}

.form-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.dos-columnas {
  grid-template-columns: repeat(2, 1fr);
}

.tres-columnas {
  grid-template-columns: repeat(3, 1fr);
}

.cuatro-columnas {
  grid-template-columns: repeat(4, 1fr);
}

.una-columna {
  grid-template-columns: 1fr;
}

.cinco-columnas {
  grid-template-columns: repeat(5, 1fr);
}

fieldset {
  border: 1px solid #ccc;
  padding: 0.8rem 1rem 0.6rem 1rem; /* reduce bottom padding un poco más */
  margin-bottom: 0.6rem;            /* acercar fieldset a los botones */
}

legend {
  font-weight: bold;
  padding: 0 0.5rem;
}

.oculto { display: none; }

/* Grid de 5 columnas, todos alineados centro vertical */
.form-grid.cinco-columnas {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;               /* espaciado horizontal */
  align-items: center;     /* centra verticalmente input+label */
}

/* Cada celda */
.form-grid.cinco-columnas .item {
  display: flex;
  align-items: center;
}

/* Asegura que el label que rodea el checkbox lo centre bien */
.form-grid.cinco-columnas .item label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* Separación entre radio buttons */
.inline-radios {
  display: flex;
  gap: 0.5rem;
  margin-left: 0.5rem; /* separación del label principal */
}

/* Hacer que el grupo Estado use una sola columna */
#grupoEstadoCliente, #grupoEstadoPersona {
  grid-template-columns: 1fr !important;
}

/* Que las opciones de radio ocupen toda la fila y queden separadas */
#grupoEstadoCliente .radio-options, #grupoEstadoPersona .radio-options {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

/* Estilos específicos para el campo Estado en personas */
#grupoEstadoPersona {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#grupoEstadoPersona > label {
  font-weight: bold !important;
  margin-bottom: 0;
  color: #333;
  font-size: 14px;
}

#grupoEstadoPersona .radio-options {
  display: flex;
  gap: 25px;
  align-items: center;
  margin-top: 5px;
}

#grupoEstadoPersona .radio-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal !important;
  cursor: pointer;
  line-height: 1.2;
  margin-bottom: 0;
  font-size: 14px;
}

#grupoEstadoPersona .radio-options input[type="radio"] {
  margin: 0;
  padding: 0;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  position: relative;
  top: 0;
}

/* Estilo para el fieldset de Datos Generales */
.fieldset-general, .fieldset-clasificacionCliente, .fieldset-divisionCartera {
  border: 1px solid #3a86ff;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
  background-color: #f1f5ff;
}

/* modal agregar editar para cliente*/

.modal-contenidoCliente {
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  width: 95%;
  max-width: 1400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  box-sizing: border-box;
}

/* ================================
   Selects en el modal Agregar/Editar Cliente
   ================================ */
.modal-contenidoCliente select,
.modal-contenidoPersona select,
.modal-contenidoCliente-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  margin: 6px 0;
  background-color: #fff;
  box-sizing: border-box;
}

.form-grid.tres-columnas {
  display: grid;                         /* ya lo tienes, pero reforzamos */
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;                             /* o el gap que uses */
  align-items: center;                   /* alinea labels/select/checks */
}

.align-center {
  align-items: center;
}

.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tab-btn {
  padding: .5rem 1rem;
  cursor: pointer;
  border: none;
  background: #eee;
  border-radius: .25rem;
}
.tab-btn.active {
  background: #ddd;
  font-weight: bold;
}
.tab-content.oculto {
  display: none;
}
.tab-content {
  /* separador visual opcional */
  padding-top: 1rem;
  border-top: 1px solid #ccc;
}
.tabla-canales {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}
.tabla-canales th, .tabla-canales td {
  border: 1px solid #ccc;
  padding: .5rem;
  text-align: left;
}

.tabla-roles {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}
.tabla-roles th, .tabla-roles td {
  border: 1px solid #ccc;
  padding: .5rem;
  text-align: left;
}

.tabla-roles-listado {
  table-layout: fixed;
}

.tabla-roles-listado th:nth-child(1),
.tabla-roles-listado td:nth-child(1) {
  width: 22%;
  text-align: left;
}

.tabla-roles-listado th:nth-child(2),
.tabla-roles-listado td:nth-child(2) {
  width: 50%;
  text-align: left;
}

.tabla-roles-listado th:nth-child(3),
.tabla-roles-listado td:nth-child(3) {
  width: 10%;
}

.tabla-roles-listado th:nth-child(4),
.tabla-roles-listado td:nth-child(4) {
  width: 18%;
}

.tabla-roles-listado td:nth-child(2) {
  white-space: normal;
  overflow: hidden;
  text-align: left;
}

.roles-descripcion-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  max-height: calc(1.35em * 2);
}

.tabla-cuentas {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}
.tabla-cuentas th, .tabla-cuentas td {
  border: 1px solid #ccc;
  padding: .5rem;
  text-align: left;
}

/* Grid de 5 columnas, todos alineados en el centro vertical */
.form-grid.cinco-columnas {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  align-items: center;
}

/* 2) Estilo para el botón “Agregar canal” */
#btnAgregarCanal, #btnAgregarEmpleador {
  background-color: #007bff;      /* mismo azul que tu btnAgregar */
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color .2s;
}

#btnAgregarCanal:hover, #btnAgregarEmpleador:hover {
  background-color: #0056b3;      /* un tono más oscuro al pasar el ratón */
}

#btnAgregarDireccion {
  background-color: #007bff;      /* mismo azul que tu btnAgregar */
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color .2s;
}

#btnAgregarDireccion:hover {
  background-color: #0056b3;      /* un tono más oscuro al pasar el ratón */
}

/* Ancho máximo igual que el de cliente */
#modalConfirmCanal .modal-contenido {
  max-width: 400px;
  padding: 24px 20px;
  text-align: center;
  margin: 0 auto;
}

/* Misma tipografía y espaciado */
#modalConfirmCanal h3 {
  font-size: 16px;
  color: #2d2d2d;
  margin-bottom: 20px;
}

/* Botones “Eliminar” y “Cancelar” con los mismos colores */
#modalConfirmCanal #btnConfirmarCanal {
  background-color: #d90429;
  color: white;
}
#modalConfirmCanal #btnConfirmarCanal:hover {
  background-color: #a80321;
}

#modalConfirmCanal #btnCancelarCanal {
  background-color: #6c757d;
  color: white;
}
#modalConfirmCanal #btnCancelarCanal:hover {
  background-color: #495057;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-contenido {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  width: 100%;
  max-width: 500px;
  text-align: center;
}

.botones-modal {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.btn-confirmar {
  background-color: #d90429;
  color: white;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.btn-confirmar:hover{
  background-color: #a80321;
}

.btn-cancelar {
  background-color: #6c757d;
  color: white;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.btn-cancelar:hover{
  background-color: #495057;
}

.tabla-direcciones {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Estilo para alinear los botones a la derecha y limitar su ancho */
.btns-derecha {
  display: flex;
  justify-content: flex-end;
  width: 50%;
  margin-left: auto;
  gap: 1rem;
  margin-top: 1.5rem;
}

.boton-guardar {
  background-color: #00b894;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.boton-guardar:hover {
  background-color: #019875;
}

.modal-contenido label {
  display: block;
  text-align: left;
  font-weight: 500;
  margin-bottom: 4px;
  align-items: flex-start !important;
}

.subtitulo-canales {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
}

/* Asegura que cada fila de canal quede en línea */
.canal-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Opcional: ajusta el select e input para que compartan espacio */
.canal-row select,
.canal-row input {
  flex: 1;
}
.canal-row button.btn-eliminar-canal {
  flex: 0 0 auto;
  font-size: 1.2rem;
  line-height: 1;
}

/* ===== BOTONES “AGREGAR” ===== */
#btnAgregarContacto,
#btnAgregarCuenta,
#btnAsignarRol,
#btnAnadirCanalContacto {
  padding: 10px 16px;
  font-size: 14px;
  background-color: #007bff;  /* azul vivo */
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  margin: 0.5rem 0;            /* opcional: separarlos un poco del contenido */
}

#btnAgregarContacto:hover,
#btnAnadirCanalContacto:hover {
  background-color: #0056b3;  /* azul más oscuro al hover */
}

/* —— Tabla de Contactos full width —— */
#tab-contactos .tabla-contactos {
  width: 100% !important;
  margin: 0 !important;
  min-width: 0 !important;
  table-layout: fixed;;      /* deja que las columnas se ajusten a su contenido */
}

#tab-contactos .tabla-contactos th,
#tab-contactos .tabla-contactos td {
  padding: 12px 8px;
  text-align: left;        /* alinea a la izquierda para aprovechar mejor el espacio */
}

.tab-content table {
  width: 100%;            /* Anula el 95% y hace que ocupe el ancho completo */
  margin: 25px 0 0 0;     /* Añade espacio arriba y elimina el centrado (margin: 0 auto) */
  box-sizing: border-box; /* Asegura que el padding y borde no afecten el ancho total */
}

/* Crea una rejilla de dos columnas con proporción 70% / 30% */
.grid-70-30 {
  display: grid;
  grid-template-columns: 7fr 3fr; /* 7 partes para el primero, 3 para el segundo */
  gap: 1rem;
}

/* Contenedor para alinear el botón a la derecha */
.grid-boton-derecha {
  display: flex;
  justify-content: flex-end; /* Alinea el contenido (el botón) a la derecha */
  margin-top: 1rem; /* Un poco de espacio superior */
}

/* === Vencimientos === */
.text-danger { color: #d90429; font-weight: 600; }   /* vencido o hoy */
.text-warning { color: #b26b00; font-weight: 600; }  /* <= 30 días */

/* Contenedor paginación + leyenda (misma fila) */
.pie-listado {
  width: 95%;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pie-listado .paginacion {
  flex: 1;
  text-align: center; /* mantiene la paginación centrada */
}

.leyenda-vencimientos {
  font-size: 12px;
  color: #555;
  display: flex;
  gap: 12px;
  align-items: center;
}

.leyenda-vencimientos .item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.leyenda-vencimientos .badge {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.badge-danger { background-color: #d90429; }
.badge-warning { background-color: #b26b00; }

/* ========================================
   SOLICITUDES DE MOVIMIENTO - Reference Styles
   ======================================== */
#main-content.smv-container {
  width: auto;
  max-width: none;
  min-width: 0;
  margin-top: 10px;
  margin-right: 30px;
  margin-bottom: 10px;
  background-color: #ffffff;
  padding: 30px 40px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}
.smv-back-link { display: inline-block; margin-bottom: 15px; font-weight: 600; color: #555; text-decoration: none; padding: 8px 15px; border-radius: 5px; background-color: #e9ecef; transition: background-color 0.2s; }
.smv-back-link:hover { background-color: #dee2e6; color: #333; }
.smv-title { color: #2c3e50; font-size: 1.9em; margin-bottom: 15px; margin-top: 5px; display: flex; align-items: center; gap: 15px; }

.smv-controls-bar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee; flex-wrap: wrap; gap: 15px; }
.smv-controls-left { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.smv-controls-right { display: flex; gap: 15px; align-items: flex-end; flex-wrap: wrap; }
.smv-toolbar-item { display: flex; flex-direction: column; }
.smv-toolbar-item label { font-size: 0.85em; font-weight: 600; color: #555; margin-bottom: 4px; }
.smv-toolbar-input { height: 38px; padding: 0 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.95em; min-width: 140px; box-sizing: border-box; line-height: 36px; }
.smv-add-btn { background-color: #1f6feb; color: white; padding: 0 20px; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 38px; transition: background-color 0.3s; }
.smv-add-btn:hover { background-color: #2980b9; }

.smv-poliza-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background-color: #e3f2fd; border: 1px solid #1f6feb; border-radius: 16px; color: #1565c0; font-size: 14px; }
.smv-poliza-badge strong { font-weight: 700; }
.smv-badge-close { background: none; border: none; color: #d32f2f; cursor: pointer; font-size: 14px; padding: 2px 6px; margin-left: 4px; border-radius: 50%; transition: background-color 0.2s; }
.smv-badge-close:hover { background-color: rgba(211, 47, 47, 0.1); }

.smv-table-wrapper { overflow-x: visible; width: 100%; border: 1px solid #eee; border-radius: 8px; }
.smv-data-table { width: 100%; border-collapse: collapse; }
.smv-data-table thead { background-color: #1f6feb; }
.smv-data-table th, .smv-data-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #ddd; vertical-align: top; font-size: 0.88em; }
.smv-data-table thead th { color: white; font-weight: 600; white-space: nowrap; }
.smv-data-table tbody tr:hover { background-color: #f9fbfd; transition: background-color 0.2s; }

.smv-caso-numero { font-size: 15px; font-weight: bold; color: #1976d2; margin-bottom: 5px; display: block; }
.smv-fecha-item { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 3px; color: #424242; }
.smv-fecha-item i { color: #1976d2; font-size: 12px; width: 14px; }
.smv-fecha-item strong { font-weight: 600; color: #212121; margin-right: 4px; }

.smv-poliza-info, .smv-cliente-info, .smv-aseguradora-info, .smv-ramo-info { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; color: #424242; }
.smv-poliza-info i { color: #1976d2; }
.smv-cliente-info i { color: #388e3c; }
.smv-aseguradora-info i { color: #f57c00; }
.smv-ramo-info i { color: #7b1fa2; }
.smv-poliza-info strong, .smv-cliente-info strong, .smv-aseguradora-info strong, .smv-ramo-info strong { font-weight: 600; color: #212121; }

.smv-concepto { font-size: 13px; color: #424242; margin-bottom: 6px; line-height: 1.4; display: flex; gap: 6px; }
.smv-concepto i { color: #1976d2; margin-top: 2px; }
.smv-ref-aseg, .smv-prima { font-size: 13px; color: #424242; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.smv-ref-aseg i { color: #f57c00; }
.smv-prima i { color: #388e3c; }

.smv-asignado, .smv-responsable { font-size: 13px; color: #424242; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.smv-asignado i { color: #1976d2; }
.smv-responsable i { color: #f57c00; }
.smv-sin-asignar { font-size: 13px; color: #9e9e9e; font-style: italic; display: flex; align-items: center; gap: 6px; }

.smv-pie-listado { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; flex-wrap: wrap; gap: 10px; }
.smv-pie-izq { font-size: 14px; color: #555; }
.smv-info-registros { font-weight: 600; }
.smv-paginacion { display: flex; gap: 5px; }
.smv-paginacion button { padding: 6px 12px; border: 1px solid #ddd; background-color: #fff; color: #555; cursor: pointer; border-radius: 4px; font-size: 14px; transition: all 0.2s; }
.smv-paginacion button:hover { background-color: #f5f5f5; border-color: #1f6feb; }
.smv-paginacion button.activo { background-color: #1f6feb; color: white; border-color: #1f6feb; font-weight: 600; }

/* CONTEXT HEADER - Rich Policy Information Table (Reference Style) */
.smv-context-header { background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 25px; border: 1px solid #ddd; }
.smv-context-header .client-name.contextual { margin-bottom: 10px; border-bottom: none; padding-bottom: 0; font-size: 1.1em; margin-top: 0; }
.smv-context-header .table-wrapper { overflow-x: visible; width: 100%; }
.smv-context-header .data-table { width: 100%; border-collapse: collapse; }
.smv-context-header .data-table thead { background-color: #3498db; }
.smv-context-header .data-table th, .smv-context-header .data-table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid #ddd; vertical-align: middle; word-wrap: break-word; }
.smv-context-header .data-table thead th { color: white; font-weight: 500; vertical-align: bottom; text-align: left; }
.smv-context-header .policy-main-info .policy-number { font-size: 1.2em; font-weight: 700; color: #3498db; margin-bottom: 5px; display: block; }
.smv-context-header .policy-details .data-value { font-size: 0.95em; font-weight: 500; color: #555; display: block; line-height: 1.3; }
.smv-context-header .field-group { display: flex; align-items: center; font-size: 0.9em; margin-bottom: 4px; }
.smv-context-header .field-label { color: #666; font-weight: 500; margin-right: 8px; flex-shrink: 0; }
.smv-context-header .field-value { font-weight: 600; color: #333; }
.smv-context-header .line-group { display: flex; justify-content: flex-start; gap: 15px; align-items: center; }
.smv-context-header .status-vigente, .smv-context-header .status-activo { color: #27ae60; background-color: #e8f8ef; padding: 4px 10px; border-radius: 12px; font-weight: 700; font-size: 0.75em; text-transform: uppercase; display: inline-block; }
.smv-context-header .status-cancelada, .smv-context-header .status-excluido { color: #e74c3c; background-color: #fdedec; padding: 4px 10px; border-radius: 12px; font-weight: 700; font-size: 0.75em; text-transform: uppercase; display: inline-block; }
.smv-context-header .status-consumida { color: #E91E63; background-color: #FCE4EC; padding: 4px 10px; border-radius: 12px; font-weight: 700; font-size: 0.75em; text-transform: uppercase; display: inline-block; }
.smv-context-header .balance-highlight { font-weight: 700; font-size: 1.05em; color: #e74c3c; padding: 2px 6px; border-radius: 4px; background-color: #fdedec; display: inline-block; }
.smv-context-header .balance-highlight.settled { color: #27ae60; background-color: #e8f8ef; }

button.solicitud-movimiento { background-color: #1f6feb; color: white; border: none; width: 32px; height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); cursor: pointer; transition: all 0.2s; }
button.solicitud-movimiento:hover { filter: brightness(0.95); transform: translateY(-1px); }

/* FORM STYLES FOR SOLICITUD MODAL */
#modalSolicitud .modal-contenidoCliente {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

#modalSolicitud #formSolicitud {
    background-color: #f1f5ff;
    border: 1px solid #3a86ff;
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 15px;
}

.smv-form-row { display: flex; gap: 20px; margin-bottom: 15px; flex-wrap: wrap; }
.smv-form-group { flex: 1; display: flex; flex-direction: column; min-width: 150px; }
.smv-form-group label { font-weight: 600; font-size: 0.9em; color: #555; margin-bottom: 6px; }
.smv-form-group .form-control { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; box-sizing: border-box; font-size: 0.95em; }
.smv-form-group textarea.form-control { min-height: 80px; resize: vertical; }
.smv-form-group select.form-control { height: 38px; }
.smv-form-group input[type="date"].form-control,
.smv-form-group input[type="number"].form-control,
.smv-form-group input[type="text"].form-control { height: 38px; }
.smv-form-group .required { color: #e74c3c; margin-left: 3px; }

/* ========================================
   TABLA DE SOLICITUDES - Reference Styles
   ======================================== */
.cell-group { display: flex; flex-direction: column; gap: 4px; }
.data-pair { display: flex; flex-direction: column; margin-bottom: 3px; }
.data-label { font-size: 0.8em; color: #777; line-height: 1.1; letter-spacing: 0.3px; }
.data-value { font-weight: 600; color: #333; font-size: 0.85em; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }

.chrono-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 2px; }

.status-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-weight: 700; font-size: 0.75em; text-transform: uppercase; margin-bottom: 5px; text-align: center; min-width: 140px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; gap: 6px; }

.badge { padding: 4px 8px; border-radius: 4px; color: white; font-size: 0.7em; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; width: fit-content; white-space: nowrap; }

.badge-days { background-color: #eceff1; color: #455a64; padding: 2px 6px; border-radius: 4px; font-size: 0.8em; font-weight: bold; border: 1px solid #cfd8dc; }

/* Days Indicator Badges */
.days-indicator { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 12px; font-weight: 700; font-size: 0.85em; margin-top: 2px; transition: all 0.3s ease; }
.days-safe { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.days-warning { background-color: #fce4ec; color: #c2185b; border: 1px solid #f8bbd0; }
.days-danger { background-color: #ffebee; color: #c62828; border: 1px solid #ffcdd2; box-shadow: 0 2px 4px rgba(198, 40, 40, 0.1); }

.money-val { font-family: 'Consolas', monospace; font-weight: 700; font-size: 0.95em; }
.money-sol { color: #2980b9; }
.money-arr { color: #27ae60; }

.user-avatar { width: 24px; height: 24px; background: #e0e0e0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7em; color: #555; margin-right: 6px; font-weight: bold; }

.note-text { background-color: #fff3cd; padding: 6px; border-radius: 4px; font-size: 0.85em; color: #856404; margin-top: 6px; border-left: 3px solid #ffeeba; line-height: 1.3; }

.note-preview { background-color: #fff8e1; border-left: 3px solid #ffc107; padding: 4px 6px; font-size: 0.8em; color: #555; border-radius: 0 4px 4px 0; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; display: inline-block; }

.actions-cell { text-align: center !important; vertical-align: middle !important; }
.action-group { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.action-btn { width: 28px; height: 28px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: white; text-decoration: none; transition: opacity 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1); cursor: pointer; border: none; font-size: 0.8em; }
.action-btn:hover { opacity: 0.85; }
.btn-docs { background-color: #ff9800; }
.btn-edit { background-color: var(--success-color); }
.btn-note { background-color: var(--warning-color); }
.btn-soportes { background-color: var(--info-color); }
.btn-delete { background-color: var(--danger-color); }
.btn-del { background-color: #e74c3c; }

@media (max-width: 1400px) {
  #main-content.smv-container { width: auto; max-width: none; min-width: 0; padding: 25px 32px; margin-top: 10px; margin-right: 30px; margin-bottom: 10px; }
  .smv-data-table th, .smv-data-table td { padding: 8px 6px; font-size: 0.84em; }
  .chrono-grid { grid-template-columns: 1fr; }
  .status-badge { min-width: 120px; font-size: 0.7em; }
}

/* ========================================
   REGISTRO DE NOTA - Reference Styles
   ======================================== */
.rnc-container { max-width: 1600px; margin: 10px auto; background-color: #ffffff; padding: 30px 40px; border-radius: 8px; box-shadow: 0 4px 4px rgba(0,0,0,0.05); }
.rnc-back-link { display: inline-block; margin-bottom: 15px; font-weight: 600; color: var(--dark-gray); text-decoration: none; padding: 8px 15px; border-radius: 5px; background-color: #e9ecef; transition: background-color 0.2s; border: none; cursor: pointer; }
.rnc-back-link:hover { background-color: #dee2e6; color: #333; }

.rnc-h1-title { font-size: 1.8em; color: var(--dark-gray); border-bottom: 2px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }

/* ESTILOS DE PESTAÑAS */
.rnc-nav-tabs { display: flex; flex-wrap: wrap; border-bottom: 2px solid var(--border-color); margin-bottom: 20px; }
.rnc-nav-link { 
    padding: 10px 20px; border: none; background-color: transparent; 
    cursor: pointer; font-size: 1em; color: var(--dark-gray); 
    border-bottom: 3px solid transparent; margin-bottom: -2px; 
    transition: all 0.2s; display: flex; align-items: center; gap: 8px; 
}
.rnc-nav-link.rnc-active { font-weight: bold; color: var(--primary-color); border-bottom-color: var(--primary-color); }
.rnc-tab-pane { display: none; min-height: 200px; padding: 10px 0; }
.rnc-tab-pane.rnc-active { display: block; }

/* Ocultar botón de pestaña de registro */
#registro-notas-nav .rnc-nav-link[data-tab="tab-registro"] {
    display: none;
}

/* CONTEXTO DE PÓLIZA */
.rnc-context-info-box {
    background-color: #f8f9fa; padding: 15px 20px; border-radius: 6px; 
    border: 1px solid var(--border-color); margin-bottom: 25px; font-size: 0.95em;
}
.rnc-client-context-title { font-weight: 500; color: var(--dark-gray); font-size: 1.1em; margin-bottom: 10px; }
.rnc-client-context-title strong { font-weight: 700; color: #333; }

.rnc-policy-context-table-wrapper { overflow-x: visible; border-radius: 8px; border: 1px solid #ddd; overflow: hidden; }
.rnc-policy-context-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.rnc-policy-context-table thead { background-color: var(--primary-color); }
.rnc-policy-context-table th { padding: 12px 10px; color: white; font-weight: 600; }
.rnc-policy-context-table th:first-child { border-top-left-radius: 8px; }
.rnc-policy-context-table th:last-child { border-top-right-radius: 8px; }
.rnc-policy-context-table td { padding: 8px 10px; border-bottom: 1px solid #eee; vertical-align: top; line-height: 1.35; background-color: white; color: #444; }
.rnc-policy-number-style { color: #2c3e50; font-weight: 700; font-size: 1.05em; display: block; }
.rnc-policy-details .rnc-data-value { font-size: 0.95em; font-weight: 500; color: #555; display: block; line-height: 1.3;}
.rnc-field-group { display: flex; align-items: center; font-size: 0.9em; margin-bottom: 4px; }
.rnc-field-label { color: #666; font-weight: 500; margin-right: 8px; flex-shrink: 0; }
.rnc-field-value { font-weight: 600; color: #333; }
.rnc-line-group { display: flex; justify-content: flex-start; gap: 15px; align-items: center; margin-bottom: 4px;}

/* CONTEXTO DE CASO */
.rnc-case-detail-box {
    background-color: #ffffff; 
    padding: 0; 
    margin-bottom: 25px;
}
.rnc-case-detail-box h2 {
    font-size: 1.4em; color: var(--primary-color); 
    display: flex; align-items: center; gap: 10px;
}

.rnc-case-context-table-wrapper {
    overflow-x: visible;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 5px; 
}
.rnc-case-context-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.rnc-case-context-table th:nth-child(1), .rnc-case-context-table td:nth-child(1) { width: 15%; }
.rnc-case-context-table th:nth-child(2), .rnc-case-context-table td:nth-child(2) { width: 20%; }
.rnc-case-context-table th:nth-child(3), .rnc-case-context-table td:nth-child(3) { width: 25%; }
.rnc-case-context-table th:nth-child(4), .rnc-case-context-table-td:nth-child(4) { width: 20%; }
.rnc-case-context-table th:nth-child(5), .rnc-case-context-table-td:nth-child(5) { width: 20%; }

.rnc-case-context-table thead {
    background-color: var(--primary-color);
    border-bottom: 1px solid #ddd;
}
.rnc-case-context-table th {
    padding: 12px 10px; 
    text-align: left;
    font-weight: 600;
    color: white;
}

.rnc-case-context-table th:first-child { border-top-left-radius: 8px; }
.rnc-case-context-table th:last-child { border-top-right-radius: 8px; }

.rnc-case-context-table td {
    padding: 12px 10px;
    vertical-align: top;
    background-color: white;
}
.rnc-case-context-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid #eee;
}

.rnc-data-block { 
    margin-bottom: 5px; 
    line-height: 1.1; 
}
.rnc-data-block .rnc-data-label { 
    font-size: 0.85em; 
    color: var(--text-muted); 
    font-weight: 500; 
    display: block; 
}
.rnc-data-block .rnc-data-value { 
    font-size: 0.95em; 
    font-weight: 600; 
    color: #333; 
    display: block; 
}

.rnc-money-sol-val {
     color: #2980b9; 
     font-weight: 700;
}
.rnc-date-danger {
    color: var(--danger-color); 
    font-weight: 700;
}
.rnc-note-text-homologated {
    background-color: #fff3cd; 
    padding: 6px; 
    border-radius: 4px; 
    font-size: 0.85em; 
    color: #856404; 
    margin-top: 6px; 
    border-left: 3px solid #ffeeba; 
    line-height: 1.3;
}
.rnc-gestion-pair {
    display: flex;
    align-items: center;
    gap: 5px;
}
.rnc-user-avatar-badge {
    width: 24px;
    height: 24px;
    background: #e1f5fe; 
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    color: #0277bd; 
    font-weight: bold;
    flex-shrink: 0;
}

.rnc-badge-days { 
    background-color: #eceff1; 
    color: #455a64; 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-size: 0.8em; 
    font-weight: 600; 
    border: 1px solid #cfd8dc; 
    min-width: 140px; 
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 5px;
    margin-top: 5px; 
    box-sizing: border-box;
}

.rnc-case-data-col strong { color: #2c3e50; font-weight: 700; display: block; }
.rnc-case-data-col .rnc-movement-type { font-weight: 700; color: var(--primary-color); margin-bottom: 5px; display: block; }

/* Grilla de fechas cronológicas */
.chrono-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 8px 15px; 
}

/* Status badge con tamaño mínimo y centrado */
.status-badge {
     min-width: 140px;
     display: inline-flex !important;
     align-items: center;
     justify-content: center;
     margin-bottom: 5px;
     gap: 5px;
     padding: 4px 10px;
     border-radius: 12px;
     font-weight: 700;
     font-size: 0.8em;
     text-transform: uppercase;
}

/* Variantes de status badge */
.status-vigente { color: var(--success-color); background-color: #e8f8ef; }
.status-cancelada { color: var(--danger-color); background-color: #fdedec; }
.status-consumida { color: var(--pink-color); background-color: #FCE4EC; }

/* GRILLA DE NOTAS */
.rnc-notes-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px; 
    padding-top: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}
.rnc-notes-controls-bar h3 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.1em;
    color: var(--dark-gray);
}

.rnc-btn-add-note {
    background-color: var(--success-color);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}
.rnc-btn-add-note:hover {
    background-color: #2ecc71;
}

.rnc-notes-table-wrapper {
    overflow-x: visible;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}
.rnc-notes-table {
    width: 100%;
    border-collapse: collapse;
}
.rnc-notes-table thead {
  background-color: #f8f9fa !important;
  border-bottom: 1px solid #e1e6ec;
}
.rnc-notes-table thead th:first-child {
  border-top-left-radius: 6px;
}
.rnc-notes-table thead th:last-child {
  border-top-right-radius: 6px;
}
.rnc-notes-table th, .rnc-notes-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
    vertical-align: top;
}
.rnc-notes-table th {
    font-weight: 600;
  color: #5f6b7a;
  letter-spacing: 0.5px;
}
.rnc-notes-table td {
  color: #444;
}
.rnc-notes-table tbody tr:nth-child(even) {
  background-color: #fcfdff;
}
.rnc-notes-table tbody tr:hover {
  background-color: #f2f8ff;
}

.rnc-note-empty-text {
    font-style: italic;
    color: var(--text-muted-color, #6c757d);
}

.rnc-note-status-block {
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 0.85em;
    margin-top: 4px;
    line-height: 1.3;
}
.rnc-note-status-current {
    font-weight: 700;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    display: inline-block;
}
.rnc-note-status-transition-label {
     font-size: 0.8em;
     color: #777;
     display: block;
     margin-top: 4px;
}

.rnc-notification-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.rnc-notification-flag {
    font-weight: 700;
    color: var(--info-color);
    background-color: #e6f7ff;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.rnc-notification-details {
    font-size: 0.8em;
    color: var(--text-muted);
}

.rnc-note-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.rnc-note-action-btn {
    padding: 6px 10px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-size: 0.8em;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rnc-note-action-btn:hover {
    opacity: 0.8;
}
.rnc-btn-note-edit {
  background-color: var(--warning-color);
}
.rnc-btn-note-delete {
    background-color: var(--danger-color);
}

/* FORMULARIO DE REGISTRO */
.rnc-form-container-note { 
    background-color: #fdfdfd; 
    padding: 25px; 
    border: 1px solid #eef; 
    border-radius: 8px; 
}
.rnc-form-title-note {
    font-size: 1.4em; 
    color: var(--primary-color); 
    margin-bottom: 20px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid #eee;
}
.rnc-form-subtitle {
    border-bottom: 1px solid #eee; 
    padding-bottom: 5px; 
    margin-top: 20px;
}
.rnc-form-row { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 15px; 
    flex-wrap: wrap; 
}
.rnc-form-group { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    min-width: 150px; 
}
.rnc-form-group label { 
    font-weight: 600; 
    font-size: 0.9em; 
    color: #555; 
    margin-bottom: 6px; 
}
.rnc-form-control { 
    width: 100%; 
    padding: 8px 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    font-family: inherit; 
    box-sizing: border-box; 
}
textarea.rnc-form-control { 
    min-height: 100px; 
    resize: vertical; 
}
.rnc-checkbox-group {
    display: flex; 
    align-items: center; 
    padding-top: 8px;
    gap: 8px;
}
.rnc-checkbox-group input[type="checkbox"] {
    width: auto;
    height: 16px;
}
.rnc-required { 
    color: var(--danger-color); 
    margin-left: 3px; 
}

/* ACCIONES */
.rnc-form-actions { 
    padding-top: 20px; 
    border-top: 1px solid var(--border-color); 
    text-align: right; 
    margin-top: 20px; 
}

.rnc-form-actions .btn {
  padding: 12px 24px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1em;
  background-color: transparent;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.rnc-form-actions .btn-primary {
  background-color: var(--primary-color, #3498db);
  color: #fff;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.rnc-form-actions .btn-primary:hover {
  background-color: #2980b9;
}

/* Círculos para DD (S/N) */
/* Círculos sólidos con texto blanco */
.circle-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;              /* súbelo a 30px si ves el “Sí” muy justo */
  height:28px;
  border-radius:50%;
  font-weight:700;
  font-size:12px;
  line-height:1;
  color:#fff;              /* texto blanco */
  border:none;             /* sin borde */
}

.circle-badge--green{ background:#00b894; } /* verde sólido */
.circle-badge--red  { background:#ef233c; } /* rojo sólido */

/* Badges pequeños para roles */
.badge-small {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  color: white;
  font-weight: bold;
  margin-left: 8px;
  display: inline-block;
}

.badge-small.bg-success {
  background-color: #28a745;
}

.badge-small.bg-warning {
  background-color: #ffc107;
  color: #212529;
}

.badge-small.bg-danger {
  background-color: #dc3545;
}

/* =========================================
   Ajuste de Anchos para Tabla de Contactos
   ========================================= */
#tab-contactos .tabla-contactos th:nth-child(1),
#tab-contactos .tabla-contactos td:nth-child(1) {
  width: 14%; 
}

/* 2. Apellidos */
#tab-contactos .tabla-contactos th:nth-child(2),
#tab-contactos .tabla-contactos td:nth-child(2) {
  width: 14%;
}

/* 3. Tipo ID */
#tab-contactos .tabla-contactos th:nth-child(3),
#tab-contactos .tabla-contactos td:nth-child(3) {
  width: 6%;
}

/* 4. Número ID */
#tab-contactos .tabla-contactos th:nth-child(4),
#tab-contactos .tabla-contactos td:nth-child(4) {
  width: 10%;
}

/* 5. Departamento */
#tab-contactos .tabla-contactos th:nth-child(5),
#tab-contactos .tabla-contactos td:nth-child(5) {
  width: 12%;
}

/* 6. Cargo */
#tab-contactos .tabla-contactos th:nth-child(6),
#tab-contactos .tabla-contactos td:nth-child(6) {
  width: 9%;
}

/* 7. F. Nac. */
#tab-contactos .tabla-contactos th:nth-child(7),
#tab-contactos .tabla-contactos td:nth-child(7) {
  width: 6%;
}

/* 8. Canales */
#tab-contactos .tabla-contactos th:nth-child(8),
#tab-contactos .tabla-contactos td:nth-child(8) {
  width: 16%;
}

/* 9. Acciones */
#tab-contactos .tabla-contactos th:nth-child(9),
#tab-contactos .tabla-contactos td:nth-child(9) {
  width: 10%;
}
/* ==============================================
   Estilos para la Tabla de Datos Laborales (Empleadores)
   ============================================== */

/* 1. Forzar el ancho fijo de la tabla */
#tab-empleadores .tabla-empleadores {
  width: 100%;
  table-layout: fixed; /* ¡Esta es la clave! Obliga a la tabla a respetar el ancho. */
  margin-top: 1.5rem;  /* Un poco de espacio después del recuadro. */
}

/* 2. Controlar el desbordamiento de texto en las celdas */
#tab-empleadores .tabla-empleadores td {
  white-space: nowrap;     /* Evita que el texto salte a la siguiente línea. */
  overflow: hidden;        /* Oculta el texto que no cabe. */
  text-overflow: ellipsis; /* Muestra "..." al final del texto cortado. */
  text-align: left;        /* Alinea el texto a la izquierda para mejor lectura. */
}

/* 3. Asignar anchos a cada columna para una distribución óptima */
#tab-empleadores .tabla-empleadores th:nth-child(1) { width: 13%; } /* Empresa */
#tab-empleadores .tabla-empleadores th:nth-child(2) { width: 9%; } /* País */
#tab-empleadores .tabla-empleadores th:nth-child(3) { width: 9%; } /* Provincia */
#tab-empleadores .tabla-empleadores th:nth-child(4) { width: 9%; } /* Municipio */
#tab-empleadores .tabla-empleadores th:nth-child(5) { width: 17%; } /* Dirección */
#tab-empleadores .tabla-empleadores th:nth-child(6) { width: 8%; }  /* Teléfono */
#tab-empleadores .tabla-empleadores th:nth-child(7) { width: 12%; }  /* Email */
#tab-empleadores .tabla-empleadores th:nth-child(8) { width: 10%; } /* Fecha Ingreso */
#tab-empleadores .tabla-empleadores th:nth-child(9) { width: 10%; }  /* Acciones */

/* ——— Selección de cliente (polizas): modal grande y robusto ——— */
#modalSelCliente .modal-contenido{
  /* ancho y alto del modal */
  width: min(1800px, 98vw);
  max-width: none; 
  height: 90vh;
  max-height: 92vh;

  /* layout */
  display: flex;
  flex-direction: column;

  /* scroll interno sin que se mueva el fondo */
  overflow: hidden; /* contenedor sin scroll; lo hacemos en la tabla */
}

#modalSelCliente .tabla-wrapper{
  flex: 1;
  overflow-y: auto;  /* scroll sólo vertical para la tabla */
  overflow-x: hidden;
  min-height: 0;   /* evita que flex fuerce altura rara */
  max-height: 100%;
}

/* 2+1 columnas: buscador 2/3 y filtro 1/3 fijos */
#modalSelCliente .form-grid.tres-columnas {
  grid-template-columns: 2fr 1fr 220px; /* o 1fr 1fr 220px si prefieres */
}

/* En móviles ocupa casi toda la pantalla */
@media (max-width: 768px){
  #modalSelCliente .modal-contenido{
    width: 98vw;
    height: 90vh;
  }
}

/* Efecto hover para las filas de selección de cliente */
#modalSelCliente tbody tr:hover {
  background-color: #e6f0ff; /* Un suave resaltado azul */
  cursor: pointer;          /* Cambia el cursor a una mano */
}

/* 1. Centra el nuevo contenedor y le da el mismo ancho que tenía la tabla */
.modal-layout-container {
  width: 98%;
  margin: 0 auto; /* Esto lo centra horizontalmente */
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* 2. Hace que la tabla ocupe el 100% de su nuevo contenedor (en lugar de 95%) */
#modalSelCliente table {
  width: 100%;
  margin: 0; /* Reseteamos el margen que la centraba antes */
  table-layout: fixed;
  font-size: 12px;
}

#modalSelCliente th,
#modalSelCliente td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: none;
  padding: 10px 8px;
}

#modalSelCliente th:nth-child(1),
#modalSelCliente td:nth-child(1) { width: 4%; }

#modalSelCliente th:nth-child(2),
#modalSelCliente td:nth-child(2) { width: 18%; }

#modalSelCliente th:nth-child(3),
#modalSelCliente td:nth-child(3) { width: 5%; }

#modalSelCliente th:nth-child(4),
#modalSelCliente td:nth-child(4) { width: 5%; }

#modalSelCliente th:nth-child(5),
#modalSelCliente td:nth-child(5) { width: 6%; }

#modalSelCliente th:nth-child(6),
#modalSelCliente td:nth-child(6) { width: 8%; }

#modalSelCliente th:nth-child(7),
#modalSelCliente td:nth-child(7) { width: 7%; }

#modalSelCliente th:nth-child(8),
#modalSelCliente td:nth-child(8) { width: 8%; }

#modalSelCliente th:nth-child(9),
#modalSelCliente td:nth-child(9) { width: 7%; }

#modalSelCliente th:nth-child(10),
#modalSelCliente td:nth-child(10) { width: 8%; }

#modalSelCliente th:nth-child(11),
#modalSelCliente td:nth-child(11) { width: 10%; }

#modalSelCliente th:nth-child(12),
#modalSelCliente td:nth-child(12) { width: 9%; }

#modalSelCliente th:nth-child(13),
#modalSelCliente td:nth-child(13) { width: 5%; }

#modalSelCliente td:last-child,
#modalSelCliente th:last-child {
  text-align: center;
}

/* Mantener visibles los encabezados al hacer scroll en la lista de clientes */
#modalSelCliente .tabla-wrapper {
  position: relative;
}

#tablaSeleccionClientes {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: visible !important;
}

#tablaSeleccionClientes thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  background-color: #3a86ff !important;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.08), 0 3px 8px rgba(17, 24, 39, 0.12);
}

/* Mantener visibles los encabezados del listado principal de pólizas al hacer scroll */
#tablaListadoPolizas {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: visible !important;
}

#tablaListadoPolizas thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 15 !important;
  background-color: #3a86ff !important;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.08), 0 3px 8px rgba(17, 24, 39, 0.12);
}

/* ============================================= */
/* ==   MAQUETACIÓN GRID PARA FORMULARIO      == */
/* ============================================= */

.policy-form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem; /* Espacio vertical entre cada fila */
}

.form-row {
  display: grid;
  gap: 1rem; /* Espacio horizontal entre cada campo */
  align-items: end; /* Alinea los campos en la base para un look limpio */
}

/* Definición de las columnas para cada fila */
.form-row.cols-6 { grid-template-columns: repeat(6, 1fr); }
.form-row.cols-7 { grid-template-columns: repeat(7, 1fr); }

/* Distribución 30%/70% para la última fila */
.form-row.cols-custom-split {
  grid-template-columns: 3fr 7fr; /* 3 partes para el primero, 7 para el segundo */
}

/* Estilo para cada celda del grid */
.form-row > div {
  display: flex;
  flex-direction: column;
}

/* Estilo específico para las celdas con checkboxes */
.form-row .checkbox-cell {
  flex-direction: row; /* Pone el checkbox al lado del texto */
  align-items: center;
  justify-content: center;
  padding-bottom: 0.5rem; /* Pequeño ajuste de altura */
  gap: 0.5rem;
}

.form-row .checkbox-cell label {
  white-space: nowrap; /* Evita que el texto del label se parta */
}

.side-by-side-container {
  display: flex;         /* Activa el modo Flexbox, que alinea los hijos horizontalmente */
  gap: 2rem;             /* Crea un espacio de separación entre los dos fieldsets */
  align-items: stretch;   /* Estira ambos fieldsets a la misma altura */
}

.side-by-side-container > fieldset {
  flex: 1; /* Hace que cada fieldset ocupe el mismo espacio disponible (50% en este caso) */
  margin-top: 0; /* Opcional: quita el margen superior por defecto para mejorar la alineación */
  display: flex;
  flex-direction: column; /* Permite que su contenido se distribuya verticalmente */
}

/* Inputs sólo lectura: fondo gris claro y cursor no-allowed */
input[readonly], textarea[readonly], select[readonly] {
  background-color: #e9ecef;
  color: #495057;
  cursor: not-allowed;
}

/* Estilo específico para Tasa y Valor no editables (LV) */
#lv-tasa[readonly], #lv-valor[readonly] {
  background-color: #eef2f7; /* un gris un poco más marcado */
  color: #6b7280;            /* gris medio para texto */
  border-color: #d1d5db;     /* borde gris claro */
}

/* Asegura que inputs y selects no fuercen más ancho que su celda de grid */
.form-grid input,
.form-grid select,
.form-grid textarea { min-width: 0; box-sizing: border-box; }

.grid-2-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Crea un grid de 2 columnas de igual tamaño */
  gap: 1.5rem 1rem; /* 1.5rem de espacio vertical, 1rem horizontal */
}

/* Esta es la regla especial:
  Selecciona el último elemento (last-child) SOLO SI también es un elemento impar (nth-child(odd)).
  Esto ocurre cuando tienes 1, 3, 5, 7, etc., elementos.
*/
.grid-2-cols > div:last-child:nth-child(odd) {
  grid-column: 1 / -1; /* Hace que el elemento ocupe todo el ancho del grid */
}

/* Uniformar inputs tipo number: quitar spinners para alineación consistente */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  appearance: textfield; /* estándar */
  -moz-appearance: textfield; /* Firefox */
}

/* Alinear filas de 4 columnas del formulario de Naves (incluye Combustible) */
#bienFormNave .form-grid.cuatro-columnas {
  align-items: end; /* alinea los contenedores de campos por la base */
}
#bienFormNave .form-grid.cuatro-columnas > div {
  display: flex;              /* asegura estructura uniforme */
  flex-direction: column;     /* label arriba, input debajo */
  justify-content: flex-end;  /* empuja el input hacia la base del contenedor */
}

#btnLimpiarCliente {
  /* Apariencia y color */
  background-color: #dc3545; 
  color: white;
  border: none;
  
  /* Forma y tamaño */
  width: 24px;
  height: 24px;
  border-radius: 4px; /* <-- CAMBIO CLAVE: De 50% a 4px para un cuadrado con esquinas suaves */
  
  /* Contenido (la "✖") */
  font-size: 14px;
  font-weight: bold;
  line-height: 1; 
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Evita que el botón se encoja si el nombre del cliente es largo */

  /* Interacción */
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

#btnLimpiarCliente:hover {
  background-color: #c82333; 
  transform: scale(1.1);
}

#clienteActualBadge:not(.oculto) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: normal;
}

.oculto { display: none !important; }

/* ===== Coberturas Bien: Tabs Header (minimal styling) ===== */
#tabsCoberturas .tabs-header {
  display: flex;
  gap: 10px;
  border-bottom: 3px solid #e5e7eb; /* línea principal gris claro, más ancha */
  margin: 10px auto 0;
  width: 95%; /* alineado con la tabla */
}

#tabsCoberturas .tab-btn {
  background: transparent;
  border: none;
  padding: 10px 12px;
  border-bottom: 3px solid transparent; /* solo el activo será azul */
  cursor: pointer;
  color: #475569; /* gris-azulado para inactivo */
}

#tabsCoberturas .tab-btn.active {
  border-bottom-color: #3a86ff; /* azul marca solo bajo el activo */
  color: #3a86ff; /* texto e ícono azules */
  font-weight: 700;
}

#tabsCoberturas .tab-btn i { margin-right: 6px; }

/* Contenedor para alinear tabs con tabla */
.tabs-cob-container{
  width: 100%;
}

/* Mesas de coberturas: mayor espaciado vertical y margen superior */
.cob-table{
  width: 95%;
  margin: 16px auto; /* más espacio arriba y abajo */
}

/* Cabecera "Riesgos contratados" con selector de plan a la derecha */
.coberturas-header{
  width: 95%;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.coberturas-title{
  font-weight: 700;
  color: #2f3e46;
  font-size: 1.15rem; /* un poco más grande */
}
.coberturas-actions select{
  min-width: 260px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

/* Contenedor del botón Guardar, alineado con la tabla de riesgos */
.cob-actions{
  width: 95%;
  margin: 12px auto 0; /* mismo alineado que las tablas */
  display: flex;
  justify-content: flex-end;
}
.cob-actions .boton-guardar{
  padding: 8px 12px; /* menos ancho a los lados */
}

/* Alinear contenido de la tabla de riesgos por columna */
.cob-riesgos thead th:nth-child(1),
.cob-riesgos tbody td:nth-child(1){ text-align: center; }
.cob-riesgos thead th:nth-child(2),
.cob-riesgos tbody td:nth-child(2){ text-align: left; }
.cob-riesgos thead th:nth-child(3),
.cob-riesgos tbody td:nth-child(3){ text-align: right; }
.cob-riesgos thead th:nth-child(4),
.cob-riesgos tbody td:nth-child(4){ text-align: right; }
.cob-riesgos thead th:nth-child(5),
.cob-riesgos tbody td:nth-child(5){ text-align: right; }
.cob-riesgos thead th:nth-child(6),
.cob-riesgos tbody td:nth-child(6){ text-align: right; }
.cob-riesgos thead th:nth-child(7),
.cob-riesgos tbody td:nth-child(7){ text-align: left; }

/* ===== Botón de coberturas (icono sombrilla) ===== */
button.coberturas {
  padding: 7px 12px;
  margin: 0 5px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: white;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  background-color: #6c5ce7; /* igual que permisos/riesgos */
}

button.coberturas:hover {
  background-color: #5a4bcf;
}

/* Utilidad: espacio consistente antes de los botones en modales de bienes */
.espaciado-antes-botones {
  margin-bottom: 28px !important; /* asegura una separación visible antes del bloque de botones */
}

/* Refuerzos específicos: garantizar separación en estos formularios */
#bienFormVehiculo fieldset:last-of-type,
#bienFormLocalVivienda fieldset:last-of-type {
  margin-bottom: 28px !important;
}

/* Badges de estado para pólizas */
.status-badge {
  display: inline-block;
  padding: .25rem .55rem;
  border: 2px solid transparent;
  border-radius: .5rem;         /* Cambia a 4px si quieres recto en lugar de pill */
  font-weight: 600;
  font-size: .85rem;
  line-height: 1;
  white-space: nowrap;
}

/* Vigente: recuadro verde */
.status-vigente {
  color: #1f7a1f;
  border-color: #1f7a1f;
  background: rgba(31, 122, 31, 0.08);  /* si NO quieres fondo, bórralo */
}

/* Cancelada: recuadro rojo */
.status-cancelada {
  color: #b42318;
  border-color: #b42318;
  background: rgba(180, 35, 24, 0.08);  /* si NO quieres fondo, bórralo */
}

/* Vigencia consumida: recuadro naranja */
.status-consumida {
  color: #b76100;
  border-color: #b76100;
  background: rgba(183, 97, 0, 0.10);   /* si NO quieres fondo, bórralo */
}

/* Azul de marca (igual al de los botones) - ya definido arriba */

/* Número de póliza en el listado */
.num-poliza {
  color: var(--brand-blue);
  font-weight: 700;        /* mantiene el negrito del <strong> */
  letter-spacing: .2px;    /* opcional, se ve más nítido */
}

.pie-listado {
  display: flex;
  align-items: center;
  justify-content: space-between; /* izq = contador+pag, der = leyenda */
  gap: 1rem;
  flex-wrap: wrap;
}

.pie-izq {
  display: flex;
  align-items: center;
  gap: 1rem; /* separa contador y paginación */
}

.info-registros {
  font-size: .92rem;
  color: #334155; /* gris oscuro suave */
}

#btnAgregar:disabled,
#btnAgregar.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.1);
}

/* Contenedor para alinear elementos en una fila (Aseguradora, Botón, Ramo) */
.form-row-flex {
  display: flex;
  align-items: flex-end; /* Alinea los elementos en la base */
  gap: 0.5rem; /* Pequeño espacio entre elementos */
}

.form-row-flex .flex-item-grow {
  flex: 1; /* Ocupa el espacio disponible */
}

.form-row-flex .flex-item-auto {
  flex: 0 0 auto; /* El tamaño se ajusta al contenido */
}

/* Estilo para el nuevo botón de ícono */
.btn-icon {
  padding: 0;
  width: 40px;  /* Ancho fijo */
  height: 40px; /* Misma altura que los selects */
  font-size: 1.1rem;
  background-color: #6c757d; /* Gris neutro */
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 1px; /* Pequeño ajuste para alinear con los selects */
}

.btn-icon:hover:not(:disabled) {
  background-color: #5a6268;
}

.btn-icon:disabled {
  background-color: #ced4da; /* Gris más claro cuando está deshabilitado */
  cursor: not-allowed;
  opacity: 0.7;
}

/* Contenedor para alinear un campo con un botón al lado */
.campo-con-boton {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Espacio entre el select y el botón */
}

.campo-con-boton select {
  flex-grow: 1; /* Hace que el select ocupe todo el espacio disponible */
}

#modalContactosAseg .modal-contenido {
  width: 95vw !important;   /* 95% del ancho de la ventana */
  max-width: 1200px !important; /* nunca más de 1200px */
  max-height: 80vh !important;
}


/* Solo afecta al modal de contactos de aseguradora */
#modalContactosAseg {
  display: flex;
  align-items: flex-start;  /* lo pega arriba */
  padding-top: 140px;        /* puedes ajustar este valor a tu gusto */
}

/* ===== ESTILOS PÁGINA DE LOGIN ===== */

/* 1. Fondo y centrado */
body.login-page {
  background-color: #eef2f7; /* Un gris azulado muy claro */
  background-image: linear-gradient(135deg, #f8f9fb 0%, #eef2f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0; /* Anulamos el padding general para el login */
}

/* 2. Contenedor principal (la "tarjeta") */
.login-container {
  background-color: #ffffff;
  padding: 40px 45px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  text-align: center;
}

/* 3. Logo y Títulos */
.login-logo {
  margin-bottom: 15px;
}

.login-container h2 {
  color: #2f3e46;
  font-size: 26px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 10px;
}

.login-subtitle {
  color: #6c757d;
  font-size: 15px;
  margin-bottom: 30px;
}

/* 4. Formulario y campos de entrada */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  font-size: 16px;
}

.login-form input {
  width: 100%;
  padding: 14px 14px 14px 45px; /* Espacio para el ícono */
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #f8f9fa;
}

.login-form input:focus {
  outline: none;
  border-color: #3a86ff;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
}

/* 5. Botón de "Entrar" */
.login-form button {
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  background-color: #3a86ff; /* El azul principal de tu app */
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  margin-top: 10px;
}

.login-form button:hover {
  background-color: #2f6ee2; /* Un azul más oscuro */
}

.login-form button:active {
  transform: scale(0.98);
}

/* 6. Mensaje de error */
#msg {
  margin-top: 20px;
  color: #d90429;
  font-weight: 500;
  font-size: 14px;
  min-height: 20px;
}

/* ============================================= */
/* ==   ESTILOS ESPECÍFICOS MODAL DE USUARIOS   == */
/* ============================================= */

/* 1. Aumentamos el ancho MÁXIMO del modal de usuarios */
.modal-contenido-usuario {
  max-width: 1150px;
}

/* 2. Convierte el formulario en un grid de 3 columnas */
.modal-contenido-usuario form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px 20px;
}

/* 3. Estilos para cada celda del grid */
.modal-contenido-usuario .form-group {
  display: flex;
  flex-direction: column;
}

/* 4. Clase de utilidad para que un elemento ocupe las 3 columnas */
.modal-contenido-usuario .grid-span-3 {
  grid-column: 1 / -1;
}

/* 5. Ajuste para los botones (posicionados a la derecha) */
.modal-contenido-usuario .botones-modal {
  grid-column: 2 / 4;         /* <-- CAMBIO CLAVE */
  margin-top: 15px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 6. Ajuste para los radio buttons de Estado */
.modal-contenido-usuario #grupoEstado .radio-options {
  margin-top: 8px;
}

/* 7. Ajusta el tamaño de los botones del modal */
.modal-contenido-usuario .botones-modal button {
  padding: 8px 16px; /* Menos padding = botón más pequeño */
  font-size: 14px;   /* Letra un poco más pequeña */
}

button.facturar {
  background:#0d6efd; color:#fff; border:none; border-radius:6px; padding:.4rem .55rem;
  cursor:pointer;
}
button.facturar i { pointer-events:none; }
button.facturar:disabled { opacity:.6; cursor:not-allowed; }

/* ===== Modal Factura: layout por filas ===== */
.form-factura .fact-row {
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
}
.form-factura .fact-row.cols-2 { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.form-factura .fact-row.cols-4 { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.form-factura .fact-row.cols-5 { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.form-factura .fact-row.cols-6 { grid-template-columns: repeat(6, minmax(120px, 1fr)); }

.form-factura .form-group label { font-weight: 600; font-size: .92rem; color: #444; }
.form-factura .form-group input,
.form-factura .form-group select,
.form-factura .form-group textarea { width: 100%; }

/* Responsive */
@media (max-width: 1200px) {
  .form-factura .fact-row.cols-6 { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .form-factura .fact-row.cols-5 { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}
@media (max-width: 768px) {
  .form-factura .fact-row.cols-6,
  .form-factura .fact-row.cols-5,
  .form-factura .fact-row.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .form-factura .fact-row.cols-2 { grid-template-columns: 1fr; }
}

/* ===== Vista previa de póliza en el modal ===== */
.factura-policy-preview {
  border: 1px solid #e0e0e0;
  background: #fafafa;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  overflow-x: visible;
}
.factura-policy-preview table { width: 100%; border-collapse: collapse; }
.factura-policy-preview th, .factura-policy-preview td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
/* Reusa tus clases de estado si ya existen (status-badge, status-vigente, etc) */

/* Solo el modal de Factura */
#modalFactura .modal-contenido{
  width: 98vw !important;          /* ocupa casi todo el ancho de la ventana */
  max-width: 1950px !important;    /* tope “grande” que tú decidas */
  max-height: 90vh;     /* por si se vuelve muy alto */
  overflow: auto;       /* scroll interno si hace falta */
}

/* Si quieres aún más ancho en pantallas grandes */
@media (min-width: 1600px){
  #modalFactura .modal-contenido{
    max-width: 1600px;
  }
}

/* ===== Alinear anchos dentro del modal de facturas ===== */
#modalFactura .modal-contenido {
  max-width: 2500px;          /* ya lo tienes inline, aquí lo reforzamos */
}

/* Asegura que ambos bloques usen el 100% del ancho disponible */
#modalFactura .factura-policy-preview,
#modalFactura .factura-policy-preview > *,
#modalFactura .tabla-wrapper,
#modalFactura .data-table {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Si usas la versión de preview en formato tabla (class="preview-poliza"),
   también la igualamos al ancho de la tabla de facturas */
#modalFactura .preview-poliza {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  box-sizing: border-box;
}

/* Hace que la tabla de facturas ajuste sus columnas al ancho 100% */
#modalFactura .data-table {
  table-layout: fixed;
}

/* Opcional: unifica “gutter” (bordes/padding laterales) para que
   los bordes del preview y la tabla coincidan visualmente */
#modalFactura .factura-policy-preview .context-header {
  padding-left: 16px;
  padding-right: 16px;
}
#modalFactura .tabla-wrapper {
  padding-left: 16px;
  padding-right: 16px;
  overflow-x: visible;
}

/* Elimina posibles márgenes distintos que desalineen horizontalmente */
#modalFactura .factura-policy-preview,
#modalFactura .tabla-wrapper {
  margin-left: 0;
  margin-right: 0;
}

/* Modal base (el grande de facturas) */
#modalFactura {
    z-index: 1000;
}

/* Modal de confirmación (el pequeño que debe ir encima) */
#modalConfirmar {
    z-index: 1050; /* Un número MÁS ALTO para que se muestre por encima */
}

.btn-secundario {
    background-color: transparent;      /* Fondo transparente */
    color: #6c757d;                   /* Color de texto gris (neutro) */
    border: 1px solid #ced4da;        /* Borde sutil */
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease-in-out; /* Efecto suave */
}

.btn-secundario:hover {
    background-color: #f8f9fa;       /* Un fondo muy claro al pasar el mouse */
    color: #212529;                   /* Texto más oscuro para resaltar */
    border-color: #adb5bd;
}

.factura-client-info {
    padding: 10px 15px;
    margin-bottom: 1rem;
    background-color: #e9ecef; /* Un gris claro y neutro */
    border-radius: 5px;
    font-size: 1.1rem; /* Un poco más grande para que resalte */
    font-weight: 500;
    color: #495057;    /* Color de texto principal */
    border: 1px solid #dee2e6;
    text-align: left;
}

.factura-client-info strong {
    color: #212529; /* Un color más oscuro para el nombre */
}

#modalFactura .factura-toolbar {
  width: 100%;
  box-sizing: border-box;
  padding-left: 16px;   /* igual que #modalFactura .tabla-wrapper */
  padding-right: 16px;  /* igual que #modalFactura .tabla-wrapper */
}

button.facturar {
  padding: 7px 12px;          /* igual que .editar / .eliminar */
  margin: 0 5px;              /* mismo espacio lateral */
  border-radius: 6px;         /* mismo borde redondeado */
  font-size: 13px;            /* misma tipografía */
  display: inline-flex;       /* centra el ícono */
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

button.facturar:hover {
  background-color: #0b5ed7;  /* hover acorde al azul base */
}

/* Alinea el preview al mismo gutter (16px) que la tabla y la toolbar */
#modalFactura .factura-policy-preview {
  padding-left: 16px;
  padding-right: 16px;
  background: transparent;   /* opcional: quita el gris para que parezca tabla normal */
  border: none;               /* opcional */
  margin-top: 8px;            /* respirito debajo del botón/cliente */
}

/* Haz que la tabla del preview luzca como la tabla principal */
#modalFactura .preview-poliza {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Mismos paddings/alto de fila que el listado principal */
#modalFactura .preview-poliza th,
#modalFactura .preview-poliza td {
  padding: 14px;                     /* antes eran 6–8px */
  border-bottom: 1px solid #e6e6e6;
  font-size: 14px;
  vertical-align: middle;
  text-align: left;
}

/* Encabezado igual que el listado */
#modalFactura .preview-poliza th {
  background-color: #3a86ff;
  color: #fff;
  font-weight: 600;
}

/* Zebra y hover, como en la tabla general */
#modalFactura .preview-poliza tbody tr:nth-child(even) {
  background-color: #f4f6f9;
}
#modalFactura .preview-poliza tbody tr:hover {
  background-color: #e6f0ff;
}

/* 1) En la vista de LISTADO: el bloque con datos del cliente */
#modalFactura #facturaClientInfo {
  margin-left: 16px;   /* mismo offset lateral que la tabla */
  margin-right: 16px;
}

/* 2) En la vista de FORMULARIO:
      el contenedor de la fila que trae el botón "← Volver al listado"
      (es el primer <div> dentro de #facturaFormPane) */
#modalFactura #facturaFormPane > div:first-child {
  padding-left: 16px;  /* alinea el botón con el inicio de la tabla */
  padding-right: 16px;
  box-sizing: border-box;
}

/* 3) En la vista de FORMULARIO: datos del cliente (debajo del botón) */
#modalFactura #facturaClientInfoForm {
  margin-left: 16px;   /* alinea el borde del recuadro con la tabla */
  margin-right: 16px;
}

/* 1) Gutter uniforme para todo el panel de formulario */
#modalFactura #facturaFormPane {
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* 2) Botón "← Volver al listado" y bloque de cliente SIN padding/margen extra
      (anula reglas previas específicas) */
#modalFactura #facturaFormPane > div:first-child,
#modalFactura #facturaClientInfoForm {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 3) El preview dentro del FORM no debe añadir padding interno,
      así la tabla del preview queda alineada con el gutter del panel */
#modalFactura #facturaFormPane .factura-policy-preview {
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
}

/* 4) El propio formulario no añade márgenes laterales extra */
#modalFactura #formFactura {
  margin-left: 0;
  margin-right: 0;
}

/* ===== Modal Facturas: 3 elementos alineados en 1 fila ===== */
#modalFactura #fac_wrap_confirm{
  display: grid;                           /* convierte el bloque en grid */
  grid-template-columns: auto minmax(220px,1fr) minmax(220px,1fr);
  gap: 12px 16px;                          /* separación entre los 3 elementos */
  align-items: end;                        /* alinea con la base de los inputs */
  margin-top: .75rem !important;           /* ignora inline si lo hubiera */
  padding: 0;
}

/* El label (checkbox + texto) como primer ítem del grid */
#modalFactura #fac_wrap_confirm > label{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* Aplana el contenedor interno para que los 2 .form-group
   se comporten como 2 ítems del grid padre */
#modalFactura #fac_wrap_confirm .fact-row{
  display: contents;                       /* ¡clave! usa sus hijos en el grid */
  margin: 0 !important;
}

/* Limpia márgenes en los grupos de los inputs */
#modalFactura #fac_wrap_confirm .form-group{
  margin: 0;
}

/* Responsivo: en pantallas angostas, se apilan */
@media (max-width: 900px){
  #modalFactura #fac_wrap_confirm{
    grid-template-columns: 1fr;            /* 1 por línea */
    align-items: start;
  }
}

/* ===== Modal Facturas: ordenar y alinear (Prima | Valor | Checkbox) ===== */
#modalFactura #fac_wrap_confirm{
  display: grid;
  grid-template-columns: minmax(220px,1fr) minmax(220px,1fr) auto; /* Prima | Valor | Check */
  gap: 12px 16px;
  align-items: end; /* alinea con la base de los inputs */
}

/* Aplana el interior para que los 2 .form-group participen en el grid del padre */
#modalFactura #fac_wrap_confirm .fact-row{
  display: contents;
}

/* Orden deseado dentro del grid */
#modalFactura #fac_wrap_confirm .form-group:first-of-type{ order: 1; } /* Nueva Prima */
#modalFactura #fac_wrap_confirm .form-group:last-of-type { order: 2; } /* Nuevo Valor */
#modalFactura #fac_wrap_confirm > label{
  order: 3;                               /* Checkbox al final */
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  align-self: end;                         /* alinea con la base de los inputs */
}

/* Responsive: en pantallas angostas se apilan en 1 columna */
@media (max-width: 900px){
  #modalFactura #fac_wrap_confirm{
    grid-template-columns: 1fr;
    align-items: start;
  }
}

#modalCliente .modal-contenidoCliente {
  position: relative; /* necesario para posicionar el botón */
}

#modalCliente .modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;               /* tamaño área clicable */
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  background: transparent;
  color: inherit;
  border: none;
  border-radius: 50%;        /* base circular */
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease,
              box-shadow .15s ease, transform .05s ease;
}

#modalCliente .modal-close:hover {
  background: #e53935;       /* círculo rojo */
  color: #fff;               /* X blanca */
  box-shadow: 0 0 0 3px rgba(229, 57, 53, .18); /* aro suave */
}

#modalCliente .modal-close:active {
  transform: scale(0.96);
}

#modalCliente .modal-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, .35);
}

/* Contenedor flex para botón + buscador */
.search-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* El input crece y ocupa el resto */
.search-actions input[type="search"] {
  flex: 1 1 auto;
}

/* Para posicionar la X en este modal */
/* Asegura posicionamiento relativo del contenedor del modal de póliza */
#modalPoliza .modal-contenidoCliente { position: relative; }

/* Botón de cierre: área clickeable circular */
.modal .close-modal{
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;               /* tamaño área clicable */
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  background: transparent;
  color: inherit;
  border: none;
  border-radius: 50%;        /* base circular */
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease,
              box-shadow .15s ease, transform .05s ease;
}

/* Hover: círculo rojo alrededor de la X */
.modal .close-modal:hover{
  background: #e53935;       /* círculo rojo */
  color: #fff;               /* X blanca */
  box-shadow: 0 0 0 3px rgba(229, 57, 53, .18); /* aro suave */
}

/* Feedback al hacer click / accesibilidad */
.modal .close-modal:active{ transform: scale(0.96); }

.modal .close-modal:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, .35);
}

.botones-modal .btn-danger{
  background:#dc3545;      /* rojo */
  border-color:#dc3545;
  color:#fff;
}

/* ===== Overrides: NO recuadro alrededor de las tablas de listados en el modal de Acuerdos ===== */

/* Alineación general (lo dejamos) */
#modalAcuerdo .modal-contenido { box-sizing: border-box; padding: 16px 20px; }
#modalAcuerdo .acuerdos-header,
#modalAcuerdo .panel,
#modalAcuerdo #acuerdoListPane { width: 100%; max-width: 100%; margin-left: 0; margin-right: 0; box-sizing: border-box; }

/* Mantener tarjeta SOLO para "División de cartera" (si te gusta el look) */
#modalAcuerdo #divisionCartera {
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

/* Quitar recuadro a la tabla de ACUERDOS (el listado) */
#modalAcuerdo #acuerdoListPane .tabla-wrapper {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;               /* sin sangría extra */
}

/* Restaurar el borde de la tabla si antes lo quitamos */
#modalAcuerdo #acuerdoListPane .tabla-wrapper .data-table {
  border: 1px solid #e5e7eb;       /* usa el estilo base de tus tablas si ya lo tienes */
  width: 100%;
}

/* Quitar recuadro a la tabla de CANALES (el otro listado) */
#modalAcuerdo .panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
#modalAcuerdo .panel .tabla-wrapper { margin-top: 8px; }  /* un poco de aire bajo el título */

/* Toolbar del listado (botón + leyenda) alineada al borde de la tabla */
#modalAcuerdo .acuerdo-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .75rem;
  margin: 10px 0 8px;     /* separación antes de la tabla */
  padding-left: 0;        /* sin sangría */
}

/* Separación vertical homogénea entre bloques */
#modalAcuerdo .acuerdos-header,
#modalAcuerdo .panel,
#modalAcuerdo #acuerdoListPane,
#modalAcuerdo #acuerdoFormPane,
#modalAcuerdo .tabla-wrapper,
#modalAcuerdo .acuerdo-toolbar,
#modalAcuerdo .acuerdo-title,
#modalAcuerdo .acuerdo-title-row {
  margin-bottom: 12px;
}

/* ===== Modal Acuerdo: igualar ancho de "Canales de contacto" y "Acuerdos" ===== */

/* contenedores sin sangrías laterales */
#modalAcuerdo .acuerdos-header,
#modalAcuerdo .panel,
#modalAcuerdo #acuerdoListPane {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box;
}

/* wrapper de tablas: sin recuadro y ocupando todo el ancho */
#modalAcuerdo .panel .tabla-wrapper,
#modalAcuerdo #acuerdoListPane .tabla-wrapper {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

/* tablas a 100% y, si quieres, layout fijo para columnas consistentes */
#modalAcuerdo .panel .tabla-wrapper .data-table,
#modalAcuerdo #acuerdoListPane .tabla-wrapper .data-table {
  width: 100% !important;
  table-layout: fixed;              /* quítalo si prefieres auto */
}

/* evita desbordes visuales en celdas estrechas */
#modalAcuerdo .panel .data-table th,
#modalAcuerdo .panel .data-table td,
#modalAcuerdo #acuerdoListPane .data-table th,
#modalAcuerdo #acuerdoListPane .data-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* toolbar del listado de acuerdos: botón a la izquierda, pegado al borde */
#modalAcuerdo #acuerdoListPane .factura-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;  /* <— botón a la izquierda */
  gap: .75rem !important;
  margin: 10px 0 8px !important;           /* igual separación que el resto */
  padding: 0 !important;
}

/* asegúrate de que el botón quede pegado al borde izquierdo */
#modalAcuerdo #btnAddAcuerdo { margin-left: 0 !important; }

/* ===== Modal Acuerdos: alineación y estética ===== */
#modalAcuerdo .modal-contenido { padding: 16px 24px; }

#modalAcuerdo .acuerdo-toolbar {
  display: flex;
  justify-content: flex-start;
  margin: 6px 0 10px;
}

#modalAcuerdo .acuerdo-section { margin-top: .75rem; }

#modalAcuerdo .acuerdo-title,
#modalAcuerdo .acuerdo-title-row {
  font-size: 1rem;
  font-weight: 600;
  margin: .75rem 0 .5rem;
}

#modalAcuerdo .acuerdo-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#modalAcuerdo .acuerdo-actions > * { margin-left: .5rem; }

/* Quitar “recuadro” y alinear bordes de tablas */
#modalAcuerdo .panel { background: transparent; border: none; padding: 0; }
#modalAcuerdo .panel-header { margin-bottom: .5rem; }

#modalAcuerdo .tabla-wrapper { border: none; padding: 0; margin: 0; }
#modalAcuerdo .tabla-wrapper table { width: 100%; border-collapse: collapse; }

/* Unificar márgenes horizontales de todas las secciones para que queden alineadas */
#modalAcuerdo .acuerdos-header,
#modalAcuerdo .panel,
#modalAcuerdo #acuerdoListPane,
#modalAcuerdo #acuerdoFormPane,
#modalAcuerdo .tabla-wrapper,
#modalAcuerdo .acuerdo-toolbar,
#modalAcuerdo .acuerdo-title,
#modalAcuerdo .acuerdo-title-row {
  margin-left: 0;
  margin-right: 0;
}

/* Inline para los checks del título de cuotas */
#modalAcuerdo .fact-row.inline {
  display: flex;
  align-items: center;
  gap: .75rem;
}
#modalAcuerdo .fact-row.inline .form-group { margin: 0; }

/* Mantener el form alineado con tablas */
#modalAcuerdo .form-factura { margin: 0; }

/* 3.1 Quitar “recuadro” visual de los listados dentro del modal de acuerdos */
#modalAcuerdo .panel,
#modalAcuerdo .tabla-wrapper {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* 3.2 Unificar el ancho y alineación izquierda de TODO:
   - barra de botones
   - division de cartera
   - tabla de canales
   - tabla de acuerdos
   - secciones del formulario
*/
#modalAcuerdo .acuerdo-toolbar,
#modalAcuerdo .acuerdos-header,
#modalAcuerdo .panel,
#modalAcuerdo #acuerdoListPane .tabla-wrapper,
#modalAcuerdo #acuerdoFormPane .acuerdo-section,
#modalAcuerdo #acuerdoFormPane .tabla-wrapper,
#modalAcuerdo #acuerdoFormPane .fact-row,
#modalAcuerdo .acuerdo-title,
#modalAcuerdo .acuerdo-title-row {
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
}

/* 3.3 La barra del botón “+ Añadir acuerdo” pegada a la izquierda (alineada con las tablas) */
#modalAcuerdo .acuerdo-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* botón a la izquierda */
  margin: 10px 0 12px;
}

/* 3.4 La grilla de división de cartera sin recuadro grueso (si quieres algo muy sutil, deja sólo el borde claro) */
#modalAcuerdo .division-cartera {
  background: #f8f9fb;
  border: 1px solid #e5e7eb;   /* o quita esta línea si no quieres borde */
  border-radius: .5rem;
  padding: .75rem;
}

/* 3.5 Tablas al 100% y sin marcos externos raros */
#modalAcuerdo table.data-table {
  width: 100%;
  border-collapse: collapse;
}

/* 3.6 Celdas cómodas y consistentes */
#modalAcuerdo .data-table th,
#modalAcuerdo .data-table td {
  padding: 8px 10px;
}

/* 3.7 Títulos de sección consistentes */
#modalAcuerdo .acuerdo-title {
  margin: 16px 0 8px;
  font-size: 1rem;
  color: #444;
}

#modalAcuerdo .acuerdo-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
}

#modalAcuerdo .acuerdo-title-row .acuerdo-actions,
#modalAcuerdo .acuerdo-title-row .acuerdo-controls {
  display: flex;
  gap: .5rem;
  align-items: center;
}

/* 3.8 Panel superior “solo en FORM” (barra volver) bien alineado */
#modalAcuerdo .acuerdo-toolbar.oculto { display: none !important; }

/* 3.9 Por si acaso, reforzar ocultamiento genérico */
.oculto { display: none !important; }

/* Nuevo estilo para la tabla de división de cartera */
.division-cartera table.datos-cliente {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background-color: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.division-cartera table.datos-cliente th,
.division-cartera table.datos-cliente td {
    padding: 0.5rem 0.75rem;
    vertical-align: top;
    text-align: left;
    white-space: nowrap;
}

.division-cartera table.datos-cliente th {
    font-weight: 600;
    color: #495057;
    width: 0%; /* Ajusta este valor si necesitas más espacio para las etiquetas */
}

.division-cartera table.datos-cliente td {
    color: #333;
    width: 30%; /* Ajusta este valor para el contenido */
}

.division-cartera table.datos-cliente th {
  background-color: transparent; /* Fondo transparente */
  color: #495057; /* Un color de texto oscuro que coincida con el fondo */
  font-weight: 600;
  border-bottom: none; /* Opcional: elimina el borde inferior si no lo quieres */
}

fieldset {
  border-radius: 8px; /* Ajusta este valor si quieres bordes más o menos curvos */
}

#modalAcuerdo .checkbox-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
#modalAcuerdo .checkbox-cell label {
  margin: 0;
}

/* Botón de gestión de bienes */
button.gestionar-bienes {
    background-color: #28a745;  /* Verde para bienes */
    color: white;
    border: none;
    padding: 7px 12px;
    margin: 0 5px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

button.gestionar-bienes:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button.gestionar-bienes i {
    pointer-events: none;
}

/* Botón de gestión de bienes */
button.gestionar-bienes {
    padding: 7px 12px;
    margin: 0 5px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
}

button.gestionar-bienes:hover {
    background-color: #218838;
}

button.gestionar-bienes i {
    pointer-events: none;
}

/* ===== BOTONES ESPECÍFICOS PARA BIENES ===== */
.btn-secundario {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 38px;
    box-sizing: border-box;
}

.btn-secundario:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-secundario:active {
    transform: translateY(0);
}

/* Campo de nombre auto-generado */
.campo-autogenerado {
    background-color: #f8f9fa !important;
    border-left: 3px solid #28a745 !important;
}

.campo-autogenerado:focus {
    background-color: #fff !important;
}

/* Indicador de campo requerido mejorado */
.form-group label .required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* Indicador de campo calculado */
.campo-calculado {
    background-color: #e3f2fd !important;
    border-left: 3px solid #2196f3 !important;
}

/* ===== ESTILOS PARA INFORMACIÓN CONTEXTUAL DE PÓLIZA (ESTILO IMAGEN) ===== */
.policy-info-horizontal {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.policy-section {
    background: #1976d2;
    color: white;
    padding: 8px 15px;
    border-bottom: 1px solid #1565c0;
}

.policy-section strong {
    font-size: 14px;
    font-weight: 600;
    margin-right: 15px;
}

.policy-tabs {
    display: inline-flex;
    gap: 20px;
}

.policy-tabs .tab {
    font-size: 12px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.policy-tabs .tab.active {
    background: rgba(255,255,255,0.3);
    font-weight: 600;
}

.policy-tabs .tab:hover {
    background: rgba(255,255,255,0.25);
}

.policy-details {
    padding: 15px;
}

.policy-row {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    align-items: center;
}

.policy-row:last-child {
    margin-bottom: 0;
}

.policy-item {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    flex: 1;
}

.policy-item span {
    font-weight: 600;
    color: #1565c0;
    font-size: 14px;
    margin-bottom: 2px;
}

.policy-item .policy-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.policy-number {
    color: #1976d2 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

.balance-highlight {
    color: #d32f2f !important;
    font-weight: 700 !important;
    background: rgba(244, 67, 54, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.balance-highlight.settled {
    color: #388e3c !important;
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.2);
}

/* Enlace de retorno */
.back-link {
    display: inline-block;
    margin-bottom: 25px;
    font-weight: 600;
    color: #6c757d;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: #f7f7f7;
    transition: background-color 0.3s;
}

.back-link:hover {
    background-color: #dee2e6;
}

.back-link i {
    margin-right: 8px;
}

/* ===== ESTILOS PARA BOTÓN AGREGAR BIEN ===== */
#btnAgregarBien,
.btn-agregar {
    padding: 10px 16px;
    font-size: 14px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

#btnAgregarBien:hover,
.btn-agregar:hover {
    background-color: #0056b3;
}

/* ===== CONTENEDOR DE ARCHIVO DIGITAL ===== */
.archivo-digital-container {
    text-align: center;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px dashed #dee2e6;
}

.archivo-digital-container h3 {
    color: #6c757d;
    margin-bottom: 15px;
}

.archivo-digital-container p {
    color: #6c757d;
}

.archivo-digital-container i {
    color: #adb5bd;
}

/* ===== ESTILOS ESPECÍFICOS PARA MODAL DE BIENES ===== */
#modalBien .modal-contenidoCliente {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

#modalBien input,
#modalBien select,
#modalBien textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    margin: 6px 0;
    background-color: #fff;
    box-sizing: border-box;
    font-family: inherit;
}

#modalBien textarea {
    min-height: 80px;
    resize: vertical;
}

#modalBien label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

/* Botones del modal de bienes */
#modalBien .botones-modal {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

#modalBien .botones-modal button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#btnGuardarBien {
    background-color: #28a745;
    color: white;
}

#btnGuardarBien:hover {
    background-color: #218838;
}

#btnCancelarBien {
    background-color: #6c757d;
    color: white;
}

#btnCancelarBien:hover {
    background-color: #5a6268;
}

/* ===== ESTILOS PARA SECCIONES LADO A LADO EN MODAL DE VEHÍCULOS ===== */
.form-sections-container {
    display: flex;
    gap: 20px;
    width: 100%;
}

.form-section-left,
.form-section-right {
    flex: 1;
    min-width: 0; /* Permite que los elementos se encojan */
}

.form-section-left {
    flex: 1.2; /* Un poco más de espacio para identificación */
}

.form-section-right {
    flex: 1; /* Espacio normal para valores y cobertura */
}

/* Ajustes para campos de formulario en secciones lado a lado */
.form-sections-container input,
.form-sections-container select,
.form-sections-container textarea {
    width: 100%;
    box-sizing: border-box;
}

/* Responsive: En pantallas pequeñas, las secciones se apilan */
@media (max-width: 1200px) {
    .form-sections-container {
        flex-direction: column;
    }

    .form-section-left,
    .form-section-right {
        flex: none;
    }
}

/* === ESTILOS ESPECÍFICOS PARA BIENES === */

/* Tabla de póliza en bienes */
#polizaInfo table {
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#polizaInfo table thead {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

#polizaInfo table thead th {
    color: white;
    font-weight: 600;
    padding: 12px 16px;
    text-align: center;
}

#polizaInfo table tbody td {
    padding: 16px;
    text-align: center;
    vertical-align: top;
    background-color: #ffffff;
}

/* Estilos para los badges de estado */
.badge-vigente {
    background-color: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

.badge-cancelada {
    background-color: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

/* Números de póliza destacados */
.policy-number {
    font-weight: 700;
    font-size: 1.1em;
    color: #007bff;
}

/* Mejoras para la alineación de las secciones del modal de vehículo */
.form-sections-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    min-height: 500px;
}

.form-section-left,
.form-section-right {
    height: 100%;
}

.form-section-left fieldset,
.form-section-right fieldset {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

/* Responsive para el modal de vehículo actualizado */
@media (max-width: 1200px) {
    .form-sections-container {
        grid-template-columns: 1fr;
        gap: 15px;
        min-height: auto;
    }

    .form-section-left fieldset,
    .form-section-right fieldset {
        min-height: auto;
    }
}

.titulo-contexto-poliza-superior:not(.oculto) {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    text-align: left;
    margin-bottom: 15px;
    padding: 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d2d2d;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
}

/* Celda de División de Cartera en 2 columnas */
td.col-division { white-space: normal; vertical-align: top; padding-top: 10px; padding-bottom: 10px; }

.col-division .dc-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 2 columnas */
  gap: 6px 24px;                    /* row-gap | col-gap */
  align-items: start;
}

.dc-item{
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}

.dc-item strong{ color:#495057; font-weight:600; }
.dc-item .value{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; max-width:100%;
}

/* móvil: 1 columna */
@media (max-width: 768px){ .col-division .dc-grid{ grid-template-columns: 1fr; } }

#modalSelCliente #btnCrearClienteDesdePoliza,
/* 2) ← Volver al listado (Facturación y Acuerdos) */
#modalFactura  #btnVolverListado,
#modalAcuerdo  #btnVolverAcuerdoListadoTop,
#modalAcuerdo  #btnVolverAcuerdoListado,
/* 3) Generar cuotas (Acuerdos de pago) */
#modalAcuerdo  #acu_btn_generar {
  background-color: #f1f3f5 !important;  /* gris bien clarito */
  color: #495057 !important;             /* texto gris medio */
  border: 1px solid #dfe3e6 !important;  /* borde suave */
}

/* Hover */
#modalSelCliente #btnCrearClienteDesdePoliza:hover,
#modalFactura  #btnVolverListado:hover,
#modalAcuerdo  #btnVolverAcuerdoListadoTop:hover,
#modalAcuerdo  #btnVolverAcuerdoListado:hover,
#modalAcuerdo  #acu_btn_generar:hover {
  background-color: #e9ecef !important;
  color: #212529 !important;
  border-color: #cfd4da !important;
}

/* Disabled (por si aplica) */
#modalSelCliente #btnCrearClienteDesdePoliza:disabled,
#modalFactura  #btnVolverListado:disabled,
#modalAcuerdo  #btnVolverAcuerdoListadoTop:disabled,
#modalAcuerdo  #btnVolverAcuerdoListado:disabled,
#modalAcuerdo  #acu_btn_generar:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/*
  Ajuste general para los elementos del modal de Cobros.
  Establece un ancho del 100% y elimina los márgenes para una alineación perfecta.
*/
#modalCobro .factura-policy-preview,
#modalCobro .tabla-wrapper,
#modalCobro .factura-toolbar,
#modalCobro .form-factura,
#modalCobro .factura-client-info {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

#modalCobro .modal-contenido {
    padding-left: 1rem;
    padding-right: 1rem;
     max-width: 2000px !important;
}

/* Asegura que los fieldsets del formulario de cobros ocupen el ancho completo */
#modalCobro .form-factura fieldset {
    width: 100%;
}

/* La barra de herramientas y la información del cliente también se ajustan al 100% */
#modalCobro .factura-toolbar,
#modalCobro .factura-client-info {
    width: 100%;
}

/* Las tablas internas se alinean al 100% del ancho del contenedor */
#modalCobro .data-table {
    width: 100%;
    table-layout: fixed;
}

#modalCobro .form-factura .fact-row {
    display: grid;
    gap: 12px;
    margin-bottom: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* <-- Ajuste clave */
}

#modalCobro #tbodyCobroDistribFacturas,
#modalCobro #tbodyCobroDistribCuotas {
    width: 100%;
    table-layout: auto; /* <-- Usa 'auto' para que las celdas se ajusten al contenido */
}

/*
 * Contenedor flexible para las tablas de distribución
 * Utiliza CSS Grid para un control preciso de las columnas
 */
.distribucion-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr; /* Relación de 2 a 1 para las columnas */
  gap: 20px; /* Espacio entre las columnas */
}

/* Las columnas individuales se adaptan al espacio */
.distribucion-col-1,
.distribucion-col-2 {
  min-width: 0; /* Permite que las columnas se encogen si es necesario */
}

/*
 * Estilos para las tablas dentro de la distribución
 * Se asegura de que las columnas se ajusten de manera uniforme
 */
.distribucion-wrapper .data-table {
  width: 100%;
  table-layout: fixed; /* Mantiene el ancho de la tabla flexible */
}

/*
 * Columnas de entrada de datos
 * Alinear a la derecha para montos y hacerlas más pequeñas
 */
#tbodyCobroDistribFacturas input[type="text"],
#tbodyCobroDistribCuotas input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  text-align: right;
}

/* Evita que los encabezados de tabla se rompan */
.distribucion-wrapper th {
  white-space: nowrap;
}

/* Estilo para las celdas de concepto */
#tbodyCobroDistribFacturas td:last-child input {
  min-width: 150px;
}

/* --- Ajustes para alinear recuadros en el modal de cobros --- */
#modalCobro .modal-contenido {
  max-width: 100%;            /* no permitir que el contenido se desborde */
  overflow-x: hidden;         /* quitar scroll horizontal */
  box-sizing: border-box;     /* incluir paddings y bordes en el ancho */
}

#modalCobro fieldset,
#modalCobro .tabla-wrapper,
#modalCobro .distribucion-wrapper {
  width: 100% !important;     /* que todos los recuadros respeten el ancho */
  box-sizing: border-box;     /* asegurar que no sobresalgan */
  margin-right: 0;
  padding-right: 0;
}

#modalCobro table {
  width: 100%;                /* tablas ocupan el ancho sin desbordarse */
  table-layout: auto;
}

/* Dar el mismo padding interno a los fieldset del modal de cobros */
#modalCobro fieldset {
  padding: 0.75rem 1rem 1rem 1rem;  /* espacio interno arriba, derecha, abajo, izquierda */
  border: 1px solid #ccc;           /* borde uniforme */
  border-radius: 6px;               /* esquinas suaves como en otros recuadros */
  box-sizing: border-box;
}

#modalCobro .tabla-wrapper {
  padding-right: 0.5rem;
  overflow-x: visible;
}

.btn-secundario {
  background-color: #e0e0e0;  /* gris claro */
  color: #333;
  border: 1px solid #bbb;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-secundario:hover {
  background-color: #d5d5d5;
}

/* === Ajustes para la sección Distribución del monto del cobro === */
#modalCobro .distribucion-wrapper {
  display: grid;
  grid-template-columns: 4fr 3fr; /* Ajuste para 60% y 40% */
  gap: 20px;
  width: 100%;
}

#modalCobro .distribucion-col-1,
#modalCobro .distribucion-col-2 {
  min-width: 0;
  overflow-x: visible;
}

/* Forzar ancho mínimo a la columna "Concepto" */
#tbodyCobroDistribFacturas th:last-child,
#tbodyCobroDistribFacturas td:last-child {
  min-width: 220px;     /* Ajusta según lo que necesites */
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/*
 * Ajuste para la columna de concepto
 * Aumenta el ancho mínimo del campo de texto
 */
#tbodyCobroDistribFacturas td:last-child {
    min-width: 220px; /* Asegura un ancho mínimo para la celda */
}

#tbodyCobroDistribFacturas td:last-child input {
    width: 100%; /* El input ocupa el 100% de la celda */
}

/* Definir anchos específicos para cada columna de la tabla de facturas */

/* --- Ajustes tabla distribución de cobros --- */
#modalCobro .distribucion-col-1 .data-table {
  table-layout: auto;          /* Que las columnas se ajusten a su contenido */
  width: 100%;                 /* Ocupa todo el ancho disponible */
}

#modalCobro .distribucion-col-1 .data-table th,
#modalCobro .distribucion-col-1 .data-table td {
  padding: 8px 12px;           /* Más espacio horizontal en celdas */
  white-space: nowrap;         /* Evita cortes en textos cortos */
}

#modalCobro .distribucion-col-1 .data-table td:last-child,
#modalCobro .distribucion-col-1 .data-table th:last-child {
  min-width: 220px;            /* 🔑 Asegura ancho para la columna de concepto */
  white-space: normal;         /* Permite que el texto largo haga salto de línea */
}

/* Inputs alineados a la izquierda */
#modalCobro .distribucion-col-1 .data-table input.cob_monto_fact,
#modalCobro .distribucion-col-1 .data-table input.cob_concepto_fact {
  text-align: left;          /* 🔑 texto alineado a la izquierda */
  padding-left: 6px;         /* un poco de padding interno */
}

/* Columna de póliza más ancha */
#modalCobro .distribucion-col-1 .data-table td:first-child,
#modalCobro .distribucion-col-1 .data-table th:first-child {
  min-width: 120px;          /* más espacio para el select de póliza */
}

/* === Ajuste visual del modal de Créditos (Igual al de Cobros) === */
#modalCredito .modal-contenido {
  width: auto;                  /* Deja que el navegador calcule el ancho natural */
  max-width: 2000px !important; /* Igual que el modal de Cobros */
  margin: 0 auto;
  padding-left: 1rem;           /* Mismo padding que Cobros (1rem = 16px aprox) */
  padding-right: 1rem;
  box-sizing: border-box;
  overflow-x: hidden;           /* Evita scroll horizontal general del modal */
}

/* Alinear la tabla con la barra de cliente */
#creditoClientInfo,
#tablaCreditosPoliza {
  width: 100%;
  box-sizing: border-box;
}

/* El contenedor de tabla debe ocupar todo el ancho disponible */
#modalCredito .tabla-wrapper {
  margin-top: 0.5rem;
  width: 100%;
}

/* Ajustar padding para que los bordes coincidan */
#modalCredito .factura-toolbar,
#modalCredito .tabla-wrapper,
#creditoClientInfo {
  padding: 0 1rem;
}

/* Opcional: mejorar legibilidad */
#modalCredito .factura-toolbar {
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  background-color: #fafafa;
  margin-bottom: 0;
}

.acuerdo-separador {
  background: #eef3ff !important;
  font-weight: bold;
  border-top: 2px solid #ccd8f0;
}

/* ======= AJUSTES VISUALES MODAL CRÉDITOS ======= */
/* Solo alineación y estructura - SIN cambiar colores existentes */

#modalCredito .form-factura {
  max-width: 1850px;
  margin: 0 auto;
}

/* Alinear tablas con los bordes de los inputs */
#modalCredito fieldset {
  border: 1px solid #ccc;
  padding: 15px;
  margin-top: 15px;
  border-radius: 8px;
}

#modalCredito .tabla-wrapper {
  width: 100%;
  overflow-x: visible;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Hacer que todas las tablas ocupen el mismo ancho que los inputs */
#modalCredito .data-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Eliminar el scroll horizontal no deseado */
#modalCredito .distribucion-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Cada columna de distribución ocupa 49% del recuadro */
#modalCredito .distribucion-col-1,
#modalCredito .distribucion-col-2 {
  flex: 1 1 48%;
  min-width: 48%;
  box-sizing: border-box;
}

/* Ajuste del recuadro para que no se desborde */
#modalCredito .distribucion-col-1 .tabla-wrapper,
#modalCredito .distribucion-col-2 .tabla-wrapper {
  overflow-x: hidden;
}

/* ELIMINAR LÍNEAS/BORDES DE LAS TABLAS - mantener estilo original */
#modalCredito table.data-table th,
#modalCredito table.data-table td {
  /* QUITAR bordes que se agregaron */
  border: none !important;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}

/* Ajustar totales a la izquierda sin desbordarse */
#modalCredito .total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 6px 10px;
  background-color: #f0f4ff;
  border: 1px solid #cfd8ff;
  border-radius: 6px;
}

/* Mantener los colores originales de los encabezados */
#modalCredito .data-table th {
  /* Los estilos de color se mantienen del CSS original */
  background-color: #3a86ff !important; /* Azul original */
  color: white !important; /* Texto blanco original */
  font-weight: 600;
}

/* Asegurar que las tablas de distribución se mantengan dentro del fieldset */
#modalCredito fieldset:has(.distribucion-wrapper) {
  overflow: hidden;
}

/* Alineación específica para la tabla de selección de facturas */
#modalCredito #tbodyCreditoFacturasElegibles {
  width: 100%;
}

/* Responsive para pantallas más pequeñas */
@media (max-width: 1400px) {
  #modalCredito .distribucion-col-1,
  #modalCredito .distribucion-col-2 {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

/* === AJUSTE DE ENCABEZADOS DE TABLAS (COBROS Y CRÉDITOS) === */

/* Unifica el alto y el padding de los encabezados */
#modalCobro table.data-table th,
#modalCredito table.data-table th {
  padding: 10px 8px;           /* igual que en cobros */
  font-size: 0.95rem;          /* tamaño de fuente coherente */
  height: 40px;                /* alto consistente */
  vertical-align: middle;      /* centra el texto verticalmente */
}

/* Asegura que los textos largos no se corten */
#modalCredito table.data-table th {
  white-space: nowrap;
}

/* Opcional: si notas que en créditos la fuente se ve más apretada */
#modalCredito table.data-table thead th {
  line-height: 1.2;            /* mejora la legibilidad */
}

/* === UNIFICAR ESTILO DISTRIBUCIÓN CRÉDITOS CON COBROS === */

#modalCredito .data-table td,
#modalCredito .data-table th {
  padding: 6px 8px;
  height: 38px;
  vertical-align: middle;
}

#modalCredito .data-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

#modalCredito .data-table tr:hover {
  background-color: #eef4ff;
}

/* Inputs de montos de distribución */
#modalCredito input.cred_monto_fact,
#modalCredito input.cred_monto_cuota,
#modalCredito input.cred_concepto_fact {
  width: 100px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: right;
  font-size: 0.9rem;
}

#modalCredito input.cred_concepto_fact {
  width: 200px;
  text-align: left;
}

/* Centrado y eliminación de scroll horizontal */
#modalCredito .fieldsetDistribucion {
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* === Alinear Fechas de Efectividad en una fila y Nota debajo ocupando toda la línea === */
#modalCredito .fact-row.cols-3 {
  display: grid;
  grid-template-columns: 1fr 1fr; /* dos columnas iguales */
  gap: 15px;
}

#modalCredito #cred_nota,
#modalCredito #cred_nota.form-group,
#modalCredito #cred_nota ~ .form-group:last-child {
  width: 100%;
}

/* Asegura que el form-group que contiene la nota ocupe las 2 columnas */
#modalCredito .fact-row.cols-3 .form-group:last-child {
  grid-column: 1 / span 2; /* la nota se extiende a lo ancho completo */
}

/* =========================================================
   CORRECCIÓN DEFINITIVA TABLA DISTRIBUCIÓN CRÉDITOS
   ========================================================= */

/* 1. Layout fijo obligatorio */
#modalCredito .distribucion-col-1 .data-table {
  table-layout: fixed !important;
  width: 100% !important;
  border-collapse: collapse;
}

/* 2. NUEVOS ANCHOS PARA QUE QUEPAN LOS TÍTULOS */

/* Póliza: reducimos un poco (de 11% a 9%) */
#modalCredito .distribucion-col-1 .data-table th:nth-child(1),
#modalCredito .distribucion-col-1 .data-table td:nth-child(1) { width: 9%; }

/* N° Factura: reducimos (de 10% a 8%) */
#modalCredito .distribucion-col-1 .data-table th:nth-child(2),
#modalCredito .distribucion-col-1 .data-table td:nth-child(2) { width: 8%; }

/* Fecha Emisión: AUMENTAMOS (de 10% a 13%) para que quepa el título */
#modalCredito .distribucion-col-1 .data-table th:nth-child(3),
#modalCredito .distribucion-col-1 .data-table td:nth-child(3) { width: 13%; }

/* Vigencia: mantenemos espacio (18%) */
#modalCredito .distribucion-col-1 .data-table th:nth-child(4),
#modalCredito .distribucion-col-1 .data-table td:nth-child(4) { width: 18%; }

/* Balance: ajustamos (11%) */
#modalCredito .distribucion-col-1 .data-table th:nth-child(5),
#modalCredito .distribucion-col-1 .data-table td:nth-child(5) { width: 11%; }

/* Días: mínimo posible (4%) */
#modalCredito .distribucion-col-1 .data-table th:nth-child(6),
#modalCredito .distribucion-col-1 .data-table td:nth-child(6) { width: 4%; }

/* Monto Acreditar: AUMENTAMOS (de 11% a 14%) para el título largo */
#modalCredito .distribucion-col-1 .data-table th:nth-child(7),
#modalCredito .distribucion-col-1 .data-table td:nth-child(7) { width: 14%; }

/* Concepto: El resto (23%) */
#modalCredito .distribucion-col-1 .data-table th:nth-child(8),
#modalCredito .distribucion-col-1 .data-table td:nth-child(8) { width: 23%; }


/* 3. Ajustes de texto para encabezados */
#modalCredito .distribucion-col-1 .data-table th {
  white-space: nowrap;          /* Evita que el título se parta en dos líneas */
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;           /* Reducimos ligeramente la fuente del encabezado para asegurar ajuste */
  padding: 8px 4px;             /* Menos padding lateral para ganar espacio */
  text-align: center;
}

#modalCredito .distribucion-col-1 .data-table td {
  padding: 4px;
}

/* 4. Corrección para evitar conflictos anteriores en la última columna */
#modalCredito #tbodyCreditoDistribFacturas td:last-child {
  min-width: auto !important; 
  overflow: visible;
}

#modalCredito #tbodyCreditoDistribFacturas input.cred_concepto_fact {
  width: 100% !important;
  box-sizing: border-box;
  min-width: 0;
}

/* ✅ EXCEPCIÓN: columna de Concepto */
#modalCredito #tbodyCreditoDistribFacturas th:last-child,
#modalCredito #tbodyCreditoDistribFacturas td:last-child {
  white-space: normal !important;    /* permite múltiples líneas */
  word-break: break-word;            /* rompe palabras largas */
  overflow: visible !important;      /* deja que se vea el contenido completo */
  text-align: left;                  /* alinea el texto a la izquierda */
  min-width: 250px;                  /* un ancho cómodo */
}

/* ✅ El input dentro de Concepto se ajusta completamente */
#modalCredito #tbodyCreditoDistribFacturas td:last-child input.cred_concepto_fact {
  width: 100% !important;            /* ocupa todo el espacio de la celda */
  max-width: none !important;        /* sin límite de ancho */
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
  box-sizing: border-box;
  height: auto;
}

/* Estilo gris para inputs/selects deshabilitados dentro de modales de bienes */
#modalBien input:disabled,
#modalBien select:disabled,
#modalBien textarea:disabled,
#modalBien input[readonly],
#modalBien textarea[readonly] {
  background-color: #eef2f7;
  color: #6b7280;
  border-color: #d1d5db;
  cursor: not-allowed;
}

#salud-descpdss:disabled {
  background-color: #f1f5f9;
}

.pdss-checkbox-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;             /* pequeño espacio entre cajita y texto */
  margin-left: 2px !important;    /* moverlo un poco a la izquierda */
  line-height: 1 !important;
  position: relative;
  transform: translateY(-26px);    /* moverlo hacia arriba para alinearlo con "Descuento PDSS" */
}

/* Ajuste del checkbox dentro del label específico */
.pdss-checkbox-label input[type="checkbox"] {
  margin: 0 !important;
  position: relative;
  top: 0px;
}

/* ============================================== */
/* ESTILOS PARA VISTA DE EXCLUSIÓN (INLINE) */
/* ============================================== */

#vista-exclusion-bien {
  margin-top: 20px;
}

#vista-exclusion-bien .form-container {
  padding: 25px;
  border-radius: 8px;
  background-color: #fdfdfd;
  border: 1px solid #eef;
  margin-top: 20px;
}

#vista-exclusion-bien .form-container h3 {
  text-align: center;
  color: var(--primary-color);
  margin-top: 5px;
  margin-bottom: 30px;
  font-size: 1.4em;
}

#vista-exclusion-bien .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-start;
}

#vista-exclusion-bien .form-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 150px;
}

#vista-exclusion-bien .form-group.compact {
  min-width: 0;
}

#vista-exclusion-bien .form-group.three-col {
  flex: 1 1 0px;
  min-width: 130px;
}

#vista-exclusion-bien .form-group.col-25 {
  flex: 1;
  max-width: 40%;
  min-width: 100px;
}

#vista-exclusion-bien .form-group.col-75 {
  flex: 3;
  max-width: 60%;
  min-width: 280px;
}

#vista-exclusion-bien .form-group label {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9em;
  color: var(--dark-gray);
}

#vista-exclusion-bien .form-group label .required {
  color: var(--danger-color);
  font-size: 1.2em;
  margin-left: 2px;
}

#vista-exclusion-bien .form-group input,
#vista-exclusion-bien .form-group select,
#vista-exclusion-bien .form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 1em;
}

#vista-exclusion-bien .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

#vista-exclusion-bien .form-section {
  flex: 1;
  padding: 20px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  min-width: 400px;
  background-color: white;
}

/* Sección izquierda (lista de bienes) más ancha como en referencia */
#vista-exclusion-bien .form-section.exclusion-list {
  flex: 3;
  min-width: 760px;
}

#vista-exclusion-bien .form-section.exclusion-data {
  border-color: var(--danger-color);
  border-width: 2px;
}

#vista-exclusion-bien .form-section h4 {
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
  color: var(--primary-color);
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

#vista-exclusion-bien .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  position: relative;
  z-index: 20;
  isolation: isolate;
}

#vista-exclusion-bien .table-wrapper {
  overflow-x: visible;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 15px;
}

#vista-exclusion-bien .grid-context-bien {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

#vista-exclusion-bien .grid-context-bien th,
#vista-exclusion-bien .grid-context-bien td {
  padding: 10px;
  font-size: 0.9em;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
}

#vista-exclusion-bien .grid-context-bien thead {
  background-color: var(--primary-color);
}

#vista-exclusion-bien .grid-context-bien thead th {
  color: white;
  font-weight: 600;
  border-bottom: none;
  padding: 12px 10px;
}

#vista-exclusion-bien .table-wrapper table.grid-context-bien {
  border: none;
}

#vista-exclusion-bien .table-wrapper table.grid-context-bien thead th:first-child {
  border-top-left-radius: 7px;
}

#vista-exclusion-bien .table-wrapper table.grid-context-bien thead th:last-child {
  border-top-right-radius: 7px;
}

#vista-exclusion-bien .grid-context-bien th.col-select,
#vista-exclusion-bien .grid-context-bien td.col-select {
  width: 50px;
  text-align: center;
  padding: 5px;
}

#vista-exclusion-bien .grid-context-bien tbody tr {
  background-color: #fff;
}

#vista-exclusion-bien .grid-context-bien tbody tr:hover {
  background-color: #f8f9fa;
}

#vista-exclusion-bien .grid-context-bien .col-valor,
#vista-exclusion-bien .grid-context-bien .col-prima,
#vista-exclusion-bien .grid-context-bien .col-monto {
  text-align: right;
}

#vista-exclusion-bien .grid-context-bien tfoot tr {
  background-color: #f8f9fa;
  font-weight: bold;
}

#vista-exclusion-bien .grid-context-bien tfoot td {
  padding: 15px 10px;
  border-top: 2px solid #ddd;
  border-bottom: none;
}

#vista-exclusion-bien .highlight-credit {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--danger-color) !important;
  background-color: #fdedec !important;
  border: 2px solid var(--danger-color) !important;
  text-align: right !important;
  padding: 10px !important;
  border-radius: 4px;
}

#vista-exclusion-bien .highlight-credit.new-premium {
  color: var(--success-color) !important;
  background-color: #e8f8ef !important;
  border-color: var(--success-color) !important;
}

#vista-exclusion-bien .btn {
  padding: 10px 24px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.96em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* Botones de acciones ligeramente más compactos */
#vista-exclusion-bien .form-actions .btn {
  padding: 10px 22px;
  font-size: 0.95em;
  position: relative;
  z-index: 21;
  pointer-events: auto;
}

#vista-exclusion-bien .form-actions .btn i {
  pointer-events: none;
}

#vista-exclusion-bien .btn-danger {
  background-color: var(--danger-color) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
  opacity: 1 !important;
  visibility: visible !important;
}

#vista-exclusion-bien .btn-danger:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.4);
}

#vista-exclusion-bien .btn-secondary {
  background-color: #6c757d;
  color: white;
  box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

#vista-exclusion-bien .btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(108, 117, 125, 0.4);
}

/* Estilos para los campos de crédito en el footer */
#vista-exclusion-bien .form-row:has(#exc-credito-neto) {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

/* Asegurar visibilidad del botón de registrar dentro del footer */
#vista-exclusion-bien .form-actions .btn.btn-danger {
  background-color: var(--danger-color) !important;
  color: #fff !important;
}

#vista-exclusion-bien #isc-acreditar-group {
  max-width: 120px;
  min-width: 100px;
}

#vista-exclusion-bien #isc-acreditar-group input {
  background-color: #f7f7f7 !important;
  text-align: right;
  font-weight: bold;
  border: 1px solid #ccc;
}

/* Responsive para vista de exclusión */
@media screen and (max-width: 1200px) {
  #vista-exclusion-bien .form-section {
    min-width: 100%;
  }
}

@media screen and (max-width: 768px) {
  #vista-exclusion-bien .form-group.col-25,
  #vista-exclusion-bien .form-group.col-75 {
    max-width: 100%;
    min-width: 100%;
  }
  
  #vista-exclusion-bien .form-section {
    min-width: 100%;
    padding: 15px;
  }
  
  #vista-exclusion-bien .form-actions {
    flex-direction: column;
  }
  
  #vista-exclusion-bien .btn {
    width: 100%;
    justify-content: center;
  }
}

/* === Estilos personalizados para botones de pólizas === */
.actions button.cobros {
  background-color: #28a745; /* Verde igual al de facturar */
  color: #fff;
  border: none;
  padding: 5px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.actions button.cobros:hover {
  background-color: #218838;
}

.actions button.creditos {
  background-color: #dc3545; /* Rojo igual al de eliminar */
  color: #fff;
  border: none;
  padding: 5px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.actions button.creditos:hover {
  background-color: #b02a37;
}

.actions button.cobros i,
.actions button.creditos i {
  font-size: 14px;
}

/* ===== ESTILOS DEL GESTOR DE DOCUMENTOS ===== */

/* Modal principal del gestor de documentos */
.modal-contenido-documentos {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  width: 95%;
  max-width: 1400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  position: relative;
}

.modal-contenido-documentos h2 {
  color: #2c3e50;
  font-size: 1.9em;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Navegación por pestañas del gestor */
.modal-contenido-documentos .nav-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
}

.modal-contenido-documentos .nav-link {
  padding: 10px 20px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-size: 1em;
  color: var(--dark-gray);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.modal-contenido-documentos .nav-link.active {
  font-weight: bold;
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.modal-contenido-documentos .nav-link:disabled {
  color: #aaa;
  cursor: not-allowed;
  background-color: #f9f9f9;
}

.modal-contenido-documentos .tab-pane {
  display: none;
}

.modal-contenido-documentos .tab-pane.active {
  display: block;
  animation: fadeIn 0.5s;
}

/* Contexto fijo */
.contexto-fijo-display-doc {
  background-color: #f0f8ff;
  border: 1px solid var(--primary-color);
  padding: 10px 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  font-size: 0.95em;
  color: #173f5f;
}

/* Contenedor de lista en grid */
.list-container-grid-doc {
  display: flex;
  gap: 20px;
  flex-direction: row;
  min-height: 500px;
}

.grid-area-doc {
  flex-grow: 1;
}

.filter-sidebar-doc {
  width: 280px;
  padding-left: 20px;
  border-left: 1px solid var(--border-color);
}

.filter-sidebar-doc h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 1.1em;
}

/* Barra de controles */
.controls-bar-doc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 15px;
}

.controls-left-doc {
  order: 1;
}

.controls-right-doc {
  order: 2;
}

.add-btn-doc {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  box-sizing: border-box;
}

.add-btn-doc:hover {
  background-color: #2980b9;
}

/* Tabla de documentos */
.table-wrapper-doc {
  overflow-x: visible;
  width: 100%;
}

.data-table-doc {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 25px;
}

.data-table-doc thead {
  background-color: var(--primary-color);
  color: white;
}

.data-table-doc th:first-child {
  border-top-left-radius: 5px;
}

.data-table-doc th:last-child {
  border-top-right-radius: 5px;
}

.data-table-doc th,
.data-table-doc td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95em;
}

.data-table-doc tbody tr:hover {
  background-color: #ecf0f1;
}

.data-table-doc .actions a {
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 5px;
  margin: 0 2px;
  transition: background-color 0.2s, transform 0.2s;
  display: inline-block;
}

.data-table-doc .actions a.view {
  background-color: var(--primary-color);
}

.data-table-doc .actions a.download {
  background-color: #27ae60;
}

.data-table-doc .actions a.delete {
  background-color: var(--danger-color);
}

.data-table-doc .actions a.share {
  background-color: #8e44ad;
}

.data-table-doc .actions a:hover {
  transform: translateY(-2px);
}

/* Paginación */
.pagination-bar-doc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  color: var(--dark-gray);
  flex-wrap: wrap;
  gap: 15px;
}

.records-info-doc {
  font-weight: 600;
}

.page-navigator-doc {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-navigator-doc button {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  padding: 5px 10px;
}

/* Formularios del gestor */
.form-group-doc {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 200px;
  margin-bottom: 15px;
}

.form-group-doc label {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 0.9em;
  color: #555;
}

.form-group-doc input,
.form-group-doc select,
.form-group-doc textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 0.95em;
}

.form-group-doc textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row-doc {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 15px;
}

.btn-filtrar-doc {
  width: 100%;
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid #ccc;
  background-color: #f0f0f0;
  cursor: pointer;
  border-radius: 5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-filtrar-doc:hover {
  background-color: #e0e0e0;
}

.btn-filtrar-doc.disabled,
.btn-filtrar-doc:disabled {
  background-color: #d3dbe6;
  cursor: not-allowed;
  opacity: 0.7;
  border-color: #ccd4dd;
}

/* Contenedor de carga */
.upload-container-doc {
  padding: 20px;
  border: 1px solid #eef;
  border-radius: 8px;
  background: #fdfdfd;
  max-width: 600px;
  margin: 0 auto;
}

.drop-zone-doc {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  margin-bottom: 15px;
  background-color: #fafafa;
  transition: all 0.3s;
  cursor: pointer;
}

.drop-zone-doc:hover {
  border-color: var(--primary-color);
  background-color: #f0f8ff;
}

.drop-zone-doc i {
  font-size: 2.5em;
  color: var(--primary-color);
  margin-bottom: 10px;
  display: block;
}

.file-info-doc {
  background-color: #eaf6ff;
  border: 1px solid #cceeff;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  font-size: 0.9em;
  white-space: pre-wrap;
}

.file-info-doc ul {
  list-style-type: disc;
  padding-left: 20px;
  margin-top: 5px;
}

.upload-results-doc {
  margin-top: 20px;
  padding: 15px;
  border-radius: 5px;
  background-color: #e8f5e9;
  border-left: 5px solid var(--success-color);
  white-space: pre-wrap;
  font-size: 0.9em;
}

/* Botones de acciones del formulario */
.form-actions-doc {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 15px;
  padding-top: 0;
  border-top: none;
}

.btn-primary-doc {
  background-color: var(--success-color);
  color: white;
  padding: 10px 25px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-doc:hover {
  background-color: #2ecc71;
}

.btn-upload-doc:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.btn-cancelar-doc {
  background-color: #6c757d;
  color: white;
  padding: 10px 25px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-cancelar-doc:hover {
  background-color: #495057;
}

/* Botón de documentos en tablas */
button.documentos {
  background-color: #ff9800;
  padding: 7px 12px;
  margin: 0 5px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: white;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

button.documentos:hover {
  background-color: #f57c00;
}

/* Botón de reclamo en tablas */
button.reclamo {
  background-color: #e74c3c;
  padding: 7px 12px;
  margin: 0 5px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: white;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

button.reclamo:hover {
  background-color: #c0392b;
}

/* Diseño responsivo para el gestor */
@media screen and (max-width: 768px) {
  .modal-contenido-documentos {
    padding: 20px;
    max-width: 95%;
  }
  
  .list-container-grid-doc {
    flex-direction: column;
  }
  
  .filter-sidebar-doc {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
  }
  
  .controls-bar-doc {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .controls-right-doc {
    width: 100%;
  }
  
  .data-table-doc thead {
    display: none;
  }
  
  .data-table-doc tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }
  
  .data-table-doc td {
    display: block;
    text-align: right !important;
    border-bottom: 1px dotted #ccc;
    position: relative;
    padding-left: 50%;
  }
  
  .data-table-doc td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    text-align: left;
    font-weight: bold;
  }
}

/* ===== PANEL DE PREVISUALIZACIÓN ===== */
.preview-panel-doc {
  display: flex;
  flex-direction: column;
  margin-top: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-height: 420px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  width: 100%;
}

#documentListSection {
  width: 100%;
}

.preview-header-doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: #ffffff;
  border-radius: 8px 8px 0 0;
}

.preview-header-doc h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
}

.preview-header-spacer {
  width: 140px;
  flex: 0 0 140px;
}

.btn-back-doc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  text-transform: none;
}

.preview-content-doc {
  flex: 1;
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  background: #fdfdfd;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.preview-content-doc iframe,
.preview-content-doc img {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
  background: #ffffff;
}

.preview-content-doc img {
  width: auto;
  height: auto;
  max-width: 70%;
  max-height: 85%;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.preview-content-doc iframe {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  align-self: stretch;
}

.preview-placeholder-doc {
  text-align: center;
  color: #666666;
  padding: 60px 20px;
  margin: 0;
  font-size: 0.95rem;
}

.tenant-badge-doc {
  background-color: #f5f7fb;
  border: 1px solid #e2e7f1;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 12px 0;
  font-size: 0.85rem;
}

.tenant-badge-doc strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5b667d;
  margin-bottom: 4px;
}

.tenant-badge-doc.secondary {
  background-color: #fdf6ed;
  border-color: #f3d7b8;
}

.preview-fallback-doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px 20px;
  gap: 16px;
  color: #444444;
}

.preview-fallback-doc p {
  margin: 0;
  line-height: 1.5;
}

.preview-fallback-doc .btn-primary-doc {
  margin-top: 8px;
}

.input-readonly-doc {
  background-color: #eef3f9 !important;
  color: #48525f !important;
  cursor: default;
}

/* Grid de 4-5 columnas bien compactas para acciones */
.acciones-grid {
  display: grid;

  /* Columnas ajustadas al tamaño del botón (no se expanden con el ancho de la celda) */
  grid-template-columns: repeat(auto-fit, minmax(30px, auto));
  max-width: 180px; /* Limitar ancho para mantener 4-5 botones por fila */

  /* Ajusta el espacio HORIZONTAL entre botones */
  column-gap: 4px;   /* <-- AJUSTA TU GUSTO */

  /* Ajusta el espacio VERTICAL entre fila 1 y fila 2 */
  row-gap: 4px;      /* <-- AJUSTA TU GUSTO */

  justify-content: center; /* centra todo el bloque */
}

/* Botones compactos y uniformes */
.acciones-grid button {
  width: 30px;    /* puedes bajar a 28 si quieres más compacto */
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px; /* más pequeño para que se vea más elegante */
}

/* Botón específico de solicitud de movimiento con color distintivo */
.acciones-grid button.solicitud-movimiento {
  background-color: #7b1fa2;
  color: white;
}

.acciones-grid button.solicitud-movimiento:hover {
  background-color: #6a1b9a;
}

/* Botón específico de reclamo con color distintivo */
.acciones-grid button.reclamo {
  background-color: #e74c3c;
  color: white;
}

.acciones-grid button.reclamo:hover {
  background-color: #c0392b;
}

/* Permitir múltiples líneas */
td.actions {
  white-space: normal !important;
  text-align: center;
}

.tabla-contexto td {
  padding: 8px;
  border: 1px solid #e0e0e0;
  color: #424242;
}

/* Botón historial */
.btn-historial {
  background-color: #7b1fa2;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.btn-historial:hover {
  background-color: #6a1b9a;
}

/* ========================================
   ESTILOS ADICIONALES PARA CONTEXTO DE PÓLIZA
   (Desde HTML de referencia)
   ======================================== */

.smv-client-name.contextual {
  margin-bottom: 10px;
  border-bottom: none;
  padding-bottom: 0;
  font-size: 1.1em;
  margin-top: 0;
  color: #2c3e50;
}

.smv-context-header .table-wrapper {
  overflow-x: visible;
  width: 100%;
}

.smv-context-header .data-table {
  width: 100%;
  border-collapse: collapse;
}

.smv-context-header .data-table thead {
  background-color: #1f6feb;
}

.smv-context-header .data-table th,
.smv-context-header .data-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
  word-wrap: break-word;
}

.smv-context-header .data-table thead th {
  color: white;
  font-weight: 500;
  vertical-align: bottom;
  text-align: left;
}

.policy-main-info .policy-number {
  font-size: 1.2em;
  font-weight: 700;
  color: #1f6feb;
  margin-bottom: 5px;
  display: block;
}

.policy-details .data-value {
  font-size: 0.95em;
  font-weight: 500;
  color: #555;
  display: block;
  line-height: 1.3;
}

.field-group {
  display: flex;
  align-items: center;
  font-size: 0.9em;
  margin-bottom: 4px;
}

.field-label {
  color: #666;
  font-weight: 500;
  margin-right: 8px;
  flex-shrink: 0;
}

.field-value {
  font-weight: 600;
  color: #333;
}

.line-group {
  display: flex;
  justify-content: flex-start;
  gap: 15px;
  align-items: center;
}

/* Status Badges para contexto */
.status-vigente,
.status-activo {
  color: #27ae60;
  background-color: #e8f8ef;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75em;
  text-transform: uppercase;
  display: inline-block;
}

.status-cancelada,
.status-excluido {
  color: #e74c3c;
  background-color: #fdedec;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75em;
  text-transform: uppercase;
  display: inline-block;
}

.status-consumida {
  color: #E91E63;
  background-color: #FCE4EC;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75em;
  text-transform: uppercase;
  display: inline-block;
}

.balance-highlight {
  font-weight: 700;
  font-size: 1.05em;
  color: #e74c3c;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #fdedec;
  display: inline-block;
}

.balance-highlight.settled {
  color: #27ae60;
  background-color: #e8f8ef;
}

.btn-estado-cuenta {
    background-color: #007bff; /* Azul profesional */
    color: white;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: 0.2s ease-in-out;
}

.btn-estado-cuenta i {
    color: white !important;
}

.btn-estado-cuenta:hover {
    background-color: #0056b3;
}

/* Control de Renovaciones styles will be added */

/* ==============================
   Control de Renovaciones
   ============================== */

.container {
    max-width: 95%;
    margin: 10px auto;
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.container h1 {
    color: #2c3e50;
    font-size: 1.9em;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.title-and-icon {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions {
    display: flex;
    align-items: center;
    font-size: 1rem;
    gap: 10px;
}

.controls-bar-wrapper {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 25px;
}

.controls-bar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
}

  .toolbar-item {
      display: flex;
      flex-direction: column;
      min-width: 120px;
  }

  .toolbar-item label {
      font-size: 0.85em;
      font-weight: 600;
      color: var(--dark-gray);
      margin-bottom: 4px;
  }

  .toolbar-select, .toolbar-input {
      padding: 8px 10px;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      font-size: 0.95em;
      height: 38px;
      box-sizing: border-box;
      min-width: 100px;
  }

  .checkbox-column {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding-bottom: 5px;
  }

  .checkbox-item {
      display: flex;
      align-items: center;
      height: 16px;
      line-height: 16px;
  }

  .checkbox-item input[type="checkbox"] {
      margin-right: 8px;
      width: 16px;
      height: 16px;
  }

  .checkbox-item label {
      font-size: 0.9em;
      font-weight: 500;
      color: #444;
      margin-bottom: 0;
  }

  .radio-label {
      font-size: 0.9em;
      cursor: pointer;
  }

  .btn-toolbar {
      padding: 8px 15px;
      border: none;
      border-radius: 4px;
      font-weight: bold;
      cursor: pointer;
      height: 38px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: background-color 0.2s;
      font-size: 0.95em;
  }

  .btn-apply-filter {
      background-color: var(--primary-color);
      color: white;
  }

  .btn-apply-filter:hover {
      background-color: #2980b9;
  }

  .btn-execute-motor {
    background-color: var(--success-color);
    color: white;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  }

  .btn-execute-motor:hover {
      background-color: #2ecc71;
  }

  .nav-tabs {
      border-bottom: 2px solid var(--border-color);
      margin-bottom: 20px;
      display: flex;
      flex-wrap: wrap;
  }

  .nav-link {
      padding: 10px 20px;
      border: none;
      background-color: transparent;
      cursor: pointer;
      font-size: 1em;
      color: var(--dark-gray);
      border-bottom: 3px solid transparent;
      margin-bottom: -2px;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 8px;
  }

  .nav-link.active {
      font-weight: bold;
      color: var(--primary-color);
      border-bottom-color: var(--primary-color);
  }

  .tab-pane { display: none; }
  .tab-pane.active {
      display: block;
      animation: fadeIn 0.5s;
  }

  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  .table-wrapper {
      overflow-x: visible;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
      background-color: white;
  }

  .data-table {
      width: 100%;
      border-collapse: collapse;
  }

  .data-table th, .data-table td {
      padding: 10px 12px;
      text-align: left;
      border-bottom: 1px solid #f0f0f0;
  }

  .data-table thead th {
      background-color: var(--primary-color);
      color: white;
      font-weight: 600;
  }

  .data-table tbody tr:nth-child(even) {
      background-color: var(--light-gray);
  }

  .data-table tbody tr:hover {
      background-color: #e0f7fa;
  }

  .data-table td[data-label] {
      font-size: 0.9em;
  }

  .btn-grid-action {
      padding: 5px 8px;
      margin: 2px;
      font-size: 0.8em;
      border-radius: 4px;
      cursor: pointer;
      border: 1px solid transparent;
      transition: background-color 0.2s;
  }

  .btn-view { background-color: var(--primary-color); color: white; }
  .btn-edit { background-color: var(--success-color); color: white; }
  .btn-delete { background-color: var(--danger-color); color: white; }
  .btn-note { background-color: var(--warning-color); color: white; }

  .btn-view:hover { background-color: #2980b9; }
  .btn-edit:hover { background-color: #2ecc71; }
  .btn-delete:hover { background-color: #c0392b; }
  .btn-note:hover { background-color: #e08e0b; }

  .action-buttons-cell {
      display: flex;
      gap: 4px;
      align-items: center;
      padding: 0;
      min-height: 40px;
  }

  .action-buttons-cell button {
      margin: 0;
  }

  .data-table tfoot td {
      font-weight: bold;
      border-top: 3px solid var(--primary-color);
      font-size: 0.95em;
  }

  .data-table tfoot tr:first-child td {
      border-bottom: 1px solid var(--border-color);
  }

  .data-table tfoot tr:hover {
      background-color: transparent !important;
  }

  .status-si { color: var(--success-color); font-weight: 600; }
  .status-no { color: var(--soft-red); font-weight: 600; }
  .prima-no-digitada { color: var(--soft-red); font-style: italic; }

  .detail-context {
      color: #2c3e50;
    padding: 6px 0 12px 0;
    margin-bottom: 12px;
    font-weight: 700;
  }

  .detail-context h2 {
    font-size: 1.55em;
    margin: 0;
    color: #2c3e50;
  }

  .detail-context strong {
      color: var(--primary-color);
  }

  .renov-context-aseg {
    color: var(--primary-color);
    font-weight: 800;
  }

  .renov-context-moneda {
    color: #2c3e50;
    font-weight: 700;
  }

  .pagination-container {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      margin-top: 15px;
      padding: 10px 0;
      font-size: 0.9em;
  }

  .pagination-info {
      margin-right: 15px;
      color: var(--dark-gray);
  }

  .page-link {
      padding: 8px 12px;
      margin: 0 4px;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      cursor: pointer;
      background-color: white;
      transition: background-color 0.2s;
      user-select: none;
  }

  .page-link:hover:not(.active) {
      background-color: var(--light-gray);
  }

  .page-link.active {
      background-color: var(--primary-color);
      color: white;
      border-color: var(--primary-color);
      font-weight: bold;
  }

  .page-link.disabled {
      cursor: not-allowed;
      opacity: 0.5;
  }

  .renov-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    background: #fff;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 14px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
  }

  .renov-bulk-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
  }

  .renov-bulk-group label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--dark-gray);
  }

  .renov-bulk-group input,
  .renov-bulk-group select {
    min-height: 38px;
  }

  .renov-bulk-group#bulkNumeroWrapper,
  .renov-bulk-group#bulkPrimaWrapper,
  .renov-bulk-group#bulkFormaWrapper,
  .renov-bulk-group#bulkEntregadoPorWrapper {
    display: none;
  }

  .renov-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .empty-row {
    text-align: center;
    padding: 14px;
    color: var(--inactive-color);
  }

  @media (max-width: 992px) {
    .container h1 { flex-direction: column; align-items: flex-start; gap: 10px; }
    .controls-bar { flex-direction: column; align-items: stretch; }
    .renov-bulk-bar { flex-direction: column; align-items: stretch; }
  }

  /* =========================================
    Control de Renovaciones - Scoped estilos
    ========================================= */
  .renov-container {
    background: #f4f7f6;
    padding: 24px;
    min-height: 100vh;
    margin-right: 30px;
    box-sizing: border-box;
  }

  .renov-card {
    background: #fff;
    border: 1px solid #d9e1ec;
    border-radius: 12px;
    box-shadow: 0 10px 18px rgba(0,0,0,0.08);
    padding: 24px 28px;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .renov-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.9rem;
    margin-bottom: 16px;
    color: #2c3e50;
  }

  .renov-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .controls-bar-wrapper {
    background: #f8f9fa;
    padding: 15px 20px;
    border: 1px solid #d9e1ec;
    border-radius: 10px;
    margin-bottom: 24px;
  }

  .renov-controls-bar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 18px;
  }

  .renov-field label,
  .renov-bulk-group label {
    font-size: 0.9em;
    font-weight: 600;
    color: #4a5568;
  }

  .renov-radio-row { display: flex; flex-direction: column; gap: 6px; }

  .btn-execute-motor {
    background: var(--success-color);
    color: #fff;
    border: none;
    padding: 8px 14px;
    min-height: 40px;
    min-width: 180px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .btn-apply-filter {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 9px 14px;
    border-radius: 6px;
  }

  .renov-card .nav-tabs {
    display: flex;
    gap: 12px;
    border-bottom: 2px solid #e0e6ed;
    margin: 6px 0 18px;
  }

  .renov-card .nav-link {
    padding: 10px 2px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #4a5568;
    font-weight: 700;
    border-radius: 0;
  }

  .renov-card .nav-link.active {
    background: transparent;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    box-shadow: none;
  }

  .tab-content { margin-top: -1px; }
  .renov-card .tab-pane { display: none; }
  .renov-card .tab-pane.active { display: block; animation: renovFade 0.35s ease; }
  @keyframes renovFade { from { opacity:0; } to { opacity:1; } }

  .renov-card .table-wrapper {
    overflow-x: auto;
    border: 1px solid #d9e1ec;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    background: #fff;
  }

  .renov-card .data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
  }

  .renov-card .data-table th,
  .renov-card .data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f4f8;
    border-right: 1px solid #eef2f5;
    font-size: 0.94rem;
  }

  .renov-card .data-table thead th {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    border-right: 1px solid rgba(255,255,255,0.2);
  }

  /* Ajustes específicos de la tabla Detalle de Renovaciones */
  .renov-card #tablaDetalle {
    table-layout: auto;
  }

  .renov-card #tablaDetalle th:nth-child(2),
  .renov-card #tablaDetalle td:nth-child(2) {
    min-width: 280px;
  }

  .renov-card #tablaDetalle td:nth-child(2) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
    line-height: 1.35;
  }

  .renov-card #tablaDetalle td:nth-child(2) small {
    display: block;
    margin-top: 2px;
  }

  .renov-card #tablaDetalle th:nth-child(3),
  .renov-card #tablaDetalle td:nth-child(3) {
    min-width: 95px;
    white-space: nowrap;
  }

  .renov-card .data-table tbody tr:nth-child(even) { background: #f7fbff; }
  .renov-card .data-table tbody tr:hover { background: #e8f3ff; }

  .renov-card .data-table tfoot td {
    font-weight: 700;
    border-top: 3px solid var(--primary-color);
    background: #fafbfd;
  }

  .renov-tfoot-row td { border-top: 2px solid #d9e1ec; }
  .renov-tfoot-label { font-weight: 800; color: #2c3e50; text-align: left; }
  .renov-flag { font-weight: 900; color: #fff; text-align: center; }
  .renov-flag-si { background: #27ae60; }
  .renov-flag-no { background: #ec8282; }
  .renov-money { text-align: right; font-weight: 700; }
  .renov-money-si, .renov-count-si { color: #27ae60; }
  .renov-money-no, .renov-count-no { color: #ec8282; }
  .renov-count-si, .renov-count-no { text-align: center; font-weight: 700; }

  .renov-th-si { background: #27ae60; color: #fff; }
  .renov-th-no { background: #ec8282; color: #fff; }
  .renov-th-group { background: var(--primary-color); color: #fff; }

  .renov-pill {
    display: inline-block;
    min-width: 34px;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
  }

  .renov-pill-si { background: #27ae60; }
  .renov-pill-no { background: #ec8282; }

  /* KPI strip */
  .renov-kpis { display:flex; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
  .renov-kpi-card { flex:1 1 180px; background:#f9fbfd; border:1px solid #dfe6ee; border-radius:8px; padding:10px 12px; box-shadow:0 1px 2px rgba(0,0,0,0.04); }
  .renov-kpi-title { font-size:0.9rem; color:#4a5568; text-transform:uppercase; letter-spacing:0.04em; margin-bottom:4px; }
  .renov-kpi-value { font-size:1.4rem; font-weight:700; color:#1f6feb; }
  .renov-kpi-sub { font-size:0.85rem; color:#2d3748; }

  .status-si { color: var(--success-color); font-weight: 700; }
  .status-no { color: #ec8282; font-weight: 700; }
  .renov-card td .status-si,
  .renov-card td .status-no { display: inline-block; padding: 2px 6px; border-radius: 4px; }
  .renov-card td .status-si { background: #e8f8ef; }
  .renov-card td .status-no { background: #fdecea; }
  .prima-no-digitada { color: #ec8282; font-style: italic; }

  .renov-container .empty-row { text-align: center; padding: 14px; color: var(--inactive-color); }

  .renov-card .pagination-container { display: flex; justify-content: flex-end; align-items: center; margin-top: 12px; padding: 8px 0; font-size: 0.92rem; }
  .renov-card .pagination-info { margin-right: 12px; color: #4a5568; }
  .renov-card .pagination-container nav { display: flex; align-items: center; gap: 4px; }
  .renov-card .page-link { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; margin: 0; border: 1px solid #d0d7de; border-radius: 4px; cursor: pointer; background: #fff; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; user-select: none; }
  .renov-card .page-link:hover:not(.active):not(.disabled) { background: #f5f8fb; border-color: #bfc6d1; }
  .renov-card .page-link.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); font-weight: 700; }
  .renov-card .page-link.disabled { cursor: not-allowed; opacity: 0.5; color: #8c939f; }

  .form-container { padding: 12px; background: #fff; border: 1px dashed #d9e1ec; border-radius: 8px; }

  @media (max-width: 992px) {
    .renov-title { flex-direction: column; align-items: flex-start; gap: 10px; }
    .renov-controls-bar { flex-direction: column; align-items: stretch; }
    .renov-bulk-bar { flex-direction: column; align-items: stretch; }
    .renov-card { padding: 18px; }
    .renov-container { margin-right: 0; }
  }

  /* -------------------------------------------------------------
  * ESTILOS PARA BOTONES CONTEXTUALES FLOTANTES (ACTION TRIGGER)
  * ------------------------------------------------------------- */

  /* 1. Contenedor que permite el posicionamiento relativo para el botón flotante 
    Se aplica al <span> que envuelve el nombre del cliente en el <td> */
  .action-trigger {
      position: relative;
      display: inline-block; /* Crucial: asegura que el <span> ocupe solo el espacio del texto */
      padding: 0;
  }

  /* 2. Estilo base del botón flotante (OCULTO POR DEFECTO) */
  .floating-action-button {
      /* Posicionamiento absoluto para sacarlo del flujo del texto */
      position: absolute;
      
      /* Colocación: en la esquina superior derecha del <span>, movido 100% hacia la derecha */
      top: -15px; /* Ajuste vertical. Si quieres centrar más, puedes usar 0, o un valor negativo. -15px está bien como inicio. */
      right: 0; /* Alineado a la derecha del <span> */
      
      /* Comportamiento de OCULTAR POR DEFECTO */
      opacity: 0;
      visibility: hidden;
      
      /* Mueve y escala para el efecto de transición (fuera de la vista) */
      /* Lo movemos 100% + un poco (ej: 10px) del span hacia la derecha para que no se superponga al texto, y lo achicamos ligeramente. */
      transform: translateX(100%) scale(0.9);
      transition: all 0.3s ease; 

      /* Estilo visual */
      padding: 6px 12px;
      border: none;
      border-radius: 4px;
      background-color: var(--primary-color); /* Usamos el azul principal de tu tema */
      color: white;
      font-size: 13px;
      cursor: pointer;
      white-space: nowrap; /* Evita que el texto del botón se rompa */
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
      z-index: 50; /* Asegura que esté por encima de las celdas adyacentes */
  }

  /* 3. Comportamiento al hacer HOVER sobre el contenedor action-trigger */
  .action-trigger:hover .floating-action-button {
      opacity: 1;
      visibility: visible;
      
      /* Movemos a la posición final visible */
      /* Dejamos el translateX(100%) para que inicie donde termina el texto, 
        pero cambiamos scale a 1 y quitamos el offset de X del step 2 */
      transform: translateX(100%) scale(1); 
  }

  /* 4. Subrayar el texto del cliente al hacer hover (indicador visual) */
  .action-trigger:hover {
      text-decoration: underline; 
      cursor: pointer;
  }

  .clientes-nombre-cell {
      text-align: left;
      white-space: normal;
      max-width: 260px;
  }

  .clientes-nombre-trigger {
      display: block;
      width: 100%;
      max-width: 100%;
  }

  .clientes-nombre-text {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
      line-height: 1.35;
      max-height: calc(1.35em * 2);
      padding-right: 4px;
  }

  table tbody td:nth-child(2) {
      overflow: visible;
  }

  /* Asegura que el botón flotante no sea cortado por el scroll del modal de cobros */
  #tbodyCobrosPoliza td:first-child {
      overflow: visible !important;
  }

  /* Ajuste específico para que el botón no tape el texto si la celda es estrecha */
  .action-trigger .floating-action-button {
      white-space: nowrap;
      min-width: 160px;
  }

  /* Asegura que el botón flotante sea visible en la tabla de acuerdos */
  #tbodyAcuerdosPoliza td:first-child {
      overflow: visible !important;
  }

  /* =============================================================
    ESTILOS MODAL INFORMACIÓN ASEGURADORA
    ============================================================= */

  /* Encabezado azul */
  #modalInfoAseguradora h3 {
      background-color: var(--primary-color, #0d6efd);
      color: white;
      margin: -20px -20px 20px -20px; /* Expande el fondo azul a los bordes */
      padding: 15px 20px;
      font-size: 1.1rem;
      border-bottom: 1px solid #ddd;
  }

  /* Ajuste del botón de cerrar (X) en el header azul */
  #btnCerrarInfoAsegX {
      color: white;
      opacity: 0.9;
      top: 12px;
      right: 15px;
      font-size: 1.5rem;
  }
  #btnCerrarInfoAsegX:hover {
      color: #ffcccc;
  }

  /* Estilo de la tabla de información */
  #tbodyInfoAseguradora tr {
      border-bottom: 1px solid #f0f0f0;
  }
  #tbodyInfoAseguradora tr:last-child {
      border-bottom: none;
  }

  /* Columna Izquierda (Etiquetas) */
  #tbodyInfoAseguradora th {
      width: 35%;
      background-color: #f8f9fa; /* Gris muy claro */
      color: #555;
      font-weight: 600;
      text-align: right;
      padding: 10px 15px;
      vertical-align: middle;
      font-size: 0.9rem;
      border-right: 3px solid white; /* Separador visual */
  }

  /* Columna Derecha (Datos) */
  #tbodyInfoAseguradora td {
      padding: 10px 15px;
      color: #333;
      font-size: 0.95rem;
      vertical-align: middle;
  }

  /* Links dentro de la tabla */
  #tbodyInfoAseguradora a {
      color: var(--primary-color, #0d6efd);
      text-decoration: none;
      font-weight: 500;
  }
  #tbodyInfoAseguradora a:hover {
      text-decoration: underline;
  }

  /* Nuevo estilo para controlar el ancho del modal de información */
  #modalInfoAseguradora .modal-contenidoCliente {
      width: 80% !important;           /* Ocupa el 80% del ancho de la pantalla */
      max-width: 1200px !important;    /* No pasará de 1000px para que no se vea exagerado en monitores gigantes */
      min-width: 600px;     /* No se encogerá más de 600px */
  }

  /* Estilo para las pestañas de información (para que se vean como las del modal principal) */
  .tab-btn-info {
      padding: 10px 20px;
      cursor: pointer;
      background: #f1f1f1;
      border: 1px solid #ddd;
      border-bottom: none;
      border-radius: 5px 5px 0 0;
      margin-right: 5px;
      font-weight: 600;
      color: #666;
      transition: all 0.3s;
  }

  .tab-btn-info.active {
      background: white;
      border-top: 3px solid var(--primary-color, #0d6efd);
      color: var(--primary-color, #0d6efd);
      padding-bottom: 11px; /* Para que pise el borde de abajo */
      position: relative;
      top: 1px;
  }

  /* =============================================================
    ESTILOS UNIFICADOS: BOTÓN FLOTANTE AZUL (TOOLTIP ARRIBA)
    Aplica a:
    1. .preview-poliza (Modales Factura, Cobro, etc)
    2. #tablaPolizas (Listado principal de pólizas)
    ============================================================= */

  /* 1. Asegurar overflow visible en las celdas contenedoras */
  .preview-poliza td,
  #tablaPolizas td:first-child { 
      overflow: visible !important;
      position: relative; 
  }

  /* 2. Definición del Botón Flotante (Posición Superior Izquierda) */
  .preview-poliza .action-trigger .floating-action-button,
  #tablaPolizas .action-trigger .floating-action-button {
      /* Reseteo */
      top: auto; 
      right: auto; 
      
      /* Posición: Encima del texto */
      bottom: 100%; 
      left: 0;      
      
      /* Ajustes */
      margin-bottom: 6px; 
      margin-left: 0;
      
      /* Animación */
      transform: scale(0.9); 
      transform-origin: bottom left;
      
      /* Estética Azul */
      background-color: var(--primary-color);
      color: white;
      white-space: nowrap;
      z-index: 1000;
      min-width: auto; 
      padding: 5px 10px;
      box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  }

  /* 3. Flechita decorativa */
  .preview-poliza .action-trigger .floating-action-button::after,
  #tablaPolizas .action-trigger .floating-action-button::after {
      content: '';
      position: absolute;
      top: 100%; 
      left: 15px; 
      border-width: 5px;
      border-style: solid;
      border-color: var(--primary-color) transparent transparent transparent; 
  }

  /* 4. Hover: Mostrar */
  .preview-poliza .action-trigger:hover .floating-action-button,
  #tablaPolizas .action-trigger:hover .floating-action-button {
      opacity: 1;
      visibility: visible;
      transform: scale(1);
  }

  /* =============================================================
    ALINEACIÓN Y ESTÉTICA DE TABLAS (CONTACTOS Y BANCOS)
    ============================================================= */

  /* Estilo general para las tablas de las pestañas de info */
  .tab-content-info table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 10px;
      table-layout: fixed; /* Fuerza a respetar los anchos que definamos */
  }

  /* Encabezados (Títulos de las columnas) */
  .tab-content-info th {
      background-color: #f1f3f5;
      color: #495057;
      font-weight: 700;
      text-align: left;        /* Cambiado de center a left */
      padding: 12px 15px;      /* Aumentamos el padding lateral para la indentación */
      border-bottom: 2px solid #dee2e6;
      font-size: 0.85rem;
      text-transform: none;
  }

  /* Celdas de contenido de las tablas */
  .tab-content-info td {
      padding: 12px 15px;      /* Alineado con el encabezado */
      border-bottom: 1px solid #eee;
      vertical-align: middle;
      text-align: left;        /* Cambiado de center a left para que coincida con el título */
      color: #333;
      font-size: 0.9rem;
      word-wrap: break-word;
  }

  /* Alineación especial para la columna de "Canales" (mejor a la izquierda) */
  /* Es la 3ra columna de la tabla de contactos */
  #tab-info-contactos td:nth-child(3) {
      text-align: left; 
      font-size: 0.85rem;
      line-height: 1.4;
  }

  /* Efecto cebra para que las filas se distingan mejor */
  .tab-content-info tbody tr:nth-child(even) {
      background-color: #fafafa;
  }

  /* Cambio de color al pasar el mouse por la fila */
  .tab-content-info tbody tr:hover {
      background-color: #f4f7ff;
  }

  /* Anchos para Contactos */
  #tab-info-contactos th:nth-child(1) { width: 30%; } /* Nombre */
  #tab-info-contactos th:nth-child(2) { width: 30%; } /* Cargo */
  #tab-info-contactos th:nth-child(3) { width: 40%; } /* Canales */

  /* Anchos para Bancos */
  #tab-info-bancos th:nth-child(1) { width: 35%; }    /* Banco */
  #tab-info-bancos th:nth-child(2) { width: 30%; }    /* Tipo */
  #tab-info-bancos th:nth-child(3) { width: 35%; }    /* Número */

  /* =============================================================
    MÓDULO DE CONTROL DE RECLAMOS
    ============================================================= */

  /* Contenedor principal */
  .rec-container {
      max-width: 1600px;
      margin: 0 auto;
      padding: 15px 20px;
  }

  /* Header de la página */
  .rec-page-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px 0;
      margin-bottom: 20px;
      border-bottom: 2px solid #e0e0e0;
  }

  .rec-page-header h1 {
      font-size: 24px;
      color: #2c3e50;
      margin: 0;
      text-align: left;
  }

  .rec-btn-back {
      background-color: var(--cancel-color);
      color: white;
      padding: 10px 18px;
      border-radius: 8px;
      text-decoration: none;
      font-weight: 500;
      transition: background-color 0.2s;
  }

  .rec-btn-back:hover {
      background-color: #5a6268;
  }

  /* Navegación de tabs */
  .rec-nav-tabs {
      display: flex;
      gap: 5px;
      border-bottom: 2px solid #e0e0e0;
      margin-bottom: 20px;
  }

  .rec-nav-link {
      padding: 12px 25px;
      border: none;
      background: #f5f5f5;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      color: #666;
      border-radius: 8px 8px 0 0;
      transition: all 0.2s;
  }

  .rec-nav-link:hover {
      background: #e8e8e8;
  }

  .rec-nav-link.active {
      background: var(--primary-color);
      color: white;
  }

  /* Barra de controles */
  .rec-controls-bar {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      flex-wrap: wrap;
      gap: 15px;
      padding: 15px;
      background: #f8f9fa;
      border-radius: 10px;
      margin-bottom: 20px;
  }

  .rec-controls-left {
      display: flex;
      gap: 10px;
  }

  .rec-controls-right {
      display: flex;
      gap: 15px;
      align-items: flex-end;
      flex-wrap: wrap;
  }

  .rec-toolbar-item {
      display: flex;
      flex-direction: column;
      gap: 5px;
  }

  .rec-toolbar-item label {
      font-size: 12px;
      color: #666;
      font-weight: 500;
  }

  .rec-toolbar-input {
      padding: 8px 12px;
      border: 1px solid #ccc;
      border-radius: 6px;
      font-size: 14px;
  }

  .rec-input-estatus { min-width: 200px; }
  .rec-input-date { width: 150px; }
  .rec-input-ramo { min-width: 180px; }

  .rec-add-btn {
      background-color: var(--primary-color);
      color: white;
      border: none;
      padding: 10px 20px;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: background-color 0.2s;
  }

  .rec-add-btn:hover {
      background-color: #1557b0;
  }

  /* Tabla de lista */
  .rec-table-wrapper {
      overflow-x: auto;
      background: white;
      border-radius: 10px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .rec-data-table-list {
      width: 100%;
      border-collapse: collapse;
      min-width: 1200px;
  }

  .rec-data-table-list thead {
      background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  }

  .rec-data-table-list th {
      padding: 14px 12px;
      text-align: left;
      color: white;
      font-weight: 600;
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
  }

  .rec-data-table-list td {
      padding: 14px 12px;
      border-bottom: 1px solid #eee;
      vertical-align: top;
      font-size: 13px;
      line-height: 1.5;
  }

  .rec-data-table-list tbody tr:hover {
      background-color: #f5f9ff;
  }

  /* Badges de estado */
  .rec-status-badge {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
  }

  .rec-status-badge.status-pendiente {
      background-color: #fff3cd;
      color: #856404;
  }

  .rec-status-badge.status-proceso {
      background-color: #cce5ff;
      color: #004085;
  }

  .rec-status-badge.status-aprobado {
      background-color: #d4edda;
      color: #155724;
  }

  .rec-status-badge.status-rechazado {
      background-color: #f8d7da;
      color: #721c24;
  }

  /* Botones de acción en grid */
  .rec-action-buttons {
      display: flex;
      gap: 8px;
      justify-content: center;
  }

  .rec-action-btn {
      width: 36px;
      height: 36px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
  }

  .rec-action-btn.edit {
      background-color: var(--primary-color);
      color: white;
  }

  .rec-action-btn.edit:hover {
      background-color: #1557b0;
  }

  .rec-action-btn.note {
      background-color: var(--warning-color);
      color: white;
  }

  .rec-action-btn.note:hover {
      background-color: #e08e0b;
  }

  /* Paginación */
  .rec-pagination-container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px 20px;
      background: #f8f9fa;
      border-radius: 0 0 10px 10px;
  }

  .rec-pagination-info {
      color: #666;
      font-size: 14px;
  }

  .rec-pagination-controls {
      display: flex;
      gap: 5px;
  }

  .rec-page-btn {
      padding: 8px 14px;
      border: 1px solid #ddd;
      background: white;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
  }

  .rec-page-btn:hover:not(:disabled) {
      background: var(--primary-color);
      color: white;
      border-color: var(--primary-color);
  }

  .rec-page-btn.active {
      background: var(--primary-color);
      color: white;
      border-color: var(--primary-color);
  }

  .rec-page-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
  }

  /* Contenedor de sesión (secciones del formulario) */
  .rec-session-container {
      background: white;
      border-radius: 12px;
      padding: 20px;
      margin-bottom: 20px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .rec-session-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--primary-color);
      padding-bottom: 12px;
      margin-bottom: 18px;
      border-bottom: 2px solid #e8f4fd;
  }

  /* Layout grid para formularios */
  .rec-layout-grid {
      display: grid;
      gap: 15px;
      margin-bottom: 15px;
  }

  .rec-form-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
  }

  .rec-form-group label {
      font-size: 12px;
      font-weight: 600;
      color: #555;
      text-transform: uppercase;
      letter-spacing: 0.3px;
  }

  .rec-form-group input,
  .rec-form-group select,
  .rec-form-group textarea {
      padding: 10px 12px;
      border: 1px solid #ddd;
      border-radius: 6px;
      font-size: 14px;
      transition: border-color 0.2s, box-shadow 0.2s;
  }

  .rec-form-group input:focus,
  .rec-form-group select:focus,
  .rec-form-group textarea:focus {
      border-color: var(--primary-color);
      outline: none;
      box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
  }

  .rec-form-group input:read-only {
      background-color: #f5f5f5;
  }

  /* Panel dividido */
  .rec-split-panel {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 25px;
  }

  .rec-split-child {
      background: white;
      border-radius: 12px;
      padding: 20px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  /* Grid de valores */
  .rec-valores-grid {
      display: grid;
      grid-template-columns: 1fr repeat(3, 1fr);
      gap: 8px;
      align-items: center;
  }

  .rec-valores-header {
      font-weight: 700;
      text-align: center;
      color: #555;
      font-size: 13px;
      padding: 8px 0;
      background: #f5f5f5;
      border-radius: 4px;
  }

  .rec-valores-grid input {
      padding: 8px 10px;
      border: 1px solid #ddd;
      border-radius: 6px;
      text-align: right;
      font-size: 13px;
  }

  /* Accordions */
  .rec-accordions-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      margin-top: 20px;
  }

  .rec-accordion-box {
      border: 1px solid #e0e0e0;
      border-radius: 10px;
      overflow: hidden;
  }

  .rec-accordion-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 14px 18px;
      background: #f8f9fa;
      cursor: pointer;
      font-weight: 600;
      font-size: 14px;
      color: #333;
      transition: background-color 0.2s;
  }

  .rec-accordion-header:hover {
      background: #eef2f7;
  }

  .rec-accordion-header.open {
      background: #e8f4fd;
      color: var(--primary-color);
  }

  .rec-accordion-content {
      border-top: 1px solid #e0e0e0;
      background: white;
  }

  .rec-header-status-pending {
      font-size: 11px;
      color: #856404;
      background: #fff3cd;
      padding: 2px 8px;
      border-radius: 10px;
      margin-left: 10px;
  }

  .rec-header-status-complete {
      font-size: 11px;
      color: #155724;
      background: #d4edda;
      padding: 2px 8px;
      border-radius: 10px;
      margin-left: 10px;
  }

  /* Checklist de documentos */
  .rec-docs-checklist {
      list-style: none;
      padding: 15px;
      margin: 0;
  }

  .rec-doc-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 0;
      border-bottom: 1px solid #f0f0f0;
  }

  .rec-doc-item:last-child {
      border-bottom: none;
  }

  .rec-doc-item.checked {
      background: #f8fff8;
  }

  .rec-doc-item input[type="checkbox"] {
      width: 18px;
      height: 18px;
      cursor: pointer;
  }

  .rec-doc-item label {
      flex: 1;
      cursor: pointer;
      font-size: 14px;
  }

  .rec-doc-required {
      color: var(--danger-color);
      font-weight: bold;
      margin-left: 4px;
  }

  .rec-btn-upload-doc {
      background: var(--info-color);
      color: white;
      border: none;
      padding: 6px 10px;
      border-radius: 5px;
      cursor: pointer;
      font-size: 12px;
  }

  .rec-btn-upload-doc:hover {
      background: #138496;
  }

  .rec-doc-file-name {
      font-size: 12px;
      color: var(--success-color);
      font-style: italic;
  }

  /* Botón agregar bienes */
  .rec-btn-add-bienes {
      background: linear-gradient(135deg, var(--info-color), #138496);
      color: white;
      border: none;
      padding: 10px 18px;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      gap: 8px;
  }

  .rec-btn-add-bienes:hover {
      opacity: 0.9;
  }

  /* Mini tabla dentro de secciones */
  .rec-mini-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
  }

  .rec-mini-table th {
      background: #f5f5f5;
      padding: 10px;
      text-align: left;
      font-weight: 600;
      color: #555;
      border-bottom: 2px solid #ddd;
  }

  .rec-mini-table td {
      padding: 10px;
      border-bottom: 1px solid #eee;
  }

  .rec-mini-table tbody tr:hover {
      background: #fafafa;
  }

  .rec-btn-remove {
      background: var(--danger-color);
      color: white;
      border: none;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      cursor: pointer;
      font-size: 12px;
  }

  .rec-btn-remove:hover {
      background: #c0392b;
  }

  /* Botón guardar reclamo */
  .rec-btn-submit-claim {
      background: linear-gradient(135deg, var(--success-color), #219a52);
      color: white;
      border: none;
      padding: 14px 35px;
      border-radius: 10px;
      cursor: pointer;
      font-size: 16px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      transition: all 0.2s;
  }

  .rec-btn-submit-claim:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
  }

  /* Modal de tabla */
  .rec-modal-table {
      width: 100%;
      border-collapse: collapse;
  }

  .rec-modal-table th {
      background: #f5f5f5;
      padding: 12px;
      text-align: left;
      font-weight: 600;
      color: #333;
      border-bottom: 2px solid #ddd;
  }

  .rec-modal-table td {
      padding: 12px;
      border-bottom: 1px solid #eee;
  }

  .rec-modal-table tbody tr:hover {
      background: #f8f9fa;
  }

  /* Upload dropzone */
  .rec-upload-dropzone {
      border: 2px dashed #ccc;
      border-radius: 10px;
      padding: 40px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      margin-top: 15px;
  }

  .rec-upload-dropzone:hover,
  .rec-upload-dropzone.dragover {
      border-color: var(--primary-color);
      background: #f8fbff;
  }

  .rec-upload-dropzone i {
      font-size: 48px;
      color: #aaa;
      margin-bottom: 15px;
  }

  .rec-upload-dropzone p {
      color: #666;
      margin: 0;
  }

  .rec-upload-dropzone .file-info {
      margin-top: 15px;
      padding: 10px;
      background: #e8f5e9;
      border-radius: 6px;
      color: var(--success-color);
      font-weight: 500;
  }

  /* Toast notifications */
  .toast {
      position: fixed;
      bottom: 30px;
      right: 30px;
      padding: 15px 25px;
      border-radius: 8px;
      color: white;
      font-weight: 500;
      z-index: 9999;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      transition: opacity 0.3s, transform 0.3s;
  }

  .toast.oculto {
      opacity: 0;
      transform: translateY(20px);
      pointer-events: none;
  }

  .toast.info {
      background: var(--info-color);
  }

  .toast.success {
      background: var(--success-color);
  }

  .toast.warning {
      background: var(--warning-color);
  }

  .toast.error {
      background: var(--danger-color);
  }

  /* Responsivo para reclamos */
  @media (max-width: 1200px) {
      .rec-split-panel {
          grid-template-columns: 1fr;
      }
      
      .rec-accordions-grid {
          grid-template-columns: 1fr;
      }
  }

  @media (max-width: 768px) {
      .rec-controls-bar {
          flex-direction: column;
          align-items: stretch;
      }
      
      .rec-controls-right {
          flex-direction: column;
      }
      
      .rec-toolbar-input {
          width: 100%;
      }
  }       
          /* ======================================*/
          /* ==== ESTILOS BASE MODULO REMESAS =====*/
          /* ==== ESTILOS BASE K@RRENET ===========*/
          /* ======================================*/
          :root {
              --primary-color: #3498db; 
              --success-color: #27ae60; 
              --danger-color: #e74c3c;
              --warning-color: #f39c12; 
              --light-gray: #f4f7f6;
              --dark-gray: #555; 
              --border-color: #ddd; 
              --text-color: #333;
          }

          body {
              font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
              background-color: var(--light-gray);
              margin: 0;
              padding: 20px;
              color: var(--text-color);
          }

          .container {
              max-width: 1600px;
              margin: 0 auto;
              background-color: #ffffff;
              padding: 30px 40px;
              border-radius: 10px;
              box-shadow: 0 4px 15px rgba(0,0,0,0.1);
              min-height: 80vh;
          }

          h1 {
              color: #2c3e50;
              font-size: 1.8em;
              margin-bottom: 25px;
              display: flex;
              align-items: center;
              gap: 15px;
              border-bottom: 1px solid #eee;
              padding-bottom: 15px;
          }

          /* --- PESTAÑAS --- */
          .nav-tabs {
              display: flex;
              border-bottom: 2px solid var(--border-color);
              margin-bottom: 20px;
              padding: 0;
              list-style: none;
          }

          .nav-link {
              padding: 12px 25px;
              border: none;
              background: transparent;
              font-size: 1rem;
              color: var(--dark-gray);
              cursor: pointer;
              border-bottom: 3px solid transparent;
              font-weight: 500;
              transition: all 0.3s;
          }

          .nav-link:hover { color: var(--primary-color); }
          .nav-link.active { 
              color: var(--primary-color); 
              border-bottom-color: var(--primary-color); 
              font-weight: bold; 
          }

          .tab-content { position: relative; }
          .tab-pane { display: none; }
          .tab-pane.active { display: block; animation: fadeIn 0.3s; }
          @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

          /* --- BOTONES Y FORMULARIOS --- */
          .btn {
              padding: 8px 15px;
              border-radius: 4px;
              border: none;
              cursor: pointer;
              font-weight: 500;
              transition: background 0.2s;
              display: inline-flex;
              align-items: center;
              gap: 8px;
          }
          
          .btn-primary { background-color: var(--primary-color); color: white; }
          .btn-primary:hover { background-color: #2980b9; }
          
          .btn-secondary { background-color: #95a5a6; color: white; }
          .btn-secondary:hover { background-color: #7f8c8d; }

          .btn:disabled, .btn[disabled] {
              background-color: #e0e0e0 !important;
              color: #a0a0a0 !important;
              border: 1px solid #dcdcdc;
              cursor: not-allowed;
              pointer-events: none;
          }

          .form-control {
              width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px;
              box-sizing: border-box; font-family: inherit; font-size: 0.9rem;
          }
          .form-group { margin-bottom: 10px; } 

          /* --- FILTRO LATERAL (SIDEBAR) --- */
          .primas-layout { display: flex; gap: 20px; align-items: flex-start; }
          
          .filter-sidebar {
              width: 0; opacity: 0; overflow: hidden; background-color: #fcfcfc;
              border-right: 1px solid var(--border-color); transition: all 0.4s ease-in-out;
              padding: 0;
          }
          .filter-sidebar.open { width: 300px; opacity: 1; padding-right: 20px; border-right: 1px solid #ddd; max-height: 70vh; overflow-y: auto; }
          
          .filter-sidebar::-webkit-scrollbar { width: 6px; }
          .filter-sidebar::-webkit-scrollbar-track { background: #f1f1f1; }
          .filter-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

          .data-area { flex: 1; width: 100%; }

          .toolbar {
              display: flex; justify-content: space-between; align-items: center;
              margin-bottom: 15px; background: #f1f2f6; padding: 10px 15px; border-radius: 6px;
          }
          .back-link { display: inline-block; margin-bottom: 15px; color: var(--dark-gray); text-decoration: none; font-weight: 600; }

          /* --- HEADER CONTEXTO (PESTAÑA 2) --- */
          .context-header {
              background-color: #e8f4fc; border-left: 5px solid var(--primary-color);
              padding: 15px; margin-bottom: 20px; border-radius: 4px; display: flex; justify-content: space-between; align-items: center;
          }
          .context-title { font-size: 1.1rem; font-weight: bold; color: #2c3e50; }
          .context-subtitle { font-size: 0.9rem; color: #666; margin-top: 5px; }        
          
          /* --- TABLA K@RRENET --- */
          .table-k {
              width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.95rem;
              border: 1px solid var(--border-color); border-radius: 8px 8px 0 0;
          }
          .table-k th {
              background-color: var(--primary-color); color: #fff; font-weight: 600;
              padding: 10px 15px; text-align: left; height: 45px; vertical-align: bottom; border-bottom: none;
          }
          .table-k th:first-child { border-top-left-radius: 8px; }
          .table-k th:last-child { border-top-right-radius: 8px; }
          .table-k td { padding: 12px 15px; border-bottom: 1px solid #eee; color: #333; vertical-align: middle; }
          .table-k tr:hover { background-color: #f1f8ff; cursor: pointer; }

          .text-right { text-align: right; }
          .text-center { text-align: center; }
          .font-bold { font-weight: bold; }
          .btn-action { background: none; border: none; color: var(--primary-color); cursor: pointer; font-size: 1.1rem; transition: transform 0.2s; }
          .btn-action:hover { transform: scale(1.2); }

          .table-footer {
              margin-top: 15px; background-color: #f1f2f6; padding: 15px;
              border-radius: 6px; display: flex; justify-content: flex-end; gap: 30px; font-weight: bold; color: var(--dark-gray);
          }
          .total-amount { color: var(--danger-color); font-size: 1.2rem; }

          /* --- PAGINACIÓN --- */
          .pagination-container {
              display: flex; justify-content: flex-end; align-items: center; gap: 20px;
              padding: 15px 0; margin-top: 10px; border-top: 1px solid #eee;
          }
          .pagination-info { color: #666; font-size: 0.9rem; font-weight: 500; }
          .pagination-controls { display: flex; gap: 5px; }
          .page-btn { padding: 8px 16px; border: 1px solid #ddd; background-color: #fff; color: var(--text-color); cursor: pointer; border-radius: 4px; }
          .page-btn:hover:not(:disabled) { background-color: #f1f1f1; border-color: #ccc; }
          .page-btn.active { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); }
          .page-btn:disabled { opacity: 0.6; cursor: not-allowed; background-color: #f9f9f9; color: #aaa; }

          .table-k input[type="checkbox"] { width: 15px; height: 15px; margin: 0 auto; display: block; cursor: pointer; }
          .table-k th:first-child, .table-k td:first-child { text-align: center; vertical-align: middle; padding: 0; }

          /* ========================================================================== */
          /* ESTILOS DEL RECIBO DE DESCARGO (MODAL + IMPRESIÓN)                         */
          /* ========================================================================== */
          .modal-overlay {
              position: fixed; top: 0; left: 0; width: 100%; height: 100%;
              background: rgba(0,0,0,0.6); z-index: 9999;
              display: none; justify-content: center; overflow-y: auto; padding-top: 20px;
              backdrop-filter: blur(3px);
          }

          .hoja-recibo {
              background: white; width: 216mm; /* Tamaño Carta */ min-height: 279mm;
              padding: 40px; margin-bottom: 50px;
              box-shadow: 0 0 20px rgba(0,0,0,0.5);
              font-family: 'Times New Roman', serif; 
              color: #000; position: relative;
          }

          /* Header del Recibo */
          .recibo-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px double #000; padding-bottom: 15px; margin-bottom: 15px; }
          .empresa-info { text-align: center; flex: 1; }
          .empresa-info h2 { margin: 0; font-family: Arial, sans-serif; font-size: 16pt; text-transform: uppercase; }
          .empresa-info p { margin: 2px 0; font-size: 10pt; }
          
          .box-remesa { border: 2px solid #000; padding: 5px 10px; text-align: center; margin-bottom: 5px; }
          .box-remesa small { display: block; font-size: 8pt; text-transform: uppercase; }
          .box-remesa span { font-size: 14pt; font-weight: bold; font-family: Arial, sans-serif; }

          .titulo-documento { text-align: center; font-weight: bold; font-size: 14pt; margin: 20px 0; text-decoration: underline; font-family: Arial, sans-serif; }

          .info-destino { margin-bottom: 20px; font-size: 11pt; font-family: Arial, sans-serif; }
          .info-destino .fila-dato { margin-bottom: 5px; }
          .info-destino .label { font-weight: bold; width: 140px; display: inline-block; }

          /* Tabla del Recibo */
          .tabla-impresion { 
              width: 100%; 
              border-collapse: collapse; 
              font-size: 8.5pt; /* Letra un poco más pequeña para que quepan las 8 columnas */
              margin-bottom: 30px; 
          }
          .tabla-impresion th { 
              border-top: 2px solid #000; 
              border-bottom: 2px solid #000; 
              padding: 6px 2px; 
              text-align: center; /* Encabezados centrados por defecto */
              font-weight: bold; 
              background-color: #f0f0f0; /* Ligero gris para diferenciar cabecera en pantalla */
          }
          .tabla-impresion th:first-child { text-align: left; } /* Cliente alineado a la izquierda */
          .tabla-impresion td { 
              border-bottom: 1px solid #ccc; 
              padding: 4px 2px; 
              vertical-align: middle; 
          }    

          .label-total { font-weight: bold; font-size: 11pt; padding-top: 10px; border-top: 2px solid #000; }
          .valor-total { font-weight: bold; font-size: 11pt; padding-top: 10px; border-top: 2px solid #000; }

          /* ESTILO RESUMEN HORIZONTAL (TIPO IMAGEN) */
          .contenedor-resumen {
              display: flex; 
              justify-content: flex-end; /* Alineado a la derecha */
              margin-top: 10px; 
              margin-bottom: 20px;
          }

          .tabla-resumen-horizontal {
              border-collapse: collapse;
              font-family: Arial, sans-serif;
              font-size: 8pt; /* REDUCIDO: De 10pt a 8pt para que combine mejor */
              border: 1px solid #999;
              min-width: 200px; /* Un poco más compacto */
          }

          /* Encabezado Principal (Gris Oscuro) */
          .tabla-resumen-horizontal thead tr:first-child th {
              background-color: #e0e0e0;
              padding: 4px 2px; /* Padding reducido */
              border-bottom: 1px solid #999;
              text-align: center;
              font-weight: bold;
              font-size: 8.5pt; /* Título apenas un poquito más grande */
              letter-spacing: 0.5px;
          }

          /* Encabezados de Columnas */
          .tabla-resumen-horizontal thead tr:last-child th {
              background-color: #f0f0f0;
              border: 1px solid #ccc;
              padding: 3px 8px; /* Más compacto verticalmente */
              text-align: right;
              font-weight: bold;
              text-transform: uppercase;
              font-size: 7.5pt; /* Letra técnica pequeña */
          }

          /* Valores Numéricos */
          .tabla-resumen-horizontal td {
              border: 1px solid #ccc;
              padding: 4px 8px;
              text-align: right;
              font-weight: bold;
              color: #333;
          }        

          /* Firmas */
          .seccion-pago { margin-bottom: 40px; font-size: 10pt; }
          .area-firmas { display: flex; justify-content: space-between; margin-top: 60px; }
          .firma { width: 40%; text-align: center; }
          .linea-firma { border-top: 1px solid #000; margin-bottom: 5px; }
          
          .footer-sistema { position: absolute; bottom: 20px; left: 40px; font-size: 8pt; color: #666; font-family: Arial, sans-serif; }

          .acciones-modal { position: absolute; top: 10px; right: -120px; display: flex; flex-direction: column; gap: 10px; }

          /* REGLAS DE IMPRESIÓN (MÁGICAS) */
          @media print {
              body * { visibility: hidden; } 
              .modal-overlay { position: absolute; left: 0; top: 0; background: none; display: block !important; padding: 0; }
              .hoja-recibo, .hoja-recibo * { visibility: visible; } 
              .hoja-recibo { box-shadow: none; margin: 0; width: 100%; padding: 0; }
              .acciones-modal { display: none; } 
          } 

          /*=========================================================*/
          .badge-success {
              background: #2ecc71;
              color: white;
              padding: 4px 8px;
              border-radius: 6px;
              font-size: 12px;
          }

          .badge-danger {
              background: #e74c3c;
              color: white;
              padding: 4px 8px;
              border-radius: 6px;
              font-size: 12px;
          }
          /*=========================================================*/

          /* =========================
            MODAL GLOBAL
          ========================= */
          .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 9999;
          }

          .modal-box {
            background: #1e1e1e;
            width: 420px;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.4);
            overflow: hidden;
            animation: fadeInScale 0.2s ease-in-out;
          }

          .modal-header {
            padding: 15px 20px;
            background: #2a2a2a;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: bold;
            color: #fff;
          }

          .modal-body {
            padding: 20px;
            color: #ddd;
            font-size: 15px;
          }

          .modal-footer {
            padding: 15px 20px;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            background: #2a2a2a;
          }

          .modal-close {
            background: none;
            border: none;
            font-size: 20px;
            color: #aaa;
            cursor: pointer;
          }

          .modal-close:hover {
            color: #fff;
          }

          .btn-primary {
            background: #3498db;
            border: none;
            padding: 8px 16px;
            color: white;
            border-radius: 6px;
            cursor: pointer;
          }

          .btn-secondary {
            background: #7f8c8d;
            border: none;
            padding: 8px 16px;
            color: white;
            border-radius: 6px;
            cursor: pointer;
          }

          @keyframes fadeInScale {
            from { transform: scale(0.9); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
          }

          /* ==========================================================
          FIX BOTONES MODALES USUARIOS (Permisos y Restricciones)
          ========================================================== */

        /* Quitar posicionamiento absoluto heredado */
        #modalPermisos .acciones-modal,
        #modalRestricciones .acciones-modal {
            position: static !important;
            right: auto !important;
            top: auto !important;

            display: flex;
            justify-content: flex-end;  /* A la derecha */
            gap: 12px;
            margin-top: 25px;
        }

        /* Evitar scroll horizontal dentro del modal */
        #modalPermisos .modal-contenido,
        #modalRestricciones .modal-contenido {
            overflow-x: hidden;
        }

        /* ==========================================================
        FIX FINAL BOTONES MODALES USUARIOS
        ========================================================== */

      /* Contenedor de botones */
      #modalPermisos .acciones-modal,
      #modalRestricciones .acciones-modal {
          position: static !important;
          display: flex !important;
          flex-direction: row !important;   /* En línea */
          justify-content: flex-end !important; /* A la derecha */
          align-items: center;
          gap: 12px;
          margin-top: 30px;
          width: 100%;
      }

      /* Quitar ancho completo heredado */
      #modalPermisos .acciones-modal button,
      #modalRestricciones .acciones-modal button {
          width: auto !important;
          min-width: 110px;
      }

   /* ==========================================================
   BOTÓN CERRAR MODALES (X)
   ========================================================== */

.btn-cerrar-modal {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 20px;
    font-weight: bold;
    color: #555;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-cerrar-modal:hover {
    background-color: #e74c3c;
    color: #fff;
}

/* ===== Modal Compartir Documento ===== */
.modal-contenido-compartir {
  max-width: 520px;
  padding-bottom: 10px;
}

.compartir-titulo {
  margin: 0 0 5px 0;
  font-size: 1.15em;
  color: #2c3e50;
}
.compartir-titulo i {
  color: #8e44ad;
}

.compartir-nombre-doc {
  margin: 0 0 15px 0;
  font-size: 0.92em;
  color: #666;
  word-break: break-all;
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 5px;
  border-left: 3px solid #8e44ad;
}

.compartir-loading {
  text-align: center;
  padding: 30px 0;
  color: #888;
  font-size: 0.95em;
}
.compartir-loading i {
  margin-right: 6px;
}

.compartir-sin-contactos {
  text-align: center;
  padding: 30px 15px;
  color: #999;
}
.compartir-sin-contactos i {
  font-size: 2em;
  margin-bottom: 10px;
  display: block;
  color: #ccc;
}
.compartir-sin-contactos p {
  margin: 0;
  font-size: 0.93em;
}

.compartir-seccion {
  margin-bottom: 15px;
}

.compartir-seccion-titulo {
  font-size: 0.95em;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 8px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}
.compartir-seccion-titulo i {
  margin-right: 5px;
  color: #7f8c8d;
}

.compartir-canales-lista {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compartir-canal-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  margin: 0;
}
.compartir-canal-option:hover {
  background-color: #f8f4ff;
  border-color: #c9a0dc;
}
.compartir-canal-option input[type="radio"] {
  margin: 0;
  width: auto;
  accent-color: #8e44ad;
}
.compartir-canal-option input[type="radio"]:checked ~ .compartir-canal-info {
  font-weight: 500;
}

.compartir-canal-icono {
  font-size: 1.15em;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.compartir-canal-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.compartir-canal-tipo {
  font-size: 0.78em;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.compartir-canal-valor {
  font-size: 0.92em;
  color: #333;
  word-break: break-all;
}

.compartir-badge-principal {
  display: inline-block;
  background: #27ae60;
  color: white;
  font-size: 0.7em;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
}

.compartir-contacto-item {
  margin-bottom: 10px;
  padding: 8px;
  background: #fafafa;
  border-radius: 6px;
}

.compartir-contacto-nombre {
  font-size: 0.9em;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}
.compartir-contacto-nombre i {
  margin-right: 5px;
  color: #95a5a6;
}

.compartir-acciones {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  margin-top: 5px;
}
.compartir-acciones button {
  flex: 1;
}

.btn-compartir-whatsapp {
  background-color: #25D366 !important;
  color: white !important;
}
.btn-compartir-whatsapp:hover {
  background-color: #1da851 !important;
}

.btn-compartir-email {
  background-color: #3498db !important;
  color: white !important;
}
.btn-compartir-email:hover {
  background-color: #2980b9 !important;
}

/* =========================================================
   COMPONENTE PUBLICO: FILTER SIDEBAR (EXTRAIDO DE GUIA)
   ========================================================= */

.kre-filter-panel.filter-sidebar {
  width: 0;
  margin-left: -20px;
  opacity: 0;
  background-color: #fff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.kre-filter-panel.filter-sidebar.open {
  width: 340px;
  margin-left: 0;
  opacity: 1;
}

.kre-filter-panel .sidebar-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  background-color: #fcfcfc;
  flex-shrink: 0;
}

.kre-filter-panel .sidebar-body {
  padding: 15px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scrollbar-width: thin;
}

.kre-filter-panel .sidebar-body::-webkit-scrollbar {
  width: 6px;
}

.kre-filter-panel .sidebar-body::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 10px;
}

.kre-filter-panel .filter-section {
  border-bottom: 1px solid #eee;
  padding-bottom: 2px;
  margin-bottom: 2px;
}

.kre-filter-panel .filter-section:last-child {
  border-bottom: none;
}

.kre-filter-panel .section-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 5px;
  cursor: pointer;
}

.kre-filter-panel .form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #555;
  margin-bottom: 5px;
}

.kre-filter-panel .form-control {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 0.85rem;
}

.kre-filter-panel .form-group {
  margin-bottom: 10px;
}

.kre-filter-panel .radio-group-box {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 8px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kre-filter-panel .radio-group-box label,
.kre-filter-panel .check-row {
  font-size: 0.85rem;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.kre-filter-panel .advanced-box {
  background-color: #f0f2f5;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #dce1e6;
}

.kre-filter-panel .btn-process {
  width: 100%;
  padding: 10px;
  background-color: var(--success-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.kre-filter-panel .btn-process:hover {
  background-color: #219150;
}

.kre-filter-panel details > summary {
  list-style: none;
}

.kre-filter-panel details > summary::-webkit-details-marker {
  display: none;
}

.kre-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kre-filter-panel .btn-clear-filters {
  padding: 10px;
  background-color: #95a5a6;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}

.kre-filter-panel .btn-clear-filters:hover {
  background-color: #7f8c8d;
}

.kre-filter-only-shell {
  padding: 16px;
  min-height: 100vh;
  box-sizing: border-box;
}

.kre-filter-only-shell #filterSidebarHost {
  display: flex;
  align-items: stretch;
}

.kre-filter-only-shell .kre-filter-panel.filter-sidebar,
.kre-filter-only-shell .kre-filter-panel.filter-sidebar.open {
  width: 420px;
  margin-left: 0;
  opacity: 1;
  border: 1px solid #ddd;
}

@media (max-width: 1100px) {
  .kre-filter-panel.filter-sidebar,
  .kre-filter-panel.filter-sidebar.open {
    width: 100%;
    margin-left: 0;
    opacity: 1;
  }

  .kre-filter-only-shell .kre-filter-panel.filter-sidebar,
  .kre-filter-only-shell .kre-filter-panel.filter-sidebar.open {
    width: 100%;
  }
}

/* =========================================================
   MODULO REPORTES - LISTA Y BASE FACTURACION
   ========================================================= */

.kre-reportes-list-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.kre-reportes-guide-surface {
  background: #ffffff;
  border: 1px solid #dde5ee;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 24px;
}

.kre-reportes-guide-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.kre-reportes-guide-title-wrap {
  min-width: 0;
}

.kre-reportes-guide-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #3498db;
  font-size: 1.8rem;
  font-weight: 700;
}

.kre-reportes-guide-subtitle {
  margin: 6px 0 0;
  color: #666;
  font-size: 1rem;
}

.kre-reportes-refresh-btn {
  background: #f2f6fb;
  border: 1px solid #cfd9e6;
  color: #325a80;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.kre-reportes-refresh-btn:hover {
  background: #e6eef8;
}

.kre-reportes-guide-filter-panel {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.kre-reportes-guide-filter-panel > i {
  color: #3498db;
  font-size: 1.15rem;
}

.kre-reportes-guide-filter-label {
  font-size: 1rem;
  font-weight: 600;
  color: #111820;
}

.kre-reportes-guide-filter-select {
  flex: 1;
  min-width: 260px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  color: #1a2a3a;
  background: #ffffff;
  outline: none;
}

.kre-reportes-guide-count {
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 700;
  color: #4a6076;
  background: #ebf2fa;
  border: 1px solid #d4dfec;
  border-radius: 16px;
  padding: 6px 10px;
}

.kre-reportes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.kre-reporte-card {
  border: 1px solid transparent;
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  text-align: left;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.kre-reporte-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  border-color: #3498db;
}

.kre-reporte-card-disabled {
  opacity: 0.56;
  cursor: not-allowed;
  background: #f9fbfe;
}

.kre-reporte-card-disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: #dce5f2;
}

.kre-reporte-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef7ff;
  color: #3498db;
  flex-shrink: 0;
  font-size: 1.5rem;
}

.kre-reporte-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.kre-reporte-card-content strong {
  color: #333;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kre-reporte-card-content small {
  color: #999;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.25;
}

.kre-reporte-card-action {
  margin-left: auto;
  color: #68829d;
  font-size: 1.05rem;
}

.kre-reportes-empty-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px dashed #c9d8ea;
  border-radius: 10px;
  padding: 14px;
  background: #f8fbff;
  color: #57708a;
}

.kre-report-view-page {
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  min-height: calc(100vh - 22px);
  --primary-color: #3498db;
  --success-color: #27ae60;
  --danger-color: #e74c3c;
  --border-color: #ddd;
}

.kre-report-guide-shell {
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 0;
  min-height: calc(100vh - 18px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kre-report-guide-header-section {
  display: block;
  margin-bottom: 0;
  padding: 20px 40px 0;
}

.kre-report-guide-title {
  margin: 0 0 10px;
  color: #2c3e50;
  font-size: 1.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  text-align: left;
}

.kre-report-guide-title i {
  color: var(--primary-color);
}

.kre-report-guide-subtitle {
  display: none;
}

.kre-report-divider {
  border: 0;
  height: 1px;
  background-color: #e0e0e0;
  margin: 0 0 10px;
}

.kre-report-nav-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  list-style: none;
  margin: 0;
  padding: 0 40px;
  gap: 5px;
}

.kre-report-nav-link {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: #555;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-weight: 500;
  transition: all 0.3s;
}

.kre-report-nav-link:hover {
  color: #3498db;
  background-color: #f9f9f9;
}

.kre-report-nav-link.active {
  color: #3498db;
  border-bottom-color: #3498db;
  font-weight: 700;
}

.kre-report-back-link {
  color: #3b5d7f;
  text-decoration: none;
  border: 1px solid #d2deeb;
  background: #f4f8fd;
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 600;
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.kre-report-back-link:hover {
  background: #e8f1fa;
}

.kre-report-toolbar {
  border: 1px solid var(--border-color);
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: #f8f9fa;
  padding: 9px 16px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 0;
}

.kre-report-toolbar-filters,
.kre-report-toolbar-search-group,
.kre-report-toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.kre-report-toolbar-filters {
  flex: 0 0 360px;
  justify-content: flex-start;
}

.kre-report-toolbar-search-group {
  flex: 1;
  min-width: 280px;
  padding-left: 8px;
  border-left: 1px solid #d6dee8;
}

.kre-report-toolbar-right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.kre-report-quick-search {
  display: inline-flex;
  align-items: stretch;
  min-width: 280px;
  width: 320px;
}

.kre-report-quick-search input {
  flex: 1;
  border: 1px solid #d4deea;
  border-right: none;
  border-radius: 999px 0 0 999px;
  padding: 7px 10px;
  font-size: 0.85rem;
  outline: none;
}

.kre-report-quick-search input:focus {
  border-color: #1f6feb;
  box-shadow: inset 0 0 0 1px #1f6feb;
}

.kre-report-quick-search button {
  border: 1px solid #d4deea;
  border-radius: 0 999px 999px 0;
  width: 45px;
  background: #ffffff;
  color: var(--primary-color);
  cursor: pointer;
}

.kre-report-quick-search button:hover {
  background: #f4f8ff;
}

.kre-btn-primary {
  border: none;
  border-radius: 4px;
  background: var(--primary-color);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  font-weight: 700;
  cursor: pointer;
}

.kre-btn-primary:hover {
  background: #2980b9;
}

.kre-btn-alt {
  border: none;
  border-radius: 4px;
  background: #8e44ad;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  font-weight: 700;
  cursor: pointer;
}

.kre-btn-alt:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.kre-report-action-btn {
  border: none;
  border-radius: 4px;
  color: #ffffff;
  height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.kre-report-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.kre-btn-excel {
  background: #217346;
}

.kre-btn-print {
  background: #d32f2f;
}

.kre-report-chip {
  border: none;
  border-left: 2px solid var(--border-color);
  border-radius: 0;
  height: 40px;
  padding: 0 0 0 14px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #666;
  background: transparent;
  font-weight: 500;
}

.kre-report-chip-muted {
  background: transparent;
}

.kre-report-chip strong {
  color: var(--primary-color);
}

.kre-report-tab-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.kre-report-tab-pane {
  display: none;
  flex: 1;
  min-height: 0;
}

.kre-report-tab-pane.active {
  display: flex;
  flex-direction: column;
}

.kre-report-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

#reportFilterHost {
  display: flex;
  align-items: stretch;
  min-height: 0;
}

#reportFilterHost .kre-filter-panel.filter-sidebar,
#reportFilterHost .kre-filter-panel.filter-sidebar.open {
  width: 340px;
  margin-left: 0;
  opacity: 1;
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--border-color);
  background: #fff;
  height: 100%;
}

#reportFilterHost .kre-filter-panel.filter-sidebar .sidebar-header {
  display: block;
  padding: 16px;
  margin: 0;
  border-bottom: 1px solid #e8edf3;
}

#reportFilterHost .kre-filter-panel.filter-sidebar .kre-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

#reportFilterHost .kre-filter-panel.filter-sidebar .btn-process,
#reportFilterHost .kre-filter-panel.filter-sidebar .btn-clear-filters {
  width: auto;
  flex: 1;
  min-width: 0;
  margin: 0;
  height: 40px;
  padding: 0 8px;
  font-size: 0.88rem;
}

#reportFilterHost .kre-filter-panel.filter-sidebar:not(.open) {
  width: 0;
  border: none;
  margin-left: -20px;
  opacity: 0;
  overflow: hidden;
}

.kre-report-results-area {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kre-report-response-meta {
  display: none;
}

.kre-report-response-meta span {
  background: #f1f6fc;
  border: 1px solid #d4e2f1;
  border-radius: 999px;
  padding: 4px 8px;
}

.kre-report-table-shell {
  width: 100%;
  height: calc(100vh - 280px);
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  position: relative;
}

.kre-report-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.kre-report-table-guide {
  table-layout: auto;
}

.kre-report-table-guide .group-title {
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.kre-report-table-guide th {
  vertical-align: bottom;
}

.kre-report-table-guide td,
.kre-report-table-guide th {
  border: 1px solid #e1e7ef;
}

.kre-report-table-guide .cell-left {
  text-align: left;
}

.kre-report-table-guide .cell-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kre-report-table-guide .cell-center {
  text-align: center;
}

.kre-report-table-guide .cell-small-label {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  text-align: left;
  font-weight: 700;
  color: #334155;
}

.kre-report-table-guide .cell-small-label.nta {
  text-align: center;
  background: #f0f7ff;
  color: #2980b9;
}

.kre-report-table-guide .cell-small-value {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  text-align: center;
  font-weight: 700;
  color: #1f2937;
}

.kre-report-table-guide .kre-currency-rd {
  font-weight: 700;
  color: #2980b9;
}

.kre-report-table-guide .kre-currency-usd {
  font-weight: 700;
  color: #27ae60;
}

.kre-report-table-guide .kre-balance-positive {
  color: #e74c3c;
  font-weight: 700;
  background: #fdf8e4;
}

.kre-report-table-guide .balance-total {
  background: #27ae60;
  color: #053d21;
  font-weight: 800;
}

.kre-report-table-guide tfoot td {
  font-weight: 700;
}

.kre-report-table-guide .kre-report-footer-title {
  text-align: right;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.kre-report-table-simple td[rowspan="2"] {
  vertical-align: middle;
}

.kre-report-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.kre-report-table th {
  background: var(--primary-color);
  color: #ffffff;
  font-size: 0.82rem;
  text-align: left;
  padding: 9px 10px;
  white-space: nowrap;
  border: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kre-report-table th:first-child {
  border-top-left-radius: 8px;
}

.kre-report-table th:last-child {
  border-top-right-radius: 8px;
}

.kre-report-table td {
  border-bottom: 1px solid #ececec;
  padding: 9px 10px;
  font-size: 0.82rem;
  color: #2f3f54;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kre-report-table tbody tr:hover {
  background: #f8fbff;
}

.kre-cell-currency,
.kre-cell-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kre-report-table tbody td.kre-cell-number,
.kre-report-table tbody td.kre-cell-currency {
  text-align: right;
  padding-right: 4px;
}

.kre-report-table th.kre-col-currency,
.kre-report-table th.kre-col-number {
  text-align: right;
}

.kre-report-table th.kre-col-text {
  text-align: left;
}

.kre-report-table td.kre-cell-text,
.kre-report-table th.kre-col-text {
  min-width: 120px;
}

.kre-report-footer-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kre-report-table tfoot td {
  background: #f8f9fa;
  border-top: 2px solid var(--primary-color);
  font-weight: 700;
}

.kre-report-table-comparativo {
  table-layout: fixed;
}

.kre-report-table-comparativo th,
.kre-report-table-comparativo td {
  padding: 5px 6px;
  font-size: 0.78rem;
  line-height: 1.15;
}

.kre-report-table-comparativo .comp-mon-head,
.kre-report-table-comparativo .comp-mon {
  width: 54px;
  min-width: 54px;
  max-width: 54px;
  text-align: center;
}

.kre-report-table-comparativo .comp-renglon-head,
.kre-report-table-comparativo .cell-renglon-name {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.22;
  word-break: break-word;
}

.kre-report-table-comparativo .cell-renglon-name {
  font-weight: 500;
}

.kre-report-table-comparativo .comp-metric-label {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: left;
}

.kre-report-table-comparativo .comp-metric-value {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  text-align: right;
}

.kre-report-table-comparativo .comp-nta-label {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  text-align: center;
}

.kre-report-table-comparativo .comp-money {
  width: 94px;
  min-width: 94px;
  max-width: 94px;
  text-align: right;
}

.kre-report-table-comparativo .comp-percent {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  text-align: center;
  font-weight: 700;
}

.kre-report-table-comparativo .group-title {
  white-space: nowrap;
}

@media print {
  .kre-report-table-comparativo {
    table-layout: fixed !important;
    width: 100% !important;
  }

  .kre-report-table-comparativo th,
  .kre-report-table-comparativo td {
    white-space: normal !important;
    word-break: break-word;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
    padding: 3px 4px !important;
  }

  .kre-report-table-comparativo .comp-mon-head,
  .kre-report-table-comparativo .comp-mon {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
  }

  .kre-report-table-comparativo .comp-renglon-head,
  .kre-report-table-comparativo .cell-renglon-name {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
  }

  .kre-report-table-comparativo .comp-metric-label,
  .kre-report-table-comparativo .comp-nta-label {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    text-align: center !important;
  }

  .kre-report-table-comparativo .comp-metric-value {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
  }

  .kre-report-table-comparativo .comp-money {
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
  }

  .kre-report-table-comparativo .comp-percent {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
  }
}

.kre-report-table tfoot td.kre-cell-number,
.kre-report-table tfoot td.kre-cell-currency {
  text-align: right;
  padding-right: 4px;
}

.kre-report-empty-cell {
  text-align: center;
  padding: 24px 10px;
  color: #607a95;
}

.kre-report-placeholder {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  color: #2f3f54;
}

.kre-report-placeholder-icon {
  color: #c8c8c8;
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 16px;
}

.kre-report-placeholder-text {
  font-size: 2rem;
  line-height: 1.2;
}

.kre-report-graph-placeholder {
  margin: 24px;
  border: 1px dashed #cad6e6;
  border-radius: 10px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6d8299;
  background: #f9fbfe;
}

.kre-report-charts-shell {
  flex: 1;
  min-height: 0;
  border: 1px dashed #cad6e6;
  border-radius: 10px;
  background: #f9fbfe;
  padding: 16px;
  overflow: auto;
}

.kre-report-charts-empty {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6d8299;
  font-size: 1.05rem;
}

.kre-chart-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kre-chart-kpi-item {
  border: 1px solid #dde7f2;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.kre-chart-kpi-item span {
  display: block;
  font-size: 0.8rem;
  color: #6d8299;
  margin-bottom: 6px;
}

.kre-chart-kpi-item strong {
  display: block;
  color: #2f3f54;
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.kre-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(420px, 1fr));
  gap: 14px;
}

.kre-chart-card {
  border: 1px solid #dde7f2;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.kre-chart-card-title {
  color: #2f3f54;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.kre-chart-canvas {
  width: 100%;
  height: 360px;
}

.kre-chart-grid .kre-chart-card:nth-child(3),
.kre-chart-grid .kre-chart-card:nth-child(4) {
  grid-column: 1 / -1;
}

.kre-report-view-page.charts-mode #reportFilterHost,
.kre-report-view-page.charts-mode #btnToggleFilterPanel,
.kre-report-view-page.charts-mode #btnShowCharts,
.kre-report-view-page.charts-mode .kre-report-toolbar-search-group,
.kre-report-view-page.charts-mode #btnExportExcel,
.kre-report-view-page.charts-mode #btnPrintReport {
  display: none !important;
}

.kre-report-view-page.charts-mode #btnExportChartsPdf {
  display: inline-flex !important;
}

.kre-report-view-page.charts-mode .kre-report-toolbar {
  justify-content: flex-end;
  padding-top: 8px;
  padding-bottom: 8px;
}

.kre-report-view-page.charts-mode .kre-report-toolbar-filters {
  display: none !important;
}

.kre-report-view-page.charts-mode .kre-report-toolbar-right {
  flex: 1;
  justify-content: flex-end;
}

.kre-btn-pdf {
  background: #c0392b;
}

.kre-btn-pdf:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.kre-report-charts-shell {
  margin-top: 0;
}

.kre-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.kre-modal-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dbe5f0;
  box-shadow: 0 18px 50px rgba(13, 38, 76, 0.22);
}

.kre-modal-header,
.kre-modal-footer {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e8edf4;
}

.kre-modal-footer {
  border-bottom: 0;
  border-top: 1px solid #e8edf4;
  justify-content: flex-end;
  gap: 8px;
}

.kre-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #2f3f54;
}

.kre-modal-close {
  border: 0;
  background: transparent;
  color: #6b7a90;
  font-size: 1.1rem;
  cursor: pointer;
}

.kre-modal-body {
  padding: 14px 18px;
}

.kre-modal-help {
  margin: 0 0 12px 0;
  color: #5f7087;
  font-size: 0.9rem;
}

.kre-modal-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

.kre-modal-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.kre-modal-tool-btn {
  border: 1px solid #ced9e7;
  background: #f7faff;
  color: #2f3f54;
  border-radius: 6px;
  height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.kre-modal-tool-btn:hover {
  background: #edf4ff;
}

.kre-modal-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  padding: 10px;
  color: #2f3f54;
  font-size: 0.9rem;
}

.kre-modal-check-item input {
  margin-top: 2px;
}

.kre-modal-btn {
  border: 0;
  border-radius: 7px;
  height: 36px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.kre-modal-btn-muted {
  background: #eef2f7;
  color: #44566f;
}

.kre-modal-btn-primary {
  background: #1f6feb;
  color: #fff;
}

@media (max-width: 1100px) {
  .kre-reportes-list-page {
    padding: 16px;
  }

  .kre-reportes-guide-surface {
    padding: 18px;
  }

  .kre-report-layout {
    flex-direction: column;
    min-height: auto;
    padding: 0;
  }

  .kre-report-toolbar {
    flex-wrap: wrap;
    align-items: stretch;
    padding: 10px 16px;
  }

  .kre-report-toolbar-filters,
  .kre-report-toolbar-search-group {
    flex: 1 1 100%;
    min-width: 0;
    border-left: 0;
    padding-left: 0;
  }

  .kre-report-toolbar-filters {
    flex-wrap: wrap;
  }

  .kre-report-toolbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .kre-report-quick-search {
    width: min(360px, 100%);
    min-width: 0;
  }

  .kre-reportes-guide-header {
    flex-direction: column;
  }

  .kre-reportes-guide-filter-panel {
    flex-wrap: wrap;
  }

  .kre-reportes-guide-count {
    margin-left: 0;
  }

  #reportFilterHost .kre-filter-panel.filter-sidebar,
  #reportFilterHost .kre-filter-panel.filter-sidebar.open {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
  }

  #reportFilterHost .kre-filter-panel.filter-sidebar:not(.open) {
    display: none;
  }

  .kre-report-placeholder-text {
    font-size: 1.25rem;
  }

  .kre-chart-kpi-strip {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .kre-chart-grid {
    grid-template-columns: 1fr;
  }

  .kre-modal-checks {
    grid-template-columns: 1fr;
  }
}

@media print {
  #sidebar,
  .kre-report-nav-tabs,
  .kre-report-toolbar,
  #reportFilterHost,
  .kre-report-graph-placeholder,
  #btnShowCharts,
  #btnExportExcel,
  #btnPrintReport {
    display: none !important;
  }

  #main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .kre-report-view-page {
    padding: 0;
    min-height: auto;
  }

  .kre-report-guide-shell {
    border: 0;
    box-shadow: none;
    min-height: auto;
  }

  .kre-report-layout,
  .kre-report-tab-pane.active {
    display: block !important;
    min-height: auto;
  }

  .kre-report-results-area {
    padding: 0;
  }

  .kre-report-table-shell {
    height: auto;
    overflow: visible;
    border: 0;
  }

  .kre-report-table thead {
    position: static;
  }
}

/* ===== Ajustes Créditos (reportería) ===== */
.kre-report-table-detallado .cell-left {
  max-width: 260px;
}

.kre-report-table-comparativo .group-title {
  letter-spacing: 0.02em;
}

.kre-report-table-comparativo td.comp-money,
.kre-report-table-comparativo td.comp-percent {
  white-space: nowrap;
}

/* =========================================================
   Listados de facturas y cobros en polizas
   Mostrar contenido completo sin truncado
   ========================================================= */

#modalFactura #facturaListPane .tabla-wrapper,
#modalCobro #cobroListPane .tabla-wrapper {
  overflow-x: visible;
}

#modalFactura #facturaListPane .data-table,
#modalCobro #tablaCobrosPoliza {
  width: 100%;
  table-layout: auto !important;
}

#modalFactura #facturaListPane .data-table th,
#modalFactura #facturaListPane .data-table td,
#modalCobro #tablaCobrosPoliza th,
#modalCobro #tablaCobrosPoliza td {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: none !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.35;
  text-align: left;
}

#modalFactura #facturaListPane .data-table thead th,
#modalCobro #tablaCobrosPoliza thead th {
  font-size: 13px;
}

#modalFactura #facturaListPane .data-table tbody td,
#modalCobro #tablaCobrosPoliza tbody td {
  font-size: 13px;
}

#modalFactura #facturaListPane .data-table th:last-child,
#modalFactura #facturaListPane .data-table td:last-child,
#modalCobro #tablaCobrosPoliza th:last-child,
#modalCobro #tablaCobrosPoliza td:last-child {
  white-space: nowrap !important;
  text-align: center;
  width: 1%;
}

#modalCobro #tablaCobrosPoliza th:nth-child(1),
#modalCobro #tablaCobrosPoliza td:nth-child(1),
#modalCobro #tablaCobrosPoliza th:nth-child(2),
#modalCobro #tablaCobrosPoliza td:nth-child(2),
#modalCobro #tablaCobrosPoliza th:nth-child(3),
#modalCobro #tablaCobrosPoliza td:nth-child(3),
#modalCobro #tablaCobrosPoliza th:nth-child(4),
#modalCobro #tablaCobrosPoliza td:nth-child(4),
#modalCobro #tablaCobrosPoliza th:nth-child(6),
#modalCobro #tablaCobrosPoliza td:nth-child(6),
#modalCobro #tablaCobrosPoliza th:nth-child(7),
#modalCobro #tablaCobrosPoliza td:nth-child(7),
#modalCobro #tablaCobrosPoliza th:nth-child(9),
#modalCobro #tablaCobrosPoliza td:nth-child(9),
#modalCobro #tablaCobrosPoliza th:nth-child(10),
#modalCobro #tablaCobrosPoliza td:nth-child(10),
#modalCobro #tablaCobrosPoliza th:nth-child(11),
#modalCobro #tablaCobrosPoliza td:nth-child(11) {
  white-space: nowrap !important;
}

#modalFactura #facturaListPane .data-table th:nth-child(1),
#modalFactura #facturaListPane .data-table td:nth-child(1),
#modalFactura #facturaListPane .data-table th:nth-child(2),
#modalFactura #facturaListPane .data-table td:nth-child(2),
#modalFactura #facturaListPane .data-table th:nth-child(3),
#modalFactura #facturaListPane .data-table td:nth-child(3),
#modalFactura #facturaListPane .data-table th:nth-child(6),
#modalFactura #facturaListPane .data-table td:nth-child(6),
#modalFactura #facturaListPane .data-table th:nth-child(7),
#modalFactura #facturaListPane .data-table td:nth-child(7),
#modalFactura #facturaListPane .data-table th:nth-child(8),
#modalFactura #facturaListPane .data-table td:nth-child(8),
#modalFactura #facturaListPane .data-table th:nth-child(9),
#modalFactura #facturaListPane .data-table td:nth-child(9),
#modalFactura #facturaListPane .data-table th:nth-child(10),
#modalFactura #facturaListPane .data-table td:nth-child(10),
#modalFactura #facturaListPane .data-table th:nth-child(11),
#modalFactura #facturaListPane .data-table td:nth-child(11),
#modalFactura #facturaListPane .data-table th:nth-child(12),
#modalFactura #facturaListPane .data-table td:nth-child(12),
#modalFactura #facturaListPane .data-table th:nth-child(13),
#modalFactura #facturaListPane .data-table td:nth-child(13),
#modalFactura #facturaListPane .data-table th:nth-child(14),
#modalFactura #facturaListPane .data-table td:nth-child(14) {
  white-space: nowrap !important;
}

/* =========================================================
   Listados de acuerdos y creditos en polizas
   Mostrar contenido completo sin truncado
   ========================================================= */

#modalAcuerdo #acuerdoListPane .tabla-wrapper,
#modalCredito .tabla-wrapper {
  overflow-x: visible;
}

#modalAcuerdo #acuerdoListPane .data-table,
#modalCredito #tbodyCreditosPoliza {
  width: 100%;
}

#modalAcuerdo #acuerdoListPane .data-table {
  table-layout: auto !important;
}

#modalCredito table.data-table {
  table-layout: auto !important;
}

#modalAcuerdo #acuerdoListPane .data-table th,
#modalAcuerdo #acuerdoListPane .data-table td,
#modalCredito table.data-table th,
#modalCredito table.data-table td {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: none !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.35;
  text-align: left;
}

#modalAcuerdo #acuerdoListPane .data-table thead th,
#modalCredito table.data-table thead th {
  font-size: 13px;
}

#modalAcuerdo #acuerdoListPane .data-table tbody td,
#modalCredito table.data-table tbody td {
  font-size: 13px;
}

#modalAcuerdo #acuerdoListPane .data-table th:last-child,
#modalAcuerdo #acuerdoListPane .data-table td:last-child,
#modalCredito #tbodyCreditosPoliza td:last-child,
#modalCredito table.data-table thead th:last-child {
  white-space: nowrap !important;
  text-align: center;
  width: 1%;
}

#modalAcuerdo #acuerdoListPane .data-table th:nth-child(1),
#modalAcuerdo #acuerdoListPane .data-table td:nth-child(1),
#modalAcuerdo #acuerdoListPane .data-table th:nth-child(2),
#modalAcuerdo #acuerdoListPane .data-table td:nth-child(2),
#modalAcuerdo #acuerdoListPane .data-table th:nth-child(4),
#modalAcuerdo #acuerdoListPane .data-table td:nth-child(4),
#modalAcuerdo #acuerdoListPane .data-table th:nth-child(5),
#modalAcuerdo #acuerdoListPane .data-table td:nth-child(5),
#modalAcuerdo #acuerdoListPane .data-table th:nth-child(6),
#modalAcuerdo #acuerdoListPane .data-table td:nth-child(6),
#modalAcuerdo #acuerdoListPane .data-table th:nth-child(7),
#modalAcuerdo #acuerdoListPane .data-table td:nth-child(7),
#modalAcuerdo #acuerdoListPane .data-table th:nth-child(8),
#modalAcuerdo #acuerdoListPane .data-table td:nth-child(8) {
  white-space: nowrap !important;
}

#modalCredito #tbodyCreditosPoliza td:nth-child(1),
#modalCredito #tbodyCreditosPoliza td:nth-child(2),
#modalCredito #tbodyCreditosPoliza td:nth-child(3),
#modalCredito #tbodyCreditosPoliza td:nth-child(4),
#modalCredito #tbodyCreditosPoliza td:nth-child(6),
#modalCredito #tbodyCreditosPoliza td:nth-child(8),
#modalCredito #tbodyCreditosPoliza td:nth-child(9),
#modalCredito #tbodyCreditosPoliza td:nth-child(10),
#modalCredito #tbodyCreditosPoliza td:nth-child(11),
#modalCredito table.data-table thead th:nth-child(1),
#modalCredito table.data-table thead th:nth-child(2),
#modalCredito table.data-table thead th:nth-child(3),
#modalCredito table.data-table thead th:nth-child(4),
#modalCredito table.data-table thead th:nth-child(6),
#modalCredito table.data-table thead th:nth-child(8),
#modalCredito table.data-table thead th:nth-child(9),
#modalCredito table.data-table thead th:nth-child(10),
#modalCredito table.data-table thead th:nth-child(11) {
  white-space: nowrap !important;
}

/* Igualar ancho del modal de creditos al de cobros */
#modalCredito .modal-contenido {
  width: 98vw !important;
  max-width: 1900px !important;
}
